agar / README.md
leodriesch's picture
Add sample images to dataset card
9ce24ca verified
|
Raw History Blame Contribute Delete
6.36 kB
---
license: cc-by-nc-2.0
pretty_name: AGAR
task_categories:
- object-detection
tags:
- microbiology
- bacteria
- colony-counting
- petri-dish
size_categories:
- 10K<n<100K
configs:
- config_name: default
default: true
data_files:
- split: train
path: data/*/train-*
- split: validation
path: data/*/validation-*
- split: unassigned
path: data/*/unassigned-*
- config_name: bright
data_files:
- split: train
path: data/bright/train-*
- split: validation
path: data/bright/validation-*
- split: unassigned
path: data/bright/unassigned-*
- config_name: dark
data_files:
- split: train
path: data/dark/train-*
- split: validation
path: data/dark/validation-*
- split: unassigned
path: data/dark/unassigned-*
- config_name: vague
data_files:
- split: train
path: data/vague/train-*
- split: validation
path: data/vague/validation-*
- split: unassigned
path: data/vague/unassigned-*
- config_name: lower_resolution
data_files:
- split: train
path: data/lower_resolution/train-*
- split: validation
path: data/lower_resolution/validation-*
- split: unassigned
path: data/lower_resolution/unassigned-*
---
# AGAR
Mirror of the [AGAR dataset](https://agar.neurosys.com) by NeuroSYS Research (version 1.0, 2020): 18,000 photos of Petri dishes with 336,442 annotated colonies of five microorganisms (*S. aureus*, *B. subtilis*, *P. aeruginosa*, *E. coli*, *C. albicans*), plus 1,055 boxes marking defects and contaminations.
This copy repackages the original release as sharded Parquet. Images are the original JPEG bytes, not re-encoded. Annotations are taken from the per-image JSON files of the release, which match the release's COCO file exactly.
| Image | Annotations |
|---|---|
| ![Petri dish with S. aureus and P. aeruginosa colonies](https://huggingface.co/datasets/leodriesch/agar/resolve/main/images/sample.jpg) | ![The same dish with bounding boxes per colony](https://huggingface.co/datasets/leodriesch/agar/resolve/main/images/sample_boxes.jpg) |
A dish from the `dark` subset with *S. aureus* and *P. aeruginosa*, downscaled to 1000 pixels.
## Usage
```python
from datasets import load_dataset
ds = load_dataset("leodriesch/agar", split="train") # all backgrounds
dark = load_dataset("leodriesch/agar", "dark", split="validation") # one background
```
The images are large (up to about 4000 × 4000 pixels, 31 GB in total). Use `streaming=True` to avoid downloading everything.
## Configurations
The release groups images by how they were photographed:
| Config | Images | Description |
|---|---|---|
| `bright` | 2,088 | higher resolution, bright background |
| `dark` | 9,649 | higher resolution, dark background |
| `vague` | 994 | higher resolution, vague background |
| `lower_resolution` | 5,269 | lower resolution camera |
The `default` config contains all four.
## Splits
- `train` / `validation`: the official split lists shipped with the release (`training_lists/`). They cover only countable images: 9,202 train and 3,067 validation.
- `unassigned`: everything the official lists do not cover: all empty and uncountable dishes, and 4 countable images that appear in neither list.
## Fields
| Field | Type | Description |
|---|---|---|
| `image` | image | the original JPEG |
| `image_id` | int | file number in the release (`<image_id>.jpg`); equals the image `id` in the COCO file |
| `sample_id` | int | `sample_id` as written in the release's per-image JSON (see Known issues) |
| `background` | class | `bright`, `dark`, `vague`, `lower-resolution` |
| `image_type` | class | `empty`, `countable`, `uncountable`, from the ID ranges in `AGAR_id_list.md` |
| `width`, `height` | int | image size in pixels |
| `classes` | list of str | microorganisms on the dish |
| `colonies_number` | int | number of colonies on the dish: counts microorganism boxes only (not `Defect`/`Contamination`), `-1` for uncountable dishes |
| `objects.id` | list of int | box ID within the image |
| `objects.bbox` | list of `[x, y, width, height]` | boxes in pixels, COCO format (top-left corner) |
| `objects.category` | list of class | `S.aureus`, `B.subtilis`, `P.aeruginosa`, `E.coli`, `C.albicans`, `Defect`, `Contamination` |
Uncountable dishes have no boxes. Use `len(objects.bbox)` for the number of boxes.
## Original files
`annotations/` holds the release's metadata unchanged:
- `coco_annotations.json`: the COCO file (`dataset/annotations.json` in the release)
- `training_lists/`: the official split lists (JSON arrays despite the `.txt` extension)
- `AGAR_id_list.md`: the ID ranges per background and image type
## Changes from the original release
- Images and per-image JSON files are combined into sharded Parquet files, grouped by background and split. The JPEG bytes are unchanged.
- Annotations are restructured: each label's `x`, `y`, `width`, `height` became `objects.bbox`, and `class` became `objects.category`.
- Added fields: `image_id` (file number), `image_type` (from `AGAR_id_list.md`), and `width`/`height` (from the COCO file).
- Splits: the official train/validation assignment is unchanged. The `unassigned` split groups the images that are in neither list.
- `dataset/annotations.json` is renamed to `annotations/coco_annotations.json`. Its content and the other metadata files are unchanged.
## Known issues
- In 438 of the per-image JSON files, `sample_id` is one higher than the file number (e.g. `1000.json` says `1001`). The annotations themselves belong to the file with the same number; they match the COCO file under that ID. Use `image_id`, not `sample_id`.
- Every official split list contains the string `"annotations.json"` as an entry. It was dropped here.
## License and citation
AGAR is licensed under [CC BY-NC 2.0](https://creativecommons.org/licenses/by-nc/2.0/): non-commercial use only, with attribution.
```bibtex
@misc{majchrowska2021agar,
title = {AGAR a microbial colony dataset for deep learning detection},
author = {Sylwia Majchrowska and Jaros\l{}aw Paw\l{}owski and Grzegorz Gu\l{}a and Tomasz Bonus and Agata Hanas and Adam Loch and Agnieszka Pawlak and Justyna Roszkowiak and Tomasz Golan and Zuzanna Drulis-Kawa},
year = {2021},
eprint = {2108.01234},
archiveprefix = {arXiv},
primaryclass = {cs.CV}
}
```