Construction method of green pepper shredded potato quality sensory evaluation model
By integrating multi-dimensional machine detection indicators and cluster analysis, a sensory evaluation model for the quality of green pepper and potato shreds was established, which solved the problems of high professional threshold, long time consumption and inconsistent results of traditional manual evaluation, and achieved efficient and accurate quality detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- JIANGNAN UNIV
- Filing Date
- 2025-12-19
- Publication Date
- 2026-04-21
AI Technical Summary
Traditional evaluation of the quality of shredded green peppers and potatoes relies on human sensory evaluation, which has high professional threshold, inconsistent evaluation results, long time consumption and lack of quantitative indicators. Existing machine testing has failed to fully cover the overall quality of the dish and lacks scientific mapping relationship.
By integrating multi-dimensional machine testing indicators such as texture, color, odor, and nutrition, and through principal component analysis, cluster analysis, and machine learning models, a sensory evaluation model for the quality of green pepper and potato shreds is established to achieve the fusion and quantitative mapping of multi-source indicators.
It enables objective and accurate evaluation of the quality of shredded green peppers and potatoes, reducing the evaluation time from 2-4 hours to 5-10 minutes, and significantly improving the consistency and reliability of the evaluation results. It is suitable for quality testing in catering and food processing enterprises.
Smart Images

Figure CN121901920A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a method for constructing a sensory evaluation model for the quality of shredded green peppers and potatoes, belonging to the field of food quality evaluation technology. Background Technology
[0002] Stir-fried shredded green peppers and potatoes, a common dish in both home cooking and restaurants, has traditionally relied on subjective ratings from professional sensory evaluators for quality assessment. This traditional method suffers from the following problems: 1. Evaluators require extensive training, resulting in a high professional threshold and hindering large-scale deployment; 2. Evaluation results are easily influenced by personal preferences, physical condition, and other factors, leading to poor consistency and a Cronbach's α coefficient often below 0.8; 3. The evaluation process is time-consuming, requiring 2-4 hours per evaluation, which cannot meet the needs of large-scale batch testing; 4. The lack of quantitative indicators results in poor repeatability and significant differences in results between different evaluation groups.
[0003] While existing technologies have attempted to use machine-assisted sensory evaluation, they suffer from several significant shortcomings: Firstly, existing technologies that rely solely on electronic nose technology to analyze the flavor characteristics of fried taro or on near-infrared spectroscopy to assist in tobacco grading fail to effectively integrate multiple indicators, making it difficult to comprehensively cover the overall quality of the dish, including color, aroma, taste, and texture. Secondly, the lack of a scientific mapping relationship between clustering grading and sensory evaluation leads to discrepancies between machine detection results and actual sensory experiences, preventing them from effectively replacing human sensory evaluation. Therefore, a method for constructing a sensory evaluation model for green pepper and potato shreds is needed to overcome the limitations of traditional sensory evaluation. Summary of the Invention
[0004] To address the aforementioned issues, this invention provides a method for constructing a sensory evaluation model for the quality of shredded green peppers and potatoes. By integrating multi-dimensional machine detection indicators such as texture, color, odor, and nutrition, and combining cluster analysis to establish a quantitative mapping relationship with human sensory evaluation, this method achieves an objective, efficient, and accurate evaluation of the quality of shredded green peppers and potatoes. It is applicable to quality testing scenarios in the catering industry, food processing enterprises, and market supervision.
[0005] To achieve the above objectives, the technical solution adopted by the present invention is as follows: In a first aspect, the present invention provides a method for constructing a sensory evaluation model for the quality of shredded green peppers and potatoes, comprising the following steps: Step 1: Obtain a multi-source database: This includes a sensory evaluation form for shredded green peppers and potatoes and a multi-source index database for machine detection. The sensory evaluation form is obtained by scoring five dimensions—color, odor, taste, texture, and overall acceptability—using a 0-9 scale. The multi-source index database for machine detection includes texture, color, odor, and nutritional indicators. Texture indicators are detected using a TPA texture analyzer, color indicators are detected using a colorimeter, and odor indicators are detected using an electronic nose and a gas chromatography-mass spectrometry (GC-MS) system. Step 2: Perform data preprocessing on the machine-detected multi-source indicator database, including missing value imputation, outlier handling, and standardization, with a sample missing rate of <3%; Step 3: Perform principal component analysis to reduce the dimensionality of the preprocessed machine detection data, and select principal components with a cumulative variance contribution rate of ≥80% to construct a dimensionality-reduced dataset; Step 4: Perform cluster analysis on the dimensionality-reduced dataset and determine the optimal number of clusters; Step 5: Map and associate the clustering results obtained in Step 4 with the total sensory evaluation score to assign a quality level meaning; Step 6: Perform multiple rounds of feature filtering on the machine-detected multi-source indicators to obtain the optimal feature set; Step 7: Using the optimal feature set as input and the quality level after clustering and mapping as output, construct and train a machine learning model. Filter the optimal model through multi-dimensional index evaluation to obtain the sensory evaluation model for green pepper and potato shreds.
[0006] In one embodiment of the present invention, the specific method of preprocessing in step 2 is as follows: missing values are filled with the median, outliers are processed by the 5% / 95% quantile shrinking method, and standardization is performed using the StandardScaler tool of the Python sklearn library.
[0007] In one embodiment of the present invention, the dimensionality reduction process in step 3 adopts principal component analysis, and finally selects nine principal components with a cumulative variance contribution rate of 81.9% to construct a dimensionality reduction dataset.
[0008] In one embodiment of the present invention, the optimal number of clusters K=3 in step 4, the clustering effectiveness is verified by the CH index and the DBI index, and the correlation coefficient r between the clustering level and the total sensory evaluation score is 0.923.
[0009] In one embodiment of the present invention, in step 5, three cluster levels are assigned quality meanings: excellent, average, and poor. Excellent corresponds to a total sensory score of 7.4-9.4, average corresponds to a total sensory score of 3.4-7.4, and poor corresponds to a total sensory score of 0.9-3.4.
[0010] In one embodiment of the present invention, the multi-round feature screening in step 6 includes: initial variance screening, removing features with variance <0.001; Lasso regularization screening, using 5-fold cross-validation; and RFECV fine screening, using random forest as the basic model, 5-fold cross-validation, and the scoring index is F1. The optimal feature set includes 7 features: the chewiness of potatoes, the L value of green peppers, the features of the electronic nose S5 sensor, (E)-2-nonenal, (E,E)-2,4-heptadienal, nonanal, and 1-octanol.
[0011] In one embodiment of the present invention, the machine learning model in step 7 includes eight machine learning methods: multilayer perceptron, random forest, Naive Bayes, support vector machine, logistic regression, K nearest neighbor, gradient boosting, and decision tree. The hyperparameter optimization adopts 5-fold cross-validation grid search.
[0012] In one embodiment of the present invention, the optimal machine learning model is logistic regression, with parameters set as C=0.1, penalty='l2', class_weight="balanced", max_iter=1500, and solver='liblinear'. The model has an accuracy of 0.8462, an average AUC of 0.9194, a LOOCV-weighted F1 score of 0.9231, and a prediction F1 score ≥0.8449 for each quality level.
[0013] Secondly, the present invention provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the method for constructing a sensory evaluation model for the quality of green pepper and potato shreds.
[0014] Thirdly, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the method for constructing a sensory evaluation model for the quality of shredded green peppers and potatoes.
[0015] The beneficial effects achieved by this invention are as follows: 1. Comprehensive and objective evaluation dimensions: It integrates multiple machine detection indicators such as texture, color, odor, and nutrition, and combines odor data detected by electronic nose and gas chromatography-mass spectrometry (GC-MS) to comprehensively cover the key factors affecting the quality of green pepper and potato shreds. The evaluation dimensions are more accurate and the evaluation is more objective and comprehensive.
[0016] 2. High efficiency in replacing manual labor: Through precise mapping between cluster analysis and sensory evaluation, combined with machine learning models, machine detection can effectively replace manual sensory evaluation. The evaluation time is shortened from the traditional 2-4 hours to 5-10 minutes, greatly reducing manpower and meeting the needs of large-scale batch testing.
[0017] 3. Accuracy of evaluation results: The consistency of sensory data was verified by Cronbach's α coefficient (0.8910), and the credibility of clustering was verified by CH index (20.59) and DBI index (1.38). The accuracy of the model test set reached 0.8462, the average AUC reached 0.9194, and the LOOCV weighted F1 reached 0.9231. The repeatability and reliability of the evaluation results are significantly better than traditional methods (traditional methods often have Cronbach's α coefficient below 0.8 and poor consistency).
[0018] 4. Wide range of applications: This invention can be widely applied to scenarios such as food quality control in catering enterprises, production line testing in food processing enterprises, and quality sampling inspection by market supervision departments. It provides standardized and quantitative technical support for the quality evaluation of green pepper and potato shreds, and also provides methodological reference for the quality evaluation of other Chinese stir-fried vegetables. Attached Figure Description
[0019] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the embodiments of the present invention will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the drawings without creative effort.
[0020] Figure 1 This is a logic diagram of the method for constructing the sensory evaluation model for the quality of green pepper and potato shreds according to the present invention.
[0021] Figure 2 Plotting the variance contribution rate of PCA.
[0022] Figure 3 For cluster analysis of WCSS elbow plot.
[0023] Figure 4 PCA scatter plots are used to visualize the three clustering results.
[0024] Figure 5 This is a comparison chart of eight types of machine learning confusion matrices.
[0025] Figure 6 This is a comprehensive comparison chart of the performance of eight machine learning methods.
[0026] Figure 7 A comparison chart of ROC curves for 8 machine learning methods. Detailed Implementation
[0027] The embodiments of the technical solution of the present invention will now be described in detail with reference to the accompanying drawings. These embodiments are merely illustrative of the technical solution of the present invention and are therefore intended to limit the scope of protection of the present invention.
[0028] Unless otherwise defined, all technical and scientific terms used in this invention have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains; the terminology used in this invention is for the purpose of describing particular embodiments only and is not intended to limit the invention; the terms “comprising” and “having”, and any variations thereof, in the specification, claims and foregoing description of the drawings are intended to cover non-exclusive inclusion.
[0029] In the description of the embodiments of this invention, technical terms such as "first" and "second" are used only to distinguish different objects and should not be construed as indicating or implying relative importance or implicitly specifying the number, specific order, or primary and secondary relationship of the indicated technical features. In the description of the embodiments of this invention, "multiple" means two or more, unless otherwise explicitly defined.
[0030] In this invention, the reference to "embodiment" means that a specific feature, structure, or characteristic described in connection with an embodiment may be included in at least some embodiments of the invention. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described in this invention can be combined with other embodiments.
[0031] In the description of the embodiments of this invention, the term "and / or" is merely a description of the relationship between associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, in this invention, the character " / " generally indicates that the preceding and following associated objects have an "or" relationship.
[0032] For ease of understanding, some key terms used in this invention are explained below: PCA (Principal Component Analysis): A data dimensionality reduction method used to extract key feature components from multi-dimensional machine detection data, reducing redundant information and retaining core data features.
[0033] K-means clustering: an unsupervised machine learning algorithm used to divide sample data into a preset number (K) of categories. In this invention, it is used to classify the quality grades of shredded green peppers and potatoes based on machine indicators.
[0034] AUC (Area Under the Curve): A metric used to evaluate the performance of classification models. It ranges from 0 to 1, with a value closer to 1 indicating a stronger ability of the model to distinguish between different quality levels.
[0035] LOOCV (Leave-One-Out Cross-Validation): A rigorous method for verifying model stability. Each time, one sample is used as the test set and the rest are used as the training set. This process is repeated until all samples have been validated.
[0036] RFECV (Recursive Feature Elimination Cross-Validation): A feature selection method that combines recursive feature elimination and cross-validation to select the subset of features that contribute most to the model's prediction from a large number of metrics.
[0037] Cronbach's α coefficient: A reliability coefficient used to assess consistency between raters or between rating items. Generally, a value greater than 0.8 is considered to indicate good consistency.
[0038] Lasso regularization: a regression analysis method that achieves feature selection by applying an L1 norm penalty to the regression coefficients, causing some coefficients to shrink to zero.
[0039] Example 1 like Figure 1 As shown in the figure, this embodiment provides a method for constructing a sensory evaluation model for the quality of shredded green peppers and potatoes, including the following steps: Step 1: Obtain a multi-source database: This includes a sensory evaluation form for shredded green peppers and potatoes and a multi-source index database for machine detection. The sensory evaluation form is obtained by scoring five dimensions—color, odor, taste, texture, and overall acceptability—using a 0-9 scale. The multi-source index database for machine detection includes texture, color, odor, and nutritional indicators. Texture indicators are detected using a TPA texture analyzer, color indicators are detected using a colorimeter, odor indicators are detected using an electronic nose and gas chromatography-mass spectrometry (GC-MS), and nutritional indicators are detected according to national standard methods. Step 2: Perform data preprocessing on the machine-detected multi-source indicator database, including missing value imputation, outlier handling, and standardization, with a sample missing rate of <3%; Step 3: Perform principal component analysis (PCA) on the preprocessed machine detection data to reduce dimensionality, and select principal components with a cumulative variance contribution rate of ≥80% to construct a dimensionality-reduced dataset; Step 4: Perform cluster analysis on the dimensionality-reduced dataset and determine the optimal number of clusters; Step 5: Map and associate the clustering results obtained in Step 4 with the total sensory evaluation score to assign a quality level meaning; Step 6: Perform multiple rounds of feature filtering on the machine-detected multi-source indicators to obtain the optimal feature set; Step 7: Using the optimal feature set as input and the quality level after clustering and mapping as output, construct and train a machine learning model. Filter the optimal model through multi-dimensional index evaluation to obtain the sensory evaluation model for green pepper and potato shreds.
[0040] Optionally, in step 1, the acquisition of the sensory evaluation form shall comply with the following regulations: General Guidelines for the Selection, Training and Management of Sensory Analysis Evaluators (GB / T 16291.1-2012), Three-Point Selection Method for Sensory Analysis Methodology (GB / T 12311-2012), and Ranking Method for Sensory Analysis Methodology (GB / T 12315-2008).
[0041] Optionally, the method can be applied to Chinese stir-fried vegetable dishes that have similar texture and flavor characteristics to shredded green peppers and potatoes.
[0042] Optionally, the specific preprocessing method in step 2 is as follows: missing values are filled with the median, outliers are processed by the 5% / 95% quantile shrinking method, and standardization is performed using the StandardScaler tool from the Python sklearn library.
[0043] Optionally, in step 3, the dimensionality reduction process uses principal component analysis (PCA), and finally selects 9 principal components (with a cumulative variance contribution rate of 81.9%) to construct the dimensionality-reduced dataset.
[0044] Optionally, in step 4, the optimal number of clusters K=3, the clustering effectiveness is verified by the CH index (20.59) and the DBI index (1.38), the correlation coefficient between the clustering level and the total sensory evaluation score is r=0.923 (p<0.001), and the clustering results have extremely high credibility.
[0045] Optionally, the multi-round feature screening in step 6 includes: initial variance screening, removing features with variance <0.001; Lasso regularization screening, using 5-fold cross-validation; and RFECV fine screening, using random forest as the basic model, 5-fold cross-validation, and the scoring index is F1. The optimal feature set includes 7 features: chewiness of potatoes, L value of green peppers, features of electronic nose S5 sensor, (E)-2-nonenal, (E,E)-2,4-heptadienal, nonanal, and 1-octanol.
[0046] Optionally, the machine learning model in step 7 includes eight machine learning methods: Multilayer Perceptron (MLP), Random Forest, Naive Bayes, Support Vector Machine (SVM), Logistic Regression, K-Nearest Neighbors (KNN), Gradient Boosting, and Decision Tree. Hyperparameter optimization uses a 5-fold cross-validation grid search. The optimal model is Logistic Regression, with parameters set as C=0.1, penalty='l2', class_weight="balanced", max_iter=1500, and solver='liblinear'. This model has an accuracy of 0.8462, an average AUC of 0.9194, a LOOCV weighted F1 score of 0.9231, and prediction F1 scores for each quality level are ≥0.8449.
[0047] Example 2 This embodiment provides a method for constructing a sensory evaluation model for the quality of shredded green peppers and potatoes, including: 1. Acquisition of multi-source basic databases (1) Sensory evaluation data: Ten evaluators (5 males and 5 females, aged 20-45 years) were selected and trained in accordance with the "General Guidelines for the Selection, Training and Management of Sensory Analysis Evaluators" (GB / T16291.1-2012). The evaluation was conducted using a 0-9 scale across five dimensions: color, odor, taste, texture, and overall acceptability, referencing the "Three-Point Selection Method in Sensory Analysis" (GB / T 12311-2012) and the "Ranking Method in Sensory Analysis" (GB / T 12315-2008). All evaluations were conducted in an independent sensory evaluation room that met the requirements of GB / T13868-2009. The specific sensory evaluation forms are shown in Table 1. The consistency of the scoring was verified by using Cronbach's α coefficient (α=0.8910, requirement >0.8). The comprehensive sensory evaluation score was calculated using the entropy weight method (S=0.3065*texture + 0.1867*overall acceptability + 0.1838*color + 0.1694*taste + 0.1535*odor), with texture being the key evaluation indicator.
[0048] Table 1 Sensory Evaluation Table of Green Pepper and Potato Shreds
[0049] (2) Machine testing data: 52 samples of shredded green peppers and potatoes from different restaurants (covering Sichuan, Northeastern, and Cantonese cuisines) were collected, homogenized at a fixed ratio of 170g potato + 30g green pepper, and then tested. Texture indicators: Texture analyzer (TPA mode), probe P25, pre-test, test, and post-test speeds are 2.00, 1.00, and 2.00 mm / s respectively, deformation is 50%, trigger force is 5g, and the hardness, elasticity, cohesion, and chewiness of potatoes are tested; Color index: Colorimeter (calibrated with a standard white board) was used to test the L, a, and b values of the outer skin of potatoes and green peppers; Odor indicators: An electronic nose (18 metal oxide sensors, see Table 2, incubation at 50℃ for 30 min, detection for 100 s, and washing for 120 s) and gas chromatography-mass spectrometry (GC-MS, J&W VF-WAXms column, temperature programmed from 50℃ to 250℃) were used to screen 15 key volatile compounds (match ≥80%, OAV ≥1). Nutritional indicators: Moisture content (GB 5009.3-2016), crude protein content (GB 5009.5-2016), dietary fiber content (GB 5009.88-2014), ash content (GB 5009.4-2016), and fat content (GB5009.6-2016) were tested according to national standard methods.
[0050] Table 2. Description of the response substances and categories of the 18 sensors for the electronic nose.
[0051] 2. Data Preprocessing (1) Missing value handling: Use the median to fill missing values of numerical features (for samples with a missing rate of <3%, median filling can avoid the mean being affected by outliers). (2) Outlier handling: The 5% / 95% quantile reduction method is used to correct extreme values that exceed the range (such as abnormally high hardness values of individual samples due to detection errors). (3) Standardization: Using the StandardScaler tool in the Python sklearn library, all machine detection indicators are converted into standardized data with a mean of 0 and a standard deviation of 1 to eliminate dimensional differences.
[0052] 3. PCA dimensionality reduction and K-means clustering analysis (1) PCA dimensionality reduction: Principal component analysis is performed on the standardized data, and principal components with a cumulative variance contribution rate of ≥80% (a total of 9, with a cumulative contribution rate of 81.9%) are selected to construct a dimensionality reduction dataset, which reduces data redundancy while retaining core information; (2) K-means clustering: Based on the dimensionality reduction dataset, the optimal number of clusters K=3 is determined by the WCSS elbow rule (when K=3, the WCSS decrease rate slows down significantly, and the decrease is <10% when the K value increases in the future). The parameters random_state=42, init='k-means++', max_iter=300, tol=1e-4, n_init=10 are set to ensure clustering stability; (3) Ranking mapping: The clustering credibility was verified by CH index (20.59) and DBI index (1.38). The clustering level was strongly positively correlated with the total sensory evaluation score (r=0.923, p<0.001). Three clustering levels were assigned quality meanings: “Excellent” (total sensory score 7.4-9.4, 12 samples), “Medium” (3.4-7.4, 24 samples), and “Poor” (0.9-3.4, 16 samples). Among them, the total sensory evaluation scores of 7.4 and 3.4 were the thresholds for dividing “Excellent” and “Medium” and “Poor” levels, respectively.
[0053] 4. Multi-round feature selection (1) Initial screening of variance: Remove features with variance < 0.001 that have no fluctuation, a total of 3 items were removed; (2) Lasso regularization selection: 5-fold stratified cross-validation (stratified according to cluster level), with regularization parameters np.logspace (-6, -1, 50) and max_iter=10000. The optimal parameters are selected based on MSE, retaining coefficients with absolute values >1e. -4 Based on the characteristics, 12 valid features were obtained; (3) RFECV fine screening: Random forest is used as the basic model (n_estimators=100, max_depth=4), 5-fold cross-validation is used, the scoring index is F1, and finally 7 optimal features are determined: as shown in Table 3 below: chewiness of potatoes, L value of green peppers, S5 (electronic nose sensor), (E)-2-nonenal, (E,E)-2,4-heptadienal, nonanal, 1-octanol.
[0054] Table 3 Optimal Feature Contribution Rate Table
[0055] 5. Machine Learning Model Construction and Parameter Optimization (1) Model selection: Eight core models were constructed, including logistic regression, random forest, and support vector machine (all implemented using the Python sklearn library and existing mature toolkits). (2) Hyperparameter optimization: 5-fold cross-validation grid search (GridSearchCV) is used, and the parameter search range is as follows: Logistic regression: C∈np.logspace (-3, 3, 7) (0.001, 0.01, 0.1, 1, 10, 100, 1000), penalty∈['l1', 'l2'], max_iter∈[1000, 1500, 2000]; (3) Determination of optimal parameters: Three rounds of screening were conducted: "cross-validation screening → independent test set validation → stability validation". Cross-validation selection: retain parameter combinations with weighted F1 ≥ 0.82 (12 groups in total); Independent test set validation: select combinations with average AUC ≥ 0.91 (only 3 groups); Stability validation: determine logistic regression as the optimal model through LOOCV (leave-one-out cross-validation), with final parameters C=0.1, penalty='l2', class_weight="balanced", max_iter=1500, solver='liblinear'; (4) Model performance: The test set accuracy of the optimal logistic regression model is 0.8462, the weighted F1 is 0.829, the average AUC is 0.9194, and the LOOCV weighted F1 is 0.9231; the prediction accuracy of each level is: "Excellent" F1 = 0.8449, "Medium" F1 = 0.8537, and "Poor" F1 = 0.8605.
[0056] Example 3 This embodiment provides data preprocessing and cluster analysis: (1) Data preprocessing: The Python pandas library was used to process the data. Missing values were filled with the median (e.g., dietary fiber data of 1 sample was missing), and outliers were shrunken with 5% / 95% quantiles (e.g., the hardness value of 1 sample exceeded the normal range by 2 times). After standardization with StandardScaler, the mean of all indicators was between -0.2 and 0.2, and the standard deviation was between 0.9 and 1.1.
[0057] (2) PCA dimensionality reduction: Using the PCA tool in the Python sklearn library, the variance contribution rates of the first 9 principal components were calculated to be 32.5%, 14.32%, 8.16%, 7.47%, 5.06%, 4.46%, 4.29%, 2.93%, and 2.7%, respectively, with a cumulative contribution rate of 81.9%, which meets the requirement of ≥80%.
[0058] (3) Cluster analysis: The WCSS elbow rule shows that K=3 is the elbow point. The clustering results were verified by ANOVA (F=289.6, p<0.001). The total sensory scores of the three levels were significantly different, proving that the clustering level matched the sensory experience. At the same time, Gaussian mixture model (GMM) and hierarchical clustering algorithm (HCA) were used to replace K-means clustering for comparison. The optimal number of clusters was still 3. Among them, the CH index of the hierarchical clustering algorithm was 19.87 and the DBI index was 1.42, which was close to the effect of K-means. The results of principal component analysis (PCA) dimensionality reduction and cluster analysis in this embodiment are as follows: Figures 2-4 As shown, K-means clustering is the optimal clustering method, and the optimal number of clusters is 3.
[0059] Example 4 This embodiment provides machine learning model training and validation: (1) Data partitioning: The training set (36 samples) and the test set (16 samples) were partitioned in a 7:3 ratio, ensuring that the proportion of the three quality levels was consistent with the total sample size. (2) Feature selection: Variance screening initially removes 3 features without fluctuation (such as S12 sensor data of electronic nose), Lasso regularization retains 12 features, and RFECV fine screening determines 7 optimal features. After feature selection, the model training efficiency is improved by 40%. (3) Model Training: Eight machine learning methods were used for model training: Multilayer Perceptron (MLP), Random Forest, Naive Bayes, Support Vector Machine (SVM), Logistic Regression, K-Nearest Neighbors (KNN), Gradient Boosting, and Decision Tree. The models were compared using metrics such as accuracy, cross-validation weighted F1, AUC, test set weighted F1, ROC curve, and mixture matrix to select the best model. Ultimately, the logistic regression model achieved a cross-validation weighted F1 of 0.856 on the training set and a test set weighted F1 of 0.8290, showing no significant overfitting. The random forest model achieved a test set weighted F1 of 0.8315, slightly lower than the logistic regression. The support vector machine model achieved an average AUC of 0.8409, lower than the logistic regression's 0.9194. (4) Performance verification: The optimal logistic regression model was tested 20 times. The accuracy fluctuated between 0.835 and 0.858, which proved that the model has good stability.
[0060] The comparison of the machine learning mixture matrix, comprehensive performance metrics, and ROC curve in this embodiment is as follows: Figures 5-7 As shown, the logistic regression model is the best predictive model.
[0061] In summary, the present invention provides a method for constructing a sensory evaluation model for the quality of shredded green peppers and potatoes. Through multi-source data integration, dimensionality reduction and clustering mapping, feature optimization and screening, and machine learning modeling, it establishes a quantitative correlation between machine-detectable indicators and human sensory evaluation, ultimately achieving machine replacement of human evaluation. The specific logic is as follows: First, sensory evaluation and multi-dimensional machine detection data are integrated to construct a multi-source database; second, cluster analysis is used to divide the machine data into quality levels matching sensory experience, establishing a correspondence between "machine indicators" and "quality levels"; finally, through multiple rounds of feature screening and parameter optimization, a high-precision machine learning model is constructed to achieve rapid prediction of quality levels based on machine indicators, balancing evaluation accuracy and efficiency.
[0062] Addressing the core issues of traditional sensory evaluation—significant subjective bias, time-consuming process, and high professional threshold—this invention innovatively integrates sensory evaluation data with multi-source indicators detected by machine. It simplifies data dimensions through PCA dimensionality reduction, establishes quality grade mapping relationships through K-means clustering, and refines key indicators through multiple rounds of feature selection, ultimately constructing a logistic regression prediction model. This model achieves an accuracy of 0.8462 and an average AUC of 0.9194 on the test set, realizing an efficient and accurate replacement of human sensory evaluation by machine detection. Evaluation efficiency is improved by over 80%, and the repeatability and reliability of results are significantly enhanced. It can be widely applied in scenarios such as catering quality control, food processing testing, and market supervision sampling, while also providing standardized and quantitative methodological support for the quality evaluation of similar Chinese stir-fried vegetables.
[0063] Furthermore, the present invention also provides a computer device, which may include a processor, a memory, a network interface, and a database connected via a system bus. The processor of the computer device provides computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The network interface of the computer device is used for communication with external terminals via a network connection. When the computer program is executed by the processor, it causes the processor to perform the steps of the method for constructing the sensory evaluation model for the quality of shredded green peppers and potatoes as described in any of the above embodiments.
[0064] The working process, working details, and technical effects of the computer equipment provided in this embodiment can be found in the embodiment above regarding the construction method of the sensory evaluation model for the quality of shredded green peppers and potatoes, and will not be repeated here.
[0065] Furthermore, the present invention also provides a computer-readable storage medium storing a computer program thereon, wherein the computer program, when executed by a processor, implements the steps of the method for constructing a sensory evaluation model for the quality of shredded green peppers and potatoes as described in any of the above embodiments. The computer-readable storage medium refers to a carrier for storing data, and may include, but is not limited to, floppy disks, optical disks, hard disks, flash memory, USB flash drives, and / or memory sticks, etc. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.
[0066] The working process, working details, and technical effects of the computer-readable storage medium provided in this embodiment can be found in the embodiment above regarding the construction method of the sensory evaluation model for the quality of shredded green peppers and potatoes, and will not be repeated here.
[0067] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM).
[0068] 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 constructing a sensory evaluation model for the quality of shredded green peppers and potatoes, characterized in that, Includes the following steps: Step 1: Obtain a multi-source database: This includes a sensory evaluation form for shredded green peppers and potatoes and a multi-source index database for machine detection. The sensory evaluation form is obtained by scoring five dimensions—color, odor, taste, texture, and overall acceptability—using a 0-9 scale. The multi-source index database for machine detection includes texture, color, odor, and nutritional indicators. Texture indicators are detected using a TPA texture analyzer, color indicators are detected using a colorimeter, and odor indicators are detected using an electronic nose and a gas chromatography-mass spectrometry (GC-MS) system. Step 2: Perform data preprocessing on the machine-detected multi-source indicator database, including missing value imputation, outlier handling, and standardization, with a sample missing rate of <3%; Step 3: Perform principal component analysis to reduce the dimensionality of the preprocessed machine detection data, and select principal components with a cumulative variance contribution rate of ≥80% to construct a dimensionality-reduced dataset; Step 4: Perform cluster analysis on the dimensionality-reduced dataset and determine the optimal number of clusters; Step 5: Map and associate the clustering results obtained in Step 4 with the total sensory evaluation score to assign a quality level meaning; Step 6: Perform multiple rounds of feature filtering on the machine-detected multi-source indicators to obtain the optimal feature set; Step 7: Using the optimal feature set as input and the quality level after clustering and mapping as output, construct and train a machine learning model. Filter the optimal model through multi-dimensional index evaluation to obtain the sensory evaluation model for green pepper and potato shreds.
2. The method for constructing a sensory evaluation model for the quality of shredded green peppers and potatoes according to claim 1, characterized in that, The specific preprocessing method in step 2 is as follows: missing values are filled with the median, outliers are processed by the 5% / 95% quantile shrinking method, and standardization is performed using the StandardScaler tool from the Python sklearn library.
3. The method for constructing a sensory evaluation model for the quality of shredded green peppers and potatoes according to claim 2, characterized in that, In step 3, the dimensionality reduction process uses principal component analysis, and finally selects 9 principal components with a cumulative variance contribution rate of 81.9% to construct the dimensionality reduction dataset.
4. The method for constructing a sensory evaluation model for the quality of shredded green peppers and potatoes according to claim 3, characterized in that, In step 4, the optimal number of clusters K=3, and the clustering effectiveness is verified by the CH index and DBI index. The correlation coefficient r between the cluster level and the total sensory evaluation score is 0.
923.
5. The method for constructing a sensory evaluation model for the quality of shredded green peppers and potatoes according to claim 4, characterized in that, In step 5, three cluster levels are assigned quality meanings: excellent, average, and poor. Excellent corresponds to a total sensory score of 7.4-9.4, average corresponds to a total sensory score of 3.4-7.4, and poor corresponds to a total sensory score of 0.9-3.
4.
6. The method for constructing a sensory evaluation model for the quality of shredded green peppers and potatoes according to claim 5, characterized in that, The multi-round feature selection in step 6 includes: initial variance screening, removing features with variance <0.001; Lasso regularization screening, using 5-fold cross-validation; and RFECV fine screening, using random forest as the basic model, 5-fold cross-validation, and the scoring index is F1. The optimal feature set includes 7 features: chewiness of potatoes, L value of green peppers, electronic nose S5 sensor features, (E)-2-nonenal, (E,E)-2,4-heptadienal, nonanal, and 1-octanol.
7. The method for constructing a sensory evaluation model for the quality of shredded green peppers and potatoes according to claim 6, characterized in that, The machine learning model in step 7 includes eight machine learning methods: multilayer perceptron, random forest, Naive Bayes, support vector machine, logistic regression, K-nearest neighbor, gradient boosting, and decision tree. Hyperparameter optimization adopts 5-fold cross-validation grid search.
8. The method for constructing a sensory evaluation model for the quality of shredded green peppers and potatoes according to claim 7, characterized in that, The optimal machine learning model is logistic regression, with parameters set as C=0.1, penalty='l2', class_weight="balanced", max_iter=1500, and solver='liblinear'. This model has an accuracy of 0.8462, an average AUC of 0.9194, a LOOCV-weighted F1 score of 0.9231, and a prediction F1 score ≥0.8449 for each quality level.
9. A computer 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 constructing a sensory evaluation model for the quality of shredded green peppers and potatoes as described in any one of claims 1-8.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the method for constructing a sensory evaluation model for the quality of green pepper and potato shreds as described in any one of claims 1-8.