HyperPistachio: A Hyperspectral Image Dataset of Aflatoxin B1 Contaminated Pistachio Nuts
Description
HyperPistachio: A Dataset for Aflatoxin Detection from Hyperspectral Images
This dataset contains hyperspectral images of raw pistachio samples contaminated with various levels of Aflatoxin in laboratory conditions. This collection aims to provide baseline data for the research and development of machine learning and image processing algorithms for non-destructive detection and quantification of Aflatoxin contamination in pistachios.
The dataset consists of three images for each of the twenty-two levels of aflatoxin contamination, each containing 4,000 images.
The data is organized into 22 sub-folders.
For each image sample, three files are provided:
1. A binary data file in .bil (Band Interleaved by Line) format contains the hyperspectral data cube.
A header file in .hdr format, containing metadata and technical information about the image.
A preview image file in .png format for quick visual inspection of the sample.
Technical Specifications:
Number of Spectral Bands: 462
Wavelength Range: 386.88 nm to 1003.60 nm
2. Contamination Data and Levels (Ground Truth)
The table below details the precise Aflatoxin contamination level for each sample. These values serve as the ground truth for training and evaluating models. The concentration unit is µg/kg (micrograms per kilogram), which is equivalent to ppb (parts per billion).
Sample Name Aflatoxin Concentration (µg/kg)
Level 00 0.00
Level 01 0.40
Level 02 0.67
Level 03 0.88
Level 04 1.13
Level 05 1.66
Level 06 2.48
Level 07 2.15
Level 08 2.30
Level 09 3.05
Level 10 2.82
Level 11 3.01
Level 12 3.85
Level 13 4.43
Level 14 5.30
Level 15 5.12
Level 16 8.93
Level 17 6.37
Level 18 26.14
Level 19 33.17
Level 19 33.17
Level 20 TBA
Level 21 TBA
Export to Sheets
3. Sample Code for Reading and Visualization
A sample script is provided to help you get started with the data. This code offers the following functionalities:
Reading .bil and .hdr files.
Displaying the image in pseudo-RGB and grayscale.
Plotting the spectral profile for a selected pixel.
How to Use:
Please run the Visualise.m file using MATLAB version R2018b or later. Before running the script, ensure you have installed the required Toolboxes, such as Image Processing Toolbox and Mapping Toolbox.
Files
Dataset.zip
Additional details
Identifiers
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-04An 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.