File size: 6,130 Bytes
84608ae
b8975f2
 
 
 
 
 
43ec852
 
 
b8975f2
 
 
 
 
 
 
 
 
84608ae
b8975f2
 
c82f9cd
b8975f2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
---

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).