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.5.tar.gz (33.0 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.5-py3-none-any.whl (43.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: dataset_builder_inat-1.0.5.tar.gz
  • Upload date:
  • Size: 33.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for dataset_builder_inat-1.0.5.tar.gz
Algorithm Hash digest
SHA256 636fa3a75211ee943fff94c633cf829f11ff30c69a35e52f746621102aef4f32
MD5 4266d66651b21ad449884d620759cd41
BLAKE2b-256 c6c45c820bbce016a3df46c99c634bfc5347f08265e33875aefe80de64352edb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dataset_builder_inat-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 671048d575d3e5d6ec6974d2c9bf4ada3e920f7568a2bfa1db3a2b447e46323c
MD5 d5b62ba9003ebd4d829d3d1265159837
BLAKE2b-256 212679ead60a8b634e01df1124caef8a2a55de7251efb27255cacccd8fe4e91d

See more details on using hashes here.

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