Skip to main content

Neural Network Dataset

GitHub release
short alias lmur

LEMUR - Learning, Evaluation, and Modeling for Unified Research

The original open-source version of the LEMUR dataset was developed by Arash Torabi Goodarzi, Roman Kochnev and Zofia Antonina Bentyn at the Computer Vision Laboratory, University of Würzburg, Germany, under the supervision and technical guidance of Dr. Dmitry Ignatov, whose foundational work established the basis for the project.

Contents

  1. 📖 Overview
  2. Create and Activate a Virtual Environment
  3. Environment for NN Dataset Contributors
  4. Contribution: Adding a New Neural Network Model
  5. Installation or Update of the NN Dataset with pip
  6. Usage
  7. 💻 API: Programmatic Access
  8. 🐳 Docker
  9. Support and Contributing
  10. Citation
  11. Licenses

📖 Overview

NN Dataset project provides flexibility for dynamically combining various deep learning tasks, datasets, metrics, and neural network models. It is designed to facilitate the verification of neural network performance under various combinations of training hyperparameters and data transformation algorithms, by automatically generating performance statistics. Developed to support the NNGPT project, this dataset contains neural network models modified or generated by NNGPT's large language models, with names featuring alphanumeric postfixes (e.g., C10C-ResNetTransformer-e2b49b871c8b9a9014277a51b2348999).

Statement of Need

Studies of neural network architectures and training procedures repeatedly need the same components: training code, a way to store results together with the model code and settings that produced them, and consistent measurements of accuracy, running time and resource use. LEMUR provides these in one package: a common model interface (each model, data loader, transformation and metric is a single Python file), a shared training pipeline built on PyTorch and Optuna, and a database that stores every epoch's result with its hyperparameters, transformation and hardware context. The records are queryable from Python through the API.

LEMUR is intended for:

  • researchers running comparative studies across many architectures, who need a uniform training and evaluation procedure;
  • AutoML and code-generation systems, such as NNGPT, that need candidate networks validated programmatically within a search loop;
  • researchers and students who want to reuse existing measurements instead of recomputing them.

Model libraries such as timm provide implementations and weights, benchmarks such as NAS-Bench-101/201 provide results for fixed collections of architectures, and experiment trackers such as MLflow or Weights & Biases record runs that users train with their own code. LEMUR combines model code, a shared training and evaluation protocol, and linked, queryable records, and accepts new models as source code. See the JOSS paper for details.

Available Modules

The NN Dataset includes the following key modules within the ab.nn package:

  • nn: Predefined neural network architectures, including models like AlexNet, ResNet, VGG, and more.
  • loader: Data loading utilities for popular datasets such as CIFAR-10, COCO, and others.
  • metric: Evaluation metrics supported for model assessment, such as accuracy, Intersection over Union (IoU), and others.
  • transform: A collection of data transformation algorithms for dataset preprocessing and augmentation.
  • stat: Statistics for different neural network model training pipelines.
  • util: Utility functions designed to assist with training, model evaluation, and statistical analysis.

For Linux/Mac:

python3 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip

For Windows:

python3 -m venv .venv
.venv\Scripts\activate
python -m pip install --upgrade pip

It is assumed that CUDA 13.0 is installed; otherwise, consider replacing 'cu130' with the appropriate version. Some neural network training tasks require GPUs with at least 24 GB of memory.

Environment for NN Dataset Contributors

Pip package manager

Create a virtual environment, activate it, and run the following command to install all the project dependencies:

python -m pip install --upgrade pip
pip install -r requirements.txt --extra-index-url https://download.pytorch.org/whl/cu130

Contribution

To contribute a new neural network (NN) model to the NN Dataset, please ensure the following criteria are met:

  1. The code for each model is provided in a respective ".py" file within the /ab/nn/nn directory, and the file is named after the name of the model's structure.
  2. The main class for each model is named Net.
  3. The constructor of the Net class takes the following parameters:
    • in_shape (tuple): The shape of the first tensor from the dataset iterator. For images it is structured as (batch, channel, height, width).
    • out_shape (tuple): Provided by the dataset loader, it describes the shape of the output tensor. For a classification task, this could be (number of classes,).
    • prm (dict): A dictionary of hyperparameters, e.g., {'lr': 0.24, 'momentum': 0.93, 'dropout': 0.51}.
    • device (torch.device): PyTorch device used for the model training
  4. All external information required for the correct building and training of the NN model for a specific dataset/transformer, as well as the list of hyperparameters, is extracted from in_shape, out_shape or prm, e.g.:
    batch = in_shape[0]
    channel_number = in_shape[1]
    image_size = in_shape[2]
    class_number = out_shape[0]
    learning_rate = prm['lr']
    momentum = prm['momentum']
    dropout = prm['dropout'].
  5. Every model script has function returning set of supported hyperparameters, e.g.:
    def supported_hyperparameters(): return {'lr', 'momentum', 'dropout'}
    The value of each hyperparameter lies within the range of 0.0 to 1.0.
  6. Every class Net implements two functions:
    train_setup(self, prm)
    and
    learn(self, train_data)
    The first function initializes the criteria and optimizer, while the second implements the training pipeline. See a simple implementation in the AlexNet model.
  7. For each pull request involving a new NN model, please generate and submit training statistics for 10 Optuna trials (or at least 3 trials for very large models) in the ab/nn/stat/train directory. The trials should cover 5 epochs of training. Ensure that this statistics is included along with the model in your pull request. For example, the statistics for the ComplexNet model are stored in files <epoch number>.json inside folder ab/nn/stat/train/img-classification_cifar-10_acc_ComplexNet, and can be generated by:
python -m ab.nn.train -c img-classification_cifar-10_acc_ComplexNet -f complex -t 10 -e 5

Before creating a pull request, run the test suite as described in CONTRIBUTING.md to ensure that your changes do not break the core functionality of the NN Dataset.

See more examples of models in /ab/nn/nn and generated statistics in /ab/nn/stat.

The LEMUR neural network checkpoints on Hugging Face .

Installation or Update of the NN Dataset with pip

Remove an old version of the LEMUR Dataset and its database:

pip uninstall nn-dataset -y
rm -rf db

Installing the stable version:

pip install --no-cache-dir nn-dataset --upgrade --extra-index-url https://download.pytorch.org/whl/cu130

Installing from GitHub to get the most recent code and statistics updates:

pip install git+https://github.com/ABrain-One/nn-dataset --upgrade --force --extra-index-url https://download.pytorch.org/whl/cu130

Adding functionality to export data to Excel files and generate plots for analyzing neural network performance:

pip install nn-dataset[stat] --upgrade --extra-index-url https://download.pytorch.org/whl/cu130

and export/generate (the ab.stat module is provided by the nn-stat package installed by this extra):

python -m ab.stat.export

Requirements, Network Access and Disk Space

  • Python 3.10 or newer is required (the CI tests 3.10 and 3.11). All runtime dependencies are listed in requirements.txt and are installed automatically by pip. The --extra-index-url only selects the CUDA 13.0 build of PyTorch; on other systems, replace cu130 with your CUDA version or use https://download.pytorch.org/whl/cpu.
  • Training uses an NVIDIA GPU when one is available and otherwise falls back to Apple MPS or the CPU, so small models and the API run on any machine; large studies are practical only on a GPU.
  • The first import downloads data. Importing ab.nn.api or running ab.nn.train opens the LEMUR database db/ab.nn.db in the current working directory (in a cloned repository, its root). If the file does not exist, it is built from the statistics in ab/nn/stat when that folder is present (a full clone; this takes a while), and otherwise downloaded from the LEMUR_DB Hugging Face repository as ab.nn.zst-<version> (about 225 MB for version 2.2.11) and decompressed to db/ab.nn.db, which is larger than the download (the compressed file is removed afterwards).
  • The database file is chosen by the installed package version. If the database of that version has not been published yet, e.g. for a development version installed from GitHub, the download fails with a 404 error; install the stable release from PyPI instead.
  • Datasets are downloaded to data/ when a pipeline first uses them (e.g. CIFAR-10), and training outputs are written to out/.

Optional export extras (TFLite / LiteRT)

The TFLite export dependencies are not part of the default installation. Each pins its own transitive versions, the two are mutually exclusive with each other, and both conflict with environments that also contain vLLM. Install whichever one you need into a dedicated virtual environment.

Running an existing .tflite model (inference only, no TensorFlow). This one is light and installs cleanly next to the main requirements:

pip install nn-dataset[tflite-run]

Converting ONNX → TFLite with onnx2tf (util/py/age/convert_onnx_to_tflite_age.py, demo/*). Pulls full TensorFlow, so use a separate environment:

python -m venv .venv-tflite && . .venv-tflite/bin/activate
pip install nn-dataset[tflite]

PyTorch → TFLite through Google LiteRT (litert-torch), no Windows wheels:

python -m venv .venv-litert && . .venv-litert/bin/activate
pip install nn-dataset[litert]

Why they are separate:

Pin Conflicts with
onnx2tf → setuptools==81.0.0 vLLM: setuptools<81.0.0
onnx2tf → ai-edge-litert==2.1.2 litert-torch: ai-edge-litert>=2.3.0
onnx2tf → onnxruntime==1.26.0 onnxruntime-gpu (same onnxruntime import namespace)
litert-torch → xdsl==0.28.0 typing-extensions<4.13 vs vLLM → pydantic>=2.12 needing >=4.14.1

There is no lite-only converter: tf.lite.TFLiteConverter ships with full TensorFlow, so [tflite] cannot be slimmed down. Only the inference side can, which is what [tflite-run] is for.

Installing an extra alongside the main requirements in one environment will fail to resolve. That is intentional — the alternative is a silently broken environment.

Usage

Standard Use Cases

Run the automated training process for this model (e.g., a new ComplexNet training pipeline configuration):

python -m ab.nn.train -f complex -c img-classification_cifar-10_acc_ComplexNet  -l 0.017 --min_learning_rate 0.013 -m 0.025 --min_momentum 0.022 --min_batch_binary_power 8 --max_batch_binary_power 9

or for all image segmentation models using a fixed range of training parameters and transformer:

. train.sh -c img-segmentation -f echo --min_learning_rate 1e-4 -l 1e-2 --min_momentum 0.8 -m 0.99 --min_batch_binary_power 2 -b 6

train.sh internally calls ab.nn.train, offering a shorter way to run the program. Both scripts accept the same input flags and can be used interchangeably (on Windows, use python -m ab.nn.train).

Reproducing Results with Fixed Training Parameters

To reproduce previously obtained results, provide fixed values for the training parameters in JSON format. The parameter names should match those returned by the supported_hyperparameters() function of the NN model.

Example command:

. train.sh -c img-classification_cifar-10_acc_ComplexNet -f complex -p '{"lr": 0.017, "momentum": 0.022 , "batch": 32}'

where:

-c specifies the training pipeline,

-f selects the preprocessing algorithm,

-p sets the hyperparameters explicitly (e.g., learning rate, momentum, batch size) using a JSON string.

To view supported flags:
. train.sh -h

To list the tasks, models and best accuracies stored in the database from a cloned repository, use info.py (see info_README.md).

Add your new neural network model to the ab/nn/nn directory and proceed with your experiments (see Contribution for details).

💻 API: Programmatic Access

The LEMUR NN Dataset API (ab.nn.api) is the dedicated programmatic interface for both querying validated deep learning experiment data and submitting new neural network configurations for automatic training and archival. It is the essential layer supporting modern AutoML systems, including the NNGPT framework.

Why the API is Important

The API solves the problem of costly and time-consuming model validation. By providing two distinct and powerful functions, it transforms the bottleneck of "waiting for results" into two key steps: instant query and automated validation.

  1. Enables Predictive Models: Access to the full historical data allows researchers to train performance prediction models that can estimate a model's final accuracy before any training begins, saving massive amounts of compute time.
  2. Facilitates LLM Feedback: The API acts as the crucial feedback mechanism for LLMs (like NNGPT). Generated architectures are validated via check_nn, their results are stored in the database and become available through data(), enabling the LLM to iteratively improve its quality based on its own outputs.

Data Extraction and Mechanism

The core value of the API is the ability to retrieve complete, validated experimental records and submit new code for verification.

1. The data() Function for Data Retrieval

def data(only_best_accuracy=False, task=None, dataset=None, metric=None, nn=None, epoch=None, max_rows=None, ...) -> pandas.DataFrame

Each row also contains 'task', 'dataset', 'metric', 'metric_code', 'nn', 'epoch' and 'transform_code'. The main columns are:

Data Type Extracted DataFrame Column Name Description
Model Python Code 'nn_code' The exact Python code (as a string) defining the neural network's architecture.
Hyperparameters 'prm' The exact dictionary of hyperparameters (e.g., {'lr': 0.01, 'momentum': 0.9}) used for this specific run.
Performance Metric 'accuracy' The metric value (e.g., accuracy) achieved in the experiment, recorded at the 'epoch' specified.
Execution Time 'duration' The wall-clock time required for the training run, ns.

Mechanism: Users filter the database using optional arguments (task, dataset, nn, etc.). The returned DataFrame allows external programs (such as statistical models or benchmark scripts) to easily consume the structured data for large-scale analysis. The optional only_best_accuracy=True ensures efficiency by returning only the best-performing trial for each unique configuration.

Further query functions in ab.nn.api return other record types as DataFrames: run_data() (on-device runtime and TFLite analytics), prun_data() (pruning results), nn_stat_data() (architecture statistics) and layer_data() (layer analysis). All arguments are described in the docstrings, e.g. help(ab.nn.api.data).

2. The check_nn() Function for NN Validation

def check_nn(nn_code: str, task: str, dataset: str, metric: str, prm: dict, save_to_db=True, ..., epoch_limit_minutes=30, ..., return_val=False) -> tuple

This function is the submission endpoint for new models.

  1. Input: An external program (e.g., an LLM agent) provides the new model's nn_code (as a string), the prm dictionary, and the context (task, dataset, metric). Besides the hyperparameters returned by the model's supported_hyperparameters(), prm must contain 'batch', 'epoch' (number of epochs) and 'transform' (the name of a module in ab/nn/transform).
  2. Process: The function automatically initiates the full training pipeline, running the code under standardized conditions with a time limit per epoch (epoch_limit_minutes). With save_to_db=True, a model that reaches the minimum accuracy is stored in the database.
  3. Output: It returns a tuple containing the key validated metrics, ready for consumption by an LLM or an external optimization loop:
    • NN Model Name (str): An automatically generated unique ID for the archived model.
    • Accuracy (float): The measured final performance.
    • Accuracy to Time Metric (float): A single metric balancing performance against compute efficiency.
    • With return_val=True, a fourth value: the validation accuracy of the last epoch (None without a validation set).

Example: Query and Validate

from ab.nn.api import data, check_nn

# Best recorded AlexNet results on CIFAR-10 (downloads the database on first use)
df = data(only_best_accuracy=True, task='img-classification', dataset='cifar-10', metric='acc', nn='AlexNet')
print(df[['nn', 'epoch', 'accuracy', 'duration', 'prm']].head())

# Train and evaluate a model given as source code (here AlexNet's stored code) for one epoch
code = df['nn_code'].iloc[0]
prm = {'lr': 0.01, 'momentum': 0.9, 'dropout': 0.2, 'batch': 64, 'epoch': 1, 'transform': 'norm_64_flip'}
name, accuracy, accuracy_to_time = check_nn(code, 'img-classification', 'cifar-10', 'acc', prm, save_to_db=False)
print(name, accuracy, accuracy_to_time)

The second call downloads CIFAR-10 to data/ and trains on a GPU if one is available.

🚀 Get Started: Build Smarter, Train Less

The LEMUR API is designed for artificial agents, as well as for students and scientists. Using data(), provides immediate access to validated performance data derived from extensive computations. Instead of dedicating weeks of expensive hardware time to replicate known results or blindly test configurations, you can now:

  1. Data Access Scale: Instantly retrieve performance benchmarks validated across a large quantity of diverse architectural and hyperparameter configurations.
  2. Focus on Generation: Use check_nn() to automate the validation of your new, unique architectures.
  3. Computational Efficiency: Prioritize allocation of high-cost computational resources (GPU/TPU) exclusively toward training novel architectures.

Checkpoints

🐳 Docker

All versions of this project are compatible with AI Linux and can be seamlessly executed within the AI Linux Docker container.

Example of training LEMUR neural network within the AI Linux container (Linux host)

Installing the latest version of the project from GitHub

docker run --rm -u $(id -u):ab -v $(pwd):/a/mm abrainone/ai-linux:cv bash -c "[ -d nn-dataset ] && git -C nn-dataset pull || git -c advice.detachedHead=false clone --depth 1 https://github.com/ABrain-One/nn-dataset"

Running a quick training script:

docker run --rm -u $(id -u):ab --shm-size=16G -v $(pwd)/nn-dataset:/a/mm abrainone/ai-linux:cv bash -c ". train.sh -c img-classification_cifar-10_acc_ComplexNet -f complex -l 0.017 --min_learning_rate 0.013 -m 0.025 --min_momentum 0.022 --min_batch_binary_power 8 --max_batch_binary_power 9"

If recently added dependencies are missing in the AI Linux, you can create a container from the Docker image abrainone/ai-linux:cv, install the missing packages (preferably using pip install <package name>), and then create a new image from the container using docker commit <container name> <new image name>. You can use this new image locally or push it to the registry for deployment on the computer cluster.

Support and Contributing

Citation

If you find the LEMUR Neural Network Dataset to be useful for your research, please consider citing our articles NN Dataset and LEMUR 2:

@article{ABrain.NN-Dataset,
  title={LEMUR Neural Network Dataset: Towards Seamless AutoML},
  author={Goodarzi, Arash Torabi and Kochnev, Roman and Khalid, Waleed and Qin, Furui and Uzun, Tolgay Atinc and Dhameliya, Yashkumar Sanjaybhai and Kathiriya, Yash Kanubhai and Bentyn, Zofia Antonina and Ignatov, Dmitry and Timofte, Radu},
  journal={arXiv preprint arXiv:2504.10552},
  year={2025}
}

@InProceedings{ABrain.LEMUR2,
	title={{LEMUR} 2: Unlocking Neural Network Diversity for {AI}},
	 author={Uzun, Tolgay Atinc and Khalid, Waleed and Din, Saif U and Mulukuledu, Sai Revanth and Singh, Akashdeep and Vysyaraju, Chandini and Duvvuri, Raghuvir and Goyal, Avi and Lukhi, Yashkumar Rajeshbhai and Hussain, Ahsan and Jesani, Krunal and Shrestha, Usha and Mittal, Yash and Kochnev, Roman and Kadam, Pritam and Ikram, Mohsin and Moradiya, Harsh Rameshbhai and Arslanian, Alice and Ignatov, Dmitry and Timofte, Radu},
	booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops (CVPRW)},	
	pages = {3291--3300},
    year={2026}
}

Licenses

This project is distributed under the following licensing terms:

  • for neural network models adopted from other projects
  • all neural network models and their weights not covered by the above licenses, as well as all other files and assets in this project, are subject to the MIT license

The idea and leadership of Dr. Ignatov

Metadata

Release files for nn-dataset 2.2.14

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nn-dataset 2.2.14
File Size Uploaded Provenance Actions
nn_dataset-2.2.14.tar.gz 976.9 kB Without provenance Details for nn_dataset-2.2.14.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for nn-dataset 2.2.14
File Interpreter ABI Platform Actions
nn_dataset-2.2.14-py3-none-any.whl Python 3 none any Details for nn_dataset-2.2.14-py3-none-any.whl

Total release size: 2.1 MB

Release files / nn_dataset-2.2.14.tar.gz

Download URL nn_dataset-2.2.14.tar.gz
Size 976.9 kB
Tags Source
SHA-256 checksum
How to use checksums
63e8b5dcb1c3036f9f898be79632a3433f44c7d2691cb6f3958d3bd217a4807a
BLAKE2b-256 checksum
How to use checksums
75557e6a97c78c8631c8591a32e2b1f0a84c8389f91f0df263ed4393e21d76a3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.5

Release files / nn_dataset-2.2.14-py3-none-any.whl

Download URL nn_dataset-2.2.14-py3-none-any.whl
Size 1.1 MB
Tags Python 3
SHA-256 checksum
How to use checksums
b2662d940bbb1ad4ecceb27dd7fef882b64c6260e9baeff833bb7ef0220c8742
BLAKE2b-256 checksum
How to use checksums
d4ed583f2197a032563ca0ecfed4cbb0ee856a15fdc4469c390af03610564fb7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.5

Security for nn-dataset 2.2.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page