Implementation method of grain quality, safety and storage risk automatic scoring service
By optimizing features and hyperparameters using a two-layer random forest model and an artificial bee colony algorithm, the data fusion problem in grain quality and safety risk assessment was solved, enabling unified assessment and operational recommendations for grain quality and safety risks, and improving the accuracy and stability of the assessment.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- NANJING UNIV OF FINANCE & ECONOMICS
- Filing Date
- 2025-12-29
- Publication Date
- 2026-05-29
AI Technical Summary
Existing technologies struggle to integrate food quality and safety risk assessments from different data sources within a unified framework, and the dynamic changes in storage risks are difficult to predict accurately. This results in a lack of smooth connection between quality grading and early warning signals, affecting the accuracy and consistency of food quality and safety governance.
A two-layer random forest model combined with an artificial bee colony algorithm is used to optimize features and hyperparameters. Through multi-source data processing and K-fold cross-validation, quantitative scoring of grain quality, safety risk and storage risk is achieved, and actionable operational suggestions are output.
It enables unified assessment of food quality and safety risks under the same scoring system, improves the accuracy and stability of the assessment, outputs clear and interpretable results, and promotes the efficient implementation of quality and safety governance.
Smart Images

Figure CN122114698A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of grain quality and safety risk assessment, and specifically to a method for implementing an automatic scoring service for grain quality, safety, and storage risks. Background Technology
[0002] Grain is affected by a variety of factors throughout the entire supply chain, from production to consumption. The physicochemical properties of raw grains (such as moisture, impurities, breakage / fragmentation rate, bulk density, protein / gluten content, and fatty acid value) determine initial quality; mycotoxins and key pesticide residues directly affect safety; and during storage, warehouse temperature and grain temperature, relative humidity, CO2 concentration, pest activity, and operational strategies such as ventilation, circulation, and fumigation can cause risks to exhibit significant temporal and spatial variations. The transportation environment and arrival inspections during distribution further alter the quality and risk status. In reality, quality grading and release often rely on single-point testing and experience-based judgment. Different data sources have inconsistent dimensions, sampling frequencies, and standards, making it difficult to integrate them within a unified framework. Furthermore, fluctuations in temperature, humidity, and pests during storage make single-point testing insufficient to reflect the true evolution of risk. There is also a lack of consistency in the understanding of thresholds and weights between personnel and storage facilities, and a lack of smooth coordination between early warning signals and specific response measures.
[0003] Against this backdrop, there is a need for a method that can unify the interpretation of multi-source data, possess a stronger ability to characterize dynamic risks, and provide clear and interpretable output results. Two-layer random forests have advantages in generalization ability and stability. Combined with artificial bee colony algorithms for joint optimization of features and hyperparameters, and further reinforced with K-fold cross-validation for robust evaluation, this method can quantify the quality (QG), safety risk (SR), and storage risk (WR) of raw grains at different stages within the same scoring system. It further provides a comprehensive score (CS) and actionable operational suggestions, thereby improving the accuracy, consistency, and feasibility of quality and safety governance. Summary of the Invention
[0004] The purpose of this invention is to address the shortcomings and deficiencies of the existing technology by proposing an implementation method for an automatic scoring service of grain quality, safety, and storage risk. This method aims to build a unified, robust, and interpretable automatic scoring method for the grain industry, which is used to quantify the raw grain quality (QG), safety risk (SR), and storage risk (WR) at different stages under the same scoring system, and further provide a comprehensive score (CS) and actionable operational suggestions.
[0005] The technical solution adopted by this invention to solve its technical problem is: a method for implementing an automatic scoring service for grain quality, safety, and storage risks, which specifically includes the following steps:
[0006] Step 1: Collect multi-source indicator data for the entire grain process. Select several items from a preset indicator set as sample features. The indicators should include at least one or more of the following: raw grain quality indicators (such as moisture, impurities, breakage rate / broken rice rate, bulk density, protein / gluten, fatty acid value), safety risk indicators (such as aflatoxin B1, ochratoxin A, vomitoxin / fumonisin, key pesticide residues, and metal contaminants), and storage operation indicators (such as storage temperature, grain temperature distribution and gradient, relative humidity, CO2 concentration, acoustic pest count, ventilation / circulation strategy and duration, and fumigation records). Processing and distribution indicators (such as product stability, transportation time and temperature and humidity fluctuations during transit, and re-inspection pass rate) can also be selected. Each indicator should be normalized to a unified numerical domain according to industry standards or through mapping.
[0007] Step 2: Standardize the collected indicators by using decimal scaling.
[0008] Step 3: Extract features from the normalized data and obtain eigenvectors using independent component analysis (ICA).
[0009] Step 4: First, use the bootstrap sampling method to generate a differentiated sampling set, and then train multiple random forest individual classifiers; each individual classifier accepts the features obtained in step 3, fits the samples and outputs classification / regression results, and integrates the individual classifiers into a first-layer strong classifier by combining strategies to output the prediction results of the quality / safety / storage risk of the grain samples; the hyperparameters of the random forest individuals are limited by a preset interval or adaptively determined by artificial bee colony algorithm combined with cross-validation.
[0010] Step 5: Use the artificial bee colony algorithm (ABC) to jointly optimize the input features and model hyperparameters of the first-layer strong classifier in Step 4, and add K-fold cross-validation to each individual classifier to obtain a stable evaluation; adjust the classifier parameters according to the validation results, and filter out individual classifiers with substandard output performance to optimize the two-layer classifier structure.
[0011] Step 6: Use a second-layer random forest to fuse the outputs (probabilities / scores) of the selected first-layer individual classifiers with the chosen key original / derived metrics for reclassification / regression, and integrate the reclassification / regression results into a second-layer strong classifier to improve overall performance.
[0012] Step 7: Use the artificial bee colony algorithm to perform final feature and parameter screening in the second-layer fusion model, and output the final results of raw grain quality score (QG), safety risk score (SR), storage risk score (WR) and comprehensive score (CS).
[0013] Furthermore, step 1 of the present invention specifically includes:
[0014] a) Collect multi-source indicators for the entire grain process, and select several items from a preset set of indicators as sample features. The indicators shall include at least one or more of the following categories: raw grain quality, safety risk, and storage operation.
[0015] b) The aforementioned indicator data are standardized using decimal scaling to unify the units of measurement;
[0016] c) Perform independent component analysis (ICA) on the normalized data to extract features and obtain feature vectors for modeling, wherein the dimension of the feature vectors is preferably 12.
[0017] Furthermore, the first layer integration of the present invention includes:
[0018] Several differentiated training subsets are constructed using autopilot sampling to train multiple random forest individual classifiers. Each individual classifier receives the multi-source feature vector of grain obtained through steps 1 to 3 and performs classification / regression fitting on the samples. The individual classifiers are integrated into a first-layer strong classifier by a combination strategy and output the prediction results of the quality / safety / storage risk of the grain samples. The hyperparameters of the random forest individual classifiers are limited by a preset range or adaptively determined by artificial bee colony algorithm combined with cross-validation.
[0019] Further, step 5 of the present invention includes:
[0020] Artificial bee colony algorithm (ABC) is used to jointly optimize the input feature subset and model hyperparameters of the first-layer strong classifier. K-fold cross-validation and at least two different performance metrics are introduced to evaluate the classification / regression results. Based on this, the optimal feature combination and parameter configuration are selected, and the individual classifiers and their corresponding feature subsets that do not meet the output performance are eliminated. This optimizes the parameters and structure of the first layer and outputs the optimal combination after retention.
[0021] The framework of this invention includes:
[0022] a) Data preprocessing: Perform fractional calibration normalization and independent component analysis (ICA) on multi-source indicators throughout the entire grain process to obtain feature vectors for modeling;
[0023] b) Two-layer random forest ensemble: The first layer consists of multiple random forest individual classifiers trained by bootstrapping and combined using a fusion strategy to form a strong classifier; the second layer of random forest takes the output probability / score vector of the first layer individual classifiers and selected key original / derived indicators as input, performs fusion reclassification / regression, and outputs the ensemble result.
[0024] c) Feature / parameter selection: Artificial bee colony algorithm (ABC) is used in the feature selection and parameter optimization process, and K-fold cross-validation is added for robust evaluation and screening.
[0025] Beneficial effects:
[0026] 1. This invention integrates quality inspection, online sensing, warehousing operations and logistics data under a unified standard, enabling a unified quantitative assessment of the quality and safety status of different stages.
[0027] 2. The two-layer random forest structure of this invention combines ABC feature / hyperparameter joint optimization and K-fold robust evaluation, enabling predictions to maintain higher accuracy and stability in complex and time-varying scenarios.
[0028] 3. The model of this invention can output feature importance and limit-breaking factors, forming clear and interpretable results, and can be directly linked to operational suggestions such as ventilation, circulation, fumigation and rotation, promoting the efficient implementation of quality and safety management.
[0029] 4. The training and inference phases of this invention are clearly defined, making it suitable for both offline modeling and the engineering deployment of online scoring services. Attached Figure Description
[0030] Figure 1 This is a flowchart of the method of the present invention.
[0031] Figure 2 This is a flowchart illustrating the feature selection process of the present invention.
[0032] Figure 3 This is a schematic diagram of the data processing of the present invention. Detailed Implementation
[0033] The present invention will be further described below with reference to the accompanying drawings. This embodiment is illustrated using the automatic scoring of grain quality / safety / storage risk as an example, but it does not limit the scope of protection of the present invention.
[0034] Example 1
[0035] This embodiment proposes a technical solution that uses a two-layer random forest as the core, combines the artificial bee colony algorithm (ABC) for joint optimization of features and hyperparameters, and supplements it with K-fold cross-validation for robust evaluation. The method is generally divided into three parts: data preprocessing, two-layer random forest ensemble, and ABC-based feature / parameter selection and screening mechanism.
[0036] In the data preprocessing section, the system selects several items from a pre-set set of indicators as sample features. These indicators cover the physicochemical properties of raw grains, safety testing items, and storage operation and environmental signals, and can incorporate processing and distribution-related information as needed. To unify the dimensions and definitions of different data sources, the collected data is first standardized using decimal scaling. Subsequently, Independent Component Analysis (ICA) is used to extract representative feature vectors while retaining key information, providing a more compact and noise-resistant input for subsequent model learning.
[0037] In the model section, the first layer constructs a differentiated training subset through bootstrap sampling, trains multiple random forest individual classifiers, and combines them using a strategy to form a strong first-layer classifier, outputting prediction scores or probabilities for samples in the dimensions of quality, safety, and storage. Subsequently, this invention utilizes the artificial bee colony algorithm to search and optimize within the joint space of "feature subset-model hyperparameters," and provides robust evaluation using K-fold cross-validation. Based on the evaluation results, individual models and feature combinations are screened out and retained, suppressing overfitting and redundancy while ensuring generalization performance. The second layer uses "the first-layer individual outputs (probabilities / scores) and selected key original / derived indicators" as fused inputs, and then trains the second-layer random forest for reclassification / regression, thereby integrating multi-source information at a higher level, improving overall prediction accuracy and stability, and outputting QG, SR, WR, and CS.
[0038] Compared to existing methods that rely on single-point detection and experience-based judgment, this embodiment offers the following comprehensive advantages: First, it provides a unified and practical approach, integrating quality inspection, online sensing, warehousing operations, and logistics data into a single scoring framework and linking them with operations such as ventilation, circulation, fumigation, and rotation. Second, it offers higher accuracy and robustness; the integrated structure of a two-layer random forest, combined with ABC and K-fold evaluation, effectively enhances the ability to characterize complex and time-varying signals. Third, it provides stronger interpretability, outputting feature importance, limit-crossing factors, and suggested actions, facilitating understanding and implementation by warehousing and quality management personnel. The overall solution is suitable for both offline modeling training and the engineering deployment of online scoring services.
[0039] This embodiment maintains the overall process structure of "data preprocessing → two-layer random forest ensemble → ABC optimization and screening", and specifically includes the following steps:
[0040] Step 1: Data Acquisition and Feature Selection
[0041] Multi-source indicator data are collected during the stages of raw grain acquisition, storage, processing, and distribution. Several items are selected from a pre-set set of indicators as sample features. These indicators can cover the physicochemical properties of raw grains (such as moisture, impurities, broken / broken rice rate, bulk density, protein / gluten content, fatty acid value, etc.), safety testing items (such as aflatoxin B1, ochratoxin A, vomitoxin / fumonisin, key pesticide residues and metallic contaminants, etc.), storage operation and environmental signals (such as warehouse temperature, grain temperature distribution and gradient, relative humidity, CO2 concentration, acoustic pest count, ventilation / circulation strategy and duration, fumigation records, etc.), and can incorporate processing and distribution-related information as needed (such as product stability, transportation time and temperature and humidity fluctuations during transit, and arrival re-inspection pass rate, etc.). To facilitate unified modeling, data from different sources are normalized to a unified numerical domain according to industry standards or through mapping.
[0042] Step 2: Standardization Processing
[0043] The collected metrics are normalized by decimal scaling to unify the units and suppress the impact of extreme values on model learning.
[0044] Step 3: Feature Extraction
[0045] Independent Component Analysis (ICA) is used to extract features from the normalized data to obtain feature vectors that are more concentrated and less redundant. For time-series warehousing and environmental signals, derivatives such as rate of change, duration and frequency of exceeding limits, skewness / kurtosis can also be extracted to enhance the ability to characterize dynamic risks.
[0046] Step 4: First-layer integrated modeling
[0047] A bootstrap sampling method is used to generate a differentiated training subset, which is then used to train multiple random forest individual classifiers. Each individual classifier receives the features obtained in step 3, performs classification / regression fitting on the samples, and outputs a score or probability. By combining strategies, the individual classes are integrated into a first-layer strong classifier to obtain preliminary predictions of grain samples in terms of quality, safety, and storage dimensions. The hyperparameters of the individual classifiers can be limited by a preset range or adaptively determined by subsequent ABC and cross-validation processes (for example, without limiting the protection range, max_features can take the range of 0.5 to 0.8, n_estimators can take several fixed values, and max_depth and min_samples_leaf are optimally set under the constraint of preventing overfitting).
[0048] Step 5: ABC Optimization and Robustness Assessment
[0049] The Artificial Bee Colony (ABC) algorithm is used to search and optimize within the joint space of "feature subset-model hyperparameters". K-fold cross-validation is introduced to robustly evaluate the classification / regression results of the model. Based on the evaluation results, the parameter configuration is tuned, and individual classifiers and their corresponding feature subsets with substandard output performance are screened out, thereby optimizing the structure and input of the first layer.
[0050] Step 6: Second Layer Integration and Relearning
[0051] The probability / score vectors output by the first-layer individual classifiers, which are selected and retained, are concatenated with the selected key original / derived indicators to form a fusion input. The second-layer random forest is then trained for reclassification / regression, and its results are integrated into a second-layer strong classifier to further improve the overall accuracy and stability. The output of this layer also provides optimized estimates of QG, SR, and WR.
[0052] Step 7: Final round of screening and result output
[0053] The final round of ABC screening is performed on the second-layer fusion model to determine the optimal combination of features and parameters, and outputs the raw grain quality score (QG), safety risk score (SR), storage risk score (WR), and comprehensive score (CS). Depending on the needs, this method can also provide explanations of key factors and corresponding operational suggestions for decisions regarding ventilation, circulation, fumigation, or rotation.
[0054] Example 2
[0055] like Figure 1 , Figure 2 and Figure 3 As shown, the method in this embodiment includes the following steps.
[0056] Step S1: Data Acquisition and Preprocessing
[0057] First, select several items (preferably 12 dimensions, but not limited to) from a pre-defined index library covering the entire grain process as sample features. The selectable content covers aspects such as raw grain quality, safety risks, storage operations, and processing and distribution.
[0058] (1) The quality of raw grains may include moisture, impurities, broken / broken rice rate, bulk density, protein / gluten content, and fatty acid value;
[0059] (2) Safety risks may include aflatoxin B1, ochratoxin A, vomitoxin / fumonisin, key pesticide residues and metallic contaminants;
[0060] (3) Storage operations can record warehouse temperature, grain temperature distribution and gradient, relative humidity, CO2 concentration, acoustic count of pests, ventilation / circulation duration and fumigation records;
[0061] (4) Processing and distribution (optional) can introduce indicators such as transportation time, temperature and humidity fluctuations during transit, re-inspection pass rate, and product stability.
[0062] To ensure that data from different sources can be used for joint modeling, standardization and cleaning are performed first after data collection: Decimal scaling is used to map different units to a consistent numerical range, while missing values are appropriately imputed and obvious outliers are truncated. Then, based on the normalization, Independent Component Analysis (ICA) is performed to obtain feature vectors for modeling. Derived features are constructed for storage-related time-series variables as needed, such as rate of change, duration or frequency of exceeding limits, and skewness and kurtosis reflecting fluctuation patterns, thus forming a reliable and more information-dense model input. For ease of understanding, an example is given. Assume that indicators such as moisture, aflatoxin B1, CO2 concentration, and grain temperature gradient are selected. Examples of the original values and normalized results are shown in Tables 1 and 2.
[0063] Table 1
[0064]
[0065] Table 2
[0066]
[0067] After ICA and optional derivation, the feature vectors used for subsequent modeling are obtained (preferably with a dimension of 12, but not limited to this).
[0068] Step S2: First-layer random forest ensemble
[0069] A bootstrap sampling method is used to construct several differential subsets on the training set, training multiple individual random forest classifiers / regressors (the number of individuals is not limited, but preferably 12). Each individual receives the feature vector obtained in step S1, fits the sample, and outputs a probability / score. The output vector of the first-layer strong classifier can be obtained through soft voting or stacking. .
[0070] In a specific implementation, a set of example parameters (not limited) can be given: n_estimators = 55, max_depth = 5, min_samples_leaf = 2, max_features ∈ [0.5, 0.8].
[0071] Step S3: ABC + K-fold robustness assessment and screening
[0072] Artificial bee colony optimization (ABC) is employed to jointly optimize the feature subset and model hyperparameters. K-fold cross-validation is introduced during each candidate solution evaluation, and at least two performance metrics are used to robustly evaluate the results. Based on the evaluation results, substandard individual classifiers are eliminated, and the key feature subset to be retained is determined, forming the optimized first-layer structure and parameter configuration. This process provides feedback for the first-layer model, enabling "elimination / tuning" (see...). Figure 2 (The arrow pointing back in the middle).
[0073] Step S4: Second Layer Fusion and Integration
[0074] The first-layer individual outputs (probabilities / scores) retained in step S3 are concatenated with the selected key original / derived indicators to construct the second-layer input:
[0075]
[0076] in This represents the concatenation of vectors in a fixed order. Random forest is used as the second-layer fusion model (RF2) for... The system performs relearning and outputs continuous scores such as raw grain quality score (QG), safety risk score (SR), storage risk score (WR), and comprehensive score (CS) (which can be standardized to a scale of 0–1 or 0–100).
[0077] Exemplary implementations and effects based on synthetic data (non-limiting)
[0078] (a) Operating environment and dependencies
[0079] This embodiment was carried out under the following circumstances (which does not constitute a limitation on the present invention):
[0080] Hardware: Intel® i7 / 16 GB RAM;
[0081] System and interpreter: Windows 10, Python 3.9;
[0082] Third-party libraries: NumPy, pandas, scikit-learn (any version 1.0 or equivalent);
[0083] Random number seed: random_state=42 / 2025.
[0084] The above-mentioned dependencies can be replaced by equivalent technologies (such as Java / Scala + Spark MLlib, C++ implementations of random forests and ICA / PCA libraries, etc.), all of which are within the scope of protection of this invention.
[0085] (II) Implementation process and pseudocode
[0086] To facilitate implementation and review, the following is provided: Figure 1 , Figure 2 Consistent pseudocode (the code in this embodiment is only for illustrating the principle and does not limit the scope of protection):
[0087] S1 Preprocessing:
[0088] Input: Multi-source indicator matrix X (including raw grain quality / safety / storage / optional distribution), objective y=[QG,SR,WR,CS]
[0089] 1) DecimalScaling(X) → X1
[0090] 2) Data cleaning: Missing test data interpolation, abnormal data truncation → X2
[0091] 3) (Optional) DerivedFeatures (X2 time series): Δ, Exceeding limits, Skewness / Kurlicity → X3
[0092] 4) ICA or PCA(X2) → S # If ICA does not converge, it is equivalent to replacing it with PCA.
[0093] 5) Concatenation feature: X_feat = concat(X3, S)
[0094] S2 Layer 1 Integration (RF Individual + Combination Strategy):
[0095] For i=1..k (preferably k=12, not limited):
[0096] Xi, yi = Bootstrap(X_feat, y)
[0097] RF_i = RandomForest(hyper_i)
[0098] RF_i.fit(Xi, yi)
[0099] Use ABC + K folding to jointly optimize and filter out substandard individuals for {feature_mask, hyper_i}.
[0100] Output p = concat(RF_i.predict(X_feat_selected) for retained i)
[0101] S3 Second-Level Fusion and Final Round Screening:
[0102] x* = concat(p, key original / derived features)
[0103] RF2.fit(x*, y)
[0104] (Preferred) CS = 0.4*QG_pred + 0.3*SR_pred + 0.3*WR_pred
[0105] (Another implementation) Perform linear / ridge regression calibration on {QG_pred, SR_pred, WR_pred} to obtain CS_pred.
[0106] Output: QG_pred, SR_pred, WR_pred, CS_pred
[0107] Typical hyperparameter examples (non-limiting range): First layer RF n_estimators 50–60, max_depth 4–6, min_samples_leaf 1–3, max_features 0.5–0.8; Second layer RF2 n_estimators 160–320, max_depth 6–10, min_samples_leaf 2–4, max_features 0.6–0.8. PCA can be used as an equivalent replacement if ICA fails to converge (see...). Figure 3 ).
[0108] (III) Evaluation Indicators and Data Scope
[0109] The QG / SR / WR / CS are output on a scale of 0–100, and evaluated on the held-out test set using indicators such as RMSE / MAE / R². K-fold cross-validation is used for robust evaluation during the ABC search process. The feature definition and generation method of the synthetic data are described in "Background Art / Invention Content" and will not be repeated here.
[0110] (iv) Exemplary Results (First 10 items for comparison)
[0111] Table 3 shows the comparison between the actual values and model predictions for the first 10 samples in the test set (unit: score).
[0112] Table 3
[0113]
[0114] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the technical principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A method for implementing an automatic scoring service for grain quality, safety, and storage risks, characterized in that, The method includes the following steps: Step 1: Collect multi-source indicator data for the entire grain process, and select several items as sample features from a preset indicator set. The indicators shall include at least one or more of the following: raw grain quality indicators, safety risk indicators, and storage operation indicators, and may also include processing and circulation indicators. Each indicator shall be normalized to a unified numerical domain according to industry standards or through mapping. Step 2: Standardize the collected indicators by using decimal scaling. Step 3: Extract features from the normalized data and obtain feature vectors using independent component analysis; Step 4: First, generate a differentiated sampling set using the bootstrap sampling method, and then train multiple random forest individual classifiers; each individual classifier receives the features obtained in Step 3, fits the samples, and outputs classification / regression results. The individual classifiers are integrated into a first-layer strong classifier by a combination strategy, which outputs the prediction results of the quality / safety / storage risk of the grain samples; the hyperparameters of the random forest individuals are limited by a preset interval or adaptively determined by artificial bee colony algorithm combined with cross-validation. Step 5: Use the artificial bee colony algorithm to jointly optimize the input features and model hyperparameters of the first-layer strong classifier in Step 4, and add K-fold cross-validation to each individual classifier to obtain a stable evaluation; adjust the classifier parameters according to the validation results, and filter out individual classifiers with substandard output performance to optimize the two-layer classifier structure. Step 6: Use a second-layer random forest to fuse the outputs of the selected first-layer individual classifiers with the chosen key original / derived metrics for reclassification / regression, and integrate the reclassification / regression results into a second-layer strong classifier to improve overall performance; Step 7: Use the artificial bee colony algorithm to perform final feature and parameter screening in the second-layer fusion model, and output the final results of raw grain quality score, safety risk score, storage risk score and comprehensive score.
2. The method for implementing an automatic scoring service for grain quality, safety, and storage risks according to claim 1, characterized in that, Step 1 includes: a) Collect multi-source indicators for the entire grain process, and select several items from a preset set of indicators as sample features. The indicators shall include at least one or more of the following categories: raw grain quality, safety risk, and storage operation. b) The aforementioned indicator data are standardized using decimal scaling to unify the units of measurement; c) Perform independent component analysis on the normalized data to extract features and obtain feature vectors for modeling, wherein the dimension of the feature vectors is preferably 12.
3. The method for implementing an automatic scoring service for grain quality, safety, and storage risks according to claim 1, characterized in that, The first layer integration includes: constructing several differentiated training subsets using bootstrapping sampling, training multiple random forest individual classifiers, each individual classifier receiving the multi-source feature vector of grain obtained through steps 1 to 3 and performing classification / regression fitting on the samples; integrating the individual classifiers into a first-layer strong classifier through a combination strategy and outputting the prediction results of the quality / safety / storage risk of the grain samples; the hyperparameters of the random forest individual classifier are limited by a preset interval or adaptively determined by artificial bee colony algorithm combined with cross-validation.
4. The method for implementing an automatic scoring service for grain quality, safety, and storage risks according to claim 1, characterized in that, Step 5 includes: using the artificial bee colony algorithm to jointly optimize the input feature subset and model hyperparameters of the first-layer strong classifier, and introducing K-fold cross-validation and at least two different performance metrics to evaluate the classification / regression results. Based on this, the optimal feature combination and parameter configuration are selected, and individual classifiers and their corresponding feature subsets that do not meet the performance standards are screened out, thereby optimizing the parameters and structure of the first layer and outputting the optimal combination after retention.