Training code and pre-trained models for Neural Cellular Automata on different datasets and tasks
Project description
NCALab
NCALab makes it easy to create Neural Cellular Automata (NCA) implementations for various downstream tasks, such as image segmentation, classification and synthesis.
Features
Features of NCALab include:
- Easy training and evaluation of NCA models
- Cascaded multi-scale training
- Tensorboard integration with default presets
- Training with k-fold cross-validation
- Convenience features: Fixing random seeds, selecting compute devices, data processing
Getting started
Perhaps the best way of getting started with NCALab is to take a look at the provided usage example tasks, starting with the Growing Emoji task.
Usage Example Tasks
So far, the following example tasks are implemented in NCALab:
- Image Generation:
- Growing NCA for emoji generation
- Training and evaluation
- Fine-tuning of a pre-trained emoji generator
- Hyperparameter search
- Growing NCA for emoji generation
- Image Classification:
- Self-classifying MNIST digits
- MedMNIST image classification (PathMNIST, BloodMNIST, DermaMNIST)
- Image Segmentation:
- Endoscopic polyp segmentation (Kvasir-SEG, public)
You can find those example tasks inside the tasks/ directory and its subfolders.
Growing Lizard Example
A good starting point to get started with NCAs is the famous Growing Lizard emoji example.
uv run tasks/growing_emoji/train_growing_emoji.py
Run this script to generate a GIF of the trained model's prediction:
uv run tasks/growing_emoji/eval_growing_emoji.py
Installation
Run
pip install ncalab
to install the latest release or
pip install git+https://github.com/MECLabTUDA/NCALab
for the most recent commit of NCALab. We recommend to install NCALab in a virtual environment.
Tensorboard integration
We recommend you to monitor your training progress in Tensorboard. To launch tensorboard, run
uv run tensorboard --logdir=runs
in a separate terminal. Once it is running, it should show you the URL the tensorboard server is running on, which is localhost:6006 by default. Alternatively, you may use the tensorboard integration of your IDE.
For Developers
Type checking:
uv run mypy ncalab
Static code analysis:
uv run ruff check ncalab
Testing:
uv run pytest
How to Cite
Coming soon.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ncalab-0.2.0.tar.gz.
File metadata
- Download URL: ncalab-0.2.0.tar.gz
- Upload date:
- Size: 14.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7bf79841119ca543360c41b0e6e98d6d286b4e07402ae6b6f08b3241cfe95a60
|
|
| MD5 |
1715be70025d90af03344b0271af8fda
|
|
| BLAKE2b-256 |
bc8b2dcf89362e5cb2270be02c725c6e3223cceffc7e8d268a7d8aa0797bf24d
|
Provenance
The following attestation bundles were made for ncalab-0.2.0.tar.gz:
Publisher:
python-publish.yml on MECLabTUDA/NCALab
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ncalab-0.2.0.tar.gz -
Subject digest:
7bf79841119ca543360c41b0e6e98d6d286b4e07402ae6b6f08b3241cfe95a60 - Sigstore transparency entry: 385233106
- Sigstore integration time:
-
Permalink:
MECLabTUDA/NCALab@23f6148b0f2ee4d8733718d0292551105348e76a -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/MECLabTUDA
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@23f6148b0f2ee4d8733718d0292551105348e76a -
Trigger Event:
release
-
Statement type:
File details
Details for the file ncalab-0.2.0-py3-none-any.whl.
File metadata
- Download URL: ncalab-0.2.0-py3-none-any.whl
- Upload date:
- Size: 10.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ace33b2cb599b408a988093b88ec083e823f8c3a87b6fc6b82275df16aef327c
|
|
| MD5 |
668edf47ec0df9b7a7ab6a7d8897f251
|
|
| BLAKE2b-256 |
93127cd92dc7992d3d9ac1a407d2880060a7aa26a6d7ba08fb16d08cf7a196bd
|
Provenance
The following attestation bundles were made for ncalab-0.2.0-py3-none-any.whl:
Publisher:
python-publish.yml on MECLabTUDA/NCALab
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ncalab-0.2.0-py3-none-any.whl -
Subject digest:
ace33b2cb599b408a988093b88ec083e823f8c3a87b6fc6b82275df16aef327c - Sigstore transparency entry: 385233116
- Sigstore integration time:
-
Permalink:
MECLabTUDA/NCALab@23f6148b0f2ee4d8733718d0292551105348e76a -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/MECLabTUDA
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@23f6148b0f2ee4d8733718d0292551105348e76a -
Trigger Event:
release
-
Statement type: