{"id":28105072,"url":"https://github.com/art-defcon/neat-python","last_synced_at":"2025-09-09T19:21:23.696Z","repository":{"id":293112893,"uuid":"982987160","full_name":"art-defcon/neat-python","owner":"art-defcon","description":"This application demonstrates the NeuroEvolution of Augmenting Topologies (NEAT) algorithm","archived":false,"fork":false,"pushed_at":"2025-05-13T18:32:57.000Z","size":0,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-13T18:47:37.915Z","etag":null,"topics":["ai","ml","neat","neat-python","python"],"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/art-defcon.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}},"created_at":"2025-05-13T17:48:32.000Z","updated_at":"2025-05-13T18:33:00.000Z","dependencies_parsed_at":"2025-05-13T18:58:01.014Z","dependency_job_id":null,"html_url":"https://github.com/art-defcon/neat-python","commit_stats":null,"previous_names":["art-defcon/neat-python"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/art-defcon/neat-python","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/art-defcon%2Fneat-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/art-defcon%2Fneat-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/art-defcon%2Fneat-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/art-defcon%2Fneat-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/art-defcon","download_url":"https://codeload.github.com/art-defcon/neat-python/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/art-defcon%2Fneat-python/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274348465,"owners_count":25268972,"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-09-09T02:00:10.223Z","response_time":80,"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":["ai","ml","neat","neat-python","python"],"created_at":"2025-05-13T21:23:51.627Z","updated_at":"2025-09-09T19:21:23.651Z","avatar_url":"https://github.com/art-defcon.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NEAT Letter Classifier\n\n## What is NEAT?\nNEAT (NeuroEvolution of Augmenting Topologies) is a genetic algorithm for evolving artificial neural networks. It starts with a simple network and complexifies it over generations by adding new neurons and connections through mutation, while also optimizing the weights of existing connections. This allows NEAT to discover novel and increasingly complex network structures.\n\n## Project Overview\nThis application demonstrates the NeuroEvolution of Augmenting Topologies (NEAT) algorithm applied to a letter classification task. While NEAT might not be the the best (or even good;)  or efficient approach for my own curiosity to explore NEAT's capabilities and visualize its evolutionary process in a tangible way.\n\nThe application features interactive interface for controlling NEAT parameters, visualizing the evolving neural network in real-time, and observing its performance. Users can configure settings like population size, mutation rates, and evaluation trials before starting an automated evolution process.\n\n## Screenshot\n![Screenshot of the NEAT Letter Classifier application](https://github.com/art-defcon/neat-python/blob/main/public/screenshot.png?raw=true)\n\n## Technology Stack and Libraries\n\nThis project utilizes the following technologies and libraries:\n\n-   **Python 3.10+**: The primary programming language.\n-   **PyQt5**: Used for building the graphical user interface.\n-   **matplotlib**: Used for plotting and visualization, specifically for the fitness history graph and network visualization.\n-   **networkx**: Used for representing and manipulating the neural network graph structure for visualization.\n-   **numpy**: Used for numerical operations, particularly in handling the pixel grid representation of letters.\n-   **NEAT Algorithm**: The core of this project is the NeuroEvolution of Augmenting Topologies (NEAT) algorithm, implemented using the excellent [neat-python](https://github.com/CodeReclaimers/neat-python) library by CodeReclaimers. \n\n**DISCLAIMER: I have modified neat-python slightly. A diff of the changes can be found in `genome_changes.diff`.**\n\n### Installation and Running\n\nTo get started with the NEAT Letter Classifier, follow these steps:\n\n**1. Clone the repository:**\n\n```bash\ngit clone https://github.com/art-defcon/neat-python.git\ncd neat-python\n```\n\n**2. Install the required libraries:**\n\n```bash\npip install PyQt5 matplotlib neat-python networkx numpy\n```\n\n**3. Run the application:**\n\n```bash\npython src/app.py\n```\n\n### Basic Usage\n\nOnce the application is running, you can:\n\n- Configure NEAT parameters using the sliders in the left pane.\n- Click \"Start Auto-Evolve\" to begin the evolutionary process.\n- Observe the evolving network topology and performance in the center and right panes.\n- Click \"Randomize New Letter\" to test the current best network on a new letter (when not in auto-evolve mode).\n- BUG: Closing app/window sometimes leaves \"Auto-Evolve\" running in background and you might need to kill process (for instance by running \"pkill python\")\n- TODO: I dont really handle end state when it solves the task very graceful \n\n## Key Features\n- **Interactive NEAT Parameters**:\n    - Grouped \"Evolution Settings\" in the left pane.\n    - Sliders for Population Size, Fitness Threshold, Evaluation Trials per Network.\n    - Sliders for specific mutation rates: Weight Mutate, Weight Replace, Connection Add, Node Add.\n    - Descriptive text for each parameter slider.\n    - Settings are locked during auto-evolution.\n- **Three-Pane Layout**:\n    - **Left Pane (\"Evolution Settings\" \u0026 Controls)**:\n        - NEAT parameter configuration group.\n        - \"Start/Stop Auto-Evolve\" button for continuous evolution.\n        - \"Randomize New Letter\" button (for manual stepping when not auto-evolving).\n        - \"Mock Data\" toggle.\n    - **Center Pane (Visualization Details)**:\n        1.  **Input Neuron Layer (To the right of Rasterized Letter):** 256 input nodes.\n        2.  **Network Topology - Hidden Layers \u0026 Connections (Center Area):** Dynamic area showing hidden neurons and connections. Connection weights visualized by line thickness/color; neuron activations by color intensity.\n        3.  **Live Classification Result (Far Right):** Text display of the predicted letter.\n    - **Right Pane (Stats \u0026 Info)**:\n        - Display of Generation, Best Fitness (individual), Average Population Fitness.\n        - Display of \"Total Evaluations (Last Gen)\".\n        - Compact Fitness History graph.\n\n## ASCII Wireframe Layout (Conceptual Update)\n```\n+-----------------------------------------------------------------+\n| NEAT Letter Classifier (Dark Theme)                             |\n+---------------------------+-----------------------+-------------+\n| Evolution Settings \u0026 Ctrl | Network Visualization | Stats \u0026 Info|\n|---------------------------|                       |-------------|\n| [GroupBox: Evo Settings]  | +-----------------+   | Generation: |\n|  Population Size: [Sl]    | | Input Neurons     |   | Best Fit:   |\n|  Fitness Thresh: [Sl]     | | Input (16x16)   |   | Avg Pop Fit:|\n|  Eval Trials: [Sl]        | +--------+--------+   | Tot Evals:  |\n|  Weight Mutate: [Sl]      |          |           |             |\n|  Weight Replace: [Sl]     |          v           | [Graph]     |\n|  Conn Add Prob: [Sl]      | +-----------------+   | Fitness     |\n|  Node Add Prob: [Sl]      | | Hidden Layers   |   | History     |\n|  [Instructional Text]     | | (Dynamic Nodes)     |   |             |\n|                           | +--------+--------+   |             |\n| [Button:Start/Stop AutoEV]|          |           |             |\n|---------------------------|          v           |             |\n| [Button:Randomize Letter] | +-----------------+   |             |\n|                           | | Prediction Text   |   |             |\n|                           | +--------+--------+   |             |\n|                           |                      |             |\n+---------------------------+-----------------------+-------------+\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fart-defcon%2Fneat-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fart-defcon%2Fneat-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fart-defcon%2Fneat-python/lists"}