# IFF Fastener Dataset (IFF-FD)

The paper benchmark comprises 850 scenes of discarded computer hardware from
19 devices, with 4,250 RGB exposures and 2,405 annotated fastener
instances. Each image is 4,112 × 3,008 pixels. The paper's split contains 587
training scenes (1,661 instances) and 263 test scenes (744 instances).

## Files

Extract the metadata ZIP and the image ZIPs for the split you need into the same
directory. The image ZIPs are independent and contain about 78.5 GB in total.
Compare the values in `MD5SUMS.txt` with the MD5 checksums reported by
Fordatis. To verify a complete download locally, run `md5sum -c MD5SUMS.txt`
from the download directory. `SHA256SUMS.txt` provides SHA-256 checksums.

| Download | Contents after extraction |
|---|---|
| `IFF-FD_metadata.zip` | `annotations/instances_train.json`, `annotations/instances_test.json`, the `acquisition/` directory, and `export_exposure.py` |
| `IFF-FD_train_*.zip` (12 files) | Training captures in `images/` |
| `IFF-FD_test_*.zip` (6 files) | Test captures in `images/` |

Each scene has a six-digit ID shared by its TIFF and camera-settings XML.
`acquisition/scenes.csv` joins scene and device IDs to the split, paths,
image ZIP and zero-based reference page index. Device IDs group scenes captured
from the same computer. The split is the paper's original scene-level split.

## Exposures and camera settings

Each TIFF contains five original RGB pages. The zero-based page indices
0–4 correspond to 10, 20, 40, 80 and 160 ms, respectively. The 40 ms page
(index 2) is the benchmark's mid-exposure reference. A standard image reader
may open the first page by default.

`acquisition/frames.csv` indexes each page's exposure in microseconds, camera
timestamp as stored in the TIFF, and camera pixel-format code. Every TIFF
retains its embedded per-page metadata. The XML in
`acquisition/camera_settings/` contains the original camera configuration for
that scene. Use the per-page metadata for exposure times.

## COCO annotations

The [COCO instance JSON](https://cocodataset.org/#format-data) files contain the
paper benchmark's original bounding boxes, polygon masks, class assignments and
split membership. File paths are relative to the extraction directory. Boxes
use pixel coordinates in `[x, y, width, height]` form. Each scene is annotated
once and its exposures share the same image geometry.

| Category ID | Fastener | Instances |
|---:|---|---:|
| 1 | PH2 | 1,321 |
| 2 | PZ2 | 233 |
| 3 | T7 | 6 |
| 4 | PH2-R | 103 |
| 5 | T7-S | 81 |
| 6 | PH2-S | 32 |
| 7 | T20 | 65 |
| 8 | T20-R | 115 |
| 9 | PH1 | 48 |
| 10 | R | 401 |

To use a loader that expects single-frame images, install Pillow and run the
following command from the metadata directory. It creates a new directory with
lossless 40 ms PNGs and a COCO JSON with matching paths.

```bash
python3 export_exposure.py train train_40ms
```

Use `test` for the test split and `--exposure-ms` to select a different exposure.
If the image ZIPs are still packed, pass their directory with
`--archives /path/to/downloads`.

## Related paper

Tim König, Deepu Krishnareddy and José Saenz, *Real-time fastener detection for
automated disassembly of e-waste*, section 2.3.
