Skip to main content

A modular Python toolkit for building, analyzing, and visualizing fine-grained classification datasets from iNaturalist. Includes tools for web crawling, species filtering, class balancing, and manifest generation.

Project description


A modular dataset preparation toolkit for species-based classification pipelines.

A flexible and fast dataset builder for iNaturalist-style species classification.

Coverage Status

About The Project

Example Output

dataset_builder is a modular toolkit designed to streamline the process of preparing image classification datasets, especially for biodiversity and species-based research projects. It provides flexible CLI tools and Python APIs to help you:

  • Organize images by species into training and validation folders.
  • Apply filtering rules based on dominant species.
  • Export dataset manifests in plain text or Parquet formats.
  • Handle restricted dataset creation, cross-referencing, and species-level analysis.

This package is designed with iNaturelist 2017 dataset in mind. However, it should still helps you if you want to build a similar iNaturelist-style datasets or building your own species classifier.

The project follows the DRY principle and is designed with modularity and pipeline automation in mind.

You can use the CLI to quickly build datasets, or integrate it directly into your own ML pipeline.

Built With

This package is written entirely in Python to ensure that it can run on multiple platform easily. I use the following packages to enable the high-level feature of the package.

Getting Started

This project helps you build custom fine-tuning datasets from the INaturelist collection with minimal effort. It supports tasks such as filtering species, copying matched images, generating manifests, and preparing training/validation splits - all with configurable YAML pipelines. Whether you are training a deep learning model or simply exploring biodiversity data, this toolkit gets your dataset in shape.

Prerequisites

  • Python >= 3.11
  • Git

Installation

pip install dataset_builder_inat

For more details, check out the wiki here

Usage

This package is designed to be used through its high-level Python APIs. The typical workflow is defined in a central Python script such as main.py (see below), which loads a config file and runs multiple dataset preparation stages.

Step 1: Create a YAML config file (config.yaml) You can check out the details in the wiki here.

global:
  included_classes: ["Aves", "Insecta"]
  verbose: false
  overwrite: false

paths:
  src_dataset: "iNaturelist_2017"
  dst_dataset: "haute_garonne"
  web_crawl_output_json: "./output/haute_garonne.json"
  output_dir: "./output"

web_crawl:
  total_pages: 104
  base_url: "https://www.inaturalist.org/check_lists/32961-Haute-Garonne-Check-List?page="
  delay_between_requests: 1

train_val_split:
  train_size: 0.8
  random_state: 42
  dominant_threshold: 0.9

Step 2: Create the main.py or use the dataset_orchestration.py provided in release

For more details, you can check out the wiki here

Roadmap

  • Simplify config.yaml structure: group related options, add environmental variable support, introduce profiles (e.g., dev/prod).
  • Add advanced options to train_val_split: support stratified splitting, per-class balancing, and deterministic sampling for reproducibility.
  • Auto-generate config.yaml step-by-step from terminal prompts.
  • Built-in summary report: after pipeline finishes, output a Markdown or HTML report: species count, splits, coverage, etc. (show logs after each run)
  • Add support for export all manifests in Parquet format regardless of path format.

Contributing

Contributions are welcome!

If you have suggestions for improvements or spot any issues, feel free to open an issue or submit a pull request.
Please follow the existing project structure and naming conventions when contributing.

To get started:

  1. Fork the repo
  2. Clone your fork locally:
    git clone https://github.com/HoangPham6337/iNaturelist_dataset_builder
  3. Create a new branch:
    git checkout -b feature/your-feature-name
  4. Make your changes and commit
  5. Push to your fork:
    git push origin feature/your-feature-name
  6. Open a Pull Request

For major changes, please open an issue first to discuss what you’d like to change.

License

Distributed under the MIT License. See MIT License for more information.

Contact

Pham Xuan Hoang – LinkedInhoangphamat0407@gmail.com

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

dataset_builder_inat-1.0.8.tar.gz (32.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dataset_builder_inat-1.0.8-py3-none-any.whl (43.2 kB view details)

Uploaded Python 3

File details

Details for the file dataset_builder_inat-1.0.8.tar.gz.

File metadata

  • Download URL: dataset_builder_inat-1.0.8.tar.gz
  • Upload date:
  • Size: 32.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for dataset_builder_inat-1.0.8.tar.gz
Algorithm Hash digest
SHA256 bd4f32846a3c4dc0313b08feb11586a81c96ff145fb9f835b5e5392a2abcc177
MD5 2bc93c18b26edc7ca935425710db78df
BLAKE2b-256 4ed0169e02589df45319152c44658bb8251b4684579c8cc7cf92d3f3c8632400

See more details on using hashes here.

Provenance

The following attestation bundles were made for dataset_builder_inat-1.0.8.tar.gz:

Publisher: python-publish.yml on HoangPham6337/iNaturelist_dataset_builder

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dataset_builder_inat-1.0.8-py3-none-any.whl.

File metadata

File hashes

Hashes for dataset_builder_inat-1.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 c2473d28c98d0f78b6e5f42effdbc4df450772a6c2ed23602b033f917dda8da6
MD5 ab7264bde87314ff119967278053a5bf
BLAKE2b-256 5e46f98bb2d85e8788e1d3b38e715e7f25de43175096d866e7bdab62a29a4581

See more details on using hashes here.

Provenance

The following attestation bundles were made for dataset_builder_inat-1.0.8-py3-none-any.whl:

Publisher: python-publish.yml on HoangPham6337/iNaturelist_dataset_builder

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page