File size: 5,211 Bytes
651237b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
628552e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
---
dataset_info:
  features:
  - name: image
    dtype: image
  - name: detections
    list:
    - name: class
      dtype: string
    - name: bbox_xyxy
      list: float64
    - name: confidence
      dtype: float64
  - name: yolo_labels
    dtype: string
  - name: image_annotated
    dtype: image
  splits:
  - name: train
    num_bytes: 11360605942.32
    num_examples: 69018
  download_size: 11350785810
  dataset_size: 11360605942.32
configs:
- config_name: default
  data_files:
  - split: train
    path: data/train-*
---

# Forest Fire Detection Dataset — Auto-Annotated

Bounding-box annotated version of [touati-kamel/forest-fire-dataset](https://huggingface.co/datasets/touati-kamel/forest-fire-dataset),
built for training forest-fire / smoke / fog object detection models.

## Overview

This dataset contains video frames auto-labeled with bounding boxes for fire and
smoke-related visual phenomena, using a zero-shot open-vocabulary object detector
(Grounding DINO). It is derived from the original `touati-kamel/forest-fire-dataset` image
classification dataset, which did not include bounding box annotations.

## Classes

| Class          | Description                                   |
|----------------|------------------------------------------------|
| `Fire`         | Visible flame                                   |
| `Fire-smoke`   | Smoke originating from fire                     |
| `Fog`          | Fog / mist in the scene                         |
| `Factory-smoke`| Industrial/factory smoke (non-fire smoke source)|

## Why a single `train` split?

The source frames were extracted from videos and then shuffled randomly before
being split into train/validation/test. Because consecutive video frames are
often 99%+ visually similar, this shuffling caused near-duplicate frames from
the same video clip to end up scattered across different splits -- a data
leakage problem that would make validation/test metrics unreliable (a model
could "memorize" a near-identical frame seen during training).

To fix this, all annotated frames from the original train/validation/test
splits have been merged into a single `train` split here. **Validation and
test splits will be added later**, sourced from separate, distinct videos not
present in `train`, to ensure clean evaluation without leakage.

## Annotation methodology

- **Model**: `IDEA-Research/grounding-dino-tiny` (zero-shot, open-vocabulary
  object detection), run via Hugging Face `transformers`.
- **Prompts used** (mapped to class names):
  - `"flame"``Fire`
  - `"smoke from fire"``Fire-smoke`
  - `"fog"``Fog`
  - `"industrial smoke"``Factory-smoke`
- **Thresholds**: box confidence >= 0.30, text matching threshold >= 0.25.
- **Important**: these are automatically generated (teacher-model) annotations,
  **not human-verified**. Expect some false positives/negatives, especially on
  visually ambiguous frames (heavy haze, distant smoke, low light). Manual
  review or a secondary verification pass is recommended before using this
  data for anything beyond bootstrapping a first model.

## Schema

| Column     | Type          | Description                                                        |
|------------|---------------|----------------------------------------------------------------------|
| `image`    | `Image`       | Original, unannotated frame                                        |
| `detections` | `list[dict]` | One entry per detected box: `{"class": str, "bbox_xyxy": [x1,y1,x2,y2], "confidence": float}` |
| `yolo_labels` | `string`   | Same boxes pre-converted to YOLO format (`class_id x_center y_center width height`, normalized 0-1), one line per box, ready to write directly to `.txt` label files |
| `image_annotated` | `Image` (optional, some chunks) | Visual copy of `image` with boxes/labels drawn, for quick QA |

Class-to-ID mapping for `yolo_labels` is stored in `classes.json` at the repo root:
`{"0": "Fire", "1": "Fire-smoke", "2": "Fog", "3": "Factory-smoke"}` (order-dependent list).

## Usage

```python
from datasets import load_dataset

ds = load_dataset("touati-kamel/forest-fire-annotations")
example = ds["train"][0]
print(example["detections"])
print(example["yolo_labels"])
```

### Converting to a YOLO training folder

```python
import os

os.makedirs("yolo_dataset/images/train", exist_ok=True)
os.makedirs("yolo_dataset/labels/train", exist_ok=True)

for i, example in enumerate(ds["train"]):
    example["image"].save(f"yolo_dataset/images/train/{i:07d}.jpg")
    with open(f"yolo_dataset/labels/train/{i:07d}.txt", "w") as f:
        f.write(example["yolo_labels"])
```

## Roadmap

- Add genuinely separate `validation` and `test` splits from new, distinct
  video sources (not derived from frames already in `train`).
- Optional human-in-the-loop verification pass on a sample of auto-labeled
  boxes to estimate label quality/precision.

## Source data

Original unannotated frames: [touati-kamel/forest-fire-dataset](https://huggingface.co/datasets/touati-kamel/forest-fire-dataset)

## Maintainer

Kamel Touati ([HuggingFace: touati-kamel](https://huggingface.co/touati-kamel),
[GitHub: KamelTouati](https://github.com/KamelTouati))