There is a newer version of the record available.

Published September 4, 2025 | Version 1.0
Dataset Open

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

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

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

Files (3.1 GB)

Name Size Download all
md5:31ce5fed31288ef2ee4b981e0ce37831
3.1 GB Preview Download
md5:3b5e8d20af571fca1f4945dd6b540c19
3.7 kB Download
md5:b57bc28f5ecf36554b3dd482ff70d22d
2.3 kB Preview Download
md5:a61250fb39c7817f935e59a45a7dd368
15.2 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.