Skip to content

sergemedvid/MorphoNAS-Bench

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MorphoNAS-Bench

A Benchmark Suite for Morphogenetic Neural Network Generation

License: MIT Python 3.11+ arXiv


Overview

MorphoNAS-Bench is a benchmark dataset and toolkit for Neural Architecture Search (NAS) based on MorphoNAS. Instead of explicitly encoding architectures as static graphs (as in NAS-Bench-101 or NATS-Bench), MorphoNAS-Bench defines compact genomes that grow into neural networks through simulated developmental processes such as:

  • Morphogen diffusion
  • Cell division and differentiation
  • Axon guidance and connectivity formation

This biologically inspired, generative approach enables the study of emergent, spatially embedded recurrent architectures — supporting experiments in evolvability, modularity, and indirect encodings.


Key Features

  • Generative Search Space: networks arise from compact genomes rather than fixed graph schemas.
  • Biologically Inspired Simulation: deterministic developmental rules (morphogens, division, axon guidance).
  • Curated Benchmark Dataset: 1,000 genome–architecture pairs selected from >50,000 generation attempts.
  • Rich Structural Annotations: graph entropy, modularity, hierarchy, core–periphery structure, transitivity, reciprocity, and more.
  • Python Toolkit: scripts for genome creation, morphogenetic development, visualization, and network evaluation.
  • Two Generation Modes:
    • FullyStratified: Latin Hypercube Sampling (LHS) with orthogonal array design for maximum parameter coverage.
    • Genome.random(): biologically plausible randomization for more realistic networks.

Benchmark Composition

The provided benchmark consists of:

  • 1,000 genome–architecture pairs (.json format)
  • Metadata (generation_metadata.json)
  • Structural metrics for each generated network
  • Jupyter workflows for reproducible analysis

Dataset Generation Pipeline

  1. Parameter Sampling

    • Latin Hypercube Sampling (LHS)
    • Orthogonal array design
    • Optional biologically constrained random generator (Genome.random())
  2. Development Simulation

    • Deterministic morphogenetic growth
    • Local rules: diffusion, division, differentiation, axon guidance
  3. Quality Filtering

    • ≥5 neurons
    • ≥3 edges
    • ≥70% out-degree coverage
    • Elimination of disconnected or trivial networks
  4. Annotation & Export

    • Structural metrics computed for every valid network
    • Metadata stored for reproducibility

Toolkit Overview

The Python toolkit provides:

  • benchmark_generator.py – genome sampling and creation
  • benchmark_analyzer.py – graph-level metric computation

Each component can be run independently or within a full pipeline.


Getting Started

Requirements

python >= 3.9
numpy
networkx
pandas
matplotlib
scipy
tqdm

Installation

git clone https://github.com/sergemedvid/MorphoNAS-Bench.git
cd MorphoNAS-Bench
pip install -r requirements.txt

Example Usage

import numpy as np
from src.genome import Genome
from src.grid import Grid
from src.benchmark_analyser import NetworkStructuralAnalyzer

# Generate a random genome
rng = np.random.default_rng(42)  # Use seeded random number generator
g = Genome.random(rng)

# Develop into a neural architecture
grid = Grid(g)
grid = grid.run_simulation(verbose=False)
net = grid.get_graph()

# Analyze structure
analyzer = NetworkStructuralAnalyzer()
metrics = analyzer.grow_network_from_genome("path/to/genome.json")
print(metrics)

Baseline Results

Metric Genome.random Fully Stratified
Graph Entropy Higher, more complex Broader, more low-entropy outliers
Modularity Higher, esp. large networks Moderate overall
Hierarchy Score More high-hierarchy outliers Mostly low-moderate
Structural Balance Stable More small-network outliers

Result: The biologically informed generator produces richer yet plausible architectures with higher yield and lower rejection rate.


Applications

  • Research in developmental and generative NAS
  • Studies of indirect encodings and genotype–phenotype mapping
  • Evaluation of evolvability, modularity, and biological realism
  • Integration into neuroevolution and graph generative modeling workflows

Repository Structure

MorphoNAS-Bench/
├── analysis/
│   ├── 01_network_analysis_results/
│   │   └── (diagrams, data)
│   └── 02_network_analysis_results/
│       └── (diagrams, data)
├── benchmark/
│   ├── 01_sample_architectures/
│   │   ├── generation_metadata.json
│   │   └── genome_*.json (1000 genome files)
│   └── 02_sample_atchitectures_genome_random/
│       ├── generation_metadata.json
│       └── genome_*.json (1000 genome files)
├── src/
│   ├── genome.py                    # Genome class and random generation
│   ├── grid.py                      # Morphogenetic development simulation
│   ├── neural_propagation.py        # Neural network propagation and Gym integration
│   ├── benchmark_generator.py       # Dataset generation pipeline
│   ├── benchmark_analyser.py        # Network structural analysis
│   └── genome_strategies.py         # Mutation and crossover strategies
├── generate_benchmark.sh            # Benchmark generation script
├── requirements.txt                 # Python dependencies
└── README.md

Citation

Publication pending.

If you use MorphoNAS in your research, please cite:

@article{glybovetsmedvid2025morphonas,
      title={MorphoNAS: Embryogenic Neural Architecture Search Through Morphogen-Guided Development}, 
      author={Mykola Glybovets and Sergii Medvid},
      year={2025},
      eprint={2507.13785},
      archivePrefix={arXiv},
      primaryClass={cs.NE},
      url={https://arxiv.org/abs/2507.13785}, 
}

Future Work

  • Expand to >100,000 genomes with tiered datasets
  • Add reinforcement learning and supervised evaluation tasks
  • Develop surrogate predictors and web-based visualization tools
  • Introduce competitions for NAS algorithms using generative design spaces

License

This project is released under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published