Skip to content

Latest commit

ย 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ‘๏ธ NeuroVision

Cognitive Visual Attention Simulation using Saliency and Fixation Modeling

A cognitive AI simulation that mimics how humans visually explore a scene using saliency maps and fixation-based attention scanning. Upload an image and watch how a cognitive system prioritizes visual information.


Python Streamlit OpenCV NumPy Matplotlib MIT License


๐Ÿ“– What is NeuroVision?

NeuroVision is a Cognitive AI simulation system that demonstrates how human visual attention works when observing a scene.

Instead of processing images uniformly, humans naturally focus on regions of interest. This project simulates that behavior using saliency maps and fixation-based scanning, allowing users to observe how an artificial cognitive system prioritizes visual information.

The system works as follows:

  1. A user uploads an image representing a visual scene.
  2. The system generates a saliency map highlighting visually prominent regions.
  3. The algorithm simulates fixation points, mimicking how human eyes move across a scene.
  4. The results are visualized interactively through a Streamlit interface.

This provides a simple yet powerful demonstration of attention modeling in cognitive AI systems.


โœจ Features

Feature Description
๐Ÿ“ธ Image Upload Interface Upload any PNG or JPG image for simulation
๐ŸŽฏ Saliency Map Generation Highlights visually prominent regions
๐Ÿ‘€ Fixation Simulation Simulates eye movement across salient regions
โš™๏ธ Adjustable Parameters Customize blur kernel size, threshold, and fixation count
๐Ÿ“Š Interactive Visualization Real-time UI using Streamlit
๐Ÿง  Cognitive AI Concepts Demonstrates perception and attention modeling
๐ŸŽ“ Educational Tool Ideal for AI and Cognitive Science coursework

๐Ÿ—๏ธ System Architecture

Visual Attention Pipeline

graph TD
    A[๐Ÿ‘ค User Uploads Image] --> B[Streamlit Web Interface]
    B --> C[Image Preprocessing]

    C --> D[OpenCV Saliency Detection]
    D --> E[Saliency Map Generation]

    E --> F[Threshold Filtering]
    F --> G[Top Salient Regions Selection]

    G --> H[Fixation Simulation]
    H --> I[Fixation Points Overlay]

    I --> J[Visualization Output]
Loading

Cognitive Processing Workflow

The simulation replicates a simplified version of human visual attention:

1๏ธโƒฃ Scene Perception

  • The uploaded image acts as a visual stimulus.

2๏ธโƒฃ Saliency Computation

  • OpenCV detects regions that visually stand out based on:

    • color contrast
    • edge intensity
    • brightness variations

3๏ธโƒฃ Attention Filtering

  • A threshold filter removes low-importance regions.

4๏ธโƒฃ Fixation Selection

  • The system selects top N salient points.
  • These points simulate human eye fixation behavior.

5๏ธโƒฃ Visualization

  • Displays:

    • Original image
    • Saliency heatmap
    • Fixation points overlay

๐Ÿ› ๏ธ Technology Stack

Core System

Component Technology
Programming Language Python 3.9+
Web Interface Streamlit
Computer Vision OpenCV
Numerical Processing NumPy
Visualization Matplotlib

๐Ÿ“‚ Project Structure

visual_attention_streamlit/
โ”‚
โ”œโ”€โ”€ app.py              # Main Streamlit application
โ”œโ”€โ”€ attention_model.py  # Saliency and fixation logic
โ”œโ”€โ”€ utils/
โ”‚   โ””โ”€โ”€ image_utils.py  # Image preprocessing utilities
โ”‚
โ”œโ”€โ”€ requirements.txt    # Project dependencies
โ””โ”€โ”€ README.md           # Project documentation

๐Ÿš€ Installation & Setup

Prerequisites

  • Python 3.9+
  • pip

1๏ธโƒฃ Clone the Repository

git clone https://github.com/your-username/visual_attention_streamlit.git
cd visual_attention_streamlit

2๏ธโƒฃ Create a Virtual Environment (Recommended)

python -m venv venv

Activate Environment

Mac/Linux

source venv/bin/activate

Windows

venv\Scripts\activate

3๏ธโƒฃ Install Dependencies

pip install -r requirements.txt

๐Ÿƒ Running the Application

Launch the Streamlit application:

streamlit run app.py

The application will start locally at:

http://localhost:8501

๐ŸŒ Application Workflow

Step 1 โ€” Upload Image

Upload a PNG or JPG image representing the visual scene.


Step 2 โ€” Adjust Simulation Parameters

Using the sidebar controls, configure:

  • Blur kernel size
  • Saliency threshold
  • Maximum fixation points

Step 3 โ€” Generate Attention Simulation

The system processes the image and generates:

  • Saliency heatmap
  • Fixation simulation

Step 4 โ€” Analyze Output

The UI displays:

Output Description
Original Image Input visual scene
Saliency Map Regions attracting attention
Fixation Points Simulated eye movement

๐Ÿง  Cognitive AI Concepts Used

Concept Description
Saliency Map Highlights visually important areas
Fixation A point where the eye briefly focuses
Visual Attention Prioritization of relevant visual stimuli
Thresholding Filters out less important visual data
Cognitive AI AI inspired by human perception and cognition

๐Ÿ› Known Issues & Troubleshooting

Saliency detection not working properly

Ensure:

  • Images are not extremely low resolution
  • Contrast between objects is sufficient

Streamlit UI not loading

Verify the server started successfully:

http://localhost:8501

Restart the app if needed.


๐Ÿ”ฎ Future Improvements

  • ๐Ÿ‘๏ธ Real eye-tracking dataset integration
  • ๐ŸŽฅ Video attention simulation
  • ๐Ÿ“Š Temporal attention heatmaps
  • ๐Ÿค– Deep learning attention models
  • ๐Ÿง  Object detection + attention fusion

๐ŸŽ“ Academic Value

This project demonstrates key concepts from Cognitive Artificial Intelligence, including:

  • perception modeling
  • visual attention mechanisms
  • cognitive psychology principles
  • computational vision techniques

It serves as a lightweight educational simulation for understanding how cognitive systems prioritize information.


๐Ÿ‘จโ€๐Ÿ’ป Author

Kishore P CSE (AI & Robotics) โ€“ VIT Chennai


๐Ÿ“œ License

This project is licensed under the MIT License.



Understanding how machines can perceive the world like humans.



NeuroVision โ€” modeling attention in artificial cognitive systems.

About

A Streamlit-based AI project that mimics human visual focus using saliency maps, fixations & attention modeling.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages