Synchronous nondestructive detection method and device for soybean mildew degree and protein content based on near infrared spectroscopy technology

CN122961945APending Publication Date: 2026-10-23CHINA AGRI UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611010683.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-08
Publication Date
2026-10-23

AI Technical Summary

Technical Problem

若直接采用单一特征空间同时完成两个任务,容易造成霉变敏感特征被蛋白质回归任务平滑,或蛋白质定量特征受到霉变分类噪声干扰;若分别建立两套完整的特征提取和预测流程,则会显著增加嵌入式设备的计算量和响应时间

Benefits of technology

本发明基于近红外光谱技术,构建涵盖不同品种及不同霉变阶段的大豆样本标准化数据库,并通过一阶导数预处理减弱光谱基线漂移、散射效应及背景噪声对检测结果的影响;在此基础上,提出双任务协同波长-流形特征提取算法DTC-WMFE,其以EMS-UVE作为前级波长纯化模块,通过蒙特卡洛重复采样和自适应阈值策略筛选与大豆霉变变化及品质劣变相关的关键特征波长,剔除无信息变量、背景噪声变量和冗余波段,再以A-LPP作为后级流形压缩模块,对筛选后的关键特征波长数据进行流形降维,提取能够表征样本局部非线性结构关系的光谱融合特征,从而提高模型输入特征的有效性、稳定性和可解释性。进一步地,本发明将霉变等级判别模型由单一类别输出扩展为霉变等级概率向量输出,并将该概率向量作为蛋白质含量预测分支的阶段性约束信息,构建由多个霉变阶段局部回归子模型组成的阶段自适应蛋白质含量预测模型。通过上述模型架构,霉变分类分支不再与蛋白质回归分支简单并列,而是为蛋白质预测提供阶段先验,从而降低同一光谱特征在双任务之间的负迁移;同时,在高置信样本下可仅调用单一局部回归子模型,在低置信或相邻等级边界样本下再进行多模型加权融合,由此兼顾预测精度、边界样本稳定性和嵌入式端计算效率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122961945A_ABST
    Figure CN122961945A_ABST
Patent Text Reader

Abstract

The application discloses a kind of soybean mouldy degree and protein content synchronous nondestructive testing method and device based on near infrared spectroscopy technique, belong to agricultural product detection technical field.The method acquires the near infrared spectrum data of different mouldy stage soybean and constructs database in combination with spore count value and protein physicochemical value;After the spectrum data is preprocessed, dual-task collaborative wavelength-manifold feature extraction algorithm DTC-WMFE is used for feature optimization, and spectrum fusion features with key wavelength interpretability and local manifold preservation are obtained;Then, a mouldy grade discrimination branch is constructed, and the probability vector of the test sample belonging to each mouldy grade is output, and the probability vector is used as the stage constraint information of protein content prediction branch, to drive multiple mouldy stage local regression sub-models for weighted fusion or confidence gating call, so as to realize the collaborative prediction of soybean mouldy degree and protein content.The application reduces the dual-task interference and reduces the redundant calculation of low-confidence samples and high-confidence samples based on the EMS-UVE and A-LPP feature extraction core, and has the advantages of fast detection speed, high prediction accuracy, non-destructive and early warning.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of non-destructive testing technology for agricultural products, and in particular relates to a non-destructive testing method and device for the degree of mold and protein content of soybeans based on near-infrared spectroscopy. Background Technology

[0002] Agricultural development is crucial to national food security and the stable supply of important agricultural products. With the expansion of grain production, storage, and distribution, grain quality and safety have received increasing attention. During harvesting, transportation, and storage, grain is susceptible to mold, nutritional deterioration, and toxic contamination due to factors such as temperature, humidity, and microbial contamination. This not only reduces the edible quality and processing value of grain but may also harm human and animal health. Therefore, establishing rapid and accurate methods for grain quality testing and risk early warning is of great significance for ensuring grain quality and safety and reducing post-harvest losses. Soybeans are an important grain, oilseed, and plant protein crop, rich in protein, unsaturated fatty acids, and various nutrients, and are widely used in food, feed, and industrial processing. Protein content is a key indicator for evaluating soybean quality and processing value. During storage, soybeans are susceptible to mold infection and spoilage due to changes in environmental temperature and humidity. Extracellular enzymes secreted by mold during growth decompose the internal nutrients of soybeans, causing protein degradation, resulting in decreased protein content, structural damage, and reduced processing performance. Some molds may also produce harmful metabolites such as aflatoxin, which can seriously threaten food and feed safety.

[0003] Soybean mold typically develops gradually from mild to severe, with significant differences in quality loss, toxin risk, and utilization depending on the degree of mold. Simply determining whether a sample is moldy is insufficient to meet the practical needs of storage management, graded disposal, and processing. Grading the degree of soybean mold helps to identify early mold risks in a timely manner, distinguishing between samples that are usable, require close monitoring, should be downgraded, or are prohibited from use. This provides a basis for warehouse ventilation and drying, batch isolation, processing diversion, and safety early warning, thereby reducing food waste and lowering food safety risks. Currently, the detection of soybean mold degree and protein content mainly relies on physicochemical analysis, microbial culture, and artificial sensory evaluation. While these methods can obtain relatively accurate results, they generally suffer from problems such as complex sample pretreatment, long testing cycles, high costs, destructive testing processes, and difficulty in achieving large-scale online testing. These methods cannot meet the needs of soybean storage, distribution, and processing for rapid, non-destructive, graded, and simultaneous testing.

[0004] In the field of near-infrared spectroscopy, existing methods typically treat mold detection and protein content prediction as separate tasks, or simply use the same set of spectral features to build separate classification and regression models. However, soybean mold grade is a discrete safety risk label, while protein content is a continuous nutritional quality indicator. The corresponding spectral response intensity, calibration error sources, and evaluation targets are not consistent. The weak absorption changes caused by early mold are easily masked by varietal differences, particle scattering, moisture fluctuations, and instrument drift, while protein-related absorption overlaps with the absorption ranges of moisture, fat, and mold metabolites. If a single feature space is used to complete both tasks simultaneously, mold-sensitive features are easily smoothed by the protein regression task, or protein quantification features are interfered with by mold classification noise. If two complete feature extraction and prediction processes are established separately, the computational load and response time of embedded devices will be significantly increased. Therefore, how to construct a synchronous detection model that can balance the accuracy of both tasks and on-site computational efficiency while preserving the interpretability of key wavelengths and local manifold structure is a technical obstacle that needs to be overcome in existing near-infrared soybean quality detection technologies. For the reasons mentioned above, there is an urgent need to establish a rapid, non-destructive testing method that can simultaneously detect the degree of mold and protein content in soybeans, and achieve synergistic optimization between accuracy and computational efficiency. Summary of the Invention

[0005] To overcome the aforementioned shortcomings, this invention provides a non-destructive detection method and apparatus for the degree of mold and protein content in soybeans based on near-infrared spectroscopy. This invention constructs a standardized soybean sample database covering multiple varieties and all stages of mold growth, innovatively designs a dual-task collaborative wavelength-manifold feature extraction algorithm to achieve efficient purification and nonlinear characterization of spectral features, and employs a stage-adaptive prediction architecture guided by mold probability to achieve synergistic optimization of dual-task accuracy and computational efficiency. Simultaneously, it integrates a portable detection device with both hardware and software, enabling rapid, non-destructive detection of "one test, two evaluations" while ensuring high detection accuracy. This provides reliable technical support for quality grading and food safety early warning throughout the entire process of soybean storage, acquisition, distribution, and processing.

[0006] The technical solution adopted by this invention to solve its technical problem is as follows:

[0007] A non-destructive method for simultaneous detection of soybean mold degree and protein content based on near-infrared spectroscopy includes the following steps: S1. Soybean samples were obtained as experimental materials, and artificial inoculation and controlled constant temperature and humidity culture of Aspergillus flavus were carried out. Samples were taken according to a preset time gradient. Raw near-infrared spectral data of soybean samples with different degrees of mold were collected. S2 measures the total number of fungal spores on the surface of soybean samples after spectral acquisition and classifies the degree of mold into different grades; simultaneously measures the protein content of each sample, and establishes a database by correlating the original spectral data of the samples obtained in step S1 with the mold grade and protein content of soybeans. S3 preprocesses the acquired raw spectral data and uses the dual-task collaborative wavelength-manifold feature extraction algorithm DTC-WMFE for feature screening and manifold dimensionality reduction to obtain spectral fusion features from the high-dimensional spectral data for mold grade discrimination and protein content prediction. S4 uses the spectral fusion feature matrix as input and the mold level label as output to train an extreme gradient boosting classification model, obtain a qualitative discrimination model for the degree of soybean mold, and outputs the probability vector of different mold levels of the test sample from the qualitative discrimination model for the degree of soybean mold. S5 uses the spectral fusion feature matrix, the true value of protein content, and the probability vector of mold level obtained in step S4 as constraints to construct a stage-adaptive protein content prediction model. The stage-adaptive protein content prediction model includes multiple support vector regression local sub-models corresponding to different mold levels, and the output results of each local sub-model are weighted and fused according to the probability vector of mold level to obtain the quantitative prediction value of soybean protein content. S6 collects near-infrared spectral data of the soybean to be tested, and performs preprocessing, wavelength purification and manifold compression in step S3 to obtain the spectral fusion feature matrix of the sample to be tested; then the spectral fusion feature matrix is ​​input into the qualitative discrimination model of soybean mold degree established in step S4 to obtain the mold level judgment result and mold level probability vector, and then the mold level probability vector is input into the stage adaptive protein content prediction model established in step S5 to realize the collaborative prediction of protein content guided by mold level.

[0008] To solve its technical problem, the present invention adopts the following technical solution: A non-destructive testing device for simultaneously detecting the degree of mold and protein content in soybeans based on near-infrared spectroscopy, used to implement the aforementioned method for simultaneously detecting the degree of mold and protein content in soybeans, the device comprising: The dark box housing has an internal detection chamber for placing the sample to be tested, thus creating a closed optical detection environment; The spectral acquisition module is located inside the dark box housing and includes a near-infrared spectrometer, an optical fiber coupled halogen light source, and an optical fiber probe. The sample carrying module is disposed on the dark chamber housing and includes a push-pull type material carrier slider; the push-pull type material carrier slider is movably installed on the dark chamber housing and is used to carry the soybean sample to be tested into the detection position, and is configured to cooperate with the dark chamber housing to form a dark chamber environment that isolates external light interference when pushed into place; The main control module is communicatively connected to the near-infrared spectrometer and the human-computer interaction module, and is configured to control the spectral acquisition module to perform data acquisition, execute preprocessing and feature extraction algorithms, and call the model to output detection results; The human-computer interaction module includes a touch screen, which is disposed on the surface of the dark box shell and connected to the main control module, and is used to receive user operation commands and display the mold level and protein content values.

[0009] The beneficial effects of this invention are as follows: This invention, based on near-infrared spectroscopy, constructs a standardized database of soybean samples covering different varieties and different stages of mold growth. First-order derivative preprocessing is used to reduce the impact of spectral baseline drift, scattering effects, and background noise on the detection results. Building upon this, a dual-task collaborative wavelength-manifold feature extraction algorithm, DTC-WMFE, is proposed. It uses EMS-UVE as a pre-stage wavelength purification module, employing Monte Carlo repeated sampling and an adaptive threshold strategy to screen key feature wavelengths related to soybean mold changes and quality deterioration, eliminating non-informative variables, background noise variables, and redundant bands. Then, A-LPP is used as a post-stage manifold compression module to perform manifold dimensionality reduction on the screened key feature wavelength data, extracting spectral fusion features that characterize the local nonlinear structural relationships of the samples, thereby improving the effectiveness, stability, and interpretability of the model's input features. Furthermore, this invention extends the mold growth level discrimination model from a single-class output to a mold growth level probability vector output, using this probability vector as stage-specific constraint information for the protein content prediction branch, constructing a stage-adaptive protein content prediction model composed of multiple local regression sub-models for different mold growth stages. With the above model architecture, the mold classification branch is no longer simply parallel to the protein regression branch, but provides a stage prior for protein prediction, thereby reducing the negative transfer of the same spectral feature between the two tasks; at the same time, only a single local regression sub-model can be called under high confidence samples, and multi-model weighted fusion can be performed under low confidence or adjacent level boundary samples, thus taking into account prediction accuracy, boundary sample stability and embedded computing efficiency.

[0010] Based on the aforementioned core algorithm, this invention further provides a portable intelligent detection device through integrated hardware and software design. Structurally, the device employs a push-pull slider combined with a sealed dark chamber design. Upon being pushed into the detection position, it automatically constructs a tightly sealed dark chamber environment, completely shielding the spectral signal from external ambient light interference at a physical level. In terms of system control, the embedded main control system integrates an active heat dissipation module, ensuring a constant core temperature under continuous high-load operation, effectively suppressing spectral distortion and model prediction deviations caused by thermal drift. Thanks to the above design, the device is extremely easy to operate; users only need to place the soybean in the slider groove and push it in to complete automatic detection and simultaneously read the mold level and protein content within 6 seconds. This highly efficient "one test, two evaluations" model requires no professional personnel and consumes no chemical reagents, greatly reducing testing costs and technical barriers. It effectively solves the shortcomings of traditional testing technologies in terms of early warning capabilities, testing efficiency, and on-site applicability. The device can simultaneously determine the degree of early soybean mold growth and accurately capture and quantify the dynamic changes in internal protein content during the mold infection process, thus providing a fast, accurate, and robust solution for quality monitoring and food safety assurance at modern grain storage and acquisition sites. Attached Figure Description

[0011] The present invention will be further described below with reference to the accompanying drawings and specific embodiments.

[0012] Figure 1 This is a flowchart of the non-destructive detection method for the degree of mold and protein content of soybeans based on near-infrared spectroscopy technology according to the present invention. Figure 2 This is a schematic diagram of the spectral acquisition platform structure of the present invention; Figure 3 This involves the analysis of spectral signal-to-noise ratio and growth rate under different scan numbers; Figure 4 It is a near-infrared spectral band image; Figure 5 The EMS-UVE module in the DTC-WMFE algorithm is used to screen characteristic bands of the mold grading model. Figure 6 It is the result of mold grading modeling by combining DTC-WMFE feature extraction with XGBoost; Figure 7 These are the characteristic bands of the protein content prediction model screened by the EMS-UVE module in the DTC-WMFE algorithm; Figure 8 This is the protein content modeling result of the DTC-WMFE feature extraction combined with the adaptive SVR stage; Figure 9 This is a structural diagram of the detection device of the present invention; Figure 10This is a performance analysis chart for the degree of mold growth; Figure 11 This is a graph showing the performance analysis of protein content prediction; Figure 12 This is a schematic diagram of an electronic device.

[0013] The components include: 1. Computer; 2. Light source; 3. Near-infrared spectrometer; 4. Fiber optic bundle; 5. Dark box housing; 6. Detection probe; 7. Optical support; 8. Main control unit; 80. Touch screen; 9. Sample carrier; 10. Electronic equipment; 11. Processor; 12. Memory. Detailed Implementation

[0014] The technical solutions of the present invention will be clearly and completely described below with reference to the embodiments and accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.

[0015] like Figure 1 As shown, this embodiment of the invention provides a method for simultaneous non-destructive detection of soybean mold degree and protein content based on near-infrared spectroscopy, including: S1: Obtain soybean samples for artificial inoculation with Aspergillus flavus and controlled constant temperature and humidity culture, and sample according to time gradient; use a near-infrared device to collect raw spectral data of samples with different degrees of mold.

[0016] S2: Use the standard spore counting method to classify the mold level of the samples, and use the national standard method to simultaneously determine the protein content; match the above physicochemical values ​​with the original spectral data in step S1 to establish a database.

[0017] S3: The acquired raw spectral data is preprocessed, and the dual-task collaborative wavelength-manifold feature extraction algorithm DTC-WMFE is used for feature selection and dimensionality reduction. DTC-WMFE uses EMS-UVE as the pre-stage wavelength purification module and A-LPP as the post-stage manifold compression module to obtain spectral fusion features from high-dimensional spectral data.

[0018] S4: Divide the samples into training and validation sets; use the spectral fusion features obtained in step S3 as input variables and the soybean mold level as output label, construct a qualitative discrimination model for soybean mold level using the Extreme Gradient Boosting (XGBoost) algorithm, and output the mold level probability vector; use the spectral fusion features of the validation set and the actual mold level to verify the model performance. If the classification accuracy, precision, recall, and F1 score of the validation set are all greater than 0.92, the qualitative discrimination model is deemed qualified.

[0019] S5: Based on the same sample division, the spectral fusion features obtained in step S3 are used as independent variables, the corresponding true values ​​of soybean protein content are used as dependent variables, and the probability vector of mold level output in step S4 is introduced to construct a stage-adaptive protein content prediction model. The model contains multiple support vector regression local sub-models corresponding to different mold levels, and weighted fusion or confidence-gated calls are performed according to the probability vectors. The model performance is verified using the spectral fusion features and true values ​​of protein content on the validation set. If the correlation coefficient R of the validation set is greater than 0.90 and the root mean square error of prediction (RMSEP) is less than 1.5%, the quantitative prediction model is deemed qualified.

[0020] S6: Collect near-infrared spectral data of the soybean to be tested, preprocess and extract features using the DTC-WMFE algorithm described in step S3, and then input the extracted spectral fusion features into the qualitative discrimination model established in step S4 to obtain the mold grade and the mold grade probability vector. Then, based on the probability vector, call the stage adaptive protein content prediction model established in step S5 to simultaneously output the mold grade and protein content of the soybean to be tested.

[0021] The following detailed description of the implementation steps, technical details, and technological advancements of the present invention, in conjunction with multiple embodiments, provides a comprehensive overview. These embodiments systematically cover the entire technical chain of the present invention, from sample preparation and data acquisition, core algorithm design and model construction to detection device integration and performance verification. Through standardized experimental procedures and quantifiable performance indicators, the feasibility, accuracy, and practicality of the technical solution of the present invention are fully verified, enabling those skilled in the art to fully understand the core innovations and engineering implementation path of the present invention.

[0022] Example 1 This embodiment constructs a near-infrared spectral acquisition platform for soybean quality detection. For example... Figure 2 As shown, the core architecture of this platform mainly includes a computer (1), a light source (2), a near-infrared spectrometer (3), a fiber optic bundle (4), a darkroom housing (5), a detection probe (6), and an optical support (7). The core detection hardware integrates an NIR-F210 fiber optic near-infrared spectrometer (3), with its detection range set to cover 900 nm. The optical resolution is better than 12 nm, with an exposure time of 0.635 ms. The accompanying optical component is an LS-NIR100 fiber-coupled halogen lamp light source 2, whose spectral range is between 380 nm and 40 nm. Between 2600 nm and 2600 nm, it features physical dimming and stable output performance. The aforementioned components are connected via a custom-designed Y-shaped reflective quartz fiber bundle 4, which employs a SIH600 step-index fiber core with a core diameter of 600 micrometers. At the probe end, the fiber bundle 4 presents a six-ring-one structural layout, specifically with a signal acquisition fiber at the center surrounded by six illumination fibers. This ensures uniform illumination of the sample surface and maximizes the collection efficiency of diffuse reflection signals.

[0023] The entire acquisition process was conducted in a controlled darkroom environment with a temperature of 25±1℃ and a relative humidity of approximately 40% to eliminate interference from stray ambient light on weak signals. Furthermore, the system required a 30-minute preheating period to reach thermal equilibrium before formal operation, and reference spectrum calibration was performed using a standard white board to ensure that the reflectance intensity remained at 80% of the instrument's maximum detection limit.

[0024] Based on the aforementioned platform environment, this embodiment systematically optimized key acquisition parameters through gradient experiments. First, distance step tests were conducted within a range of 11 mm to 16 mm. Experimental results show that when the acquisition distance between the detection probe 6 and the sample is set to 14 mm, the spectral intensity reaches its peak value of approximately 5.6. 10 5 At this distance, the coupling efficiency between the incident light, the reflection path, and the probe geometry reaches its optimal level; therefore, this distance is determined as the best detection distance. To evaluate the spectral quality under different scan counts, this embodiment uses the signal-to-noise ratio (SNR) as an indicator, defined as the ratio of the mean to the standard deviation of the absorbance across the entire wavelength range in the first n scans. A higher SNR indicates a more stable spectrum. Based on this, to balance spectral quality and acquisition efficiency, this embodiment introduces the SNR growth rate to measure the quality improvement brought about by each additional scan. By simultaneously analyzing the trend of SNR change and its growth rate, the optimal number of scans to meet the spectral stability requirements can be determined.

[0025]

[0026]

[0027] in, For the front n The average absorbance across the entire wavelength range during each scan; For the front n The standard deviation of absorbance across the entire wavelength range in each scan; From Next time n SNR growth rate per scan.

[0028] like Figure 3As shown, the stability threshold was set to 0.5%. Through continuous scanning analysis of soybean samples covering four levels of mold, the data showed that the spectral signal-to-noise ratio increased with the number of scans. However, after five scans, the increase in signal-to-noise ratio from further increasing the number of scans was less than the preset threshold of 0.5%, indicating that the signal quality had entered a plateau.

[0029] This embodiment ultimately determined that performing 5 repeated scans at a detection distance of 14 mm was the optimal acquisition strategy, balancing detection timeliness and spectral signal-to-noise ratio. Figure 4 As shown, this embodiment collected the original near-infrared spectral curves of soybean samples covering the 900~1650 nm wavelength band.

[0030] Example 2 This embodiment selects four representative soybean varieties: Dongsheng No. 2, Heilong 43, Ruidou No. 1, and Zhonghuang 13. 150 healthy soybeans from each variety are randomly selected and artificially inoculated with Aspergillus flavus. The inoculated samples are placed in a biochemical incubator (25℃, 90% relative humidity) to accelerate mold induction. Samples are taken every 24 hours to obtain gradient samples covering different stages of mold growth.

[0031] The spore counting method was used to determine the degree of mold, and it was strictly implemented in accordance with LS / T 6132-2018 "Detection of Fungi in Grain Storage - Spore Counting Method". The severity of mold was assessed by quantitatively analyzing the fungal spore load on the surface and epidermis of soybeans.

[0032] (1) Spore elution and extraction: To ensure the representativeness of the test results, a standardized spore elution procedure was designed in this embodiment. First, the soybean samples from each sampling point were accurately weighed and placed in 15 mL centrifuge tubes, and three times the sample volume of sterile water was added. Then, the centrifuge tubes were placed on a vortex mixer and vigorously shaken at a frequency of 120-150 times / min for about 1 minute to allow the fungal spores on the soybean surface and in the epidermal folds to fully enter the aqueous phase and form a suspension. After the eluent was precisely filtered through a 300-mesh filter cloth to remove impurities, the filtrate was collected and transferred to 1.5 mL centrifuge tubes using a pipette for storage in the dark until analysis.

[0033] (2) Microscopic counting and calculation: Quantitative observation of the spore suspension was performed using a hemocytometer. Before counting, the suspension was remixed using a vortex mixer, and an appropriate amount of sample solution was injected into the cleaned and dried counting chamber through capillary action. The chamber was left to stand for 30 seconds to allow the spores to settle completely. Under the microscope, a differential statistical strategy was used based on the spore distribution density.

[0034] During the counting process, first use a low-power objective lens to locate the counting area, then switch to a high-power objective lens to accurately count the spores in the target square. When the average number of spores in the five squares is greater than 10, the following calculation method can be used:

[0035] If the number of spores in each Chinese square is less than 10, to improve statistical reliability, the counting range should be expanded to 25 Chinese squares, and the calculation should be performed as follows:

[0036] (3) Grading criteria: Based on the count of fungal conidia in storage and referring to the grain safety evaluation criteria in Table 1, the fungal hazard level of soybean samples can be divided into four levels: safe, critical, hazardous and seriously hazardous.

[0037] Table 1 Reference Table for Grain Storage Safety Evaluation Levels

[0038] In this embodiment, a total of 340 soybean samples were collected. The samples without mold were classified as "healthy," while the rest were divided into three levels based on the degree of mold growth: critical, hazardous, and severely hazardous. The number of samples in the healthy, critical, hazardous, and severely hazardous levels were 75, 59, 128, and 78, respectively.

[0039] To quantify the impact of mold on the nutritional quality of soybeans, this embodiment uses the Dumas combustion method to determine the true value of protein content, strictly following the standard GB / T 31578-2015 "Grain and Oil Inspection: Determination of Crude Protein in Grains and Products - Dumas Combustion Method". First, sample pretreatment is performed: soybean samples that have undergone spore elution are placed in 9 mm petri dishes according to their number and dried in a precision forced-air drying oven at 50-60 ℃ for 12 hours. The dried samples are then thoroughly pulverized using a grinder and sieved through a 20-mesh standard sieve. To ensure detection accuracy, the grinding and sieving equipment is thoroughly cleaned after each sample processing to prevent cross-contamination. Next, the combustion determination stage begins: 100-150 mg of soybean sample powder is accurately weighed, wrapped and sealed in aluminum foil, and placed in the sample pan of the Dumas nitrogen analyzer for high-temperature combustion. 100-150 mg of standard and thoroughly mixed soybean protein sample are also placed in the sample pan, wrapped in aluminum foil. After high-temperature combustion, the instrument software can directly read the initial protein content of the sample. After all samples have been burned, a correction factor is calculated based on the standard, and the protein content of the samples is corrected accordingly. The formula for calculating soybean protein content is as follows:

[0040] in, denoted as , where is the nitrogen content measured in the sample; F is the nitrogen-protein conversion factor; and K is the standard correction factor.

[0041] As shown in Table 2, the protein content of the total sample ranged from 33.61%. The percentage of protein content in the training set was 55.47%, with a mean of 42.57% and a standard deviation of 3.39%, indicating that there are certain differences in protein composition among the samples, which can well cover the actual variation range under different mold levels. The maximum and minimum values ​​of the training set are consistent with the total sample, at 55.47% and 33.61% respectively, with a mean of 42.71% and a standard deviation of 3.61%, indicating that the training sample has a wider distribution and includes extreme values ​​of protein content, which is beneficial for the model to learn the differential characteristics under different mold levels.

[0042] Table 2. Statistical analysis of protein content in soybean samples

[0043] Example 3 Based on the aforementioned near-infrared spectroscopy acquisition platform and physicochemical analysis (see Examples 1 and 2), this embodiment provides a modeling method based on feature variable screening and dimensionality reduction optimization to achieve accurate prediction of soybean mold degree and protein content.

[0044] First, the original spectra are preprocessed using the first derivative to eliminate baseline drift during spectral acquisition and effectively enhance the identification of characteristic absorption peaks. Then, the SPXY algorithm is used to precisely divide all 340 valid samples into training and validation sets at a 3:1 ratio. This algorithm ensures that the selected 255 training samples and 85 validation samples are highly representative in multidimensional space by comprehensively calculating the distribution distance of the samples in the spectral feature space and the physicochemical true value space.

[0045] After completing the sample partitioning, this embodiment employs the dual-task collaborative wavelength-manifold feature extraction algorithm DTC-WMFE to optimize the features of the preprocessed near-infrared spectral data. DTC-WMFE is based on the integrated sampling non-informative variable elimination method EMS-UVE and the adaptive dimensionality-preserving projection algorithm A-LPP, organizing them into a unified feature extraction architecture of pre-stage wavelength purification and post-stage manifold compression.

[0046] Specifically, EMS-UVE is first used as the pre-feature screening method, introducing a Monte Carlo repeated sampling mechanism and random noise variables to evaluate the stability of spectral variables. In each round of Monte Carlo sampling, a random noise matrix following a normal distribution is generated and concatenated with the preprocessed true spectral matrix to form an extended spectral matrix. Then, a partial least squares regression model is established on the extended spectral matrix, and the stability index of each wavelength variable is calculated based on the regression coefficients obtained from multiple iterations. This index is used to quantify the strength and robustness of the contribution of each wavelength variable to the model.

[0047]

[0048] in, The mean of the regression coefficients; The standard deviation is denoted as .

[0049] Since the stability index is already taken as an absolute value, this embodiment adopts a one-sided upper threshold strategy. The threshold is adaptively constructed from the stability distribution of the noise variable, and the calculation formula is:

[0050] in, and These are the mean and standard deviation of the noise variable stability, respectively. The strict coefficient is set to k=7 to ensure that only the characteristic bands that make significant contributions are retained.

[0051] Only true spectral wavelengths with stability indices greater than the threshold T are retained as key feature wavelengths, thereby eliminating background noise variables, uninformative variables, and redundant bands that are weakly correlated with the detection indicators, and reducing collinearity and random interference in high-dimensional spectral data.

[0052] After obtaining the key feature wavelengths selected by EMS-UVE, the A-LPP algorithm is further used for dimensionality reduction optimization. The A-LPP algorithm uses the key feature wavelength matrix as input to construct an adjacency graph of the training set samples to describe the local manifold structure between samples, and traverses different numbers of feature components within a preset dimension range. Subsequently, the low-dimensional features obtained under different dimensions are input into the classification model, and the classification performance of the validation set is used as feedback signal to automatically determine the optimal number of feature components. Through this step, the interpretability of the key wavelengths selected by EMS-UVE is preserved, and the nonlinear local structural information between moldy samples is further explored.

[0053] Those skilled in the art can adjust the nearest neighbor parameter k within the range of 5 to 20 (preferably setting it to 11) based on the sample size and distribution. The local preserving projection algorithm obtains the projection vector by solving the following generalized characteristic equation:

[0054] Where X is the preprocessed spectral matrix, and D is the degree matrix (its diagonal elements) L = D - W is the Laplacian matrix, and a is the projection vector to be found.

[0055] Furthermore, a nearest neighbor mapping mechanism is introduced to address the out-of-sample expansion problem of the validation set. This mechanism determines the optimal feature dimension by using the validation set correlation coefficient as an evaluation metric during the traversal of different dimensionality reduction dimensions. For any validation set sample... Its manifold features projected onto a lower-dimensional space This is obtained through the following mapping relationship:

[0056] in, This is the projection matrix composed of the first d optimal eigenvectors. This mapping mechanism ensures that the test sample can retain the local manifold topology constructed from the training set, thereby achieving accurate dimensionality reduction of the features.

[0057] Based on the spectral fusion features obtained from the DTC-WMFE cascade feature extraction, three soybean mold grading prediction models—SVC, RF, and XGBoost—were constructed, respectively. Figure 5 As shown, the cascaded feature extraction process first uses the aforementioned EMS-UVE algorithm to screen the preprocessed high-dimensional near-infrared spectral data for feature wavelengths. Through Monte Carlo repeated sampling and noise variable threshold comparison, wavelengths without information, background noise wavelengths, and redundant bands are eliminated to obtain feature wavelengths that are closely related to the degree of soybean mold and have high stability. Subsequently, the feature wavelength matrix screened by EMS-UVE is used as the input of the A-LPP algorithm to further extract low-dimensional feature components that can maintain the local nonlinear structure of the sample, thereby forming a spectral fusion feature that has both feature wavelength interpretation and manifold structure characterization capabilities.

[0058] The prediction results of each model are shown in Table 3. The XGBoost model has 12 feature wavelengths selected by EMS-UVE and 9 feature components extracted by A-LPP. The model performs the best, with training set accuracy, precision, recall and F1 score of 0.9647, 0.9657, 0.9607 and 0.9648 respectively, and validation set accuracy, precision, recall and F1 score of 0.9529, 0.9594, 0.9453 and 0.9530 respectively.

[0059] The above results show that EMS-UVE can effectively screen for mold-sensitive characteristic wavelengths, and A-LPP can further extract low-dimensional manifold characteristic components on this basis. The cascaded combination of the two can reduce the dimensionality of spectral data and noise interference, and improve the classification accuracy, stability and generalization ability of soybean mold grading model.

[0060] Table 3. Prediction results of different classification models after DTC-WMFE cascaded feature extraction

[0061] To evaluate the generalization ability of the DTC-WMFE-XGBoost model, this embodiment plots a comparison chart of the true and predicted classes on the validation set, as well as a confusion matrix, as shown below. Figure 6 As shown in the figure, the results indicate that the predicted categories for the vast majority of samples are consistent with the actual categories, and the model can accurately identify different mold levels. Among them, the first category (safety level) and the third category (hazard level) performed well, with an accuracy rate of 100%. Only a small number of adjacent levels were misclassified, and no serious cross-level misclassifications occurred. Overall, the DTC-WMFE-XGBoost model performed stably on the 85 validation samples, therefore this model was selected as the soybean mold level classification model.

[0062] To predict the protein content of soybean samples with different degrees of mold, this embodiment uses an EMS-UVE-A-LPP cascaded feature extraction method to optimize the features of near-infrared spectral data. The feature selection and dimensionality reduction process is as follows: Figure 7 As shown in Table 4, quantitative prediction models were established by combining four machine learning models: PLSR, SVR, RF, and XGBoost. The prediction results of each model are shown in Table 4.

[0063] Table 4. Prediction results of the protein content prediction model after DTC-WMFE feature extraction.

[0064] Figure 8 The scatter distribution of predicted and true values ​​for the model on the training and validation sets is shown. Most sample points are distributed near the reference diagonal, indicating a high degree of consistency between the predictions and the true values. The prediction bias is small and the distribution is relatively uniform in both the low-protein and high-protein ranges, with no obvious outliers or deviations. This demonstrates that the DTC-WMFE-SVR model not only performs well in the training phase but also exhibits strong generalization ability and stability in the validation phase, accurately predicting soybean protein content. Ultimately, SVR was chosen as the basis for the local regression sub-model of protein content in this embodiment, providing a modeling foundation for the subsequent development of adaptive protein content prediction models and online detection equipment.

[0065] Based on the aforementioned classification and regression models, this embodiment further constructs a stage-adaptive protein content prediction architecture guided by mold growth probability. Specifically, the DTC-WMFE-XGBoost mold growth level discrimination model outputs a probability vector P=(p1, p2, p3, p4), representing the probability that a sample belongs to the safe, critical, hazardous, and severe hazardous levels, respectively. Subsequently, SVR local regression sub-models f1, f2, f3, and f4 are trained for the four mold growth stages, respectively, and then... The protein content fusion prediction value is obtained by p1·f1(X) + p2·f2(X) + p3·f3(X) + p4·f4(X). For samples where the probability of the maximum mold growth level exceeds the preset confidence threshold, the system only calls a single SVR local sub-model for the corresponding stage to reduce repeated regression calculations. For boundary samples of adjacent levels such as critical and hazard, multiple local sub-models are called and probabilistically weighted and fused to improve the prediction stability of boundary samples. This model architecture uses mold growth stage information to constrain and schedule the protein prediction branches, thereby achieving a balance between prediction accuracy and computational efficiency.

[0066] Example 4 This embodiment provides a portable rapid soybean quality testing device. For example... Figure 9 As shown, the device adopts a compact, integrated desktop cabinet structure. Its main body is a custom-designed 3D-printed shell, manufactured in sections and precisely assembled into a darkroom housing 5, with a maximum geometric dimension of approximately 500 mm × 400 mm × 500 mm. To optimize the viewing angle and operating experience, the front control panel of the darkroom housing 5 features an ergonomically tilted design. A touchscreen 80 is integrated on its left side as the main human-machine interface, used to receive user commands and display mold level and protein content values. A dedicated sample detection port is located on the right side, housing a sample carrying device 9, specifically a push-pull slider. This slider is movably mounted on the darkroom housing 5 and is used to carry the soybean sample to be tested into the detection position. When pushed into place, it cooperates with the darkroom housing 5 to form a dark chamber environment that isolates external light interference. The surface of the push-pull slider has positioning grooves to fix the soybean sample to be tested, ensuring a consistent detection distance for each measurement.

[0067] In terms of internal hardware integration, the dark chamber housing 5 features a structured design to create a fully enclosed darkroom, shielding it from stray light interference. The core control unit 8 within housing 5 is a Raspberry Pi, which establishes a communication link with the NIR-F210 fiber optic near-infrared spectrometer 3 via a high-speed data interface. The optical system is stably illuminated by an LS-NIR100 fiber-coupled halogen lamp light source 2, and the probe light is transmitted and acquired via a custom-designed Y-shaped quartz fiber bundle 4. The fiber optic probe is vertically locked 14 mm above the sample carrier 9 via an optical bracket 7, ensuring constant detection geometry. Furthermore, a heat dissipation matrix and fan are located on the side of housing 5 to ensure the long-term operational stability of heat-generating components such as the Raspberry Pi and the light source 2. Based on this integrated platform, users can obtain real-time detection results of soybean mold grade and protein content via a touchscreen 80, achieving efficient on-site monitoring of soybean quality.

[0068] Based on the aforementioned hardware platform, this embodiment developed a supporting quality monitoring software system. This software is based on a Python programming environment and utilizes the PyQt5 framework to construct a graphical user interface (GUI). The software deeply integrates the optimized DTC-WMFE-XGBoost mold grade discrimination model and DTC-WMFE-SVR protein content prediction model from Embodiment 3. It employs parallel processing logic, synchronously calling the qualitative discrimination model and quantitative prediction model for real-time feature analysis and simultaneous calculation after acquiring spectral data, ensuring that the response speed and accuracy of a single sample test meet the preset quality monitoring requirements.

[0069] The rapid soybean quality testing device in this embodiment mainly includes the following steps when performing soybean quality testing: The first step is to place the soybean sample to be tested into the positioning groove of the sample carrying module, and push the push-pull carrying slider until it reaches the limit position, so that the sample enters the predetermined detection position inside the dark chamber shell 5, forming a closed dark chamber environment. The second step involves triggering a data acquisition command through the human-computer interaction interface. The main control unit 8 drives the spectral acquisition module to scan the soybean sample five times, and the average value is taken to obtain the raw near-infrared spectral data. The third step is for the main control unit 8 to preprocess and extract features from the raw spectral data, and then input the extracted feature data into the built-in qualitative discrimination model for soybean mold degree and quantitative prediction model for soybean protein content, respectively. The fourth step involves the qualitative discrimination model for the degree of soybean mold outputting the determination result of the degree of mold in soybeans, and the quantitative prediction model for soybean protein content outputting the predicted value of soybean protein content. Both results are then displayed simultaneously on the human-computer interaction screen.

[0070] To comprehensively evaluate the overall detection performance of the device, this experiment selected 50 soybean samples with different degrees of mold. During the test, the device demonstrated good operating efficiency, with statistics showing an average response time of 5.6 seconds for detecting a single sample. The experiment systematically recorded and saved the original spectral data, predicted protein values, and mold grade determination results.

[0071] In the task of grading the degree of mold, such as Figure 10 As shown, the device achieved a classification accuracy of 0.9200 and an F1 score of 0.9208 on the test set. The confusion matrix results show that the model has extremely high accuracy in identifying health and severe hazard levels; although there is a small amount of confusion between adjacent levels such as critical and hazard, the overall prediction curve is highly consistent with the true categories, confirming the reliability of the device in qualitative discrimination.

[0072] In terms of quantitative prediction of protein content, the test sample covered 34.42%. A wide-range gradient of 49.78%. (For example...) Figure 11 As shown, the predicted values ​​and the actual values ​​maintained a high degree of consistency across the entire range, with the sample points closely converging near the 1:1 reference line. Statistical indicators show that the correlation coefficient R reached 0.906, and the root mean square error (RMSE) was 1.430%.

[0073] This embodiment also evaluated the thermal stability of the device under continuous operation. When the device was started at an initial ambient temperature of 25.0 °C, the internal core temperature showed an upward trend during the first 30 minutes of operation. Subsequently, the rate of temperature rise gradually slowed down as the dynamic balance between internal heat generation and the heat dissipation system was established. After approximately 60 minutes of operation, the internal temperature of the device finally stabilized at around 55.0 °C and remained constant. These test results confirm that the device can maintain excellent thermal stability under long-term continuous operation, and that the operating temperature remains within the safe threshold range of the core electronic components.

[0074] This device demonstrates excellent performance in determining the degree of mold growth, measuring protein content, and ensuring hardware reliability, fully meeting the high-precision, non-destructive, and rapid testing requirements under complex environments at the storage site.

[0075] Example 5 This embodiment provides a schematic diagram of an electronic device 10. For example... Figure 12 As shown, the electronic device 10 of this embodiment includes: a processor 11, a memory 12, and a computer program 13 stored in the memory 12 and executable on the processor 11, such as a method program for simultaneous non-destructive detection of soybean mold degree and protein content based on near-infrared spectroscopy. When the processor 11 executes the computer program 13, it implements the steps in the above embodiment of the method for simultaneous non-destructive detection of soybean mold degree and protein content, for example... Figure 1The steps are shown.

[0076] For example, computer program 13 may be divided into one or more modules / units, one or more of which are stored in memory 12 and executed by processor 11 to complete the present invention. One or more modules / units may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of computer program 13 in electronic device 10.

[0077] Electronic device 10 can be a desktop computer, laptop, handheld computer, cloud server, or other computing device. Electronic device 10 may include, but is not limited to, a processor 11 and a memory 12. Those skilled in the art will understand that... Figure 12 This is merely an example of electronic device 10 and does not constitute a limitation on electronic device 10. It may include more or fewer components than shown, or combine certain components, or different components. For example, electronic device 10 may also include input / output devices, network access devices, buses, etc.

[0078] The processor 11 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.

[0079] The memory 12 can be an internal storage unit of the electronic device 10, such as a hard disk or RAM of the electronic device 10. The memory 12 can also be an external storage device of the electronic device 10, such as a plug-in hard disk, Smart Media Card (SMC), Secure Digital (SD) card, FlashCard, etc., equipped on the electronic device 10. Furthermore, the memory 12 can include both internal and external storage units of the electronic device 10. The memory 12 is used to store computer programs and other programs and data required by the electronic device 10. The memory 12 can also be used to temporarily store data that has been output or will be output.

[0080] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0081] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0082] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0083] In the embodiments provided by this invention, it should be understood that the disclosed devices / electronic devices and methods can be implemented in other ways. For example, the device / electronic device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0084] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0085] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0086] If integrated modules / units are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of the present invention can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc.

[0087] It should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for simultaneous non-destructive detection of soybean mold degree and protein content based on near-infrared spectroscopy, characterized in that, Includes the following steps: S1 collected raw near-infrared spectral data of soybean samples with different degrees of mold; S2 determines the total number of fungal spores on the surface of each sample after collection and classifies their degree of mold into different levels; simultaneously determines the protein content of each sample; and establishes a database by correlating the original spectral data of each soybean sample obtained in step S1 with its degree of mold and protein content. S3 performs first-order derivative preprocessing on the raw spectral data to eliminate baseline drift and background interference; Subsequently, the dual-task collaborative wavelength-manifold feature extraction algorithm DTC-WMFE was used to optimize the features of the preprocessed high-dimensional spectral data. The DTC-WMFE uses the integrated Monte Carlo stability non-information variable elimination method EMS-UVE as the pre-stage wavelength purification module and the adaptive dimension local preservation projection algorithm A-LPP as the post-stage manifold compression module, and outputs a spectral fusion feature matrix for mold grade discrimination and protein content prediction. S4 uses the spectral fusion feature matrix as input and the mold level label as output to train an extreme gradient boosting classification model, obtain a qualitative discrimination model for the degree of soybean mold, and outputs the probability vector of different mold levels of the test sample from the qualitative discrimination model for the degree of soybean mold. S5 uses the spectral fusion feature matrix, the true value of protein content, and the probability vector of mold level obtained in step S4 as constraints to construct a stage-adaptive protein content prediction model. The stage-adaptive protein content prediction model includes multiple support vector regression local sub-models corresponding to different mold levels, and the output results of each local sub-model are weighted and fused according to the probability vector of mold level to obtain the quantitative prediction value of soybean protein content. S6 collects near-infrared spectral data of the soybean to be tested, and uses step S3 to perform preprocessing, wavelength purification and manifold compression to obtain the spectral fusion feature matrix of the sample to be tested. Subsequently, the spectral fusion feature matrix is ​​input into the qualitative discrimination model for soybean mold degree established in step S4 to obtain the mold level determination result and the mold level probability vector. Then, the mold level probability vector is input into the stage adaptive protein content prediction model established in step S5 to realize the collaborative prediction of protein content guided by mold level.

2. The detection method according to claim 1, characterized in that, In step S1, spectral data for each sample are collected five times consecutively and averaged to reduce random noise interference; the near-infrared spectral scanning range is 900. 1650nm.

3. The detection method according to claim 1, characterized in that, In step S2, the degree of mold growth is divided into four levels: safe, critical, hazardous, and severely hazardous. To determine the protein content of each sample, the total nitrogen content of soybeans is determined by the Dumas combustion method and converted into protein content.

4. The detection method according to claim 1, characterized in that, In step S3, the DTC-WMFE algorithm includes: First, performing Monte Carlo repeated sampling on the near-infrared spectral data after first-order derivative preprocessing, and introducing random noise variables and a correction model in each sampling to calculate the stability index of each wavelength variable in multiple samplings; then, based on the stability index and an adaptive threshold constructed from the noise variable distribution, removing uninformative variables, background noise variables, and redundant bands with stability below the threshold to obtain the key feature wavelength matrix; then, using the key feature wavelength matrix as input, constructing a sample adjacency graph using A-LPP and traversing the projection dimensions within a preset dimension range; finally, determining the optimal projection dimension based on a comprehensive evaluation index of mold grade discrimination performance and protein content prediction performance, and outputting a spectral fusion feature matrix that combines physical wavelength interpretation and nonlinear local topology preservation.

5. The detection method according to claim 1, characterized in that, In step S5, the probability vector of mold level is denoted as P=(p1, p2, p3, p4), where p1, p2, p3, and p4 represent the probabilities that the sample to be tested belongs to the safe, critical, hazardous, and severe hazardous levels, respectively; the stage-adaptive protein content prediction model includes four local regression sub-models f1, f2, f3, and f4, and the predicted protein content values ​​are calculated according to... =p1·f1(X)+p2·f2(X)+p3·f3(X)+p4·f4(X) are fused, where X is the spectral fusion feature matrix output by DTC-WMFE.

6. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, it implements the steps of the method for simultaneous non-destructive detection of soybean mold degree and protein content as described in any one of claims 1 to 5.

7. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by the processor, it can implement the steps of the method for simultaneous non-destructive detection of soybean mold degree and protein content as described in any one of claims 1 to 5.

8. A device for simultaneous non-destructive testing of soybean mold degree and protein content based on near-infrared spectroscopy, used to implement the method for simultaneous non-destructive testing of soybean mold degree and protein content as described in any one of claims 1 to 5, characterized in that, The device includes: The dark box housing has an internal detection chamber for placing the sample to be tested, thus creating a closed optical detection environment; The spectral acquisition module is located inside the dark box housing and includes a near-infrared spectrometer, an optical fiber coupled halogen light source, and an optical fiber probe. The sample carrying module is disposed on the dark chamber housing and includes a push-pull type material carrier slider; the push-pull type material carrier slider is movably installed on the dark chamber housing and is used to carry the soybean sample to be tested into the detection position, and is configured to cooperate with the dark chamber housing to form a dark chamber environment that isolates external light interference when pushed into place; The main control module is communicatively connected to the near-infrared spectrometer and the human-computer interaction module, and is configured to control the spectral acquisition module to perform data acquisition, execute preprocessing and feature extraction algorithms, and call the model to output detection results; The human-computer interaction module includes a touch screen, which is disposed on the surface of the dark box shell and connected to the main control module, and is used to receive user operation commands and display the mold level and protein content values.

9. The detection device according to claim 8, characterized in that, The surface of the push-pull type carrier slider of the sample carrying module is provided with a positioning groove, which is used to fix the soybean sample to be tested to ensure that the detection distance is consistent in each measurement. The main control module adopts an embedded development board, which integrates an active cooling system including heat sink copper plates and cooling fans to maintain the internal core temperature stability of the device under continuous operation and suppress thermal drift of spectral signals caused by temperature fluctuations. The main control module adopts parallel processing logic. After acquiring spectral data, it synchronously calls the qualitative discrimination model and the quantitative prediction model to perform real-time feature analysis and synchronous calculation, so as to ensure that the response speed and accuracy indicators of a single sample detection meet the preset quality monitoring requirements.

10. A method for soybean quality testing using the simultaneous non-destructive testing device for soybean mold degree and protein content as described in claim 8 or 9, characterized in that, Includes the following steps: The first step is to place the soybean sample to be tested into the positioning groove of the sample carrying module, and push the push-pull material carrier slider until it reaches the limit position, so that the sample enters the predetermined detection position inside the dark chamber shell, forming a closed dark chamber environment. The second step involves triggering a data acquisition command through the human-computer interaction module. The main control module then drives the spectral acquisition module to scan the soybean sample five times, taking the average value to obtain the raw near-infrared spectral data. The third step is for the main control module to preprocess and extract features from the raw spectral data. Then, the extracted feature data is input into the built-in qualitative discrimination model for the degree of soybean mold and the quantitative prediction model for soybean protein content. In the fourth step, the qualitative discrimination model for the degree of soybean mold outputs the determination result of the degree of mold of soybean, and the quantitative prediction model for soybean protein content outputs the predicted value of soybean protein content. The main control module displays the above two results simultaneously on the screen of the human-computer interaction module.