File size: 3,910 Bytes
e42237f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# IndoLepAtlas — Indian Lepidoptera & Host Plants Dataset

A large-scale computer vision dataset of Indian butterflies, moths, and their larval host plants. Sourced from [ifoundbutterflies.org](https://www.ifoundbutterflies.org/) with public CC-licensed photographs.

> **Inspired by:** [iNaturalist](https://www.inaturalist.org/) | **Domain:** Indian Wildlife & Biodiversity

## Dataset Overview

| | Butterflies | Host Plants | Total |
|---|---|---|---|
| **Species** | ~967 | ~127 | ~1,094 |
| **Images** | ~2,000+ | ~700+ | ~2,700+ |
| **Source** | ifoundbutterflies.org | ifoundbutterflies.org | — |

## Motivation

Existing CV datasets (ImageNet, iNaturalist) under-represent Indian biodiversity. India hosts **~1,500 butterfly species** — many endemic and poorly documented in digital datasets. This dataset enables:

- **Species classification** of Indian butterflies and host plants
- **Object detection** with auto-generated bounding boxes
- **Ecological analysis** of butterfly-plant host relationships
- **Diagnostic analysis** using pretrained models

## Directory Structure

```
IndoLepAtlas/
├── data/
│   ├── butterflies/
│   │   ├── raw/              # Original images (with overlays)
│   │   ├── images/           # Clean trimmed images
│   │   └── metadata.csv      # Enriched per-image metadata
│   └── plants/
│       ├── raw/
│       ├── images/
│       └── metadata.csv
├── annotations/
│   ├── butterflies/*.txt     # YOLO format
│   ├── plants/*.txt          # YOLO format
│   ├── annotations.json      # COCO format (combined)
│   └── classes.txt           # Species→ID mapping
├── splits/
│   ├── train.txt (70%)
│   ├── val.txt   (15%)
│   └── test.txt  (15%)
├── docs/
│   ├── class_definitions.json
│   ├── annotation_guide.md
│   ├── data_card.md
│   └── distribution_stats.md
├── README.md
└── LICENSE
```

## Metadata Fields

### Butterflies (`metadata.csv`)
`image_id, filename, species, common_name, family, subfamily, genus, order, life_stage, sex, media_code, location, state, date, credit, source_url, source, split`

### Plants (`metadata.csv`)
`image_id, filename, species, family, genus, image_type, media_code, location, state, date, credit, butterfly_hosts, source_url, source, split`

## Annotation Format

- **YOLO** (per image): `<class_id> <x_center> <y_center> <width> <height>` (normalized)
- **COCO** (`annotations.json`): standard format with `images`, `categories`, `annotations`
- **Classes**: Species-level (~1,094 classes). See `annotations/classes.txt`

## Pipeline Scripts

| Script | Purpose |
|--------|---------|
| `pull_hf_data.py` | Download datasets from HuggingFace |
| `process_images.py` | Trim overlay text bands |
| `enrich_metadata.py` | OCR overlay extraction → metadata CSVs |
| `generate_annotations.py` | Auto bounding boxes (Grounding DINO) |
| `generate_splits.py` | Stratified train/val/test splits |
| `generate_stats.py` | Distribution statistics |
| `crawler_logged.py` | Butterfly species scraper |
| `plant_crawler.py` | Host plant species scraper |

All pipeline scripts are **incremental** — they skip already-processed data and support adding new species non-destructively.

## Ethical Guidelines

- All images are from publicly available sources (ifoundbutterflies.org)
- Photographer credits are preserved in metadata via OCR extraction
- No human faces or personal information in the dataset
- Source URLs and attribution maintained for every image

## Citation

```
@dataset{indolepatlas2026,
  title={IndoLepAtlas: Indian Lepidoptera and Host Plants Dataset},
  year={2026},
  source={ifoundbutterflies.org},
  license={CC BY-NC-SA 4.0}
}
```

## License

This dataset is released under [CC BY-NC-SA 4.0](LICENSE).