# APOAI 2026 Spot the Spots: Individual Identification of Leopard Cats

**Note: This task will be evaluated in an environment based on the `ioai3.7` image. Participants should select `ioai3.7` as the training image.**

**This is the only task that uses the `ioai3.7` image, because the pre-trained models provided for this task are permitted for use.**

---

## 1. Background

In ecology, studying animal habitats and behavioral patterns is crucial for biodiversity conservation. Traditionally, **camera traps**—infrared-triggered cameras—have served as a vital non-invasive monitoring tool, capturing rare images of wildlife that are often difficult for humans to observe directly.

While modern Artificial Intelligence has achieved remarkable success in **species identification** (detecting *what* animal is in a photo), a more significant challenge remains: **individual identification**. The ability to distinguish specific individuals within the same species enables researchers to estimate population density, track movement patterns, and better understand wildlife social dynamics.

The research team led by Professor Luo Shu-Jin at Peking University has conducted long-term studies on *Prionailurus bengalensis* (leopard cats) inhabiting the outskirts of Beijing, accumulating an extensive camera-trap image dataset from numerous individuals. One of their most iconic photographs, titled "The Hidden Olympic Spectator," was published in *Science*. It captured a leopard cat walking in snow, with the ski slopes of Beijing Winter Olympics visible in the background.

<img src="https://bohrium.oss-cn-zhangjiakou.aliyuncs.com/competition/ioai/apoai/cat_samples/olympic_spectator.jpg" width="400" />

Leopard cats are characterized by distinct spotted coat patterns that are unique to each individual and can be used to identify specific animals. Enabling automated individual re-identification (Re-ID) would represent a significant breakthrough, greatly accelerating ecological research and conservation efforts for these elusive felines.

> **Reference:** Luo, S. J. (2021). The hidden Olympic spectator. *Science*, 373(6553), 404.



## 2. Task Overview

Your mission is to **build an AI recognition system** capable of fine-grained classification for identifying individual leopard cats.

### Key Objectives

- **Feature Extraction:** Develop a model that can recognize unique morphological markers (such as spot patterns and facial features) specific to individual cats.
- **Robustness:** The model should be robust to variations in lighting, including daytime and nighttime infrared images, as well as background clutter and differences in body posture.
- **Generalization:** Develop a model that generalizes well from the training split to the validation and test splits.

| Attribute | Value |
|---|---|
| **Species** | *Prionailurus bengalensis* (The Leopard Cat) |
| **Task Type** | Fine-grained Image Classification / Individual Re-identification |
| **Data Source** | Peking University Leopard Cat Research Team |



## 3. Dataset

### 3.1 Dataset Statistics

The leopard cat research team from Peking University has meticulously performed manual labeling to establish a ground-truth dataset. From an initial pool of more than 1,500 images, **1,090 high-quality images** were selected to form the curated dataset for this pilot study on individual identification.

| Split | Images | Purpose |
|---|---|---|
| Train | 780 | Model optimization |
| Validation | 155 | Hyperparameter tuning & public leaderboard |
| Test | 155 | Final performance evaluation (private leaderboard) |
| **Total** | **1,090** | |

### 3.2 Data Structure

Please refer to the [baseline](https://www.bohrium.com/notebooks/11881653382) notebook for the complete file structure.

### 3.3 Label Format

Each CSV file contains two columns: `filename` (image file name) and `label` (numeric individual ID).

Example rows from `train.csv`:

| filename | label |
|---|---|
| train_0.jpg | 0 |
| train_1.jpg | 0 |
| train_2.jpg | 0 |
| train_5.jpg | 1 |
| train_10.jpg | 2 |
| train_15.jpg | 3 |
| train_21.jpg | 3 |

There are 54 unique individual leopard cats (labels 0–53) in the dataset.

### 3.4 Sample Images

Below are typical examples from the training set. These infrared-triggered camera trap images exhibit the characteristic variations in lighting (day vs. night infrared), angle, background clutter, and body posture that the model must handle.

<img src="https://bohrium.oss-cn-zhangjiakou.aliyuncs.com/competition/ioai/apoai/cat_samples/train_56.jpg" width="400" />

*Daytime camera trap capture showing the leopard cat's distinctive coat pattern.*

<img src="https://bohrium.oss-cn-zhangjiakou.aliyuncs.com/competition/ioai/apoai/cat_samples/train_3.jpg" width="400" />

*Nighttime infrared capture — the model must recognize individuals even under dramatically different lighting conditions.*

The validation and test sets are **not directly accessible** during development. They must be accessed through environment variables (see [baseline](https://www.bohrium.com/notebooks/11881653382) notebook for details).

### 3.5 Training Data Access

Training data can be accessed directly:

- **Images:** `/bohr/train-pn60/v1/train/*.jpg`
- **Labels:** `/bohr/train-pn60/v1/train.csv`

---

## 4. Task

Implement an image classifier for individual leopard cat identification.

### Requirements

- Training + inference must complete within a reasonable time.
- Images are camera trap photographs with varying resolutions, lighting conditions, and angles.
- Only the `train` split may be used for model development and training. The `validation` and `test` splits are reserved exclusively for evaluation during the official submission process.


---

## 5. Submission

Participants must submit a notebook containing both the training process and the prediction process.

### 5.1 Input and Output

- **Input:** Images from `train/` + `train.csv` for training; validation and test data are accessed via environment variables during submission runtime (see [baseline](https://www.bohrium.com/notebooks/11881653382) for details).
- **Output:** A zip file named `submission.zip` containing:
  - `validation_submission.csv` — predictions for the validation set
  - `test_submission.csv` — predictions for the test set

### 5.2 File Structure

Please refer to the [baseline](https://www.bohrium.com/notebooks/11881653382) notebook for the complete file structure.

### 5.3 Submission CSV Format

Both `validation_submission.csv` and `test_submission.csv` should contain two columns:

| Column | Description |
|---|---|
| `filename` | Image file name (matching the input) |
| `label` | Predicted individual leopard cat ID |

Example:

```csv
filename,label
cat_001.jpg,0
cat_002.jpg,1
cat_003.jpg,2
```

---

## 6. Scoring

### 6.1 Metric: Accuracy

The final score is the **accuracy** — the proportion of correctly classified images:

$$\text{Accuracy} = \frac{\text{Number of correct predictions}}{\text{Total number of images}} \times 100\%$$

### 6.2 Public vs Private Leaderboard

- **Public leaderboard (A):** validation set accuracy
- **Private leaderboard (B):** test set accuracy (revealed after competition ends)

---

## 7. Constraints

- **Pre-trained Models:** Participants are encouraged to use pre-trained backbone models available from the provided dataset(/bohr/apweights-x4fz/v1/weights/). The following pre-trained weights are explicitly permitted:

| Model | Source | File |
|---|---|---|
| ConvNeXt-Tiny | `torchvision` | `convnext_tiny-983f1562.pth` |
| ResNet101 | `torchvision` | `resnet101-cd907fc2.pth` |
| Swin-T | `torchvision` | `swin_t-704ceda3.pth` |
| Swin-Base (384) | Hugging Face | `swin_base_384_pytorch_model.bin` |
| YOLO11n/s/m/x | `ultralytics` | `yolo11n.pt` / `yolo11s.pt` / `yolo11m.pt` / `yolo11x.pt` |

- **Using any pre-trained weights other than those listed above is strictly prohibited and may result in a score of zero.**
- **Frameworks:** Standard Python deep learning frameworks (PyTorch). The following libraries are available: `torch`, `torchvision`, `transformers`, `ultralytics`, `timm`, `opencv-python`, `scikit-learn`, `pandas`, `numpy`. Example code for calling these pre-trained models is provided in the [baseline](https://www.bohrium.com/notebooks/11881653382).
- **Self-contained:** Solutions must be self-contained and reproducible without external API calls or internet access.
- **Time constraints: **Training and inference must be completed within 25 minutes on a Tesla L20 GPU.

## 8. Baseline and Reference Scores

The baseline score on Leaderboard B is: 0.2580

The reference score achieved by the scientific committee on Leaderboard B is: 0.6580

## 9. Acknowledgements

We thank the Peking University Leopard Cat Research Team, specifically, Han Yuchen, Jiang Mengluan,  Wu Zhenbo, Han Sicheng, Lu Daowei, and Luo Shu-Jin, for generating and providing the original dataset;

And the Collaborative Research Team: Feng Junran, Lian Haoming, Shen Mohan, Ma Kaidi, Zhang Yuxin, and Tao Dajiang from Beijing Mingcheng Academy, for pilot test.

