Hyperspectral and image multi-modal fusion based compost maturity assessment method
Patent Information
- Application Number
- CN202611204054.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-10
- Publication Date
- 2026-10-27
- Estimated Expiration
- 2046-08-10
AI Technical Summary
[0035]本发明针对传统堆肥成熟度评估技术存在的诸多行业短板,提出一种高光谱与图像多模态双向融合的智能评估方法,有效解决了传统检测标准混乱、精度不足、效率偏低、难以规模化应用核心问题;以堆肥多项理化、生物指标构建综合成熟度评分,搭建统一评价标签锚点,规范了成熟度评估标准,解决了行业阈值不统一、评价结果不可比的痛点;通过双模态双向增强融合机制,将高光谱微观生化特征与图像宏观形态、纹理特征互补结合,既弥补了光谱数据空间形态信息缺失的问题,提升量化指标预测精度,又依托精准光谱生化数据约束图像分级模型,提升成熟度等级划分的稳定性与准确性;该方法摒弃传统实验室复杂检测流程,依托无损快速的智能检测模式,大幅降低检测成本、缩短检测周期,同时有效抵御环境、原料、工艺波动带来的干扰,提升模型泛化能力与鲁棒性;此外,本发明可输出分级结果、量化预测值、模型置信度等多维评估数据,能够精准判别堆肥安全风险,为堆肥工艺优化、质量分级、市场定价提供数据支撑,有力推动农业废弃物资源化利用行业的标准化与智能化升级。
Smart Images

Figure CN122695573B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent monitoring technology for compost, specifically to a method for assessing compost maturity based on hyperspectral and image multimodal fusion. Background Technology
[0002] Composting is an important way to utilize agricultural waste resources, converting straw, livestock manure, residual feed, and other organic waste into relatively stable organic fertilizers. The safe use of compost products largely depends on their maturity. Immature compost may continue to consume oxygen and nitrogen, release ammonia, organic acids, and phytotoxic substances, and pose pathogen risks during storage and transportation. Therefore, maturity assessment is a crucial step in compost production, application, and pricing.
[0003] Current maturity assessments typically rely on one or more physical, chemical, and biological indicators, such as color, odor, temperature, moisture content, pH, electrical conductivity, C / N ratio, ammonia nitrogen, nitrate nitrogen, germination index (GI), and respiration activity. While these methods can reflect the internal biochemical processes of compost, they suffer from drawbacks including long testing cycles, high experimental costs, reliance on specialized personnel, inconsistent threshold standards, and difficulty in large-scale online application. For example, different studies use significantly different maturity thresholds for C / N ratio, GI, or temperature stabilization stages, leading to inconsistent labeling and limiting model training and industry quality control.
[0004] Hyperspectral imaging can acquire spatial-spectral information of compost materials without damaging the sample, reflecting the vibration of functional groups such as CH, OH, and NH and the humification process. However, relying solely on hyperspectral imaging may still be affected by spatial heterogeneity of the sample, differences in surface texture, particle distribution in the compost pile, and changes in light / water content; if only the average spectrum or a few characteristic bands are used, the appearance and local differences of the compost may be lost.
[0005] Image-based machine learning can rapidly identify and classify compost maturity using visual features such as color, texture, particle morphology, and depth, making it suitable for online deployment. However, relying solely on images suffers from issues such as subjective label construction, unstable grade boundaries, and difficulty in directly mapping to specific indicators like GI, C / N ratio, ammonia nitrogen, and nitrate nitrogen. Furthermore, the generalization ability of image models tends to decline when light, raw materials, equipment, and composting processes change. To address these issues, we propose a compost maturity assessment method based on hyperspectral and image multimodal fusion. Summary of the Invention
[0006] To address the aforementioned technical challenges, this paper presents a compost maturity assessment method based on hyperspectral and image multimodal fusion. This solution resolves the difficulty in directly mapping specific indicators such as GI, C / N ratio, ammonia nitrogen, and nitrate nitrogen.
[0007] To achieve the above objectives, the technical solution adopted in this invention is: a compost maturity assessment method based on hyperspectral and image multimodal fusion, the specific steps of which are as follows:
[0008] Step S1: Synchronously collect hyperspectral data and image data of the compost sample, and obtain the physicochemical / biological indicators corresponding to the compost sample;
[0009] Step S2: Construct a comprehensive maturity score based on the physicochemical / biological indicators, and use the comprehensive maturity score as a common label anchor point for hyperspectral regression and image grading;
[0010] Step S3: Preprocess and extract features from the hyperspectral data to obtain spectral features; preprocess and extract features from the image data to obtain image features;
[0011] Step S4: Using the comprehensive maturity score as the fusion anchor point, perform bidirectional enhancement, introduce the image features into the hyperspectral regression model to enhance the prediction accuracy of the maturity index, and introduce the spectral features and the prediction index output by the hyperspectral regression model into the image grading model to enhance the stability of maturity identification and grading, so that the image features and the spectral features form a bidirectional complementary enhancement.
[0012] Step S5: Output compost maturity assessment results, which include at least one of the following: maturity classification results, continuous index prediction values, multi-level maturity levels, and model confidence scores.
[0013] Preferably, the construction method of the comprehensive maturity score in step S2 includes: selecting at least two of the following as maturity indicators: C / N ratio, germination index, ammonium nitrogen, nitrate nitrogen, pH, electrical conductivity, water content, temperature stability, respiratory activity, and humification degree; determining the maturity threshold of each maturity indicator based on statistical methods; assigning weights to each maturity indicator using the analytic hierarchy process, entropy weight method, principal component weighting method, or grey relational weighting method; and multiplying the normalized score of each maturity indicator by its corresponding weight and summing the results to obtain the comprehensive maturity score.
[0014] Preferably, the specific steps for obtaining spectral features in step S3 are as follows:
[0015] Black and white correction is performed on the raw hyperspectral data. The correction is based on the white board calibration data and the black field correction data. The correction formula is: R=(ID) / (WD), where I is the raw hyperspectral signal, D is the dark field correction signal, and W is the white board calibration signal.
[0016] After completing black and white correction, dark current correction is performed, and smoothing filter is used to smooth the spectral curve to retain effective spectral feature information.
[0017] A standard normal transformation is performed on the smoothed data, and the spectral baseline drift is removed by the first derivative transformation to highlight the characteristic differences of the spectral absorption peaks;
[0018] Reflectance normalization is performed to map the spectral reflectance values to the [0, 1] interval, thus unifying the dimensions of spectral data from different samples.
[0019] Competitive adaptive reweighted sampling is used to initially screen the characteristic bands of the preprocessed hyperspectral data. Monte Carlo sampling and regression coefficients are used to compete in screening, eliminating redundant and irrelevant bands and retaining characteristic bands that are strongly correlated with compost maturity.
[0020] Principal component analysis was used to reduce the dimensionality of the selected feature bands, mapping the high-dimensional spectral data to a low-dimensional space, and extracting the principal components with a cumulative variance contribution rate of ≥95% as the final spectral features.
[0021] Preferably, the specific steps for obtaining image features in step S3 are as follows:
[0022] White balance correction is performed on the original compost image. Background segmentation is performed by thresholding and morphological operations to remove background interference from non-compost areas in the image and retain the main compost area data.
[0023] The segmented image is normalized for illumination, and a homomorphic filtering algorithm is used to equalize the image illumination distribution, eliminate image brightness differences, and complete the image data preprocessing.
[0024] The preprocessed image is converted to multiple color spaces including RGB, HSV, and Lab. The mean, variance, and entropy of each channel are calculated to form the statistical features of the color space. At the same time, the contrast, correlation, energy, and homogeneity of the gray-level co-occurrence matrix are calculated as the texture features of the gray-level co-occurrence matrix.
[0025] A lightweight convolutional neural network was built. The preprocessed compost image was input into the network and processed through convolution, pooling, and fully connected layers. The high-dimensional feature vector output by the fully connected layer of the network was extracted as a deep visual feature.
[0026] The final image features are formed by integrating artificial image features with depth visual features.
[0027] Preferably, in step S4, the way the image features are introduced into the hyperspectral regression model includes feature concatenation, cross-modal attention fusion, or intermediate layer fusion of the image features and the spectral features, and then inputting them into the regression model to compensate for the problem that the spectral features are insufficient in expressing spatial heterogeneity;
[0028] The spectral features and prediction indicators are introduced into the image classification model by using the spectral features, the comprehensive maturity score of spectral prediction, and individual maturity indicators as additional inputs, auxiliary task objectives, soft labels, or ranking constraints to constrain image level boundaries and reduce the subjectivity of manual annotation.
[0029] Preferably, the level division in steps S4 and S5 includes: using deep visual features to discover multi-level maturity candidate levels through a clustering algorithm, using the clustering labels generated by the clustering algorithm as supervised learning labels to train a classification model to predict the level of new samples, and using the comprehensive maturity score and individual maturity index predicted by the spectral features to correct the image level; when the image level is inconsistent with the spectral prediction index, output a review prompt or reduce the confidence of the level.
[0030] Preferably, the evaluation method further includes an interpretability analysis step: determining key spectral bands by at least one of permutation importance, SHAP value analysis, or feature band importance ranking; determining key regions of interest of the image grading model by Grad-CAM, saliency map, or attention map; jointly verifying the key spectral bands and the key regions of interest with the composting humification process, color evolution, and particle morphology changes, and outputting interpretability analysis results.
[0031] Preferably, step S2 further includes a closed-loop label construction step: for samples with complete physicochemical / biological test results, the comprehensive maturity score is directly calculated and maturity labels and multi-level labels are generated; for samples lacking some test indicators, the comprehensive maturity score or key maturity indicators are first predicted by the hyperspectral regression model, and then soft labels, auxiliary labels or ranking constraints are provided for the image grading model; for candidate levels obtained by image clustering, the comprehensive maturity score, germination index, C / N ratio, ammonium nitrogen and nitrate nitrogen are combined in reverse to perform level correction.
[0032] Preferably, the sorting criteria for the multi-level maturity levels in step S5 include at least one of the following: median sampling time, temperature change trend, comprehensive maturity score, spectral principal components, key band reflectance, color mean, color saturation, texture uniformity, and Grad-CAM high-response region area; the index predicted by the spectral features and the interpretable results of the image features jointly constrain the level sorting, so that the level arrangement remains monotonically consistent with the composting and humification process and nitrogen conversion trend.
[0033] Preferably, the evaluation method further includes an online deployment and application step: embedding the trained hyperspectral regression model and the image grading model into the composting reactor control system, conveyor line detection equipment, or mobile inspection terminal; after collecting compost sample data in real time through hyperspectral sensors and image acquisition equipment, automatically outputting maturity level, continuous index prediction values, and composting application suggestions; the composting application suggestions include at least one of the following: turning time, extending the composting period, terminating composting, product grading, and pricing reference.
[0034] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0035] This invention addresses numerous shortcomings in traditional compost maturity assessment technologies by proposing an intelligent assessment method that integrates hyperspectral and image multimodal data. This method effectively solves the core problems of inconsistent testing standards, insufficient accuracy, low efficiency, and difficulty in large-scale application. It constructs a comprehensive maturity score based on multiple physicochemical and biological indicators of compost, establishes unified evaluation label anchors, standardizes maturity assessment criteria, and resolves the pain points of inconsistent industry thresholds and incomparable evaluation results. Through a dual-modal bidirectional enhancement fusion mechanism, it complementarily combines hyperspectral microscopic biochemical features with macroscopic morphological and texture features of images, compensating for the lack of spatial morphological information in spectral data and improving the predictability of quantitative indicators. This method improves the accuracy of maturity level classification by relying on precise spectral and biochemical data to constrain the image grading model. It abandons the complex testing procedures of traditional laboratories, relying on a non-destructive and rapid intelligent testing mode to significantly reduce testing costs and shorten the testing cycle. Simultaneously, it effectively resists interference from environmental, raw material, and process fluctuations, enhancing the model's generalization ability and robustness. Furthermore, this invention can output multi-dimensional evaluation data such as grading results, quantitative prediction values, and model confidence levels, enabling precise identification of composting safety risks. This provides data support for composting process optimization, quality grading, and market pricing, powerfully promoting the standardization and intelligent upgrading of the agricultural waste resource utilization industry. Attached Figure Description
[0036] Figure 1 This is a flowchart of the steps of the present invention;
[0037] Figure 2 Visualization of principal component loadings and variance contribution rates for hyperspectral and image features;
[0038] Figure 3 A comparison chart showing the effect of original spectra, feature band screening, and prediction accuracy of Integrated Maturity Score (IMS);
[0039] Figure 4 This is a graph showing the results of image clustering and classification, and the performance of the classification model.
[0040] Figure 5Test plots for the stability, interpretability, and robustness against interference of the fusion model;
[0041] Figure 6 This is a graph showing the temporal changes of biochemical indicators in compost and the thermal interpretability of Grad-CAM images. Detailed Implementation
[0042] The following description is intended to disclose the invention and enable those skilled in the art to implement it. The preferred embodiments described below are merely examples, and other obvious variations will occur to those skilled in the art.
[0043] See Figure 1 The method flow shown includes the following steps: Step S1, synchronously collect hyperspectral data and image data of compost samples, and obtain physicochemical / biological indicators corresponding to the compost samples; Step S2, construct a comprehensive maturity score based on the physicochemical / biological indicators, and use the comprehensive maturity score as a common label anchor point for hyperspectral regression and image grading; Step S3, preprocess and extract features from the hyperspectral data to obtain spectral features; preprocess and extract features from the image data to obtain image features; Step S4, perform bidirectional enhancement using the comprehensive maturity score as a fusion anchor point, introduce the image features into the hyperspectral regression model to enhance the prediction accuracy of maturity indicators, and introduce the spectral features and the predicted indicators output by the hyperspectral regression model into the image grading model to enhance the stability of maturity identification and grading, so that the image features and the spectral features form a bidirectional complementary enhancement; Step S5, output the compost maturity assessment result, which includes at least one of maturity classification results, continuous indicator prediction values, multi-level maturity levels, and model confidence.
[0044] In the specific implementation process, such as Figure 1As shown, compost samples can originate from windrow composting, trough composting, reactor composting, or vertical fermentation chamber composting using organic materials such as straw, livestock and poultry manure, kitchen waste, garden waste, and mushroom residue as raw materials. The synchronous acquisition mentioned in step S1 refers to simultaneously acquiring hyperspectral data, image data, and physical samples suitable for chemical detection from the same batch of compost samples at the same sampling time, ensuring a traceable one-to-one correspondence between the three types of data in both time and space dimensions. The hyperspectral data can be acquired by a pushbroom or staring hyperspectral imager covering the visible-near-infrared or short-wave infrared bands, preferably with a wavelength range of 900nm to 1700nm and a preferably large number of spectral channels. The image data can be acquired by an industrial camera, a color area array camera, or a high-definition camera on a mobile inspection terminal. The image resolution can be 1080P, 2K, or 4K, reflecting the macroscopic color, texture, particle morphology, and pile state of the compost. The physicochemical / biological indicators include at least some or all of the following: C / N ratio, germination index (GI), ammonium nitrogen, nitrate nitrogen, pH, conductivity, moisture content, temperature stability, respiration activity, and degree of humification. The physicochemical indicators can be determined by conventional laboratory chemical analysis methods, and the biological indicators can be obtained through germination tests, microbial counting, or respiration measurement devices. Steps S2 to S5 can be implemented as software modules on the same server or industrial computing unit, or deployed in a distributed manner between edge computing nodes and the cloud.
[0045] By employing the above technical solution, and simultaneously acquiring hyperspectral data, image data, and physicochemical / biological indicators at the same sampling time, a strictly aligned sample-label pair is provided for the two modeling paths of hyperspectral regression and image grading, avoiding label drift caused by temporal and spatial misalignment. By using the comprehensive maturity score as a common label anchor, the pain point of inconsistent thresholds and incomparable evaluation results for single indicators such as C / N ratio, GI, ammonia nitrogen, and nitrate nitrogen in the industry is fundamentally solved. By performing preprocessing and feature extraction on hyperspectral and image data respectively, and using a bidirectional enhancement mechanism to make the two types of features mutually constrain and compensate each other, the prediction accuracy of quantitative maturity indicators and the stability of maturity level classification are improved. By outputting multi-dimensional evaluation data such as classification results, continuous predicted values, multi-level labels, and confidence scores, sufficient data basis is provided for composting process optimization, quality grading, market pricing, and safety risk early warning.
[0046] In some preferred embodiments of this application, the construction method of the comprehensive maturity score in step S2 includes: selecting at least two of the following as maturity indicators: C / N ratio, germination index, ammonium nitrogen, nitrate nitrogen, pH, electrical conductivity, water content, temperature stability, respiration activity, and humification degree; determining the maturity threshold of each maturity indicator based on statistical methods; assigning weights to each maturity indicator using the analytic hierarchy process, entropy weight method, principal component weighting method, or grey relational weighting method; and multiplying the normalized score of each maturity indicator by its corresponding weight and summing the results to obtain the comprehensive maturity score.
[0047] In the specific implementation process, the Comprehensive Maturity Score (IMS) can be constructed according to the following steps: First, select N indicators from the above ten candidate indicators based on the type of compost material, process type, and testing capability. For example, taking straw-livestock manure mixed compost as an example, C / N ratio, germination index (GI), ammonium nitrogen, nitrate nitrogen, degree of humification, and temperature stability can be prioritized as core indicators. Second, determine the maturity threshold range for each maturity indicator based on the statistical distribution of historical samples and recommended values in literature. For example, the immature-mature threshold can be defined by using the 25th quantile and the 75th quantile or the mean plus or minus one standard deviation. It can also be corrected by combining recommended values in ISO or industry standards. Next, the analytic hierarchy process (AHP), entropy weight method, principal component weighting method, or grey relational weighting method are used to assign weights to each maturity index. AHP is suitable for scenarios with high expert participation, entropy weighting is suitable for scenarios with significant differences in data distribution information, principal component weighting is suitable for scenarios with strong correlations between indicators, and grey relational weighting is suitable for scenarios with small sample sizes. Then, each maturity index is normalized to map all indices to the [0,1] interval. Finally, the normalized scores of each maturity index are multiplied by their corresponding weights and summed to obtain the Integrated Maturity Score (IMS), which also ranges from [0,1]. A higher IMS indicates that the sample is closer to a state of decay. The IMS serves as both the regression target of the hyperspectral regression model and the classification target of the image grading model, discretized into several levels, thus achieving label unification for the two modeling paths.
[0048] The above technical solution avoids the one-sidedness of single-indicator evaluation by integrating multiple indicators. For example, relying solely on GI is easily affected by differences in seed sensitivity, and relying solely on C / N ratio is easily affected by differences in raw material composition. Multi-indicator weighting can effectively reduce the error of a single indicator. By introducing mature thresholds based on statistical distribution or industry standards, a traceable anchor point is provided for the normalization of each indicator, ensuring that samples from different batches and processes are still comparable horizontally. By flexibly selecting among the analytic hierarchy process, entropy weight method, principal component weight method, and grey relational weight method, it adapts to different evaluation scenarios from "expert-driven" to "data-driven". By using IMS as a common anchor point for both regression and grading objectives, the consistency of the two modeling paths, hyperspectral regression and image grading, in terms of optimization objectives is ensured from the source, laying the foundation for label alignment for subsequent bidirectional enhancement fusion.
[0049] In some preferred embodiments of this application, the specific steps for obtaining spectral features in step S3 are as follows: Black and white correction is performed on the original hyperspectral data, using white-field calibration data and black-field correction data as references. The correction formula is R=(ID) / (WD), where I is the original hyperspectral signal, D is the dark-field correction signal, and W is the white-field calibration signal; after black and white correction, dark current correction is performed, and smoothing filtering is used to smooth the spectral curve, preserving effective spectral feature information; standard normal transformation is performed on the smoothed data, and the spectral baseline drift is removed through first-order derivative transformation. The study identified the characteristic differences in the spectral absorption peaks; it performed reflectance normalization, mapping the spectral reflectance values to the [0,1] interval to unify the dimensions of spectral data from different samples; it conducted initial screening of feature bands in the preprocessed hyperspectral data based on competitive adaptive reweighted sampling, using Monte Carlo sampling and regression coefficient competition to eliminate redundant and irrelevant bands, retaining feature bands strongly correlated with compost maturity; it then used principal component analysis to reduce the dimensionality of the screened feature bands, mapping the high-dimensional spectral data to a low-dimensional space, and extracting principal components with a cumulative variance contribution rate ≥95% as the final spectral features.
[0050] In the specific implementation process, the hyperspectral principal component loading and functional group corresponding bands are shown in the diagram. The spectral feature extraction and processing link of compost samples can be refined as follows: The first step is black and white correction. During the acquisition, white plate calibration data W and dark field correction data D are acquired simultaneously. Then, the correction formula R=(ID) / (WD) is used. The reflectance R is calculated band by band to eliminate systematic errors caused by light source brightness, sensor dark current, and optical path inhomogeneity. The second step is smoothing filtering, which can be achieved using Savitzky-Golay convolution smoothing with an odd window length (e.g., 7, 9, 11, 15) and a polynomial order of 2 or 3 to suppress random noise while preserving the shape of spectral absorption peaks. The third step is standard normal variable transformation (SNV), which independently subtracts the mean from each spectral curve and divides by the standard deviation to effectively suppress the additive and multiplicative effects caused by particle scattering and sample thickness inhomogeneity. The fourth step is first derivative transformation, which can be achieved using the point difference method or Savitzky-Golay differentiation to remove baseline drift and highlight the characteristic absorption peaks of functional groups such as CH, OH, and NH. The fifth step is reflectance normalization, which maps the processed values to the [0,1] interval. The sixth step is competitive adaptive reweighted sampling (C The ARS feature band selection process involves multiple rounds of Monte Carlo sampling, exponentially decreasing weighting, and competitive selection using regression coefficients to identify feature bands highly correlated with IMS or individual indicators from hundreds of original bands. In actual measurements, bands such as 1060nm, 1163nm, 1216nm, 1228nm, 1335nm, 1420nm, 1460nm, 1490nm, and 1620nm were repeatedly selected, corresponding to the functional group vibrations of water, organic carbon, cellulose, lignin, aliphatic compounds, amino acids, polysaccharides, humic substances, and hydrated organic matter, respectively. The seventh step is principal component analysis (PCA) dimensionality reduction. The first principal component, PC1, contributes approximately 95.91% of the variance, while the second principal component, PC2, and the third principal component, PC3, contribute approximately 3.01% and 0.80%, respectively. The cumulative variance contribution rate of the first few principal components ≥95% can be used as the final spectral feature input to the downstream hyperspectral regression model.
[0051] Using the above technical solution, a complete preprocessing chain of "black and white correction—smoothing—SNV—first derivative—normalization" is employed to suppress noise sources such as light source fluctuations, dark current, particle scattering, and baseline drift step by step, while preserving spectral absorption peaks directly related to the composting and humification process. Through CARS feature band screening, feature bands strongly correlated with indicators such as C / N ratio, GI, ammonium nitrogen, and nitrate nitrogen are identified from hundreds of bands, avoiding interference from redundant bands in high-dimensional spectral data on the regression model. Dimensionality reduction using PCA further compresses the feature bands screened by CARS. By reducing the cumulative variance contribution rate to principal components ≥95%, the MRE of the training set decreased from approximately 2.41% to approximately 1.69%, and the MAE decreased from approximately 0.023 to approximately 0.016 before and after feature band extraction. The MRE of the validation set decreased from approximately 3.42% to approximately 2.38%, and the MAE decreased from approximately 0.033 to approximately 0.023. The MRE of the test set decreased from approximately 2.93% to approximately 2.76%, and the MAE decreased from approximately 0.028 to approximately 0.027. This fully demonstrates that feature band selection and principal component dimensionality reduction have a dual effect on improving regression accuracy and generalization ability.
[0052] In some preferred embodiments of this application, the specific steps for obtaining image features in step S3 are as follows: White balance correction is performed on the original compost image; background segmentation is performed using threshold segmentation combined with morphological operations to remove background interference from non-compost areas in the image, retaining the main compost area data; illumination normalization is performed on the segmented image; a homomorphic filtering algorithm is used to equalize the image illumination distribution, eliminate image brightness differences, and complete image data preprocessing; the preprocessed image is converted to RGB, HSV, and Lab multi-color spaces, and the mean, variance, and entropy of each channel are calculated to constitute color space statistical features; simultaneously, the contrast, correlation, energy, and homogeneity of the gray-level co-occurrence matrix are calculated as gray-level co-occurrence matrix texture features; a lightweight convolutional neural network is constructed, the preprocessed compost image is input into the network, and after convolution, pooling, and fully connected layer operations, the high-dimensional feature vector output by the fully connected layer of the network is extracted as depth visual features; the artificial image features and depth visual features are fused to form the final image features.
[0053] In the specific implementation process, the image feature extraction processing chain can be broken down as follows: The first step is white balance correction, which corrects the color deviation of the image to a uniform color temperature using the gray-world hypothesis, perfect reflection hypothesis, or color chart calibration method, providing comparability for subsequent cross-batch comparisons; the second step is background segmentation, which uses threshold segmentation (e.g., Otsu's method) combined with morphological operations (opening, closing, connected component filtering) to extract the composting main area from the original image, removing non-composting backgrounds such as sampling containers, conveyor belts, ground, or walls; the third step is illumination normalization, which uses a homomorphic filtering algorithm to separate the illuminance component and reflectance component in the frequency domain, suppressing the low-frequency components of the illuminance component and enhancing the high-frequency components of the reflectance component, eliminating uneven illumination at different locations in the compost pile; the fourth step is multi-color space statistical feature extraction, which converts the preprocessed image to RGB, HSV, and Lab color spaces simultaneously, and calculates the mean, variance, and entropy of each channel, forming a total of 27-dimensional color space statistical features to characterize the macroscopic color depth and saturation of the compost. The fifth step is gray-level co-occurrence matrix (GLCM) texture feature extraction. After converting the image to grayscale, a gray-level co-occurrence matrix is generated in four directions (0°, 45°, 90°, and 135°) with specific pixel distances. Four statistical measures, namely contrast, correlation, energy, and homogeneity, are calculated to reflect the coarseness, uniformity of distribution, and crystallinity of compost particles. The sixth step is depth visual feature extraction. A lightweight convolutional neural network (such as MobileNet series, ShuffleNet series, EfficientNet-B0, or similar structures) is built. The preprocessed compost image is input into the network and processed through several convolutional layers, pooling layers, and fully connected layers. The high-dimensional feature vector (e.g., 128-dimensional, 256-dimensional, or 512-dimensional) output by the fully connected layer is taken as the depth visual feature. The seventh step is feature fusion. The above artificial image features (27-dimensional color features plus 16-dimensional GLCM texture features) are concatenated or weighted and fused with the depth visual features to form the final image features, which are then output to the downstream image grading model.
[0054] By employing the above technical solution, three-level preprocessing—white balance correction, background segmentation, and homomorphic filtering illumination normalization—eliminates the interference of uneven color temperature, background, and illumination at the image acquisition end on feature stability, laying the foundation for cross-batch and cross-device image model generalization. Through the combination of RGB, HSV, and Lab color spaces with GLCM textures, the macroscopic appearance of compost is comprehensively depicted from two orthogonal dimensions: color and texture, overcoming the limitation of a single color space in simultaneously depicting differences in hue, brightness, and saturation. By introducing a lightweight convolutional neural network to extract deep visual features, it retains the high-level abstraction capabilities for compost particle morphology, local texture, and microscopic color changes, while avoiding the computational bottleneck of deploying large models on mobile inspection terminals or edge devices. By fusing artificial image features with deep visual features, the advantages of interpretable features and end-to-end features are complemented, enabling the image grading model to maintain good robustness and interpretability even under small sample conditions.
[0055] In some preferred embodiments of this application, the method of introducing image features into the hyperspectral regression model in step S4 includes feature concatenation, cross-modal attention fusion, or intermediate layer fusion of the image features and the spectral features, and then inputting them into the regression model to compensate for the problem that the spectral features are insufficient in expressing spatial heterogeneity; the method of introducing spectral features and prediction indicators into the image classification model includes using the spectral features, the comprehensive maturity score of spectral prediction, and individual maturity indicators as additional inputs, auxiliary task objectives, soft labels, or ranking constraints of the image classification model to constrain image level boundaries and reduce the subjectivity of manual annotation.
[0056] In specific implementation, bidirectional enhancement fusion can adopt the following three typical implementation methods: The first is feature concatenation fusion, which concatenates spectral feature vectors and image feature vectors column by column and inputs them into regression models such as partial least squares regression (PLSR), support vector regression (SVR), random forest regression, gradient boosting regression, or multilayer perceptron to obtain the predicted values of the comprehensive maturity score (IMS) and key individual indicators (such as GI, C / N ratio, ammonium nitrogen, and nitrate nitrogen); The second is cross-modal attention fusion, which encodes spectral features and image features separately through independent encoding branches and then uses a cross-attention mechanism to weight them in the semantic space. For example, spectral features are used as queries and image features are used as keys and values to output the weighted fused features, which are then input into the regression head; The third is intermediate layer fusion, which introduces spectral feature branches into the intermediate layers of a lightweight convolutional network and injects spectral features into the image feature pathway through feature addition, channel-wise multiplication, or gating mechanisms. On the reverse path, spectral features, spectral predicted IMS, and individual indicators can be injected into the image grading model in one of the following ways or in combination: First, as additional input features directly concatenated to the fully connected layer of the image grading model; second, as an auxiliary task objective, allowing the image model to regress the spectral predicted IMS in a multi-task learning manner while completing grading, thus achieving coupling between deep visual features and spectral semantics; third, as soft labels, using the grade probability distribution after IMS discretization as the teacher signal for knowledge distillation to guide the Softmax output distribution of the image grading model; fourth, as ranking constraints, using the IMS size relationship between different samples obtained from spectral prediction as the positive and negative pair constraints for contrastive learning, allowing the image model to learn a ranking relationship consistent with IMS near the grade boundaries.
[0057] By incorporating image features into the hyperspectral regression model, the limitations of single spectral features in expressing information such as spatial heterogeneity, particle morphology, and macroscopic color are overcome, making the regression model more robust to local regional fluctuations and thus improving the accuracy of IMS and key indicator predictions. Furthermore, by introducing spectral features and their predictive indicators into the image grading model, a biochemically meaningful anchor point is provided for defining image grades, effectively reducing the subjective bias caused by "judging grades by color" in manual annotation. Finally, by flexibly selecting from various fusion methods such as feature stitching, cross-modal attention, intermediate layer fusion, auxiliary tasks, soft labels, and ranking constraints, different fusion strategies can be matched according to computing power budget, sample size, and business needs, forming a flexible and scalable bidirectional enhanced fusion system.
[0058] In some preferred embodiments of this application, the level division in steps S4 and S5 includes: using deep visual features to discover multi-level maturity candidate levels through a clustering algorithm; using the clustering labels generated by the clustering algorithm as supervised learning labels to train a classification model to predict the level of new samples; and using the comprehensive maturity score and individual maturity index predicted by the spectral features to correct the image level; when the image level is inconsistent with the spectral prediction index, outputting a review prompt or reducing the confidence of the level.
[0059] In the specific implementation process, the image learning and grading performance demonstration and grading process can be detailed as follows: The first step is deep visual feature clustering. The deep visual features output by the image feature extraction module are input into clustering algorithms such as K-Means, hierarchical clustering, spectral clustering, or Gaussian mixture model. The number of clusters can be determined from 3 to 8 using the elbow rule or silhouette coefficient. In actual tests, the deep visual features in the two-dimensional space composed of the first two principal components are presented as Immature 1, Immature 2, Immature 3, Immature 4, Mature 1, Mature The image shows six naturally clustered groups, with the sample size and cluster purity of each group labeled in the figure. The second step is pseudo-label generation, where the cluster numbers output by the clustering algorithm are sorted in ascending order of IMS mean, mapping them to a multi-level maturity candidate level from "Unripe-1" to "Ripe-2," serving as supervised learning pseudo-labels for the image grading model. The third step is classification model training, where image features are paired with pseudo-labels and input into classifiers such as K-Nearest Neighbors (KNN), Random Forest (RF), Extreme Gradient Boosting (XGB), and Support Vector Machine (SVM) for supervised training. The accuracy, precision, recall, and F1 scores of the four classifiers on the training / test sets are measured. The scores were consistently above 0.8, with XGB performing best in most metrics. The fourth step was spectral constraint correction. For each test sample, the class_img output by the image grading model was read simultaneously with the IMS and individual metrics obtained from the spectral prediction. If the IMS interval corresponding to Class_img was consistent with the IMS interval of the spectral prediction, the class was accepted and a high confidence level was output. If the two were inconsistent, the correction logic was triggered, either by directly using the spectral prediction result and outputting a verification prompt, or by reducing the confidence level of the class for manual verification and subsequent label iteration.
[0060] By adopting the above technical solution, multi-level maturity candidate levels are automatically discovered through deep visual feature clustering, avoiding the subjectivity caused by manually setting the number and boundaries of levels in advance. The clustering results naturally reflect the stage characteristics of the composting and humification process. By using clustering labels as pseudo-labels to train the classification model, the unsupervised representation is transformed into a supervised model that can quickly infer new samples, realizing a closed loop from "discovering levels" to "predicting levels". By introducing spectral prediction indicators to correct the consistency of image levels, the problem of level boundary drift under changes in illumination, particle morphology, and moisture content is solved, making the dual-modal fusion system more robust in classifying under complex field conditions. By outputting verification prompts and confidence reduction when there is inconsistency, the uncertainty of the model is explicitly expressed, which facilitates the intervention of process personnel and continuous optimization of the labeling system.
[0061] In some preferred embodiments of this application, the evaluation method further includes an interpretability analysis step: determining key spectral bands by at least one of permutation importance, SHAP value analysis, or feature band importance ranking; determining key regions of interest of the image grading model by Grad-CAM, saliency map, or attention map; jointly verifying the key spectral bands and the key regions of interest with the composting humification process, color evolution, and particle morphology changes, and outputting interpretability analysis results.
[0062] In the specific implementation process, the interpretability analysis steps can be carried out in the following ways: The first step is the identification of key spectral bands. This can be achieved using the permutation importance method, where the reflectance of each candidate band is shuffled on the test set, and the changes in the IMS or single-item prediction error output by the hyperspectral regression model are observed. The greater the increase in error, the more important the band. Alternatively, SHAP value analysis can be used, treating each band as a feature and calculating its Shapley contribution value at the sample level to quantify positive or negative impacts. Furthermore, the selection frequency and regression coefficient modulus during the CARS feature band screening process can be used as the basis for ranking band importance. Bands such as 1060nm, 1163nm, 1228nm, 1335nm, 1420nm, 1460nm, and 1620nm are repeatedly marked as key bands, corresponding to CH bending, CH stretching, cellulose / lignin OH bending, lignin / amino acid CH stretching, water / lignin OH stretching, water / cellulose / sugar OH stretching, and hydrated organic matter CH stretching, respectively. The second step is image key interest region identification. For the trained lightweight convolutional neural network hierarchical model, the Grad-CAM method is used to generate an activation-like heatmap in the last convolutional layer, or saliency maps, integrated gravitations, attention maps, etc., are used to generate pixel-level importance maps. This identifies the image regions on which the model relies to determine different maturity levels, such as dark areas rich in humus, areas covered by white mycelium, and areas of particle agglomeration. The third step is joint validation, which matches the key spectral bands and key interest regions with prior knowledge of composting humification processes, color evolution, and particle morphology changes. For example, the strong responses in the 1420nm and 1460nm bands can be validated in conjunction with the dark brown areas in the high-response regions of Grad-CAM, both pointing to the accumulation of hydrated organic matter in the middle and late stages of humification. The fourth step is interpretability report output, which integrates the band contribution ranking, the Grad-CAM heatmap overlay, and biochemical meaning annotations into standardized interpretable analysis results, which are output along with the model prediction results.
[0063] By employing the above technical solutions, key spectral bands are determined through multiple paths, including permutation importance analysis, SHAP value analysis, and CARS selection frequency. This transforms the decision-making process of the hyperspectral regression model from a "black box" into an explicit list of bands that directly corresponds to the biochemical mechanisms of composting. Grad-CAM, saliency maps, and attention maps are used to identify key regions of interest in the image grading model, making the model's judgment criteria visualized as a heatmap on the original image, facilitating understanding and trust among process engineers. Furthermore, by jointly validating key spectral bands and key regions of interest, a consistent chain of evidence—from biochemical mechanism to spectral representation to image morphology—is formed. This provides a clear framework for the reliability, accountability, and subsequent iterative optimization of the model's output results.
[0064] In some preferred embodiments of this application, step S2 further includes a closed-loop label construction step: for samples with complete physicochemical / biological test results, the comprehensive maturity score is directly calculated and maturity labels and multi-level labels are generated; for samples lacking some test indicators, the comprehensive maturity score or key maturity indicators are first predicted by the hyperspectral regression model, and then soft labels, auxiliary labels or ranking constraints are provided for the image grading model; for candidate levels obtained by image clustering, the comprehensive maturity score, germination index, C / N ratio, ammonium nitrogen and nitrate nitrogen are combined in reverse to perform level correction.
[0065] In the specific implementation process, the closed-loop label construction step can be implemented as follows: First, for high-quality samples with complete physicochemical / biological test results, the weighted summation formula defined in step S2 is directly called to calculate the IMS, and the IMS is discretized into multi-level maturity labels according to a preset threshold, which serve as the regression labels for the hyperspectral regression model and the classification labels for the image grading model; Second, for samples with missing detection indicators (e.g., only pH, conductivity, and water content are measured, but laboratory indicators such as GI and C / N ratio are missing), the already trained hyperspectral regression model first predicts the missing indicators or directly predicts the IMS based on its spectral characteristics, and then the predicted IMS or indicators are presented as soft labels. The data is provided to the image grading model in the form of formulas (e.g., the Softmax distribution of discretized levels), auxiliary task labels (e.g., as auxiliary regression targets in multi-task learning), or ranking constraints (e.g., as positive and negative sample ranking signals in contrastive learning) to mine effective supervisory information from the semi-labeled data. Third, for candidate levels obtained through image clustering, the levels are corrected using inversely predicted indicators such as IMS, GI, C / N ratio, ammonium nitrogen, and nitrate nitrogen. After sorting the clusters by IMS mean, consistency with the trends of biochemical indicators is checked. If the ranking of a cluster is found to be inconsistent with the monotonicity of GI or the decreasing trend of ammonium nitrogen, cluster merging, cluster splitting, or boundary re-division is triggered. These three paths continuously iterate, forming a closed loop of "complete sample training of the model—model prediction of semi-labels—semi-label feedback to grading—clustering correction of levels—updating IMS thresholds."
[0066] By employing the above technical solution, and through differentiated processing of three types of data sources—complete samples, missing indicator samples, and clustering candidate levels—a multi-level labeling system was constructed, progressing from "laboratory gold labels" to "model pseudo labels" and then to "clustering candidate labels," significantly expanding the sample size available for model training. The ability of the hyperspectral regression model to complete missing indicator samples avoids the waste of resources that would otherwise lead to the abandonment of entire batches of samples due to the absence of a single indicator. By using spectral prediction indicators to correct clustering candidate levels, the drift in image clustering levels under conditions of lighting and raw material fluctuations is prevented. Through continuous closed-loop iteration, the entire evaluation system evolves with the introduction of new samples, new processes, and new raw materials, possessing long-term adaptability to the diverse production conditions of the composting industry.
[0067] In some preferred embodiments of this application, the sorting criteria for the multi-level maturity levels in step S5 include at least one of the following: median sampling time, temperature change trend, comprehensive maturity score, spectral principal components, key band reflectance, color mean, color saturation, texture uniformity, and Grad-CAM high-response region area; the index predicted by the spectral features and the interpretive results of the image features jointly constrain the level sorting, so that the level arrangement remains monotonically consistent with the composting and humification process and nitrogen conversion trend.
[0068] In the specific implementation process, the ranking of multi-level maturity can be comprehensively determined using the following multi-dimensional criteria: First, the median sampling time, which is the median sampling time of samples within the same cluster. As the composting fermentation date progresses, samples generally evolve along the direction of "uncomposted – semi-composted – composted". The median sampling time can serve as a priori reference for the level order. Second, the temperature change trend. The compost temperature typically goes through a warming period, a high-temperature period, a cooling period, and a stable period. The stable period temperature is close to the ambient temperature, which can be used as one of the criteria for the maturity stage. Third, the Integrated Maturity Score (IMS), which directly reflects the weighted score of each indicator. The higher the IMS, the closer it is to the mature state. Fourth, the principal components of the spectrum, PC1, PC2, and PC3. The displacement direction during the humification process can serve as an independent criterion for grading direction; fifth, key band reflectance, such as the reflectance of humification-related bands like 1420nm, 1460nm, and 1620nm, shows a stable trend in the mature state; sixth, color mean and color saturation, as compost evolves from yellow / light brown to dark brown / black during the humification process, the RGB and HSV mean and saturation show monotonous changes; seventh, texture uniformity, mature compost particles have a relatively loose and uniform structure, and GLCM homogeneity increases; eighth, the area of Grad-CAM high-response regions, in mature samples, Grad-CAM high-response regions are usually concentrated in dark humic areas, and their area proportion is positively correlated with IMS. These multidimensional criteria can be synthesized into a grading score using weighted voting, multi-criteria decision-making, or linear ranking models, participating in the final grading. After the ranking is completed, monotonic consistency constraints are introduced, such as requiring that the IMS intervals of adjacent levels do not overlap, GI does not decrease monotonically, and ammonium nitrogen does not increase monotonically. If these conditions are not met, the boundaries are merged or adjusted.
[0069] By adopting the above technical solution, the sorting criteria are comprehensively selected from the time, biochemical, spectral, color, texture, and depth visual dimensions, avoiding the problem that a single criterion (such as relying solely on color or solely on IMS) is easily affected by sampling environment, lighting, and local pile differences. By incorporating spectral prediction indicators and image interpretability results into the grading constraints, the grading arrangement simultaneously satisfies the consistency between biochemical mechanisms and visual appearance, conforming to the intuitive understanding of process engineers. By introducing monotonic consistency constraints, the interpretability and traceability of the grading sequence in the humification process and nitrogen conversion trend are guaranteed, providing a stable grading benchmark for the automatic generation of downstream composting application recommendations.
[0070] In some preferred embodiments of this application, the evaluation method further includes online deployment and application steps: embedding the trained hyperspectral regression model and the image grading model into the composting reactor control system, conveyor line detection equipment, or mobile inspection terminal; after collecting compost sample data in real time through hyperspectral sensors and image acquisition equipment, automatically outputting maturity level, continuous index prediction values, and composting application suggestions; the composting application suggestions include at least one of turning timing, extending the maturity period, terminating maturity, product grading, and pricing reference.
[0071] In practical implementation, the trained hyperspectral regression model and image grading model can be embedded into the actual production process in the following three typical deployment forms: The first is embedded deployment within the compost reactor control system, where the model is deployed in the reactor host computer or PLC controller extension module as a dynamic link library or REST API service. The hyperspectral sensor and color camera installed in the reactor observation window or sampling port collect sample data in real time, and the output maturity level and prediction index are directly used as feedback signals for reactor stirring frequency, ventilation flow rate, and temperature control setpoint. The second is deployment in the conveyor line detection equipment, where the model is deployed in the detection frame above the compost discharge conveyor line. In conjunction with a line scan hyperspectral camera and an industrial area array camera, it performs millisecond-level acquisition and inference as the sample passes by, realizing online grading, weighing, and packaging linkage of batch compost products. The third is deployment in the mobile inspection terminal, where the model is quantized and compressed (e.g., INT8 quantization, channel pruning, distillation) and deployed on a handheld terminal or AGV / drone equipped with a portable hyperspectral module and camera. Process personnel can collect and evaluate the surface and cross-section of the compost pile at any location in the compost yard. The system output can be directly connected to the process decision module to automatically generate composting application suggestions. For example, when IMS is below the first threshold and ammonium nitrogen is high, it is recommended to turn the compost and increase ventilation; when IMS is between the first and second thresholds, it is recommended to extend the composting period; when IMS is above the second threshold and GI is above the safety threshold, it is recommended to terminate composting and switch to product grading; when IMS and other indicators meet the high-quality product threshold, it is recommended to enter the market with a higher pricing reference.
[0072] By adopting the above technical solution, and embedding the model into three typical deployment forms—reactor control system, conveyor line detection equipment, and mobile inspection terminal—it achieves full coverage of different production scenarios, from continuous factory composting to windrow outdoor composting and yard inspection, taking into account the implementation needs of large-scale factory production and small-to-medium-scale decentralized production. Through model quantization compression and inference acceleration, the method can run with low latency on edge devices with limited computing power, providing a hardware foundation for online closed-loop control. By outputting maturity level, continuous indicator prediction values, and composting application suggestions to the process decision module through a standardized interface, a "perception-evaluation-decision-execution" closed loop is formed, directly supporting the judgment of turning time, maturity cycle management, product grading, and market pricing reference, transforming the technical value of this method into actual economic value.
[0073] Based on the above implementation schemes, this application constructs a unified, comparable, and traceable compost maturity evaluation standard by simultaneously collecting hyperspectral data, image data, and physicochemical / biological indicators of compost samples, using the comprehensive maturity score as a common anchor point for hyperspectral regression and image grading. Through a complete spectral processing chain including black-and-white correction, smoothing, SNV, first derivative, normalization, CARS feature band screening, and PCA dimensionality reduction, the spectral data is focused on key bands between 1060nm and 1620nm directly related to the vibrations of CH, OH, and NH functional groups, significantly improving the regression accuracy of IMS and key indicators. Through an image processing chain combining white balance, background segmentation, illumination normalization preprocessing, and multi-color space statistical features, GLCM texture features, and depth visual features, a comprehensive depiction of the macroscopic appearance of compost is achieved. A bidirectional enhancement fusion mechanism anchored by IMS allows image features to compensate for spectral spatial heterogeneity and constrain image grade boundaries. A grading method combining deep visual feature clustering with spectral indicator correction achieves Immature 1~4 and Mature... This method features automatic discovery and stable grading of six levels (1-2). Interpretive analysis methods, such as permutation importance, SHAP value, and Grad-CAM, are used to corroborate model decisions with composting humification mechanisms. A closed-loop system is constructed using differentiated labels to mine monitoring signals from three data sources: complete samples, missing samples, and clustered candidate samples. A multi-level ranking mechanism based on multi-dimensional weighting and monotonic consistency constraints ensures the biochemical interpretability of the grading sequence. Multiple online deployment methods, including reactor embedding, conveyor line detection, and mobile inspection, achieve a closed loop from laboratory assessment to on-site production decisions. This method comprehensively addresses the core problems of existing compost maturity evaluation methods, such as inconsistent testing standards, insufficient accuracy, low efficiency, and difficulty in large-scale application. It provides ample data and model support for the standardization and intelligent upgrading of composting process optimization, product grading, market pricing, and the agricultural waste resource utilization industry.
[0074] Reference Figure 2 The results shown are the principal component analysis results of paired spectral information and hyperspectral imaging-derived image information. Among them, (a) is the principal component loading curve of spectral features; (b) is the principal component loading curve of image features; (c) is the variance explained rate (EVR) and cumulative variance explained rate (CEVR) of the spectral principal components; and (d) is the EVR and CEVR of the first 30 image principal components.
[0075] Interpretation Notes: A larger absolute value of the loading or a more pronounced peak and trough indicates a greater contribution of the corresponding band or image features to the principal component. Spectral information can be fully summarized by a few principal components, while image information requires more principal components to describe it, indicating that the image contains dispersed texture, grain morphology, and spatial organization information. This figure reflects differences in information structure and does not directly represent the quality of prediction performance.
[0076] Reference Figure 3 As shown, (ac) represents the changes in the prediction performance of the joint model on the four maturity indicators in the training, validation, and test sets; (d) represents the performance improvement rate of IMS under different datasets and evaluation indicators; (e) represents the Pearson correlation between the spectral principal components and the cross-target diagnostic image principal components; (f) represents the mutual information of the high-load image principal components and the comparison of the paired relative errors of the two types of models; and (g) represents the mutual information between the spectral principal components and the diagnostic image principal components.
[0077] Interpretation Notes: For R², a higher improvement rate is better; for mean absolute error, mean square error, mean relative error, and root mean square error, a greater decrease in error is better. Most correlation coefficients have low absolute values, indicating limited linear redundancy between spectral and image features. The overall mutual information is low, but there are locally high values, suggesting that the two types of features retain relatively independent information while also being correlated in some mature variations. The mean relative error of the joint model decreased significantly from 0.0497 to 0.0414 (p = 0.015), further supporting the predictive complementarity between the two models.
[0078] Reference Figure 4 As shown, (a) shows the sample quantity distribution of the "Immature 1–4" category under different composting times. The total stack height represents the total number of samples at the corresponding time, and the area of each color represents the sample quantity of the corresponding category. Different categories coexist in the same period, reflecting the heterogeneity and asynchronous nature of compost maturation changes. (b) compares the classification performance of artificial neural networks, random forests, extreme gradient boosting, and support vector machines, including accuracy, precision, recall, and F1 score.
[0079] Interpretation Notes: In Figure (a), the focus should be on observing whether the sample categories undergo directional migration over time, rather than solely judging the maturity effect based on the total height of the curve; the more dispersed the categories are at the same time, the more significant the differences between samples. In Figure (b), the closer each indicator is to 1, the better the classification performance, and the closer the four indicators are, the more balanced the model performance. In the figure, the Support Vector Machine performs best overall, followed by Extreme Gradient Boosting; all model indicators exceeding 0.90 indicate good overall classification performance.
[0080] Reference Figure 5 As shown, (a) is the validation result of IMS prediction performance under different random seeds; (b) is the permutation importance of the principal components of the spectrum and HSI derived image in the joint model; (c) is the IMS prediction result after adding Gaussian noise (σ= 0.1); and (d) is the IMS prediction result under the target feature perturbation stress test (ε= 0.1).
[0081] Interpretation Notes: The smaller the fluctuation of R² under different random seeds, the less dependent the model is on specific data partitions. Higher permutation importance indicates a greater impact of the feature on the prediction result, but does not necessarily imply causation. After adding noise and feature perturbation, R² only decreased from 0.868 to 0.854 and 0.863 respectively, and the scatter plot remained close to the diagonal, indicating that the model maintained good stability under the set internal perturbation conditions.
[0082] Reference Figure 6 As shown, (a) are the Grad-CAM visualization results of the principal components PC1 and PC4 related to edge features in the early, middle and mature stages; (b) are the Grad-CAM results of PC5 and PC7 related to texture features; and (c) are the Grad-CAM results of PC9, PC11 and PC13 related to shape features.
[0083] Interpretation Notes: In Grad-CAM, yellow and red areas indicate a high level of model focus; the focus area increases and tends to disperse in the mature stage, indicating that the particle edges, textures, and surface spatial organization change as the model matures.
[0084] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely principles of the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the claimed invention.
Claims
1. A compost maturity assessment method based on hyperspectral and image multimodal fusion, characterized in that, The specific steps are as follows: Step S1: Synchronously collect hyperspectral data and image data of the compost sample, and obtain the physicochemical / biological indicators corresponding to the compost sample; Step S2: Construct a comprehensive maturity score based on the physicochemical / biological indicators, and use the comprehensive maturity score as a common label anchor point for hyperspectral regression and image grading; Step S3: Preprocess and extract features from the hyperspectral data to obtain spectral features; The image data is preprocessed and features are extracted to obtain image features; Step S4: Using the comprehensive maturity score as the fusion anchor point, perform bidirectional enhancement, introduce the image features into the hyperspectral regression model to enhance the prediction accuracy of the maturity index, and introduce the spectral features and the prediction index output by the hyperspectral regression model into the image grading model to enhance the stability of maturity identification and grading, so that the image features and the spectral features form a bidirectional complementary enhancement. Step S5: Output compost maturity assessment results, which include at least one of the following: maturity classification results, continuous index prediction values, multi-level maturity levels, and model confidence scores; In step S4, the image features are introduced into the hyperspectral regression model by performing feature concatenation, cross-modal attention fusion, or intermediate layer fusion on the image features and the spectral features, and then inputting them into the regression model to compensate for the problem that the spectral features are insufficient in expressing spatial heterogeneity. The spectral features and prediction indicators are introduced into the image classification model by using the spectral features, the comprehensive maturity score of spectral prediction, and individual maturity indicators as additional inputs, auxiliary task objectives, soft labels, or ranking constraints to constrain image level boundaries and reduce the subjectivity of manual annotation.
2. The compost maturity assessment method based on hyperspectral and image multimodal fusion according to claim 1, characterized in that, The construction method of the comprehensive maturity score in step S2 includes: selecting at least two of the following as maturity indicators: C / N ratio, germination index, ammonium nitrogen, nitrate nitrogen, pH, electrical conductivity, water content, temperature stability, respiratory activity, and humification degree; determining the maturity threshold of each maturity indicator based on statistical methods; assigning weights to each maturity indicator using the analytic hierarchy process, entropy weight method, principal component weighting method, or grey relational weighting method; and multiplying the normalized score of each maturity indicator by its corresponding weight and summing the results to obtain the comprehensive maturity score.
3. The compost maturity assessment method based on hyperspectral and image multimodal fusion according to claim 1, characterized in that, The specific steps for obtaining spectral features in step S3 are as follows: Black and white correction is performed on the original hyperspectral data. The correction is based on the white board calibration data and the black field correction data. The correction formula is: R=(ID) / (WD), where I is the original hyperspectral signal, D is the dark field correction signal, and W is the white board calibration signal. After completing black and white correction, dark current correction is performed, and smoothing filter is used to smooth the spectral curve to retain effective spectral feature information. A standard normal transformation is performed on the smoothed data, and the spectral baseline drift is removed by the first derivative transformation to highlight the characteristic differences of the spectral absorption peaks; Reflectance normalization is performed to map the spectral reflectance values to the [0, 1] interval, thus unifying the dimensions of spectral data from different samples. Competitive adaptive reweighted sampling is used to initially screen the characteristic bands of the preprocessed hyperspectral data. Monte Carlo sampling and regression coefficients are used to compete in screening, eliminating redundant and irrelevant bands and retaining characteristic bands that are strongly correlated with compost maturity. Principal component analysis was used to reduce the dimensionality of the selected feature bands, mapping the high-dimensional spectral data to a low-dimensional space, and extracting the principal components with a cumulative variance contribution rate of ≥95% as the final spectral features.
4. The compost maturity assessment method based on hyperspectral and image multimodal fusion according to claim 1, characterized in that, The specific steps for obtaining image features in step S3 are as follows: White balance correction is performed on the original compost image. Background segmentation is performed by thresholding and morphological operations to remove background interference from non-compost areas in the image and retain the main compost area data. The segmented image is normalized for illumination, and a homomorphic filtering algorithm is used to equalize the image illumination distribution, eliminate image brightness differences, and complete the image data preprocessing. The preprocessed image is converted to multiple color spaces including RGB, HSV, and Lab. The mean, variance, and entropy of each channel are calculated to form the statistical features of the color space. At the same time, the contrast, correlation, energy, and homogeneity of the gray-level co-occurrence matrix are calculated as the texture features of the gray-level co-occurrence matrix. A lightweight convolutional neural network was built. The preprocessed compost image was input into the network and processed through convolution, pooling, and fully connected layers. The high-dimensional feature vector output by the fully connected layer of the network was extracted as a deep visual feature. The final image features are formed by integrating artificial image features with depth visual features.
5. The compost maturity assessment method based on hyperspectral and image multimodal fusion according to claim 1, characterized in that, The level division in steps S4 and S5 includes: using deep visual features to discover multi-level maturity candidate levels through clustering algorithms, using the clustering labels generated by the clustering algorithm as supervised learning labels to train a classification model to predict the level of new samples, and using the comprehensive maturity score and individual maturity index predicted by the spectral features to correct the image level; when the image level is inconsistent with the spectral prediction index, output a review prompt or reduce the confidence of the level.
6. The compost maturity assessment method based on hyperspectral and image multimodal fusion according to claim 1, characterized in that, The evaluation method also includes an interpretability analysis step: determining key spectral bands by at least one of permutation importance, SHAP value analysis, or feature band importance ranking; determining key regions of interest of the image grading model by Grad-CAM, saliency map, or attention map; jointly verifying the key spectral bands and key regions of interest with composting humification process, color evolution, and particle morphology changes, and outputting interpretability analysis results.
7. The compost maturity assessment method based on hyperspectral and image multimodal fusion according to claim 1, characterized in that, Step S2 also includes a closed-loop label construction step: for samples with complete physicochemical / biological test results, the comprehensive maturity score is directly calculated and maturity labels and multi-level labels are generated; for samples lacking some test indicators, the comprehensive maturity score or key maturity indicators are first predicted by the hyperspectral regression model, and then soft labels, auxiliary labels or ranking constraints are provided for the image grading model; for candidate levels obtained by image clustering, the comprehensive maturity score, germination index, C / N ratio, ammonium nitrogen and nitrate nitrogen are combined in reverse to perform level correction.
8. The compost maturity assessment method based on hyperspectral and image multimodal fusion according to claim 1, characterized in that: The sorting criteria for the multi-level maturity levels in step S5 include at least one of the following: median sampling time, temperature change trend, comprehensive maturity score, spectral principal components, key band reflectance, color mean, color saturation, texture uniformity, and Grad-CAM high-response region area. The indexes predicted by the spectral features and the interpretable results of the image features jointly constrain the level sorting, so that the level arrangement remains monotonically consistent with the composting and humification process and nitrogen conversion trend.
9. The compost maturity assessment method based on hyperspectral and image multimodal fusion according to claim 1, characterized in that, The evaluation method also includes online deployment and application steps: embedding the trained hyperspectral regression model and the image grading model into the composting reactor control system, conveyor line detection equipment, or mobile inspection terminal; after collecting compost sample data in real time through hyperspectral sensors and image acquisition equipment, automatically outputting maturity level, continuous index prediction values, and composting application suggestions; the composting application suggestions include at least one of the following: turning time, extending the maturity period, terminating maturity, product grading, and pricing reference.
Citation Information
Patent Citations
Hyperspectral detection method for ripeness of camellia oleifera fruits based on deep learning and sorting equipment
CN114112932A
Method for intelligently and accurately judging color, shape and state of tobacco leaves in baking process
CN120629064A
Straw decomposition effect evaluation method and system based on multi-source data analysis
CN121723032A