Published May 5, 2026 | Version v3

HyperPistachio: A Hyperspectral Image Dataset of Aflatoxin B1 Contaminated Pistachio Nuts

  • 1. ROR icon Leeds Beckett University
  • 2. Fathers Farm Foods

Description

 

HyperPistachio: A Hyperspectral Dataset for Aflatoxin Detection in Pistachios

This dataset contains a curated subset of hyperspectral image cubes of raw pistachio samples contaminated with controlled levels of aflatoxin under laboratory conditions. The purpose of this release is to provide researchers with high-quality, reflectance-calibrated hyperspectral data for developing and evaluating machine learning and image processing models for non-destructive aflatoxin detection.

This version is a subset of the full HyperPistachio dataset. From each contamination level, only two representative samples are included. The full version of the dataset contains 4000 images for each of the 26 levels.

 

Dataset Structure

  • Total contamination levels: 26 (including one healthy control)
  • Samples per level in this subset: 2 hyperspectral images
  • Samples per level in full version: 4000 hyperspectral images
  • Files per sample: 3

L##_####.bil – hyperspectral reflectance data cube
L##_####.hdr – ENVI header file with acquisition metadata
L##_####.png – pseudo‑RGB preview image

 

Folder structure:

/Level_01/
/Level_02/
...
/Level_26/

 

Technical Specifications

Sensor: Resonon Pika XC2‑501 (Benchtop imaging system)
Spatial resolution: 256 lines × 384 samples
Spectral bands: 462
Wavelength range: 386.88 nm to 1003.60 nm
Interleave: BIL (Band Interleaved by Line)
Data type: uint16 (ENVI type 12)
Reflectance scale factor: 10000 (indicates white and dark reference calibration)

 

Average file sizes:

.bil: 86.6 MB
.hdr: 3.99 KB
.png: 85.6 KB

 

Contamination Levels (Ground Truth)

Below is the complete contamination table representing the laboratory‑measured aflatoxin concentration (µg/kg) for all 26 levels.  

Level Aflatoxin Concentration (µg/kg)
01 0.00 (healthy control)
02 0.40
03 0.67
04 0.88
05 1.13
06 1.66
07 2.15
08 2.3
09 2.48
10 2.82
11 3.01
12 3.05
13 3.85
14 4.43
15 5.12
16 5.30
17 6.37
18 8.93
19 12.16
20 17.12
21 24.03
22 26.14
23 33.17
24 56.06
25 57.29
26 114.67

 

Naming Convention

L##_####.bil corresponds to:

  • ## = contamination level (01–26)
  • #### = sample index (0001–0002 for this subset)

Example: L14_0002.bil is the second sample from Level 14 (4.43 µg/kg aflatoxin).

 

Calibration

All images are reflectance-calibrated using white and dark reference frames acquired under the same conditions. This ensures band-to-band comparability and suitability for quantitative spectral analysis. Raw pixel values should be divided by the reflectance scale factor (10000) to obtain physical reflectance in the range [0, 1].

 

Sample MATLAB Code

A set of ready-to-use MATLAB scripts is provided in the /code/ folder to help you load and explore the data. See README_codes.md for full instructions.

Script Description
rgb_viewer.m Load and display an RGB composite
band_tour.m Animated grayscale tour through all 462 bands
explorer.m 6-panel overview: RGB, NDVI, spectra, and more

 

License

This dataset was produced under KTP Project No. 13808, funded by UK Research and Innovation (UKRI) and developed at Leeds Beckett University.
This subset is made available strictly for academic education and research purposes only.

  • Redistribution, commercial use, or incorporation into commercial products is not permitted.
  • If you require access to the full HyperPistachio dataset, please contact the dataset manager: Dr. A. Sheikh-Akbari (A.Sheikh-Akbari@leedsbeckett.ac.uk)

 

Citation

Citation details will be added upon publication. Please check back or contact the dataset manager.

Files

Dataset.zip

Files (2.9 GB)

Name Size
md5:5bc110d969250c7af8afb8964856a59c
4.2 kB Download
md5:e1069857719b28d6a87d363c891f4d36
2.9 GB Preview Download
md5:e8c27ae70c89118945295551ffefbf54
5.2 kB Download
md5:0635dbe70d42cadd47a637881cfd66a9
2.3 kB Preview Download
md5:d52c142b184d097f98e07f5bb4ebab67
2.5 kB Download

Additional details

Related works

Has version
Photo: 10.5281/zenodo.14213013 (DOI)

Funding

UK Research and Innovation
Leeds Beckett University and Fathers Farm Foods Limited KTP23_24R3 10082905

Dates

Created
2025-09-04
An annotated dataset of hyperspectral images of pistachios, identifying and quantifying Aflatoxin B1 contamination to train machine learning models for non-destructive food safety analysis.

Software

Programming language
MATLAB

References

  • Sheikh-Akbari, A., & Mehrabinejad, H. (2025). Hyperspectral Image of Contaminated Pistachios with Aflatoxin B1 (Version 1.0) [Data set]. Zenodo. DOI: 10.5281/zenodo.14213013. Retrieved from September 4, 2025.