HyperNut / README.md
afshin-dini's picture
Modify readme
c82f9cd
---
language:
- en
license: cc-by-4.0
pretty_name: HyperNut
size_categories:
- n<1K
task_categories:
- image-segmentation
- image-classification
tags:
- hyperspectral-imaging
- anomaly-detection
- anomaly-segmentation
- defect-detection
- food-quality
- nuts
- vis-nir
- computer-vision
---
# HyperNut: Hyper Spectral Dataset of Nuts for Unsupervised Defect Detection and Segmentation
This is the hyperspectral dataset for anomaly detection and segmentation purposes in nuts, specfically almonds and pistachios.
## Dataset Summary
**HyperNut** is a hyperspectral dataset for **unsupervised defect detection and segmentation** in nuts. It contains visible and near-infrared (VIS-NIR) hyperspectral images of **almonds** and **pistachios**, captured in the **400–1000 nm** wavelength range.
The dataset is designed for anomaly detection settings where only **normal samples** are available for training, while both **normal and defective samples** are provided for testing. In addition to image-level defect analysis, HyperNut also includes **pixel-level defect masks** for segmentation.
HyperNut is intended to support research on:
- hyperspectral anomaly detection
- defect segmentation
- food quality inspection
- VIS-NIR image analysis
- unsupervised and semi-supervised industrial inspection
## Supported Tasks and Leaderboards
This dataset can be used for:
- **Unsupervised / semi-supervised anomaly detection**
- **Defect localization**
- **Defect segmentation**
- **Band selection and spectral analysis**
- **Comparison between hyperspectral and RGB-based methods**
## Dataset Structure
HyperNut contains two sub-datasets:
- **Almond**
- **Pistachio**
For each category, the dataset is split into:
- **Training set**: only normal samples
- **Test set**: both normal and abnormal samples
Abnormal test samples include different defect types and are accompanied by segmentation masks indicating the defect regions.
### Dataset Statistics
| Category | Train Normal | Test Normal | Test Abnormal | Defect Groups | Abnormality Types |
|------------|--------------|-------------|---------------|---------------|-------------------|
| Almond | 100 | 26 | 35 | 6 | scratch, broken, rotten, insect, external material, mix |
| Pistachio | 118 | 36 | 35 | 6 | branch, shell, stone, insect, external material, mix |
## Data Instances
Each hyperspectral sample is captured with:
- **Spatial resolution**: `1024 x 1024`
- **Spectral range**: `400–1000 nm`
- **Number of spectral bands**: `600`
- **Spectral resolution**: approximately `1 nm`
The hyperspectral data are stored in:
- an **HDR** file containing metadata such as wavelength information
- a **DAT** file containing the hyperspectral cube in **12-bit** resolution
For defective test samples, an additional **segmentation mask** is provided.
A sample may include:
- one or multiple nuts
- background noise
- varying environmental conditions
- non-aligned object layouts
## Curation Rationale
HyperNut was created to address the lack of publicly available hyperspectral datasets for **anomaly detection and segmentation** in realistic inspection settings.
Most existing anomaly detection benchmarks rely on RGB images, which may fail to reveal subtle defects when the anomaly has:
- similar color or texture to the normal object
- material-related differences not visible in RGB
- small spectral changes outside the visible range
Hyperspectral imaging offers a richer representation by capturing hundreds of contiguous bands, making it suitable for detecting both **surface-level** and **material-related** abnormalities.
## Data Collection Process
Images were collected under real imaging conditions using:
- a **SENOP HSC-2** hyperspectral camera
- **halogen lamps** positioned at approximately **45 degrees**
- VIS-NIR spectral coverage from **400 nm to 1000 nm**
The setup was designed to capture realistic variation, including:
- environmental noise
- background reflections
- multiple objects per scene
- variability in object arrangement and lighting conditions
This makes the dataset more representative of real-world industrial inspection scenarios than highly controlled single-object acquisitions.
## Personal and Sensitive Information
The dataset does not contain personal or sensitive information.
## Preprocessing
To use the hyperspectral data effectively, the following preprocessing steps are recommended:
1. **Normalization** using white and dark reference values
2. **Region of Interest (RoI) extraction** to isolate the sample from background
3. **Noise filtering** using the **Savitzky–Golay filter**
4. **Mean centering** to reduce offset caused by lighting and environmental variation
In our experiments, **Otsu thresholding** on the **600 nm** band provided effective RoI extraction.
## Uses
### Direct Use
HyperNut can be used directly for:
- training unsupervised or semi-supervised anomaly detection models
- defect localization and segmentation
- spectral band analysis
- comparing RGB and hyperspectral approaches
### Out-of-Scope Use
This dataset is not intended for:
- supervised defect classification with large balanced class labels
- medical, biometric, or human-centered applications
- applications requiring short-wave infrared (SWIR) data beyond 1000 nm
## Citation
```bibtex
@conference{visapp26,
author={Afshin Dini and Farnaz Delirie and Esa Rahtu},
title={HyperNut: Hyper Spectral Dataset of Nuts for Unsupervised Defect Detection and Segmentation},
booktitle={Proceedings of the 21st International Conference on Computer Vision Theory and Applications - Volume 2: VISAPP},
year={2026},
pages={177-184},
publisher={SciTePress},
organization={INSTICC},
doi={10.5220/0014063900004084},
isbn={978-989-758-804-4},
issn={2184-4321},
}
```
## License
This model is licensed under the Attribution–NonCommercial 4.0 International License (CC BY-NC 4.0).