Mutton freshness multi-index rapid detection method and system based on hyperspectral imaging

By constructing and decoupling spectral features using hyperspectral imaging technology, the problems of spectral signal stability and crosstalk in the detection of mutton freshness were solved, enabling stable and reliable synchronous detection of multiple indicators and improving the accuracy and reliability of the detection results.

CN121921769APending Publication Date: 2026-04-24BENGBU COLLEGE
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BENGBU COLLEGE
Filing Date
2026-02-09
Publication Date
2026-04-24

AI Technical Summary

Technical Problem

Existing hyperspectral imaging technology suffers from poor spectral signal stability, severe signal crosstalk, and low model prediction accuracy when detecting the freshness of mutton. Furthermore, it lacks an internal logical verification mechanism and cannot determine whether multiple freshness indicators conform to the objective laws of mutton spoilage.

Method used

By employing a method of constructing and decoupling coupled spectral features, hyperspectral image cube data is acquired, reflectance calibration and texture boundary recognition are performed, scattering and baseline shift are corrected, spectral normalization is carried out, spectral features are decoupled to generate index feature vectors, and abnormal outputs are eliminated through physical consistency screening, thereby achieving stable detection of multiple indicators.

Benefits of technology

It improves the purity and signal-to-noise ratio of spectral information, reduces collinearity between models, enhances the specificity and sensitivity of single-index prediction, ensures the accuracy and repeatability of detection results, can identify and eliminate abnormal result combinations, and outputs reasonable and reliable multi-index prediction results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121921769A_ABST
    Figure CN121921769A_ABST
Patent Text Reader

Abstract

The invention discloses a mutton freshness multi-index rapid detection method and system based on hyperspectral imaging, and belongs to the technical field of food quality detection.The mutton freshness multi-index rapid detection method comprises the steps that a hyperspectral image of the surface of mutton is obtained, and reflectivity calibration is conducted; identifying image texture and light intensity distribution, and extracting a regional average spectrum; scattering and baseline deviation of the spectrum are corrected, and spatial normalization is carried out to obtain a spatial consistent spectrum; coupling complementary wave band information to construct coupling spectrum characteristics; feature subspaces corresponding to the freshness indexes are decoupled, and index feature vectors are generated; calculating predicted values of the indexes based on the feature vectors; and finally, verifying and eliminating abnormal results through physical consistency screening, and outputting a stable prediction result. By adopting construction of coupling spectral characteristics, decoupling separation and physical consistency screening of multi-index prediction results, spectral crosstalk can be inhibited, and the reasonability of the results can be verified, so that stable and reliable synchronous rapid detection of a plurality of freshness indexes is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0002] This invention relates to the field of food quality testing technology, and in particular to a rapid detection method and system for multiple indicators of mutton freshness based on hyperspectral imaging. Background Technology

[0004] The freshness of mutton is a core standard for evaluating its quality and safety, typically assessed through a comprehensive evaluation of multiple physicochemical and microbiological indicators, including total volatile basic nitrogen, pH value, total bacterial count, and color. Hyperspectral imaging technology, as an emerging non-destructive testing method, can simultaneously acquire spatial and spectral information of samples, making it possible to achieve rapid, non-destructive, and comprehensive assessment of meat product freshness, demonstrating enormous application potential in the field of food quality control.

[0005] Existing methods for detecting mutton freshness using hyperspectral imaging typically involve first acquiring hyperspectral images of the mutton sample, performing routine preprocessing on the acquired spectral data (such as smoothing, noise reduction, or normalization), and then directly using the preprocessed full-band spectrum or selected characteristic bands to establish independent prediction models such as partial least squares regression or support vector machines for each freshness indicator. This approach constitutes the mainstream application scheme of current non-destructive spectral testing technology.

[0006] However, the aforementioned existing technical solutions have significant shortcomings in practical applications. First, conventional spectral preprocessing methods struggle to completely eliminate complex interferences caused by irregular sample surface morphology, internal tissue inhomogeneity, and scattering effects and baseline drift resulting from changes in the acquisition environment, leading to poor stability of the spectral signals. Second, the spectral absorption characteristics of chemical components related to different freshness indicators, such as proteins, fats, moisture, and various spoilage products, highly overlap in the near-infrared band. Directly modeling each indicator independently would suffer from severe signal crosstalk and variable collinearity, affecting the model's prediction accuracy and robustness. Furthermore, the multiple prediction results obtained by existing methods are independent of each other, lacking an inherent logical verification mechanism, making it impossible to determine whether the output set of indicator values ​​conforms to the objective laws of mutton spoilage. Summary of the Invention

[0008] To address the aforementioned issues, this invention provides a rapid detection method and system for multiple indicators of mutton freshness based on hyperspectral imaging. By constructing and decoupling coupled spectral features and screening the physical consistency of multi-indicator prediction results, it can suppress spectral crosstalk and verify the rationality of the results, thereby achieving stable, reliable, and simultaneous rapid detection of multiple freshness indicators.

[0009] The above objectives can be achieved through the following approach:

[0010] A rapid multi-index detection method for mutton freshness based on hyperspectral imaging includes: acquiring a hyperspectral image cube of the surface of refrigerated mutton for reflectance calibration to generate raw image data; identifying the texture boundaries and light intensity distribution of the raw image data to obtain a regional average spectrum; correcting the scattering and baseline shift of the regional average spectrum to output a scattering-corrected spectrum; normalizing the intensity differences of the scattering-corrected spectrum in the spatial dimension to obtain a spatially consistent spectrum; coupling the complementary band information of the spatially consistent spectrum to obtain coupled spectral features; decoupling the feature subspaces of the corresponding indices in the coupled spectral features to generate index feature vectors; calculating the detection values ​​of each index based on the index feature vectors to obtain multi-index prediction results; screening the physical consistency of the multi-index prediction results and removing abnormal outputs to obtain stable prediction results.

[0011] Optionally, generating the original image data includes: acquiring a hyperspectral image cube of the surface of refrigerated mutton; acquiring a preset white board and dark field reference to obtain a reflectance reference set; calibrating the instrument response and separating the non-uniform components of the light source based on the reflectance reference set to obtain response compensation parameters; calibrating each band of the hyperspectral image cube using the response compensation parameters to obtain a reflectance calibration cube; and outputting the reflectance calibration cube and locking the acquisition timestamp to obtain the original image data.

[0012] Optionally, obtaining the region-averaged spectrum includes: extracting and analyzing the reflectance histogram and local contrast of the original image data to obtain a light intensity distribution map; based on the light intensity distribution map, dividing continuous regions and locating texture change contours to obtain a texture boundary map; fusing the texture boundary map and the light intensity distribution map and excluding non-sample regions to obtain a region of interest mask; and calculating the average reflectance of each pixel within the region of interest mask to obtain the region-averaged spectrum.

[0013] Optionally, the output scattering correction spectrum includes: analyzing the baseline trend of the regional average spectrum and compensating for low-frequency drift to obtain a baseline-compensated spectrum; extracting the multiplicative scattering component of the baseline-compensated spectrum and performing scale normalization to obtain a scattering-normalized spectrum; and smoothing the noise of the scattering-normalized spectrum while preserving characteristic edges to obtain a scattering correction spectrum.

[0014] Optionally, obtaining the spatially consistent spectrum includes: mapping the scattering correction spectrum to the spatial coordinates of the region of interest mask to obtain the regional spectral distribution; constructing spatial consistency constraints based on the pixel-to-pixel deviations of the regional spectral distribution to obtain consistency constraint parameters; and using the consistency constraint parameters to normalize the intensity of the regional spectral distribution to obtain the spatially consistent spectrum.

[0015] Optionally, obtaining the coupled spectral features includes: grouping the relevant bands of the spatially consistent spectrum to obtain band correlation groups; obtaining a complementary fusion spectrum based on the complementary response of the band correlation groups and suppressing redundant components; extracting the spectral components of the complementary fusion spectrum that meet preset conditions and forming a fixed-length description to obtain the coupled spectral features.

[0016] Optionally, generating the indicator feature vector includes: analyzing the correlation strength between the coupled spectral features and the preset indicators and constructing a mapping to obtain an indicator correlation matrix; separating the mutually coupled terms of the indicator correlation matrix and constraining cross-indicator interference to obtain indicator separation parameters; and using the indicator separation parameters to perform a projection transformation on the coupled spectral features to obtain the indicator feature vector.

[0017] Optionally, obtaining the multi-indicator prediction result includes: dividing the indicator feature vector into sub-vectors of the corresponding indicator to obtain an indicator sub-vector set; using the indicator sub-vector set to perform multi-path inference and calculate the detection value of each indicator; and combining the detection values ​​of each indicator to obtain the multi-indicator prediction result.

[0018] Optionally, obtaining a stable prediction result includes: calculating the interpretable relationship between the multi-indicator prediction results and quantifying the consistency to obtain a consistency score; comparing the consistency score with a preset screening criterion, identifying abnormal detection values ​​and marking them to obtain anomaly marks; filtering the detection values ​​corresponding to the anomaly marks and performing a stability assessment to obtain a stable prediction result.

[0019] Based on the same inventive concept, this invention also provides a rapid multi-index detection system for mutton freshness based on hyperspectral imaging. The system includes: a hyperspectral imaging module for acquiring a hyperspectral image cube of the surface of refrigerated mutton for reflectance calibration, generating raw image data; an image processing module for identifying the texture boundaries and light intensity distribution of the raw image data to obtain a regional average spectrum; a spectral correction module for correcting the scattering and baseline shift of the regional average spectrum, outputting a scattering-corrected spectrum; a spectral processing module for normalizing the intensity differences of the scattering-corrected spectrum in the spatial dimension to obtain a spatially consistent spectrum; a feature construction module for coupling complementary band information of the spatially consistent spectrum to obtain coupled spectral features; a feature decoupling module for decoupling the feature subspaces of corresponding indicators in the coupled spectral features to generate indicator feature vectors; an indicator calculation module for calculating the detection values ​​of each indicator based on the indicator feature vectors to obtain multi-index prediction results; and a result output module for filtering the physical consistency of the multi-index prediction results and removing abnormal outputs to obtain stable prediction results.

[0020] Compared with the prior art, the present invention has the following advantages:

[0021] This invention systematically eliminates interference from the environment, instruments, and the physical characteristics of the sample itself by physically calibrating the original image, intelligently identifying the region of interest, and performing depth correction and normalization of the spectral signal. This improves the purity and signal-to-noise ratio of the spectral information, lays a data foundation for subsequent modeling, and ensures the accuracy and repeatability of the detection results.

[0022] This invention can solve the technical problem of overlapping and mutual interference of multiple freshness indicators in spectral information; it condenses the effective information scattered across the entire spectral band into a low-dimensional coupled feature, and then separates it into independent subspaces that are highly corresponding to each indicator through target projection transformation, thereby reducing collinearity between models and enhancing the specificity and sensitivity of prediction for each individual indicator.

[0023] This invention cross-validates the predicted values ​​of multiple indicators simultaneously output at the end of the detection process based on the inherent biochemical laws of mutton spoilage. This method can identify and eliminate abnormal result combinations that are logically inconsistent, thereby avoiding the false predictions that may occur in traditional models. This makes the final stable prediction results not only numerically reliable, but also more reasonable and credible in scientific logic.

[0024] Other features and advantages of the invention will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention may be realized and obtained by means of the structures pointed out in the description, claims and drawings. Attached Figure Description

[0026] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0027] Figure 1 This is a flowchart illustrating a rapid detection method for multiple indicators of mutton freshness based on hyperspectral imaging, according to an embodiment of the present invention.

[0028] Figure 2 This is a schematic diagram of a hyperspectral image cube according to an embodiment of the present invention.

[0029] Figure 3 This is a schematic diagram of reflectivity calibration according to an embodiment of the present invention.

[0030] Figure 4 This is a reflectance histogram according to an embodiment of the present invention.

[0031] Figure 5 This is a schematic diagram of single-band texture image extraction according to an embodiment of the present invention.

[0032] Figure 6 This is a schematic diagram of the region of interest mask according to an embodiment of the present invention.

[0033] Figure 7 This is a schematic diagram of the index correlation matrix according to an embodiment of the present invention.

[0034] Figure 8 This is a schematic diagram of the structure of a rapid detection system for multiple indicators of mutton freshness based on hyperspectral imaging, according to an embodiment of the present invention. Detailed Implementation

[0036] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0037] Reference Figure 1 One embodiment of the present invention proposes a rapid detection method for multiple indicators of mutton freshness based on hyperspectral imaging. By constructing and decoupling coupled spectral features and screening the physical consistency of multi-indicator prediction results, spectral crosstalk can be suppressed and the rationality of the results can be verified, thereby achieving stable and reliable synchronous rapid detection of multiple freshness indicators.

[0038] The method described in this embodiment specifically includes:

[0039] S1. Obtain a hyperspectral image cube of the surface of refrigerated mutton, perform reflectance calibration, and generate raw image data;

[0040] Optionally, generating the original image data includes:

[0041] Obtain a hyperspectral image cube of the surface of refrigerated mutton;

[0042] Collect a preset white board and dark field reference to obtain a reflectivity reference set;

[0043] Based on the reflectivity reference set, the instrument response is calibrated and the non-uniform components of the light source are separated to obtain the response compensation parameters.

[0044] Each band of the hyperspectral image cube is calibrated using the response compensation parameters to obtain a reflectance calibration cube.

[0045] The reflectivity calibration cube is output and the acquisition timestamp is locked to obtain the raw image data.

[0046] Specifically, a standardized image acquisition and calibration process is first performed using a hyperspectral imaging system to convert the raw light intensity signal recorded by the instrument into a physically meaningful sample surface reflectance that is unaffected by light source inhomogeneity and camera dark current. A hyperspectral image cube of the surface of refrigerated mutton is then acquired; this data cube is a three-dimensional data structure, such as... Figure 2 As shown, two dimensions represent spatial coordinates, and the third dimension represents spectral wavelength. Data acquisition is typically carried out in the spectral range of 400 to 1000 nanometers, with the spectral resolution set between 2 and 5 nanometers.

[0047] To achieve reflectivity conversion, a preset white board and dark field reference are first acquired to form a reflectivity reference set. The dark field reference is obtained by completely blocking the camera lens and is used to quantify the inherent noise of the system under no-light conditions, i.e., dark current. The white board reference is obtained by imaging a standard polytetrafluoroethylene (PTFE) white board with high Lambertian characteristics, whose reflectivity is higher than 99% within the target spectral range. This image records the combined characteristics of the light source spectral distribution and the camera sensor's response in each band.

[0048] Based on this reflectivity reference set, the system performs reflectivity calibration, calculates and applies response compensation parameters to eliminate measurement errors caused by the environment and the equipment itself, such as... Figure 3 As shown. This calibration process calculates reflectance calibration cubes by performing band-by-band calculations on each pixel in the hyperspectral image cube using the following formula:

[0049] ,

[0050] in, Representative sample at wavelength The final calculated reflectance at the location is a dimensionless value. This represents the spectral intensity value at wavelength λ of the raw image data collected from the surface of the mutton sample. This represents the average spectral intensity value of the dark field reference obtained by blocking the lens at wavelength λ, which represents the system's noise floor. This represents the average spectral intensity value of the whiteboard reference sampled from a standard whiteboard at wavelength λ, which serves as the benchmark for maximum light intensity in this wavelength band. Because... , and All values ​​are the raw photon counts recorded by the instrument or in digital quantization units. The calculation result of this formula... The data is processed and stored to form a reflectance calibration cube. Finally, the system outputs this reflectance calibration cube, appending an acquisition timestamp. This data packet together constitutes the raw image data used for subsequent analysis. This timestamp is crucial information for tracking sample storage time.

[0051] S2. Identify the texture boundaries and light intensity distribution of the original image data to obtain the regional average spectrum;

[0052] Optionally, obtaining the regional average spectrum includes:

[0053] The reflectance histogram and local contrast of the original image data are extracted and analyzed to obtain the light intensity distribution map.

[0054] Based on the light intensity distribution map, continuous regions are divided and texture change contours are located to obtain a texture boundary map;

[0055] By fusing the texture boundary map and the light intensity distribution map and excluding non-sample areas, a mask for the region of interest is obtained.

[0056] The average reflectance of each pixel within the mask of the region of interest is calculated to obtain the average spectrum of the region.

[0057] Specifically, in order to extract the average spectrum representing the chemical information of mutton samples from the raw image data containing background and noise, this method performs a region of interest identification and spectral extraction process based on image analysis, locates and segments the effective mutton tissue region, and excludes interfering regions such as background, high light reflection and shadow, thereby calculating a stable and representative regional average spectrum.

[0058] By analyzing the reflectance histogram and local contrast in the original image data, a light intensity distribution map is generated. One or more characteristic band images with high signal-to-noise ratios in the near-infrared band (700-900 nm) are selected for analysis. The reflectance histogram of this image is calculated, such as... Figure 4 As shown, by setting thresholds, such as pixels with reflectivity below 2% or above 8%, regions that may be background, shadows, or specular reflections are initially identified. Simultaneously, the system uses a sliding window of 5x5 or 7x7 pixels to calculate the local contrast of each pixel, i.e., the standard deviation of pixel intensity within the window, to quantify the image's texture information. Combining the results of histogram thresholding and local contrast analysis, a light intensity distribution map is generated, marking highlights, dark areas, and smooth texture regions.

[0059] Next, based on the light intensity distribution map, the system performs region division and texture contour localization to generate a texture boundary map, outlining the physical contour of the mutton sample, such as... Figure 5As shown, the system applies edge detection algorithms, such as the Canny operator, to the non-background areas marked on the light intensity distribution map. The high and low thresholds are dynamically set based on the global contrast of the image. This algorithm effectively identifies locations of abrupt changes in reflectance between muscle and fat, and between the sample and the background, marking these locations as texture change contours, ultimately forming a binarized texture boundary map.

[0060] The system fuses texture boundary maps and light intensity distribution maps, and excludes non-sample regions to generate a region of interest mask. A schematic diagram of the region of interest mask is shown below. Figure 6 The process begins by using the largest connected closed contour in the texture boundary map as the initial contour of the sample. From this initial contour region, pixel regions previously marked as specular highlights and deep shadows in the intensity distribution map are subtracted. This fusion and exclusion operation ensures that the final region of interest mask only covers the effectively lit tissue portion that reflects the internal quality of the mutton. This mask is a binary image with the same spatial dimensions as the original image, where effective region pixel values ​​are 1 and invalid region pixel values ​​are 0.

[0061] Finally, the system uses this mask to calculate the average reflectance of all pixels within the region, obtaining the region-averaged spectrum. This process is accomplished by independently performing a spatial averaging operation on each band of the hyperspectral data cube, as follows:

[0062] ,

[0063] in, Represents wavelength The reflectance value of the average spectrum of the region is calculated at this location. This indicates that all valid pixels within the region of interest mask are at wavelengths... Reflectance value at Perform summation. This represents the total number of valid pixels covered by the region of interest mask. and All values ​​are dimensionless reflectance values. By repeating this calculation for all bands, a one-dimensional vector is finally generated, which represents the regional average spectrum of the optical properties of the entire mutton sample.

[0064] S3. Correct the scattering and baseline shift of the average spectrum of the region and output the scattering correction spectrum;

[0065] Optionally, the output scattering correction spectrum includes:

[0066] The baseline trend of the average spectrum in the region is analyzed and the low-frequency drift is compensated to obtain the baseline-compensated spectrum;

[0067] The multiplicative scattering component of the baseline compensated spectrum is extracted and scaled to obtain the scattering normalized spectrum;

[0068] The noise in the normalized scattering spectrum is smoothed while preserving the characteristic edges to obtain the scattering corrected spectrum.

[0069] Specifically, in order to extract absorption features directly related to the chemical components of mutton from the regional average spectrum, this method performs a spectral correction process designed to eliminate physical interference and random noise. The regional average spectrum is preprocessed, and baseline drift and surface scattering effects are corrected, and noise is smoothed, thereby outputting a scattering-corrected spectrum that can stably reflect the intrinsic chemical information of the sample.

[0070] First, the baseline trend of the regional average spectrum is analyzed and its low-frequency drift is compensated to generate a baseline-compensated spectrum. Low-frequency drift caused by temperature changes or instrument aging can cause a slow, non-linear rise or fall in the entire spectrum. The system uses an asymmetric least squares method to model this baseline trend by setting a smoothness parameter such as... to A baseline is iteratively fitted using an asymmetry factor, such as 0.001 to 0.01, to pass only through the spectral valleys. This fitted baseline is then subtracted from the original regional average spectrum to obtain the baseline-compensated spectrum, effectively removing background signals unrelated to chemical absorption.

[0071] The system extracts the multiplicative scattering component from the baseline-compensated spectrum and performs scale normalization to obtain the scattering-normalized spectrum. The multiplicative scattering effect originates from the irregular physical structure of the sample surface, such as the roughness of muscle fibers and the size of fat particles, leading to changes in optical path length and causing overall spectral shift and scaling. To correct for this effect, the system applies a standard normal variable transformation algorithm. This algorithm processes all band data of a single baseline-compensated spectrum, and the calculation method is as follows:

[0072] ,

[0073] in, Represents wavelength The intensity value of the normalized scattering spectrum calculated at that location. It is the baseline compensation spectrum at wavelength The intensity value at that location. It is the average intensity value of the baseline compensation spectrum across all bands. This is the standard deviation of the intensity of the baseline-compensated spectrum across all bands. Because... , and All originate from the same spectrum, have consistent dimensions, and ultimately yield the following results. These are dimensionless normalized intensity values. This operation transforms each spectrum to a scale with a mean of 0 and a standard deviation of 1, eliminating spectral differences caused by physical scattering.

[0074] Finally, the system performs noise smoothing on the normalized scattering spectrum while preserving the characteristic edges of the spectrum, ultimately outputting a scattering-corrected spectrum. This process filters out high-frequency random noise and avoids disrupting the shape of key absorption peaks. A Savitzky-Gore smoothing filter can be used, employing a sliding window (e.g., 7 to 15 data points) and a polynomial order (e.g., 2 or 3) to perform local polynomial fitting on the spectrum. Compared to simple moving averages, this method better preserves the height and width information of absorption peaks while reducing noise, resulting in a scattering-corrected spectrum with a higher signal-to-noise ratio and clearer features for subsequent feature construction and analysis.

[0075] S4. Normalize the intensity differences of the scattering correction spectrum in the spatial dimension to obtain a spatially consistent spectrum;

[0076] Optionally, obtaining the spatially consistent spectrum includes:

[0077] The scattering correction spectrum is mapped to the spatial coordinates of the region of interest mask to obtain the regional spectral distribution;

[0078] Spatial consistency constraints are constructed based on the pixel-to-pixel deviations in the spectral distribution of the region, and consistency constraint parameters are obtained.

[0079] The intensity of the spectral distribution in the region is normalized using the consistency constraint parameters to obtain a spatially consistent spectrum.

[0080] Specifically, the spectra of each pixel after scattering correction are remapped to their spatial coordinates in the mask of the region of interest, forming a regional spectral distribution. This involves re-associating the spectral vector (one-dimensional) of each pixel belonging to the region of interest in the hyperspectral data cube processed in the previous step with its two-dimensional spatial position (x, y), thereby obtaining a spectral dataset containing spatial information, i.e., the regional spectral distribution.

[0081] The system constructs spatial consistency constraints and calculates consistency constraint parameters based on the spectral intensity deviations between pixels in the spectral distribution of the region. Although the global scattering effect has been corrected, small, multiplicative intensity differences may still exist between pixels. To quantify this difference, the system calculates the scattering-corrected spectrum for each pixel i within the region of interest. The L2 norm, which represents the overall energy or intensity of the pixel's spectral vector, is used as a consistency constraint parameter for the pixel.

[0082] The system uses calculated consistency constraint parameters to normalize the intensity of the spectrum of each pixel in the regional spectral distribution, and finally averages them to obtain a spatially consistent spectrum. This normalization operation processes the spectral vector of each pixel using the following formula:

[0083] ,

[0084] in, Represents pixel i at wavelength The spectral value after intensity normalization. It is the value of the original scattering correction spectrum of the pixel at wavelength λ. It is the spectral vector of pixel i The L2 norm is calculated by taking the square root of the sum of the squares of the intensity values ​​of all bands within the spectral vector. After normalizing the spectra of all pixels within the region of interest, the system applies the normalized spectra to all pixels. Averaging is performed band by band, ultimately outputting a single, highly stable and representative one-dimensional spectral vector, namely the spatially consistent spectrum.

[0085] S5. Couple the complementary band information of the spatially consistent spectrum to obtain the coupled spectral features;

[0086] Optionally, obtaining the coupled spectral features includes:

[0087] The correlated bands of the spatially consistent spectrum are grouped to obtain band correlation groups;

[0088] Based on the complementary response of the band correlation group and by suppressing redundant components, a complementary fusion spectrum is obtained;

[0089] Extract the spectral components of the complementary fusion spectrum that meet the preset conditions and form a fixed-length description to obtain the coupled spectral features.

[0090] Specifically, the system first groups the relevant bands in the spatially consistent spectrum to generate band correlation groups. Based on a pre-established training spectral dataset, the system calculates the Pearson correlation coefficient matrix between all bands. By setting a high correlation threshold, such as an absolute coefficient value greater than 0.95, the system clusters all bands that meet this condition into different groups. Each band correlation group represents a highly collinear region in the spectrum caused by specific chemical bond vibrations or physical properties, such as the water absorption peak region near 970 nm or the myoglobin-related region near 550 nm.

[0091] Based on the complementary responses of these band-correlated groups and by suppressing redundant components, the system constructs a complementary fusion spectrum. A single representative variable is extracted for each highly correlated band group, and these variables are combined. For each band-correlated group, principal component analysis is applied, extracting only the score vector of its first principal component. This score vector can be seen as the optimal linear combination of all band information within the group, effectively capturing the main spectral variations in that region while filtering out noise and secondary information. Subsequently, the system serially concatenates the first principal component score vectors extracted from all different band-correlated groups to form a new, reduced-dimensional spectral curve, i.e., the complementary fusion spectrum. Each data point in this spectrum represents the comprehensive information of a specific region of the original spectrum.

[0092] The system extracts spectral components that meet preset conditions from the complementary fusion spectrum and organizes them into a fixed-length description, thereby generating coupled spectral features. This step aims to further screen and solidify the features. The system applies variable importance projection analysis or a similar selection algorithm to the complementary fusion spectrum, scoring each variable on the spectrum based on its comprehensive predictive ability for all target freshness indicators. The system selects the top N variables in terms of score, where N is a preset feature dimension, typically set between 15 and 30. The intensity values ​​of these N selected variables are arranged into a fixed-length one-dimensional vector, which is the final coupled spectral feature. It condenses the spectral information most relevant to changes in mutton freshness and provides input for subsequent multi-indicator decoupling and prediction.

[0093] S6. Decouple the feature subspace of the corresponding index in the coupled spectral features to generate the index feature vector;

[0094] Optionally, the generated indicator feature vector includes:

[0095] The correlation strength between the coupled spectral features and the preset indexes is analyzed and a mapping is constructed to obtain the index correlation matrix;

[0096] Separate the mutually coupled terms of the index correlation matrix and constrain cross-index interference to obtain index separation parameters;

[0097] The coupled spectral features are projected and transformed using the index separation parameters to obtain the index feature vector.

[0098] Specifically, in order to separate and extract independent information corresponding to various freshness indicators such as TVB-N, pH, TVC, and L* from a single coupled spectral feature, the coupled feature vector containing information from multiple indicators is transformed into a new feature space. In this space, the feature subspaces representing different indicators are orthogonal or approximately orthogonal to each other, thereby generating a set of indicator feature vectors that clearly correspond to each indicator.

[0099] First, the correlation strength between coupled spectral features and preset indicators is analyzed, and an indicator correlation matrix is ​​constructed. This is done using a large pre-collected calibration sample set, which includes both coupled spectral feature data and the true values ​​of each indicator measured by traditional chemical or physical methods. The system employs a partial least squares regression algorithm, using coupled spectral features as independent variables (X) and the true value matrix of all indicators as dependent variables (Y), to construct a many-to-many prediction model. During this process, the algorithm calculates a weight matrix W, where each column defines a direction for linearly combining the original coupled spectral features into a latent variable, which maximizes covariance with the indicator true values. This weight matrix W is the indicator correlation matrix, which quantifies the comprehensive contribution of each spectral feature variable to all indicators, such as... Figure 7 As shown.

[0100] The system analyzes the correlation matrix of the indicator, separates its coupled terms, and applies constraints to reduce interference between indicators, thereby calculating the indicator separation parameters. The engineering objective of this step is to optimize the correlation matrix so that it can more accurately project coupled spectral features onto the subspace of a specific indicator. The system uses target projection algorithms or orthogonal signal correction methods to decompose and transform the weight matrix W. For example, for a target indicator (such as TVB-N), the system identifies the direction vector in the weight matrix W that is most relevant to TVB-N but has the lowest correlation with other indicators, and uses it as the projection direction of TVB-N. By repeating this process for each indicator, the system obtains a set of nearly orthogonal projection vectors, which together constitute the indicator separation parameter matrix P. Each column of this matrix P corresponds to the feature extraction direction of a specific indicator.

[0101] Finally, the system uses the calculated index separation parameters to perform a projection transformation on the input coupled spectral features to generate the final index feature vector. For a single sample's coupled spectral feature vector... The transformation process can be achieved through the following matrix operations:

[0102] ,

[0103] in, It is the output indicator feature vector. It is the parameter matrix for separating indicators. The transpose of . This is the input coupled spectral feature vector. The matrix multiplication operation transforms the original coupled spectral feature vector... Projecting onto a new feature space defined by P, we obtain Each element of the vector primarily corresponds to a contribution to a specific freshness metric. For example, The first element may primarily reflect changes in TVB-N, the second element primarily reflects changes in pH, and so on, thus achieving decoupling of characteristics and laying the foundation for subsequent independent index calculations.

[0104] S7. Calculate the detection value of each indicator based on the indicator feature vector to obtain the multi-indicator prediction result;

[0105] Optionally, obtaining the multi-indicator prediction results includes:

[0106] The feature vectors of the indicators are divided into sub-vectors of the corresponding indicators to obtain the indicator sub-vector set;

[0107] Multi-path inference is performed using the aforementioned indicator sub-vector set to calculate the detection value of each indicator;

[0108] By combining the detection values ​​of each indicator, a multi-indicator prediction result is obtained.

[0109] Specifically, based on a pre-defined correspondence, the input indicator feature vector is divided into sub-vectors corresponding to different indicators, forming an indicator sub-vector set. During the feature decoupling stage, the generated indicator feature vectors... Each element or combination of elements is designed to be highly correlated with a specific index, such as TVB-N, pH, TVC, L*. Therefore, this step only requires slicing or extracting the vector according to a predetermined indexing rule. For example, if the first k elements of the index feature vector correspond to TVB-N, the next m elements correspond to pH, and so on, the system will slice or extract the vector according to this rule. Decomposed into , Multiple independent index sub-vectors.

[0110] The system utilizes these indicator sub-vector sets to calculate the detection values ​​of each indicator in parallel through multi-path inference. An independent prediction model is maintained for each indicator to be tested; these models are trained using a large amount of calibration sample data during the system development phase. These models can be the final regression part of a multiple linear regression model, a support vector machine regression model, or a partial least squares regression model. The calculation process is represented by the following general functional form:

[0111] ,

[0112] in, A predicted value representing a specific indicator, such as the predicted TVB-N value. It is the sub-vector corresponding to this indicator, for example . This represents the trained prediction model function associated with that metric. The system inputs a subvector of each metric into its corresponding model. The calculations are performed in parallel across multiple processor cores because the subvectors of each metric are independent, enabling fast multi-metric inference.

[0113] The outputs of parallel computations, such as predicted values ​​for TVB-N, pH, the logarithm of TVC, and L*, are integrated into a single data structure, such as a list or object containing key-value pairs. This multi-indicator prediction provides a comprehensive snapshot of the current freshness status of the lamb sample, but it has not yet undergone final validation.

[0114] S8. Screen the physical consistency of the multi-indicator prediction results and remove abnormal outputs to obtain stable prediction results.

[0115] Optionally, obtaining stable prediction results includes:

[0116] Calculate the interpretability relationship among the prediction results of the multi-indicator system and quantify the consistency to obtain a consistency score;

[0117] The consistency score is compared with the preset screening criteria to identify and mark abnormal detection values, thus obtaining an anomaly label.

[0118] The detection values ​​corresponding to the anomaly markers are filtered and stability is evaluated to obtain stable prediction results.

[0119] Specifically, the interpretable relationships between the prediction results of multiple indicators are calculated and their consistency is quantified to obtain a consistency score. This is achieved through a rule engine based on prior knowledge, which incorporates the synergistic changes among various indicators during the spoilage process of mutton under refrigeration. For example, TVB-N and TVC values ​​typically show a strong positive correlation, while pH increases with increasing TVB-N values ​​in the later stages of spoilage. The system inputs the multi-indicator prediction results, such as TVB-N=25mg / 100g, pH=6.5, TVC=10^7CFU / g, L*=35, into the rule engine. The engine then evaluates the joint probability or logical consistency of this data set based on a preset association model, such as a spoilage kinetic function or decision tree. Whenever a set of predicted values ​​deviates from the expected synergistic trend, such as a high TVB-N value accompanied by an extremely low pH value, a penalty term is added to the consistency score. This score is a comprehensive measure reflecting the overall credibility of the current prediction results.

[0120] The calculated consistency score is compared with a preset screening criterion to identify and label abnormal detection values, thus generating an anomaly label. This screening criterion is typically a maximum permissible penalty score, for example, set to 3.0. If the consistency score exceeds this threshold, the system triggers an anomaly identification procedure. This procedure traces back to which specific combinations of indicators violate the core association rule and applies an anomaly label to the detection value that deviates most significantly or contradicts the majority of indicators. For example, if the predicted values ​​of TVB-N and TVC both point to severe spoilage, but the pH value shows a fresh state, the system will determine that the pH value is abnormal and attach an "inconsistent" anomaly label to it.

[0121] Finally, the system filters out the detected values ​​marked as anomalies and performs a stability assessment on the remaining results to generate the final stable prediction result. In this step, the "filtering" operation is not a simple deletion; instead, the outlier is explicitly marked as unreliable or recommended for review in the results, while other indicator values ​​that have passed the consistency test are retained. Subsequently, the system performs a final stability assessment on these retained indicator values, checking whether these values ​​fall within their respective reasonable physicochemical ranges, such as whether the pH value is between 5.4 and 7.0. Only prediction values ​​that pass this series of tests are integrated to form the final stable prediction result. This result includes both reliable indicator data and clearly identifies potential measurement anomalies, thus providing users with a comprehensive and reliable basis for decision-making.

[0122] Based on the same inventive concept, such as Figure 8 As shown, the present invention also provides a rapid detection system for multiple indicators of mutton freshness based on hyperspectral imaging, the system comprising:

[0123] The hyperspectral imaging module is used to acquire hyperspectral image cubes of the surface of refrigerated mutton for reflectance calibration and to generate raw image data.

[0124] The image processing module is used to identify the texture boundaries and light intensity distribution of the original image data to obtain the regional average spectrum;

[0125] The spectral correction module is used to correct the scattering and baseline shift of the average spectrum of the region and output the scattering-corrected spectrum.

[0126] The spectral processing module is used to normalize the intensity differences of the scattering correction spectrum in the spatial dimension to obtain a spatially consistent spectrum.

[0127] A feature construction module is used to couple complementary band information of the spatially consistent spectrum to obtain coupled spectral features;

[0128] The feature decoupling module is used to decouple the feature subspace of the corresponding index in the coupled spectral features and generate the index feature vector;

[0129] The indicator calculation module is used to calculate the detection value of each indicator based on the indicator feature vector to obtain the multi-indicator prediction result.

[0130] The result output module is used to filter the physical consistency of the multi-indicator prediction results and remove abnormal outputs to obtain stable prediction results.

[0131] To verify the feasibility and effectiveness of this invention in practical applications, this embodiment monitors the dynamic changes in freshness of a batch of commercially purchased mutton samples over a 9-day period. The samples were stored in a constant-temperature refrigerator at 4°C, and portions were taken out for testing on days 0, 3, 5, 7, and 9. This embodiment describes the entire process of testing one of the mutton samples stored for 5 days.

[0132] This embodiment employs a pushbroom hyperspectral imaging system with engineering parameters set to a spectral range of 400-1000 nm and a spectral resolution of 2.8 nm, acquiring images across 215 spectral bands. The light source consists of two 150W halogen lamps, symmetrically illuminated at a 45-degree angle. First, a dark-field reference image is acquired through a masked lens. Its average intensity value across all wavelengths is between 150-200 DN. Subsequently, a standard PTFE white board with a reflectivity greater than 99% was imaged, and a white board reference image was acquired. Its average intensity value in the 750nm band is approximately 3800 DN. A mutton sample stored for 5 days was placed on a stage to acquire its original hyperspectral image cube. The dimensions are 640×480 pixels × 215 bands. Using the formula... Each pixel undergoes band-by-band reflectance calibration. For example, the original intensity value of a pixel in the sample at 750nm. 2500DN, average value in dark field The average value of the whiteboard is 160DN. If the value is 3800 DN, then the calibrated reflectivity at this point is... After completing the calculations for all pixels and bands, a reflectance calibration cube is generated and an acquisition timestamp is added to form the original image data.

[0133] To eliminate background and specular interference, the system analyzes single-band images at 850nm. By calculating the reflectance histogram and setting thresholds of 0.05 and 0.95, background and specular reflection areas are initially excluded. Simultaneously, a 7×7 pixel sliding window is used to calculate local contrast and locate texture variation contours. After fusing the above information, the Canny operator is applied, with high and low thresholds dynamically set to 0.18 and 0.09 based on the global image contrast, to extract precise edges of the samples. Finally, the system generates a region-of-interest mask covering 28,560 effective pixels. Subsequently, the system calculates the average reflectance of all pixels within this mask in each band, obtaining the region-average spectrum. , where i is the pixel index within the mask.

[0134] The acquired regional average spectrum exhibits baseline drift and scattering effects. First, baseline correction is performed using an asymmetric least squares method, with smoothness parameters... Set as The asymmetry factor p was set to 0.005, effectively removing the low-frequency background. Next, the standard normal variable transformation (SNV) was applied to the baseline-corrected spectrum for scattering correction, transforming the spectrum to a new scale with a mean of 0 and a standard deviation of 1. Finally, to filter out high-frequency noise, a Savitzky-Gore smoothing filter was used, with a sliding window width of 11 data points and a polynomial order of 2, generating a scattering-corrected spectrum with improved signal-to-noise ratio.

[0135] To extract compact and efficient features from the scattering-corrected spectra of 215 bands, the bands with a correlation greater than 0.95 were first divided into 18 band correlation groups by calculating the Pearson correlation coefficient matrix. Principal component analysis was applied to each group to extract the first principal component score, and these 18 scores were concatenated to form an 18-dimensional complementary fusion spectrum. Subsequently, based on the variable importance projection scores in the pre-trained model library, the 15 variables with the strongest comprehensive predictive ability for the four indicators (TVB-N, pH, TVC, and L) were selected from this 18-dimensional fusion spectrum, forming a 15×1 coupled spectral feature vector f_c. This feature vector... The input is fed into a pre-trained feature decoupling model. This model utilizes the index separation parameter matrix P, which is a 15×15 orthogonal transformation matrix, through projection transformation. ,Will Decomposed into a 15×1 indicator feature vector The first four elements of this vector mainly correspond to TVB-N, the fifth to seventh elements mainly correspond to pH, the eighth to eleventh elements correspond to TVC, and the twelfth to fifteenth elements correspond to L, thus achieving effective feature separation.

[0136] index feature vector The sample was sliced ​​according to preset rules, resulting in four indicator sub-vector sets. Each sub-vector was fed into its corresponding partial least squares regression prediction model to calculate the multi-indicator prediction results for the sample on day 5. The system then initiated a physical consistency screening. The predicted values ​​for this sample conformed to the basic laws of mutton spoilage, i.e., all indicators were at a moderate level of spoilage, and the correlation trend was normal. Its consistency score was 1.2, lower than the preset screening criterion threshold of 3.0. Therefore, all predicted values ​​were accepted. In contrast, another sample stored for 9 days showed that both TVB-N and TVC values ​​had reached a severe spoilage level, but the pH value was abnormally within the range of fresh meat. The rule engine determined that this combination seriously violated the biochemical law that "an increase in TVB-N is necessarily accompanied by an increase in pH," and calculated a consistency score of 4.8, exceeding the threshold of 3.0. The system therefore added an "abnormal" label to the pH value. The final output of stable prediction results includes not only numerical values ​​but also a reliability assessment.

[0137] It should be noted that the above descriptions are merely exemplary embodiments of the present invention and should not be construed as limiting the scope of the invention. That is, any equivalent changes and modifications made in accordance with the teachings of this invention are still within the scope of this invention. Those skilled in the art will readily conceive of other embodiments of the invention upon considering the disclosure of the specification and practical truths. This application is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or conventional techniques in the art not described herein.

Claims

1. A rapid detection method for multiple indicators of mutton freshness based on hyperspectral imaging, characterized in that, The method includes: Hyperspectral image cubes of the surface of refrigerated mutton are obtained and their reflectance is calibrated to generate raw image data. The texture boundaries and light intensity distribution of the original image data are identified to obtain the regional average spectrum; The scattering and baseline shift of the average spectrum in the region are corrected, and the scattering-corrected spectrum is output. The spatially consistent spectrum is obtained by normalizing the intensity differences of the scattering correction spectrum in the spatial dimension. By coupling the complementary band information of the spatially consistent spectrum, the coupled spectral features are obtained; Decouple the feature subspace of the corresponding index in the coupled spectral features to generate an index feature vector; The detection values ​​of each indicator are calculated based on the indicator feature vectors to obtain the multi-indicator prediction results. By screening the physical consistency of the multi-indicator prediction results and removing abnormal outputs, stable prediction results are obtained.

2. The rapid detection method for multiple indicators of mutton freshness based on hyperspectral imaging according to claim 1, characterized in that, The generated raw image data includes: Obtain a hyperspectral image cube of the surface of refrigerated mutton; Collect a preset white board and dark field reference to obtain a reflectivity reference set; Based on the reflectivity reference set, the instrument response is calibrated and the non-uniform components of the light source are separated to obtain the response compensation parameters. Each band of the hyperspectral image cube is calibrated using the response compensation parameters to obtain a reflectance calibration cube. The reflectivity calibration cube is output and the acquisition timestamp is locked to obtain the raw image data.

3. The rapid detection method for multiple indicators of mutton freshness based on hyperspectral imaging according to claim 2, characterized in that, The obtained regional average spectrum includes: The reflectance histogram and local contrast of the original image data are extracted and analyzed to obtain the light intensity distribution map. Based on the light intensity distribution map, continuous regions are divided and texture change contours are located to obtain a texture boundary map; By fusing the texture boundary map and the light intensity distribution map and excluding non-sample areas, a mask for the region of interest is obtained. The average reflectance of each pixel within the mask of the region of interest is calculated to obtain the average spectrum of the region.

4. The rapid detection method for multiple indicators of mutton freshness based on hyperspectral imaging according to claim 3, characterized in that, The output scattering correction spectrum includes: The baseline trend of the average spectrum in the region is analyzed and the low-frequency drift is compensated to obtain the baseline-compensated spectrum; The multiplicative scattering component of the baseline compensated spectrum is extracted and scaled to obtain the scattering normalized spectrum; The noise in the normalized scattering spectrum is smoothed while preserving the characteristic edges to obtain the scattering corrected spectrum.

5. The rapid detection method for multiple indicators of mutton freshness based on hyperspectral imaging according to claim 4, characterized in that, The obtained spatially consistent spectrum includes: The scattering correction spectrum is mapped to the spatial coordinates of the region of interest mask to obtain the regional spectral distribution; Spatial consistency constraints are constructed based on the pixel-to-pixel deviations in the spectral distribution of the region, and consistency constraint parameters are obtained. The intensity of the spectral distribution in the region is normalized using the consistency constraint parameters to obtain a spatially consistent spectrum.

6. The rapid detection method for multiple indicators of mutton freshness based on hyperspectral imaging according to claim 5, characterized in that, The obtained coupled spectral features include: The correlated bands of the spatially consistent spectrum are grouped to obtain band correlation groups; Based on the complementary response of the band correlation group and by suppressing redundant components, a complementary fusion spectrum is obtained; Extract the spectral components of the complementary fusion spectrum that meet the preset conditions and form a fixed-length description to obtain the coupled spectral features.

7. The rapid detection method for multiple indicators of mutton freshness based on hyperspectral imaging according to claim 6, characterized in that, The generated indicator feature vector includes: The correlation strength between the coupled spectral features and the preset indexes is analyzed and a mapping is constructed to obtain the index correlation matrix; Separate the mutually coupled terms of the index correlation matrix and constrain cross-index interference to obtain index separation parameters; The coupled spectral features are projected and transformed using the index separation parameters to obtain the index feature vector.

8. The rapid detection method for multiple indicators of mutton freshness based on hyperspectral imaging according to claim 7, characterized in that, The obtained multi-indicator prediction results include: The feature vectors of the indicators are divided into sub-vectors of the corresponding indicators to obtain the indicator sub-vector set; Multi-path inference is performed using the aforementioned indicator sub-vector set to calculate the detection value of each indicator; By combining the detection values ​​of each indicator, a multi-indicator prediction result is obtained.

9. The rapid detection method for multiple indicators of mutton freshness based on hyperspectral imaging according to claim 8, characterized in that, The obtained stable prediction results include: Calculate the interpretability relationship among the prediction results of the multi-indicator system and quantify the consistency to obtain a consistency score; The consistency score is compared with the preset screening criteria to identify and mark abnormal detection values, thus obtaining an anomaly label. The detection values ​​corresponding to the anomaly markers are filtered and stability is evaluated to obtain stable prediction results.

10. A rapid detection system for multiple indicators of mutton freshness based on hyperspectral imaging, characterized in that, The system includes: The hyperspectral imaging module is used to acquire hyperspectral image cubes of the surface of refrigerated mutton for reflectance calibration and to generate raw image data. The image processing module is used to identify the texture boundaries and light intensity distribution of the original image data to obtain the regional average spectrum; The spectral correction module is used to correct the scattering and baseline shift of the average spectrum of the region and output the scattering-corrected spectrum. The spectral processing module is used to normalize the intensity differences of the scattering correction spectrum in the spatial dimension to obtain a spatially consistent spectrum. A feature construction module is used to couple complementary band information of the spatially consistent spectrum to obtain coupled spectral features; The feature decoupling module is used to decouple the feature subspace of the corresponding index in the coupled spectral features and generate the index feature vector; The indicator calculation module is used to calculate the detection value of each indicator based on the indicator feature vector to obtain the multi-indicator prediction result. The result output module is used to filter the physical consistency of the multi-indicator prediction results and remove abnormal outputs to obtain stable prediction results.