{"id":31971361,"url":"https://github.com/burnycoder/visualized-neural-network","last_synced_at":"2025-10-14T19:46:34.960Z","repository":{"id":316920354,"uuid":"1065323170","full_name":"BurnyCoder/visualized-neural-network","owner":"BurnyCoder","description":"Interactive visualization of weights of neural network training and inference on MNIST dataset.","archived":false,"fork":false,"pushed_at":"2025-09-27T14:41:03.000Z","size":83876,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-09-27T16:23:42.168Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BurnyCoder.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-27T13:47:18.000Z","updated_at":"2025-09-27T14:41:06.000Z","dependencies_parsed_at":"2025-09-27T16:33:50.502Z","dependency_job_id":null,"html_url":"https://github.com/BurnyCoder/visualized-neural-network","commit_stats":null,"previous_names":["burnycoder/visualized-neural-network"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/BurnyCoder/visualized-neural-network","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BurnyCoder%2Fvisualized-neural-network","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BurnyCoder%2Fvisualized-neural-network/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BurnyCoder%2Fvisualized-neural-network/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BurnyCoder%2Fvisualized-neural-network/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BurnyCoder","download_url":"https://codeload.github.com/BurnyCoder/visualized-neural-network/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BurnyCoder%2Fvisualized-neural-network/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279020656,"owners_count":26086897,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-14T02:00:06.444Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-10-14T19:46:33.991Z","updated_at":"2025-10-14T19:46:34.949Z","avatar_url":"https://github.com/BurnyCoder.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MNIST Neural Network Visualization\n\nInteractive visualization of neural network training and inference on MNIST dataset.\n\n![Neuron Specialization Evolution](specialization_evolution.gif)\n\n*This animation from weight_evolution_animation.py shows how neurons progressively specialize to recognize specific digits during training. Each pixel represents a neuron's activation relative to its mean activation across all digits (differential activation). Red indicates neurons that activate above their mean for specific digits, blue shows below-mean activation. Watch as the network learns to dedicate different neurons to different digit patterns.*\n\n## Features\n\n- **Training Visualization**: Watch weights evolve and loss decrease during training\n- **Activation Patterns**: See how neurons activate for different inputs\n- **Interactive Explorer**: Slider-based exploration of network behavior on test samples\n- **Architecture Diagram**: Visual representation of the network structure\n- **Statistical Analysis**: Correlation matrices and sparsity analysis\n\n## Installation\n\n```bash\npip install -r requirements.txt\n```\n\n## Usage\n\n### Advanced Weight Evolution and Specialization Analysis\n```bash\npython weight_evolution_animation.py [--epochs 3] [--record-every 5] [--fps 10]\n```\n\nThis comprehensive visualization tool generates multiple outputs showing how neural networks learn:\n\n#### Generated Files:\n- `specialization_evolution.gif` - Animated visualization of neuron specialization during training (shown above)\n- `weight_evolution.gif` - Complete weight evolution animation with training progress\n- `weight_evolution_interactive.png` - Screenshot of interactive visualization interface\n- `all_digits_inference.png` - Comprehensive inference analysis for all digits 0-9\n- `digit_activation_analysis.png` - Differential activation patterns for each digit\n- `network_specialization.png` - Matrix showing which neurons specialize for which digits\n\n#### Key Features:\n- **Weight Evolution Tracking**: Records and visualizes how all network weights change during training\n- **Neuron Specialization Analysis**: Shows how neurons progressively specialize for specific digit patterns using differential activations (relative to mean)\n- **Dual Mode Visualization**:\n  - Training mode: Watch weights evolve step-by-step during training\n  - Inference mode: Analyze how the trained network processes each digit\n- **Interactive Controls**: Play/pause animation, frame-by-frame navigation with slider, mode switching\n- **Weight Distribution Analysis**: Real-time histogram showing weight value distribution with mean/median statistics\n- **Comprehensive Inference Analysis**:\n  - Per-digit weight visualization\n  - Prediction confidence scores\n  - Activation gradients and input importance\n- **Specialization Matrices**: Visualize which layer neurons respond most strongly to each digit class\n- **Multi-view Displays**: Simultaneous visualization of weights as pixels, layer-specific patterns, loss curves, and accuracy metrics\n\n#### Command Line Options:\n- `--epochs`: Number of training epochs (default: 3)\n- `--record-every`: Record weights every N training steps (default: 5)\n- `--fps`: Frames per second for GIF animations (default: 10)\n- `--max-frames`: Maximum frames in animation (default: 150)\n\n### Basic Training Visualization\n```bash\npython train_visualized.py\n```\n\nThis generates:\n- `weight_evolution.png` - Weight distribution changes during training\n- `activation_patterns.png` - Neuron activation heatmaps\n- `inference_visualization.png` - Single inference breakdown\n- `training_animation.gif` - Animated training progress\n\n### Interactive Visualization\n```bash\npython interactive_visualization.py\n```\n\nThis creates:\n- Interactive neuron explorer with sample slider\n- Network architecture diagram\n- Activation correlation analysis\n\n## Network Architecture\n\n- Input: 784 neurons (28x28 flattened MNIST images)\n- Hidden Layer 1: 128 neurons with ReLU\n- Hidden Layer 2: 64 neurons with ReLU\n- Output: 10 neurons (digit classes 0-9)\n\n## Key Insights\n\nThe visualizations reveal:\n- How different neurons specialize for different digit patterns\n- Weight distribution evolution from random to structured\n- Activation sparsity patterns\n- Layer-wise information flow","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fburnycoder%2Fvisualized-neural-network","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fburnycoder%2Fvisualized-neural-network","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fburnycoder%2Fvisualized-neural-network/lists"}