dataset for "Deep learning identifies optimal single spectral bands for non-destructive fresh weight estimation in cabbage "

Published: 6 November 2025| Version 1 | DOI: 10.17632/747n6gpz9j.1
Contributors:
Hyoung-sub Shin,
,

Description

This dataset provides the complete code, data structure, and environment requirements necessary to reproduce the findings of the manuscript: "Deep learning identifies optimal single spectral bands for non-destructive fresh weight estimation in cabbage" (submitted to Computers and Electronics in Agriculture). The repository is organized to support two distinct deep learning workflows, both of which are iterated over 150 separate spectral bands (band_1 to band_150): CNN Regression: A 1D Convolutional Neural Network (CNN) to perform the main regression task (fresh weight estimation) using HDF5 (.h5) data. Attention U-Net Segmentation: An Attention U-Net model to perform semantic segmentation on image-mask pairs, likely for plant area identification or related preprocessing. All scripts were developed and tested using Python 3.10. Data and Directory Structure The project requires a BASIS_FOLDER (root directory) containing the Python scripts and a series of band_X subfolders. The data for both workflows is co-located within these band-specific folders. 1. CNN Workflow (Fresh Weight Estimation) This workflow uses the CNN_MODEL_TRAIN_TEST_EVALUATION.py script. BASIS_FOLDER/ band_X/ INPUT_H5/: Contains NOR_Train.h5 (H5 file with training patches and labels). TEST_H5/: Contains NOR_Test.h5 (H5 file with test patches and labels). MODEL_SAVE/: [Output] Directory where the trained CNN models, weights, and history logs (.csv) are saved. RESULTS/: [Output] Directory where the final predictions (Predict_CNN_model.csv) are saved. CNN_MODEL_TRAIN_TEST_EVALUATION.py: The main script to run this workflow. 2. Attention U-Net Workflow (Segmentation) This workflow uses the three ATT_UNET scripts in sequence. BASIS_FOLDER/ band_X/ input_frames/: [Input] Folder containing training images (e.g., .png, .tif). input_masks/: [Input] Folder containing corresponding ground-truth masks. SAVE/: [Output] Directory where the trained U-Net models, weights, and history logs (.csv) are saved. 01_ATT_UNET_MODEL.py: Script to train the U-Net model. 02_ATT_UNET_POSTPROCESSING.py: Script for post-processing and prediction. 03_ATT_UNET_EVALUATION.py: Script to evaluate the segmentation results. Code and Reproducibility The root folder contains the following Python scripts: CNN_MODEL_TRAIN_TEST_EVALUATION.py: The primary script for the paper. It iterates through all bands, loads the H5 data, trains the CNN regression model, and saves all models and prediction results. 01_ATT_UNET_MODEL.py: Part 1 of the segmentation workflow. Iterates through all bands, loads image/mask pairs, and trains the Attention U-Net model. 02_ATT_UNET_POSTPROCESSING.py: Part 2 of the segmentation workflow. Loads trained models to perform prediction and post-processing tasks. 03_ATT_UNET_EVALUATION.py: Part 3 of the segmentation workflow. Evaluates the segmentation model's performance (e.g., IoU, Dice).

Files

Institutions

Chungbuk National University

Categories

Hyperspectral Imaging, Crop Yield, Convolutional Neural Network, U-Net

Licence