Hyperspectral imaging, descriptive sensory, electronic tongue, and physicochemical dataset of 198 pork belly samples, with analysis code
Description
Supporting data and analysis code for the study "Hyperspectral Prediction of Pork Belly Taste-Profile Groups Through Stage-Wise Machine-Learning Optimization and Physicochemical Interpretation". 198 pork belly samples were collected weekly over four weeks (batches 1-4), starting 31 March 2025, at a commercial slaughterhouse in Anseong, Republic of Korea. One farm was sampled per week (50 + 50 + 50 + 48 samples). All pigs were Landrace x Yorkshire x Duroc crossbreds (83 gilts, 115 barrows). The deposit has two folders. data/ provides, for every sample: mean hyperspectral reflectance spectra for three regions of interest (whole meat, muscle, fat) over 406-1002 nm at a 4 nm interval; descriptive sensory scores from a trained panel, together with the individual panellist ratings; electronic tongue sensor responses; physicochemical quality traits (pH, water content, water-holding capacity, CIE L*a*b*); carcass traits; the K-means-derived taste-profile group label (high- or low-intensity taste profile); and the fixed train/hold-out splits and cross-validation folds used in the paper. It also includes 19,800 manually annotated muscle/fat pixel coordinates, binary whole-meat region-of-interest masks for all 198 samples, and the trained region-of-interest segmentation models. code/ provides the eleven analysis notebooks as they were run, with a script that repoints their paths at data/. Farm names are replaced by codes A-D, processing dates by week numbers, and carcass identification numbers are removed. Sensory panellists are identified only by codes P01-P18, in accordance with the protocol approved by the Institutional Review Board of Seoul National University (IRB No. 2504/001-010). README.md at the root explains the layout; data/06_docs/README.md documents every file, the band-to-wavelength mapping, the units of the spectral values and the split definitions; data/06_docs/data_dictionary.csv defines every column; MANIFEST.csv lists SHA-256 checksums for all files. The data in data/ is released under CC BY 4.0. The code in code/ is released under the MIT licence, as stated in code/LICENSE.txt. Raw hyperspectral image cubes (approximately 231 GB) are not deposited here; they are available from the corresponding authors upon reasonable request and with the permission of Sunjin Co., Ltd.
Files
Steps to reproduce
Environment. Python 3.10 with the versions pinned in code/requirements.txt (numpy 1.26.4, scipy 1.11.4, pandas 2.1.4, scikit-learn 1.3.2, joblib 1.5.3, matplotlib 3.8.4). The scikit-learn version matters for the modelling notebooks. The three region-of-interest pipelines in data/05_models were pickled under scikit-learn 1.6.1 and load under 1.3.2 with a version warning. 1. Download the deposit so that data/ and code/ sit side by side. 2. In code/, run: python set_data_root.py --dataset "..\data" --results ".\results". The notebooks are the working notebooks used for the study and carry absolute Windows paths of the original working tree; this script rewrites those paths, and the few column names that were changed for this deposit, so the notebooks read data/. It writes a .bak of each notebook it edits, and --restore undoes it. See code/README.md for what it covers. 3. Run the notebooks in the order given in code/README.md. Notebooks 05 (three-stage optimization), 06 (nested cross-validation of physicochemical trait combinations), 07 (regression), 10 and 11 run against this deposit. Notebooks 01 and 02 require the raw hyperspectral image cubes, which are not deposited; their outputs are included here instead. Notebooks 03, 04, 08 and 09 were run on intermediate files and are included as a record of what was done rather than as runnable scripts. Loading the region-of-interest models. data/05_models/rf_pipeline.joblib begins with a FunctionTransformer wrapping a module-level function, flatten_fn, which pickle stores by reference only, so joblib.load fails on a fresh interpreter. Import code/roi_helpers.py first, which defines and registers it. Verified from these files. The taste-profile labels in data/03_labels_and_splits/taste_profile_labels.csv, the fixed 138/60 train/hold-out split and the five cross-validation folds, the per-sample sensory means in data/02_reference_data/sensory_descriptive_mean.csv recomputed from the individual panellist ratings, the colour means recomputed from the replicates, and the reported model metrics all reproduce from the deposited files. data/06_docs/README.md documents each of these and gives the exact settings.
Institutions
- Seoul National UniversitySeoul, Seoul