
Multimodal deep learning framework, datasets, and models for plankton identification.
Part of Inria Challenge OcΓ©anIA.
planktonzilla is a framework for managing datasets, training computer vision models, and evaluating performance on various plankton image identification tasks. Built on top of Hugging Face Transformers and Hydra for configuration management, it offers specialized tools for handling imbalanced plankton datasets and state-of-the-art imbalance learning loss functions.
planktonzilla-17Mdataset: 17 million plankton images from 9 different datasets, all standardized and preprocessed for deep learning applications:project-oceania/planktonzilla-17M.- Planktonzilla taxonomy mapping explorer:
project-oceania/planktonzilla-explorer - Models trained on
project-oceania/planktonzilla-17M: - Planktonzilla Hugging Face Collection: https://huggingface.co/collections/project-oceania/planktonzilla
- Project OcΓ©anIA project website: https://oceania.inria.cl.
- Project OcΓ©anIA on Hugging Face Hub (more datasets, trained models, and demos): https://huggingface.co/project-oceania.
If you use Planktonzilla in your research, please cite as:
A. G. Contreras Montanares, L. Valenzuela, L. MartΓ, and N. SanchezβPi, Planktonzilla: Multimodal dataset and models for understanding plankton ecosystems, Inria Chile Research Center, Tech. Rep., May 2026, doi: 10.48550/arXiv.2606.00080, arXiv: 2606.00080 [cs.CV]. url: https://arxiv.org/abs/2606.00080
@techreport{contrerasmontanares:hal-05621003,
title = {Planktonzilla: {M}ultimodal dataset and models for understanding plankton ecosystems},
author = {Contreras Montanares, Alan Gerson and Valenzuela, Luis and Mart{\'i}, Luis and Sanchez-Pi, Nayat},
year = 2026,
month = {May},
keywords = {Explainable AI; XAI ; Plankton Classification ; CLIPS ; Multimodal Classification},
eprinttype = {arxiv},
hal_id = {hal-05621003},
hal_version = {v1},
eprint = {2606.00080},
archivePrefix = {arXiv},
primaryClass = {cs.CV},
url = {https://arxiv.org/abs/2606.00080},
doi = {10.48550/arXiv.2606.00080},
institution = {Inria Chile Research Center},
}from transformers import AutoModelForImageClassification, AutoImageProcessor
from PIL import Image
model_id = "project-oceania/<model-name>" # see https://huggingface.co/project-oceania
processor = AutoImageProcessor.from_pretrained(model_id, trust_remote_code=True)
model = AutoModelForImageClassification.from_pretrained(model_id, trust_remote_code=True)
image = Image.open("plankton.jpg").convert("RGB")
inputs = processor(images=image, return_tensors="pt")
outputs = model(**inputs)
predicted_idx = outputs.logits.argmax(-1).item()
print(model.config.id2label[predicted_idx])planktonzilla/ # repo root
βββ configs/ # Hydra configuration tree (bundled into wheel)
β βββ train.yaml # root config for pz_train
β βββ import_dataset.yaml # root config for pz_import_dataset
β βββ generate_planktonzilla.yaml # root config for dataset generation
β βββ update_planktonzilla.yaml # root config for dataset update
β βββ augmentation/ # data augmentation strategies
β βββ custom_loss/ # imbalance-aware loss configs
β βββ dataset/ # dataset-specific configs
β βββ dataset_import/ # per-source import configs
β βββ debug/ # debug-run configs
β βββ experiment/ # composed experiment configs
β βββ extras/ # misc extras (e.g. print config tree)
β βββ hparams_search/ # hyperparameter-search configs
β βββ hydra/ # Hydra runtime (help/, launcher/ for SLURM)
β βββ local/ # machine-local overrides
β βββ model/ # model architecture configs
β βββ paths/ # path configs (PROJECT_ROOT etc.)
β βββ peft/ # LoRA / PEFT adapter configs
β βββ tracking/ # experiment tracking (W&B, MLflow, trackio)
β βββ training_arguments/ # HF TrainingArguments configs
βββ planktonzilla/ # main package
β βββ train.py # pz_train entry point (HF Trainer pipeline)
β βββ dataset.py # DatasetWrapper: load/split/transform
β βββ loss.py # imbalance-aware loss functions
β βββ clip_model.py # ClipClassifier (open_clip encoder + head)
β βββ dataset_import/ # pz_import_dataset entry point + DatasetImporter subclasses
β β βββ public_data/ # bundled source-dataset metadata
β βββ clip_train/ # SLURM contrastive CLIP pretraining (main.py, train.py)
β βββ open_clip_ext/ # forward-compat seam around open_clip factory/transform
β β βββ model_configs/ # open_clip model JSON configs
β βββ planktonzilla_dataset/ # builds the master composite dataset from external sources
β β βββ generate_planktonzilla.py # main dataset build (Hydra entry)
β β βββ gen_planktonzilla_only_plankton.py
β β βββ update_planktonzilla.py # incremental dataset update (Hydra entry)
β β βββ save_planktonzilla_for_clip.py # export to WebDataset for CLIP
β β βββ generate_sankey.py # taxonomy Sankey diagram
β β βββ constants.py # shared constants
β β βββ planktonzilla_taxonomy.csv # taxonomy mapping table
β β βββ utils/ # extract_cox.py, extract_taxon_ids.py, KNOWN_ISSUES.md
β βββ utils/ # hydra.py, resolvers.py, logger.py, rich_utils.py
βββ scripts/ # train.sh, train_clip.sh, push_dataset.sh (SLURM launchers)
βββ tests/ # pytest suite (mocks all network)
- Python 3.11-3.14
- uv for dependency management
- CUDA-compatible GPU (recommended for training)
# Clone the repository
git clone https://github.com/Inria-Chile/planktonzilla.git
cd planktonzilla
# Install dependencies (creates .venv automatically)
uv sync
# Install with development dependencies
uv sync --group dev
# Activate the virtual environment (optional β `uv run` works without it)
source .venv/bin/activateuv run <command> runs any project script inside the project venv without needing
to activate it manually. If you prefer an activated shell, run
source .venv/bin/activate.
# Import ISIISNET dataset
uv run pz_import_dataset dataset_import=isiisnet
# Import other available datasets
uv run pz_import_dataset dataset_import=flowcamnet
uv run pz_import_dataset dataset_import=lensless# Basic training with default configuration
uv run pz_train
# Train with specific dataset and model
uv run pz_train dataset=isiisnet model=resnet18
# Use specialized loss for imbalanced data
uv run pz_train dataset=isiisnet model=resnet50 custom_loss=focal
# Override training parameters
uv run pz_train dataset=isiisnet model=resnet18 training_arguments.num_train_epochs=10 training_arguments.learning_rate=1e-4Planktonzilla uses Hydra for hierarchical configuration management. You can override any configuration parameter:
# Use different model architecture
uv run pz_train model=efficientnet
# Apply different augmentation strategy
uv run pz_train augmentation=autoaugment
# Combine multiple overrides
uv run pz_train dataset=isiisnet model=resnet50 custom_loss=ldam training_arguments.learning_rate=1e-4The training pipeline composes Hydra-configured datasets, models, and losses through the Hugging Face Trainer, then publishes the resulting checkpoint to the Hub β where external users load it with AutoModelForImageClassification.from_pretrained.
flowchart TB
subgraph Configure["1 Β· Configure"]
direction TB
CLI["CLI<br/>pz_import_dataset Β· pz_train"]:::entry
CFG["Hydra configs<br/>configs/"]:::cfg
end
subgraph Ingest["2 Β· Ingest"]
direction TB
DATA_IMPORT["planktonzilla/dataset_import/<br/>DatasetImporter subclasses"]:::code
HF_DATA[("HF Hub<br/>project-oceania datasets")]:::ext
end
subgraph Train["3 Β· Train"]
direction TB
DATA["planktonzilla/dataset.py<br/>DatasetWrapper"]:::code
MODEL["Model<br/>timm Β· HF Β· open_clip"]:::code
LOSS["planktonzilla/loss.py<br/>AbstractHFLoss subclasses"]:::code
TRAIN_LOOP["HF Trainer<br/>planktonzilla/train.py"]:::code
TRACK["Tracking<br/>W&B Β· MLflow Β· trackio"]:::ext
OUTPUTS["Local outputs<br/>logs/ Β· checkpoints/"]:::code
end
subgraph Publish["4 Β· Publish"]
direction TB
HF_MODEL[("HF Hub<br/>project-oceania models")]:::ext
end
SCRIPTS["scripts/*.sh<br/>SLURM launchers"]:::code
TESTS["tests/<br/>smoke runs"]:::code
CONSUMER(["AutoModelForImageClassification<br/>.from_pretrained"]):::consumer
CLI --> CFG
CFG -.->|configures| DATA_IMPORT
CFG -.->|configures| TRAIN_LOOP
CFG -.->|selects| MODEL
CFG -.->|selects + params| LOSS
- ISIISNET: In-Situ Ichthyoplankton Imaging System Network
- FlowCamNet: FlowCam plankton dataset
- Lensless: Lensless plankton microscopy dataset
- UVP6Net: Underwater Vision Profiler 6 dataset
- WHOI-Plankton: Woods Hole Oceanographic Institution plankton dataset
- ZooLake: Lake Greifensee (Switzerland) zooplankton dataset
- ZooScanNet: ZooScan plankton dataset
- JEDI-Oceans: JEDI oceanic plankton dataset
- CIFAR-10: Generic image classification benchmark (sanity-check / smoke-test runs)
Planktonzilla includes specialized loss functions designed for imbalanced plankton classification:
- FocalLoss: Addresses class imbalance through dynamic loss weighting
- LDAMLoss: Label-Distribution-Aware Margin loss
- AsymmetricLoss: For multi-label classification scenarios
- RobustAsymmetricLoss: Enhanced version of asymmetric loss
- MaximumMarginLoss: Margin-based learning approach
- BalancedMetaSoftmaxLoss: Meta-learning approach for class balance
Integrate with popular experiment tracking tools:
# Enable Weights & Biases tracking
uv run pz_train tracking.use_wandb=true
# Enable MLflow tracking
uv run pz_train tracking.use_mlflow=true
# Enable Trackio
uv run pz_train tracking.use_trackio=true# Run all tests
uv run pytest
# Run with coverage
uv run pytest --cov=planktonzilla
# Run specific test file
uv run pytest tests/test_datasets.py# Lint code
uv run ruff check
# Format code
uv run ruff format- Create a dataset configuration in
configs/dataset/your_dataset.yaml - Ensure your dataset is available on Hugging Face Hub
- Test with:
uv run pz_train dataset=your_dataset
- Implement your loss class inheriting from
AbstractHFLossinplanktonzilla/loss.py - Add configuration file in
configs/custom_loss/your_loss.yaml - Loss functions must handle
ImageClassifierOutputWithNoAttentioninput format - Test with:
uv run pz_train custom_loss=your_loss