File size: 4,298 Bytes
fadaef3
 
 
 
 
 
 
 
 
 
 
 
 
71ee09b
 
 
 
 
 
 
fadaef3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c310e69
fadaef3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
106
107
108
109
110
111
112
113
114
115
116
---
task_categories:
  - keypoint-detection
license: cc-by-4.0
tags:
  - biology
  - pose-estimation
  - multiview
  - fly
  - lightning-pose
pretty_name: Fly Anipose (Lightning Pose subset)
size_categories:
  - 1K<n<10K
configs:
  - config_name: default
    data_files:
      - split: ind
        path: data/ind-train-*.parquet
      - split: ood
        path: data/ood-test-*.parquet
---

# Fly Anipose — Lightning Pose Multiview Dataset

6-camera pose estimation dataset for *Drosophila* leg keypoints, packaged for use with [Lightning Pose](https://github.com/danbider/lightning-pose).

## Dataset Description

Head-fixed flies run on a spherical treadmill while 6 synchronized cameras capture locomotion at **300 Hz**. Each frame is labeled with **30 keypoints** — 5 joint segments (A–E) on each of 6 legs (left legs L1–L3, right legs R1–R3).

Labels are **filtered Anipose predictions**, not hand-labeled frames. They were constructed by:
1. Removing instances with mean 3D reprojection error > 10 px
2. Running k-means on 3D poses and keeping 25 instances per session
3. Using filtered 2D predictions; setting keypoints with 2D reprojection error > 10 px to NaN

Source data: Karashchuk et al., *Cell Reports* 2021 — original archive at https://doi.org/10.5061/dryad.nzs7h44s4

## Data Splits

| Split | Labeled instances | Sessions |
|-------|----------------:|--------:|
| In-distribution (InD) | 377 | 16 |
| Out-of-distribution (OOD) | 300 | 12 |

InD and OOD sets contain **different animals/sessions** (no overlap).

- `CollectedData_Cam-{A-F}.csv` — InD labels; `videos/` — InD videos
- `CollectedData_Cam-{A-F}_new.csv` — OOD labels; `videos_new/` — OOD videos

## Keypoints

30 keypoints total: side (`L`/`R`) + leg number (`1``3`) + segment (`A``E`, proximal→distal).

| Left legs | Right legs |
|-----------|------------|
| L1A, L1B, L1C, L1D, L1E | R1A, R1B, R1C, R1D, R1E |
| L2A, L2B, L2C, L2D, L2E | R2A, R2B, R2C, R2D, R2E |
| L3A, L3B, L3C, L3D, L3E | R3A, R3B, R3C, R3D, R3E |

## Directory Structure

```
fly_anipose_subset/
├── labeled-data/           # Extracted frames per session×view; includes ±2 context frames
├── videos/                 # Full InD session videos (<SessionKey>_<View>.mp4)
├── calibrations/           # Per-session camera calibration (.toml) for 3D features
├── calibrations.csv        # InD calibration index
├── calibrations_new.csv    # OOD calibration index
├── CollectedData_Cam-{A-F}.csv      # InD 2D keypoint labels (x,y per keypoint)
├── CollectedData_Cam-{A-F}_new.csv  # OOD 2D keypoint labels
├── config_fly-anipose.yaml # Sample Lightning Pose training config
├── project.yaml            # View and keypoint definitions (required by LP App)
└── models/                 # Pre-trained model checkpoints
    ├── baseline/
    ├── seed1/
    ├── seed2/
    └── pleasant_ensemble/
```

See the Lightning Pose documentation for full details on the [multiview data directory structure](https://lightning-pose.readthedocs.io/en/latest/source/directory_structure_reference/multiview_structure.html) and [model directory structure](https://lightning-pose.readthedocs.io/en/latest/source/directory_structure_reference/model_dir_structure.html).

## Usage with Lightning Pose

The included `config_fly-anipose.yaml` is a ready-to-use training config. Key settings:

- **Image resize:** 256 × 256
- **Backbone:** `resnet50_animal_ap10k`
- **Views:** Cam-A through Cam-F
- **Keypoints:** 30

Update `data.data_dir` and `data.video_dir` to absolute paths on your machine before training.

```bash
litpose train config_fly-anipose.yaml
```

## Citation

If you use this dataset, please cite the original Anipose paper:

```bibtex
@article{karashchuk2021anipose,
  title   = {Anipose: A toolkit for robust markerless 3D pose estimation},
  author  = {Karashchuk, Pierre and Rupp, Katie L and Dickinson, Evyn S and
             Walling-Bell, Sarah and Sanders, Elisha and Azim, Eiman and
             Brunton, Bingni W and Tuthill, John C},
  journal = {Cell Reports},
  volume  = {36},
  number  = {13},
  year    = {2021},
  doi     = {10.1016/j.celrep.2021.109730}
}
```

Original data archive: https://doi.org/10.5061/dryad.nzs7h44s4