# BugNIST2024 — Data

来源：https://www.kaggle.com/competitions/bugnist2024fgvc/data

采集时间：2026-10-19T06:31:33Z

# BugNIST Dataset and Submission Guidelines

The [BugNIST](https://arxiv.org/abs/2304.01838) dataset is specifically designed for the task of volumetric object detection under domain shift. The training data consists of volumes of individual bugs, while the test data is a mixture of bugs and other materials such as leaves, wood shavings, cotton, and shredded paper.

## Dataset Structure

### Training Data
The training dataset is located in the `BugNIST_DATA/train` folder. It is divided into 12 subfolders, each containing single-volume scans of a specific class of bug, as indicated by the folder name. Each volume measures 128-by-64-by-64 voxels (z-axis corresponds to the longest axis). For submission the abbreviated name should be used.

Here is a breakdown of the individual volumes:

| Abbreviation     | **AC**        | **BC**        | **BF**   | **BL**        | **BP**            | **CF**         |
|------------------|---------------|---------------|----------|---------------|-------------------|----------------|
| Bug Type         | Brown Cricket | Black Cricket | Blowfly  | Beetle Larvae | Blowfly Pupae     | Curly-wing Fly |
| # of Volumes     | 724           | 762           | 734      | 780           | 752               | 756            |
| **Abbreviation** | **GH**        | **MA**        | **ML**   | **PP**        | **SL**            | **WO**         |
| Bug Type         | Grasshopper   | Maggot        | Mealworm | Fly Pupae     | Soldierfly Larvae | Woodlice       |
| # of Volumes     | 716           | 765           | 738      | 769           | 740               | 949            |

### Validation Data
The validation dataset is located in the `BugNIST_DATA/validation` folder. It contains 78 volumes of bug mixtures in `.tif` file format. The dimensions are (128, 92, 92) corresponding to the z,x,y-axis. The true labels are provided in the `validation.csv` file within the same folder.

### Test Data
The test dataset is located in the `BugNIST_DATA/test` folder. It contains 310 volumes of bug mixtures in `.tif` file format. The dimensions are (128, 92, 92) corresponding to the z,x,y-axis. For submission of predictions on the test set, use the `Sample_solution.csv` file.

## Submission Format
To submit predictions for evaluation on the validation data and for participation in the Kaggle competition, you must adhere to a specific format. Use the provided `Sample_solution.csv` file as a reference for formatting your predictions.

Your prediction file should be a CSV with two columns: 'filename' and 'centerpoints'.

- 'filename': This column should contain the name of the volume file. This is already given in the file `Sample_solution.csv`.
- 'centerpoints': This column should contain the centerpoint and class prediction for each bug detected in the volume.

The format for each bug's centerpoint is as follows:
- Class label (as given in the table above), followed by a semicolon (;)
- x-coordinate of the centerpoint, followed by a semicolon (;)
- y-coordinate of the centerpoint, followed by a semicolon (;)
- z-coordinate of the centerpoint

If multiple bugs are detected in the same volume, their centerpoints should be combined in the same cell, separated by semicolons (;).

For example, if a bug of class "Beetle Larva" ("bl") is detected with a centerpoint at x-coordinate: 48.61, y-coordinate: 39.14, and z-coordinate 96.19, it should be written as a string "bl;48.61;39.14;96.19". If an additional bug of type "Soldier Fly Larva" ("sl") is detected at position (77.71, 53.14, 57.17), it can be combined in the cell as a string "bl;48.61;39.14;96.19;sl;77.71;53.14;57.17".

Here is an example of a submission file:

| Filename                    | Centerpoints                                      |
| --------------------------- | ------------------------------------------------- |
| mix_02_006_centroids.csv    | bl;48.61;39.14;96.19;sl;77.71;53.14;57.17        |
| mix_02_011_centroids.csv    | ml;77.86;46.26;57.79;sl;41.14;61.93;32.37;sl;56.09;48.52;56.20 |

Ensure your submission file follows this format for proper evaluation and scoring using the F1 class label score.

The notebook `BugNIST_example_load.ipynb` contains an example load function. It loads an image and a string of formatted centerpoints which it uses to display the centerpoints in a figure.

Nb. z-coordinate corresponds to the longest axis i.e. we expect a center coordinate value between 0 and 128. Both the x and y-axis have dimensions of 92.

## Evaluation 
Predictions are evaluated by matching the predicted centerpoints to the true centerpoints. This is done by calculating the `scipy.spatial.distance.cdist` and then matching the points using `scipy.optimize.linear_sum_assignment`. The labels of the matched points are then compared to calculate the F1 score.

The evaluation metric is provided in the `BugNIST_metric.py` file. You can use this to locally evaluate the validation data.