CoolFace
Modelpublic

Invictus-AI/Ivictus_Self-Evolving-Neural-network

sourceHugging Faceupdated 2mo agoView on Hugging Face
0likes
Model Card

๐Ÿงฌ Ivictus โ€” Self-Evolving Neural Network

A self-evolving neural network that redesigns its own architecture using evolutionary strategies, plus a live web dashboard to watch and control it from your browser.

Creator: Kashyap Khakhkhar


โœจ Capabilities

๐Ÿง  Self-Evolving Architecture Search

  • โ€”Genome-based architecture system โ€” every network layout (layer count, units, activations, dropout, batch-norm, learning rate, optimizer, batch size) is encoded as a mutable genome.
  • โ€”Evolutionary loop โ€” each generation mutates and crosses over the population, evaluates every model on real training data, and keeps only the fittest (elitism).
  • โ€”Gated feature routing โ€” the genome evolves which 3 input features drive the first hidden layer, with the rest injected into deeper layers.
  • โ€”Diversity pressure โ€” duplicate and near-duplicate architectures are penalized so the population doesn't collapse onto one local optimum.
  • โ€”Smart fitness โ€” classification optimizes validation accuracy (not loss) to prevent memorization; complexity is gently penalized (Occam's razor).

๐Ÿ›ก๏ธ Built-In Safety Gates

  • โ€”Hard, immutable ceilings on layers, units, and total parameters that evolution can never exceed.
  • โ€”Failure gates reject NaN/Inf losses and exploded models.
  • โ€”Wall-clock budget and stagnation detection halt runs gracefully.

๐ŸŽ›๏ธ Live Web GUI (evo_gui.py)

  • โ€”Start / stop evolutionary runs from the browser.
  • โ€”Live fitness chart (best vs. average over generations).
  • โ€”Champion genome inspector + population table with fitness bars.
  • โ€”Upload your own dataset (CSV / TSV / TXT / NPY / NPZ).
  • โ€”Start from a saved model, a custom architecture, or the current champion.
  • โ€”Streams the engine console to the browser in real time.

๐Ÿ“Š Training on Your Own Data (evolve_dataset.py)

  • โ€”Loads CSV / TSV / TXT / NPY / NPZ datasets with no extra dependencies.
  • โ€”Auto-detects regression vs. classification, z-scores features, and targets the column you choose.
  • โ€”Synthetic data generator when no dataset is provided.

๐Ÿ’พ Checkpointing & Resumability

  • โ€”Full evolution state (population, history, best genome) saved to disk every generation.
  • โ€”Automatically resumes from checkpoints; --reset starts fresh.
  • โ€”Best model exported as .keras plus genome config as JSON.

๐ŸŽฏ Benefits

BenefitWhy it matters
No architecture hand-tuningThe network finds the best design for your data automatically.
Generalizes betterValidation-based fitness + diversity pressure reduce overfitting.
Safe to run unattendedHard safety gates mean evolution can't blow up memory, time, or loss.
Beginner-friendly GUIWatch evolution live, tweak parameters, upload data โ€” no ML expertise required.
Fully offline-capableWorks with synthetic data or your own files; no external API needed.
Resume anytimeLong runs survive restarts thanks to per-generation checkpoints.

Usage:

  • โ€”The project Kashyap-K/self-evolving-nn is one of the testing of this when this was in developing stage.

๐Ÿš€ Quick Start

bash
pip install -r requirements.txt

# CLI: quick evolution run (synthetic data)
python3 self_evolving_model.py

# More generations / bigger population
python3 self_evolving_model.py --generations 100 --pop-size 12

# Web dashboard
python3 self_evolving_model.py --gui          # http://localhost:5000

# Train on your own dataset
python3 evolve_dataset.py data.csv --target label --task auto
Optional: the text-understanding path (e.g. --text-dataset rotten_tomatoes) lazily uses the HuggingFace datasets library โ€” install it only if you need it: pip install datasets

๐Ÿ“‚ Files

FilePurpose
self_evolving_model.pyThe self-evolving neural network engine + CLI.
evo_gui.pyLive web dashboard for the evolution engine.
evolve_dataset.pyDataset loader & training driver for your own data.
requirements.txtPython dependencies.

๐Ÿ“œ License

Created by Kashyap Khakhkhar. Free to use, modify, and share.