A sophisticated web application that uses Anthropic's Claude AI models to simulate how the human brain processes visual information, from photon absorption in the retina to conscious perception.
This application simulates the complete visual processing pathway through 8 sequential brain regions, using Claude's advanced language models to represent the biological functions of each neural area. Based on cutting-edge neuroscience research, it demonstrates the hierarchical nature of visual processing in the human brain.
- Multiple Claude Models: Support for Claude 3.5 Sonnet, Claude 3.5 Haiku, and Claude 3 Opus
- Intelligent Model Selection: Automatic optimization using different models for different processing steps
- Real-time API Integration: Live connection to Anthropic's Claude API
- Vision-Capable Processing: Native support for image analysis using Claude's vision models
- Cost Optimization: Smart model selection balances performance and cost
- Live Camera Feed: Real-time video capture from device cameras
- Frame Capture: High-quality image capture for processing
- Multi-Camera Support: Switch between front and rear cameras
- Permission Handling: Secure camera access with user consent
- Real-World Analysis: Process actual visual scenes from your environment
- Retinal Processing (Photoreceptors) - Basic light detection and color processing
- Retinal Ganglion Cells - Parallel pathway organization (M, P, K streams)
- Lateral Geniculate Nucleus - Thalamic relay and signal enhancement
- Primary Visual Cortex (V1) - Basic feature extraction (edges, orientations)
- Ventral Stream (V2/V4) - Object identification pathway
- Dorsal Stream (MT/MST) - Spatial and motion processing pathway
- Inferotemporal Cortex - High-level object recognition
- Perirhinal Cortex - Memory integration and conscious perception
- Interactive step-by-step visualization
- Detailed biological explanations for each brain region
- Real-time processing progress tracking
- Comprehensive result export and analysis
- Modern web browser (Chrome 90+, Firefox 88+, Safari 14+, Edge 90+)
- Claude API key from Anthropic Console
- Python 3.8+ (for backend testing)
-
Clone or download the application files
-
Get your Claude API key from console.anthropic.com
-
Run the application:
Option A: Local Web Server (Recommended)
# Windows start_server.bat # Or manually with Python python start_server.py # Or with Python 3 python3 -m http.server 8000
Then open http://localhost:8000 in your browser
Option B: Direct File Access
- Open
index.htmldirectly in your browser - Note: May have CORS limitations for API calls
Option C: Python Backend
- Install requirements and run
script.py
- Open
-
Configure Claude API:
- Select your preferred Claude model or use "Auto-Select Optimal"
- Enter your Claude API key
- Test the connection
-
Choose Input Method:
- Text Description: Describe a visual scene (traditional method)
- Live Camera Feed: Use your device's camera for real-world visual processing
-
Camera Mode Setup (NEW):
- Click "Enable Camera" to request camera permissions
- Capture a frame from the live video feed
- The captured image will be processed using Claude's vision capabilities
- Switch between front/back cameras if available
-
Run Simulation:
- Click "Start Claude Neural Simulation"
- Watch as each brain region processes the visual information
- Observe the hierarchical transformation from raw visual input to conscious perception
-
Analyze Results:
- Review the final conscious perception
- Download processing results in JSON format
- Generate detailed analysis reports
from script import VisualProcessingSimulator
# Initialize simulator
simulator = VisualProcessingSimulator()
# Set Claude API key
simulator.set_claude_api_key("your-claude-api-key")
# Test connection
if simulator.test_claude_connection():
print("Connected to Claude!")
# Process text description
results = simulator.process_visual_input(
"A red rose in a glass vase on a white table",
use_optimal_models=True,
input_type="text"
)
# OR process image file (NEW)
results = simulator.process_visual_input(
"path/to/your/image.jpg",
use_optimal_models=True,
input_type="image"
)
# Export results
json_output = simulator.export_results(results)
print(json_output)| Model | Best For | Cost | Performance |
|---|---|---|---|
| Claude 3.5 Haiku | Basic processing steps (1-3) | Low | Fast |
| Claude 3.5 Sonnet | Intermediate processing (4-6) | Medium | Balanced |
| Claude 3 Opus | Research & highest accuracy | High | Premium |
| Auto-Optimal | Automatic model selection | Optimized | Adaptive |
- Processing Speed: Adjust delay between steps (500ms - 3000ms)
- Detailed Logging: Enable comprehensive processing logs
- Model Selection: Manual or automatic optimization
{
"metadata": {
"simulator_version": "Claude Neural Processing v2.0",
"timestamp": "2024-01-15T10:30:00Z",
"total_processing_time": 15250,
"model_usage": {
"claude-3-5-haiku-20241022": 3,
"claude-3-5-sonnet-20241022": 5
}
},
"processing_steps": [...]
}- Processing statistics and performance metrics
- Model usage breakdown
- Step-by-step neural pathway analysis
- Biological accuracy assessment
The simulator is based on extensive neuroscience research including:
- Hierarchical Visual Processing: From basic feature detection to complex object recognition
- Parallel Processing Streams: Ventral ("what") and dorsal ("where/how") pathways
- Predictive Coding: Top-down feedback and expectation mechanisms
- Cross-Modal Integration: Multi-sensory processing capabilities
- Retinal ganglion cell pathway organization
- LGN contrast enhancement and spatial filtering
- V1 hypercolumn organization and feature detection
- Ventral stream object recognition hierarchy
- Dorsal stream motion and spatial processing
- Memory integration in higher cortical areas
- Frontend: Modern HTML5, CSS3, and vanilla JavaScript
- AI Integration: Direct Claude API calls with error handling
- Camera API: WebRTC MediaDevices for video capture
- Image Processing: Canvas-based frame capture and base64 encoding
- State Management: Browser-based session management
- Security: Secure API key handling and camera permission management
// Claude API call example
const response = await fetch('https://api.anthropic.com/v1/messages', {
method: 'POST',
headers: {
'x-api-key': apiKey,
'Content-Type': 'application/json',
'anthropic-version': '2023-06-01'
},
body: JSON.stringify({
model: 'claude-3-5-sonnet-20241022',
max_tokens: 1000,
temperature: 0.3,
system: "You are simulating a brain region...",
messages: [{ role: 'user', content: prompt }]
})
});- Smart Model Selection: Uses faster/cheaper models for basic processing
- Error Handling: Robust API error recovery and retry logic
- Rate Limiting: Respects Claude API rate limits
- Caching: Efficient state management to minimize API calls
- Educational Demo (Haiku): ~$0.10-0.20 per simulation
- Research Quality (Sonnet): ~$0.50-1.00 per simulation
- Premium Analysis (Opus): ~$2.00-4.00 per simulation
- Auto-Optimal: ~$0.30-0.80 per simulation
- Understand brain organization and visual processing hierarchy
- Explore how AI can model biological neural processes
- Learn about the complexity of human perception
- Compare artificial and biological information processing
- Test hypotheses about visual processing mechanisms
- Compare AI model outputs with neuroimaging data
- Develop new approaches to neural simulation
- Validate computational models of vision
- Interactive demonstrations of brain function
- Bridge neuroscience theory with AI applications
- Engaging lessons about perception and consciousness
- Real-time neural processing visualization
- API Key Security: Keys are never logged or stored permanently
- Data Privacy: Processing data remains local to your session
- Secure Communication: All API calls use HTTPS encryption
- No Data Retention: No personal data is collected or stored
No installation required - just open index.html in a modern browser.
pip install requests
# Run the simulator
python script.pyexport ANTHROPIC_API_KEY="your-claude-api-key"Input: "A red apple on a wooden table"
β Retina: Rod/cone activation patterns for red wavelengths
β Ganglion Cells: M/P/K pathway separation
β LGN: Contrast enhancement and spatial filtering
β V1: Edge detection and orientation mapping
β V2/V4: Shape and color processing
β MT/MST: Spatial relationship analysis
β IT: Object recognition as "apple"
β Perirhinal: Memory integration and semantic understanding
Input: "A person walking a dog in a park with trees and sunlight"
β Multiple object recognition pathways
β Motion detection and tracking
β Scene understanding and context
β Spatial relationship mapping
β Semantic integration with life experience
This application demonstrates the integration of AI language models with neuroscience simulation. Contributions welcome for:
- Enhanced biological accuracy
- Additional AI model integrations
- Improved visualization features
- Educational content expansion
- Performance optimizations
Based on research from leading neuroscience sources including:
- NeuroLogica blog neuroscience articles
- Harvard Brain Initiative findings
- MIT computational neuroscience research
- Anthropic AI safety and capability research
Educational and research use. Commercial applications require separate licensing.
"Network error - check your internet connection"
- Cause: CORS restrictions when opening
index.htmldirectly - Solution: Use the local web server instead:
python start_server.py # Then open http://localhost:8000
"Invalid API key - check your Claude API key"
- Verify your API key starts with
sk-ant- - Get a new key from console.anthropic.com
- Ensure no extra spaces or characters
"API access forbidden"
- Check your Anthropic account has API access enabled
- Verify your account has sufficient credits
- Check for any account restrictions
Camera access denied
- Grant camera permissions in your browser
- Check browser security settings
- Ensure you're using HTTPS or localhost
Frame capture not working
- Refresh the page and try again
- Check browser compatibility (Chrome/Firefox recommended)
- Verify camera is not being used by another application
For additional issues or questions:
- Check the browser console for detailed error messages
- Verify Claude API key and connection using the test button
- Try running from a local web server instead of opening the file directly
- Review input format requirements
- Check the console for setup instructions
Powered by Anthropic's Claude AI β’ Educational Neural Simulation β’ Interactive Neuroscience