Penaeus vannamei quality grading method based on multi-parameter fusion of machine learning algorithm
Through a multi-parameter fusion method based on machine learning algorithm, a quality grading model for South American white shrimp was constructed, which solved the problem of lack of objectivity and accuracy in the quality evaluation of South American white shrimp in the existing technology, and achieved more efficient and accurate quality evaluation.
Patent Information
- Application Number
- CN202411673226.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-21
- Publication Date
- 2025-02-25
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The prior art has a single method, lack of objectivity and accuracy in the quality assessment of South American white shrimps, and it is difficult to fully reflect the true quality status of shrimps.
A multi-parameter fusion method based on machine learning algorithm is adopted to collect data including physical and chemical indicators, microbial indicators and freshness indicators, perform preprocessing and feature selection, and build a quality grading model of South American white shrimp for quality grading of shrimp.
It improves the objectivity and accuracy of quality assessment, simplifies the traditional artificial sensory assessment method, reduces interference from subjective factors, and improves the efficiency of the industrial chain.
Smart Images

Figure CN119513497A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of aquatic product quality assessment, and in particular to a method for grading the quality of whiteleg shrimp based on multi-parameter fusion of a machine learning algorithm. Background Art
[0002] As an important aquaculture species in the world, the accurate assessment of the quality of whiteleg shrimp is of vital importance to all aspects of the industry. At present, the methods for judging the quality of whiteleg shrimp on the market are relatively simple and have certain limitations. Traditional manual sensory evaluation methods are greatly affected by subjective factors and lack objectivity and accuracy; and simply relying on a certain type of indicator (such as relying only on physical and chemical indicators or microbial indicators) for evaluation is difficult to fully reflect the true quality of shrimp. Therefore, a quality grading model that integrates multiple factors, is scientifically accurate and easy to operate is needed to meet the industry's needs for quality assessment of whiteleg shrimp. Summary of the invention
[0003] The purpose of the present invention is to solve the problems existing in the above-mentioned prior art.
[0004] In the first aspect, to achieve the above-mentioned object, the present invention provides the following solutions:
[0005] The quality grading method of whiteleg shrimp based on multi-parameter fusion of machine learning algorithm includes:
[0006] Collecting index data of whiteleg shrimp; wherein the index data includes: physical and chemical index data, microbial index data, and freshness index data;
[0007] Preprocessing the indicator data;
[0008] Using the preprocessed index data, training and verifying the preset machine learning model to obtain a South American shrimp grading model;
[0009] The Penaeus vannamei grading model is used to grade the quality of the Penaeus vannamei to be tested.
[0010] Optionally, the physical and chemical index data include: moisture content, protein content, fat content, pH value, TVB-N content;
[0011] The microbial indicator data include: the total number of bacterial colonies, the number of Escherichia coli and the content of Salmonella under the preset culture environment;
[0012] The freshness index data includes: odor component information related to freshness, hardness and elasticity texture parameters of shrimp meat.
[0013] Optionally, preprocessing the indicator data includes:
[0014] Fill missing values;
[0015] Process outliers in the data;
[0016] Perform data normalization.
[0017] Optionally, using the preprocessed indicator data to train and verify a preset machine learning model includes:
[0018] Performing feature selection and extraction on the preprocessed indicator data;
[0019] Build machine learning models;
[0020] Determine label data for the extracted features;
[0021] Build a dataset based on the extracted features and corresponding label data;
[0022] The data set is used to train and validate the machine learning model.
[0023] Optionally, performing feature selection and extraction on the preprocessed indicator data includes:
[0024] Calculate the Pearson correlation coefficients between various physical and chemical indicators, microbiological indicators and freshness indicators, and select indicators with absolute values of correlation coefficients greater than the preset threshold as the features for preliminary screening
[0025] The principal component analysis is performed on the initially screened features to transform the initially screened features into mutually independent principal components.
[0026] Optionally, using the data set to verify the machine learning model includes:
[0027] The trained model was evaluated using the k-fold cross validation method;
[0028] According to the results of cross-validation, the model is optimized and adjusted.
[0029] Optionally, building a machine learning model includes:
[0030] The Bagging method is combined with the SVM model to construct an SVM integration model based on the AdaBoost algorithm.
[0031] In a second aspect, the present invention provides an electronic device comprising a memory and a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the steps of the method described in the first aspect or any possible implementation of the first aspect are implemented.
[0032] The beneficial effects of the present invention are:
[0033] By integrating data from multiple dimensions (physical and chemical indicators, microbial indicators, and freshness indicators, etc.), the model can more comprehensively reflect the true quality of white shrimp, thereby improving the objectivity and accuracy of quality assessment. The traditional manual sensory evaluation method is simplified, and the interference of subjective factors is reduced. The rapid assessment capability of the present invention helps processing plants or purchasers to quickly grade the quality of shrimp, reasonably arrange the subsequent processing, storage, and transportation processes, and improve the efficiency of the entire industrial chain. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0035] Figure 1 The present invention is a flowchart of a method for grading quality of whiteleg shrimp based on multi-parameter fusion of a machine learning algorithm according to an embodiment of the present invention.
[0036] Figure 2 This is how the model accuracy changes with parameters under different search methods in the embodiments of the present invention. DETAILED DESCRIPTION
[0037] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0038] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0039] like Figure 1 As shown, this embodiment proposes a quality grading method for whiteleg shrimp based on multi-parameter fusion of machine learning algorithm, including:
[0040] Collecting index data of whiteleg shrimp; wherein the index data includes: physical and chemical index data, microbial index data, and freshness index data;
[0041] Preprocessing the indicator data;
[0042] Using the preprocessed index data, training and verifying the preset machine learning model to obtain a South American shrimp grading model;
[0043] The Penaeus vannamei grading model is used to grade the quality of the Penaeus vannamei to be tested.
[0044] Furthermore, the physical and chemical index data include: moisture content, protein content, fat content, pH value, TVB-N content;
[0045] The microbial indicator data include: the total number of bacterial colonies, the number of Escherichia coli and the content of Salmonella under the preset culture environment;
[0046] The freshness index data includes: odor component information related to freshness, hardness and elasticity texture parameters of shrimp meat.
[0047] Specifically, in this embodiment, data collection covers data in multiple dimensions, as follows:
[0048] Physical and chemical indicators:
[0049] 1. Accurately measure the moisture content of shrimp meat, using the drying and weighing method. The moisture content of shrimp meat has an important impact on its taste and shelf life. The moisture content of fresh shrimp is relatively stable. As the quality decreases, the moisture may be lost or changed due to factors such as microbial activity. After testing a large number of samples, the average moisture content of fresh white shrimp is about [78%]. As the quality decreases, the moisture content may drop below [70%].
[0050] 2. Use Kjeldahl nitrogen determination method to determine protein content. Protein is an important nutrient in shrimp meat. The change of its content can reflect the growth status and quality difference of shrimp. High-quality shrimp usually has a suitable protein content range. Actual test data shows that the protein content of high-quality shrimp is generally between [18%-22%].
[0051] 3. Accurately measure the fat content. The amount of fat content will affect the flavor and texture of the shrimp meat. The fat content of shrimps of different qualities may vary. Generally speaking, the fat content of white shrimp is around [1%-3%]. The fat content of shrimps of better quality is relatively stable and within a reasonable range.
[0052] 4. Use professional instruments to measure the pH value of shrimp meat. The change of pH value can indirectly reflect the freshness of shrimp meat and the activity of microorganisms. The pH value of fresh shrimp meat is generally within a certain range. When the shrimp meat deteriorates, the pH value will change accordingly. The pH value of fresh white shrimp is usually between [6.8-7.2]. As the quality decreases, the pH value may rise to above [7.5].
[0053] 5. Determine the volatile basic nitrogen (TVB-N) content by microdiffusion method or automatic analyzer. TVB-N is one of the important indicators to measure the freshness of shrimp meat. Its content gradually increases with the decrease of shrimp freshness. When the TVB-N content exceeds a certain standard, it indicates that the quality of shrimp has declined. According to research, the TVB-N content of fresh shrimp is generally lower than [15mg / 100g]. When the TVB-N content reaches [25mg / 100g] or above, the quality of shrimp is significantly reduced and may be judged as unqualified.
[0054] Microbiological indicators:
[0055] 1. Use the plate count method to detect the total number of bacteria in shrimp meat. The total number of bacteria directly reflects the sanitary condition and degree of contamination of shrimp meat. A lower total number of bacteria usually indicates a better quality of shrimp, while a higher total number of bacteria may mean that the shrimp has a sanitary risk or has begun to deteriorate. According to statistics from a large number of samples, the total number of bacteria in high-quality white shrimp is generally between [1×10^4-5×10^4CFU / g]. When the total number of bacteria exceeds [1×10^6CFU / g], the quality of the shrimp is greatly affected.
[0056] 2. Use the culture method and multiple tube fermentation method to detect the number of harmful microorganisms such as E. coli and Salmonella. The presence of harmful microorganisms such as E. coli and Salmonella poses a potential threat to human health. Their content is an important basis for evaluating the safety and quality of shrimp meat. Any content exceeding the safety standard may cause the quality of shrimp to be judged as unqualified. Generally speaking, the number of E. coli in shrimp meat should be lower than [3MPN / g], and Salmonella should not be detected.
[0057] Freshness index:
[0058] 1. Use an electronic nose to detect changes in the odor components emitted by shrimp meat. Shrimp meat will produce different volatile odor substances under different freshness conditions. The electronic nose can analyze and identify these odors and judge the freshness of the shrimp meat by comparing them with the known standard odor characteristics of freshness. For example, fresh shrimp meat will have a unique fresh smell, but when the shrimp meat begins to deteriorate, it will produce some odors. The electronic nose can keenly capture these odor changes. Through the odor analysis of a large number of samples, a database of the corresponding relationship between odor characteristics and freshness was established to provide a basis for model judgment.
[0059] 2. Use a texture analyzer to measure the hardness, elasticity and other texture parameters of shrimp meat. The texture of shrimp meat is closely related to its quality. Fresh shrimp meat is firm and elastic. As time goes by and the quality deteriorates, the hardness of shrimp meat may decrease and the elasticity may also deteriorate.
[0060] Furthermore, preprocessing the indicator data includes:
[0061] Fill missing values;
[0062] Process outliers in the data;
[0063] Perform data normalization.
[0064] Specifically, in this embodiment, data preprocessing includes:
[0065] Preprocess the collected data to ensure the quality and availability of the data. First, clean the data to remove outliers and erroneous data. For example, for measurement values that are obviously deviated from the normal range, check the measurement equipment, operation process and other factors to determine whether they are valid data. If they are confirmed to be outliers, remove or correct them. Then, normalize the data to convert indicator data of different dimensions into a unified scale, such as mapping all data to the [0,1] interval to facilitate subsequent data analysis and model calculation. This can avoid model training deviations caused by different indicator dimensions and improve the accuracy and stability of the model.
[0066] Furthermore, using the preprocessed indicator data to train and verify the preset machine learning model includes:
[0067] Performing feature selection and extraction on the preprocessed indicator data;
[0068] Build machine learning models;
[0069] Determine label data for the extracted features;
[0070] Build a dataset based on the extracted features and corresponding label data;
[0071] The data set is used to train and validate the machine learning model.
[0072] Furthermore, performing feature selection and extraction on the preprocessed indicator data includes:
[0073] Calculate the Pearson correlation coefficients between various physical and chemical indicators, microbiological indicators and freshness indicators, and select indicators with absolute values of correlation coefficients greater than the preset threshold as the features for preliminary screening
[0074] The principal component analysis is performed on the initially screened features to transform the initially screened features into mutually independent principal components.
[0075] Further, using the data set to verify the machine learning model includes:
[0076] The trained model was evaluated using the k-fold cross validation method;
[0077] According to the results of cross-validation, the model is optimized and adjusted.
[0078] Furthermore, building a machine learning model includes:
[0079] The Bagging method is combined with the SVM model to construct an SVM integration model based on the AdaBoost algorithm.
[0080] Specifically, in this embodiment, feature selection and extraction include:
[0081] The key features that have a significant impact on the quality of white shrimp are screened out from numerous raw data using scientific data analysis methods. The correlation analysis method can be used to calculate the correlation coefficients between each index and between the index and the quality of the shrimp, and select the index with a higher correlation with the quality as the key feature. For example, if it is found that there is a strong correlation between certain physical and chemical indicators and microbial indicators, and these correlations are consistent with the quality change trend of the shrimp, then these indicators are likely to be selected as key features. In addition, it is also possible to combine methods such as principal component analysis (PCA) to convert multiple related indicators into a few independent comprehensive indicators (principal components), which can retain the information of the original data to the maximum extent, while reducing the dimension of the data, and improving the calculation efficiency and generalization ability of the model. Through feature selection and extraction, not only can the complexity of the model be reduced, but also the key influencing factors of the quality of the shrimp can be highlighted, so that the model can be more accurately and efficiently evaluated and graded. In the present embodiment, the Pearson correlation coefficient between each physical and chemical index, microbial index and freshness index is first calculated, and the index with an absolute value of the correlation coefficient greater than a certain threshold (such as 0.5) is selected as the feature of the preliminary screening. Then, principal component analysis is performed on the initially selected features to convert them into mutually independent principal components. According to the cumulative contribution rate of the principal components (usually the principal components with a cumulative contribution rate greater than 80% are selected), the final feature combination for model input is determined. The results of the correlation analysis are shown in Table 1 below:
[0082] Table 1 Example of correlation analysis results
[0083] index Correlation coefficient with quality Moisture content -0.65 Protein Content 0.72 Fat Content 0.45 pH -0.58 TVB-N content -0.82 Total bacteria count -0.75 E. coli count -0.90 (when detected, strongly correlated with quality) hardness 0.68 elasticity 0.70
[0084] According to the correlation analysis, the indicators with high correlation with quality were preliminarily screened out, such as protein content, TVB-N content, total bacteria count, E. coli count (when detected), hardness and elasticity, etc. Then, principal component analysis was performed on these indicators, and the following principal components and contribution rates were obtained as shown in Table 2;
[0085] Table 2 Principal components and contribution rates
[0086] principal component Contribution rate (%) Cumulative contribution rate (%) PC1 35.2 35.2 PC2 42.5 77.7 PC3 18.3 96.0
[0087] Usually, the principal components with a cumulative contribution rate greater than 80% are selected. Here, it is assumed that the first three principal components meet the requirements and are used as the feature combination of the subsequent model input.
[0088] Specifically, in this embodiment, model suggestion and training:
[0089] Three machine learning algorithms, support vector machine (SVM), random forest (RF) and neural network (MLP), were used to construct the quality grading model of whiteleg shrimp.
[0090] For the SVM model, radial basis function (RBF) is selected as the kernel function, and the optimal penalty parameter C and kernel function parameter γ are determined by grid search and cross validation. The training data is divided into a training set and a validation set according to a certain ratio (such as 70%), the SVM model is trained on the training set, and the parameters are adjusted on the validation set until the performance of the model on the validation set reaches the best.
[0091] For the RF model, the number of decision trees is set to [NT] (determined by experiments, such as NT = 100), the maximum depth of the tree is [MD] (such as MD = 10), and the number of randomly selected features is the square root of the total number of features (rounded down). During the training process, 70% of the training data is used for model training, and 30% of the data is used for validation. By adjusting the model parameters, the model has the highest accuracy on the validation set.
[0092] For the MLP model, a neural network structure including an input layer, a hidden layer, and an output layer is designed. The number of neurons in the input layer is determined according to the number of selected features, the hidden layer is set to [NH] neurons (determined by experiments, such as NH = 50), and the number of neurons in the output layer is the number of quality level categories (such as high-quality, good, qualified, and unqualified, a total of 4 categories, then the number of neurons in the output layer is 4). ReLU is used as the activation function of the hidden layer, and softmax is used as the activation function of the output layer. Stochastic gradient descent (SGD) is used as the optimization algorithm, and the learning rate is set to [LR] (such as LR = 0.01), and the number of iterations is [IT] times (such as IT = 500). During the training process, the weights and biases of the network are continuously adjusted to gradually reduce the loss function value of the model on the training set, while the accuracy on the validation set is continuously improved.
[0093] Specifically, in this embodiment, the verification and optimization of the model:
[0094] Cross Validation:
[0095] The k-fold cross-validation method is used to evaluate the established quality grading model. The collected data set is randomly divided into k subsets of similar size, of which k-1 subsets are used as training sets for training the model, and the remaining subset is used as a validation set to evaluate the performance of the model. This process is repeated k times, and a different subset is selected as the validation set each time. Finally, the average of the k validation results is calculated to obtain the average accuracy, recall rate, F1 value and other evaluation indicators of the model. Through cross-validation, the performance of the model on different data subsets can be comprehensively and objectively evaluated to avoid evaluation bias caused by unreasonable data division. At the same time, it can also detect whether the model has problems such as overfitting. For example, when k=10, the data set is divided into 10 parts, 9 parts of data are trained and 1 part of data is validated in turn, and the average of the 10 validation results is finally obtained to evaluate the performance of the model. Specifically:
[0096] The above three models were evaluated using the 10-fold cross validation method. The preprocessed data set was randomly divided into 10 parts, 9 of which were used as training sets and 1 as validation sets in turn, and training and validation were performed 10 times. The accuracy, recall, and F1 value of the model were calculated for each validation.
[0097] In each cross-validation, for each model, the classification results of shrimps of different quality grades on the validation set were recorded. The accuracy (the proportion of correctly classified samples to the actual number of samples of that grade), recall (the proportion of correctly classified samples to the number of samples predicted to be of that grade) and F1 value (an indicator that comprehensively considers accuracy and recall, F1 = 2*(accuracy*recall) / (accuracy+recall)) of each quality grade were calculated.
[0098] Finally, the average accuracy, average recall, and average F1 value of each model in the 10 cross-validations were calculated as evaluation indicators of model performance. The performance of the three models on these indicators was compared, and the model with the best performance was selected as the final quality grading model for white shrimp. Assume that in this experiment, the RF model performed best, with an average accuracy of 87.5%, an average recall of 86.2%, and an average F1 value of 86.8%. The cross-validation results are shown in Table 3 below.
[0099] Table 3 Cross validation results:
[0100] Model Average accuracy (%) Average recall rate (%) Average F1 value SVM 85.2 83.5 84.3 RF 87.5 86.2 86.8 MLP 84.8 82.9 83.8
[0101] Optimization adjustments:
[0102] According to the results of cross-validation, the model is optimized and adjusted. If the classification accuracy of the model is low at certain quality levels, the reasons can be analyzed and corresponding measures can be taken to improve it. For example, if it is found that the importance of certain features is underestimated or the model parameters are set unreasonably, feature selection can be re-performed or the hyperparameters of the model (such as the kernel function parameters of SVM, the learning rate of the neural network, and the number of hidden layer nodes, etc.) can be adjusted. In addition, it is also possible to consider increasing the diversity or quantity of training data to improve the generalization ability of the model. By continuously optimizing and adjusting the model, it can be more accurately graded and evaluated for the quality of white shrimp to meet the needs of practical applications.
[0103] Application of the model
[0104] The quality grading model for whiteleg shrimp constructed in this embodiment has a wide range of application scenarios and can be used throughout the entire industrial chain of whiteleg shrimp, including but not limited to the following links:
[0105] Farming stage: Farmers can collect samples regularly during the shrimp farming process and use this model to evaluate the quality of the shrimp. According to the evaluation results, the farming environment, feed formula and feeding strategy can be adjusted in time to improve the quality and growth performance of the shrimp. For example, if the model predicts that the quality of the shrimp has a downward trend, the farmer can check whether there are problems with the water quality, such as whether the dissolved oxygen content and ammonia nitrogen content exceed the standard, and take corresponding measures to improve it in time; at the same time, the feed formula can be adjusted according to the nutritional needs of the shrimp to ensure that the shrimp obtains sufficient nutrition, thereby improving the quality and yield of the shrimp.
[0106] Post-harvest processing: After the shrimps are caught, the processing plants or buyers can use this model to quickly grade the shrimps in order to reasonably arrange the subsequent processing, storage and transportation processes. For shrimps with better quality, high value-added processing can be given priority, such as making shrimp meat, shrimp dumplings and other products; while for shrimps with slightly lower quality, appropriate processing methods can be selected or they can be sold in time to reduce losses. In addition, through quality grading, different pricing strategies can be formulated according to different grades of shrimps to achieve high quality and high prices and improve economic benefits.
[0107] Processing stage: During the shrimp processing, the model can be used to monitor the quality changes of shrimp in real time to ensure the quality stability of processed products. For example, during the shrimp processing, by regularly testing the physical and chemical indicators and freshness indicators of shrimp meat and inputting them into the model for evaluation, abnormal changes in shrimp meat quality can be discovered in time, such as quality degradation caused by improper temperature control or too long processing time. According to the feedback of the model, the processing parameters are adjusted in time to ensure that the processed shrimp products meet the quality standards. At the same time, the model can also provide a basis for quality traceability for processing companies. When a batch of products is found to have quality problems, the model can be used to analyze relevant data, trace the source of the problem, and take corresponding measures to improve and prevent it.
[0108] Market circulation: In the process of shrimp sales, the quality grading model can provide objective quality information for dealers and consumers, and enhance the transparency and trust of the market. Dealers can classify and sell shrimps of different quality grades according to the evaluation results of the model, and clearly mark the quality grade and related information of the products to consumers to help consumers make reasonable purchasing decisions. Consumers can choose products that meet their needs and expectations by understanding the quality grade of shrimps, and can also monitor and compare the quality of shrimp products on the market. This will help promote fair competition in the market and promote the healthy development of the white shrimp industry.
[0109] In another implementation of this embodiment:
[0110] Data collection expansion and optimization:
[0111] In addition to collecting samples at the farm, samples were also collected at the transportation stage after shrimp was caught and at the beginning of the processing stage. During the transportation stage, shrimp samples were randomly selected from the transport boxes at regular intervals (every 2 hours), and the number of samples collected from each transportation batch was [X2]. At the beginning of the processing stage, samples were taken from different batches of raw shrimp, and the number of samples collected from each batch was [X3]. This can more comprehensively cover the quality changes of shrimp from fishing to processing, providing richer data support for the model.
[0112] For the collected samples, in addition to the conventional physical and chemical indicators, microbiological indicators and freshness indicators mentioned in the examples, some other indicators related to the quality of shrimp are further added, such as the antioxidant capacity of shrimp meat (which can be evaluated by measuring the activity of relevant antioxidant enzymes or the content of antioxidant substances in shrimp meat) and the nutritional composition of shrimp meat (such as amino acid composition and content, fatty acid composition and content, etc.). These indicators can reflect the quality characteristics of shrimp from different angles and help improve the accuracy and reliability of the model.
[0113] Model optimization and adjustment
[0114] Feature Engineering Optimization:
[0115] On the basis of the above-mentioned feature selection and extraction, more complex feature combination methods are further explored. In addition to simple correlation analysis and principal component analysis, a feature importance evaluation method based on a decision tree is used to determine the importance of each feature for the quality grading of shrimp. For those features with high importance scores in the decision tree and low correlation with other features, higher weights are given or more in-depth feature derivation is performed. For example, based on the changing trends of the pH value and TVB-N content of shrimp meat, a new feature "comprehensive index of freshness" is constructed, which can more intuitively reflect the changes in the freshness of shrimp meat. It is assumed that the correlation coefficient between the "comprehensive index of freshness" and the quality of shrimp has reached 0.78 through experimental verification, which is significantly higher than the correlation between the pH value or TVB-N content and quality alone.
[0116] Taking into account the possible nonlinear relationship between different indicators, polynomial features and interaction features are introduced. Some key physical and chemical indicators and microbiological indicators are transformed into polynomials (such as quadratic terms and cubic terms), and the interaction terms (such as product terms) between them are calculated. These newly constructed features are added to the original feature set, and feature selection and extraction are performed again to explore more potential useful information and improve the model's ability to fit complex quality relationships. For example, for the two indicators of protein content and fat content, after constructing their quadratic features (protein content 2, fat content 2) and interaction features (protein content × fat content), it was found that the accuracy of the model on the training set was improved by 3.5%.
[0117] Model hyperparameter tuning:
[0118] For the selected machine learning model (after comparison in the embodiment, the SVM model performs best), the tuning range and search strategy of the hyperparameters are further refined. Figure 2 As shown in the figure, in addition to using the grid search method, random search and Bayesian optimization algorithms are tried to find more suitable hyperparameter combinations. For example, for the penalty parameter C and kernel function parameter γ of the SVM model, random search or optimization search based on Bayesian reasoning is performed in a wider parameter space to improve the generalization ability and adaptability of the model on different data sets. By comparing the results of different search methods, it is found that the Bayesian optimization algorithm performs better in finding a better hyperparameter combination, which improves the accuracy of the model on the validation set by 2.2%.
[0119] Introduce model integration technology, such as Bagging (self-help aggregation) or Boosting (boosting) method, combined with the SVM model. For example, build an SVM integration model based on the AdaBoost (adaptive boosting) algorithm, and improve the stability and accuracy of the model by training weak classifiers (SVM) multiple times and weighted combination according to their performance. When building the integration model, adjust the number of Boosting iterations, learning rate and other parameters to obtain the best integration effect. Experimental results show that after using the AdaBoost-SVM integration model, the average accuracy of the model reached 89.2%, which is 1.7 percentage points higher than the single SVM model.
[0120] Model validation and evaluation improvements:
[0121] The stratified cross-validation method is used instead of the simple k-fold cross-validation to ensure that samples of each quality level can be fully considered and evaluated during the validation process. Stratified cross-validation divides the data set into layers according to the quality level, and then randomly samples in each layer to form a training set and a validation set. This can avoid the situation where samples of certain quality levels are too few or too many in the validation set due to random division, thereby more accurately evaluating the performance of the model at different quality levels. For example, in stratified cross-validation, the proportion of samples of each quality level in the validation set is basically the same as that in the original data set, making the model's evaluation of each quality level more accurate and reliable.
[0122] In addition to using common evaluation indicators such as accuracy, recall and F1 value, some more comprehensive and detailed evaluation indicators are introduced, such as the area under the receiver operating characteristic curve (AUC-ROC), mean square error (MSE) and mean absolute error (MAE). AUC-ROC can intuitively reflect the model's ability to distinguish different quality levels at different thresholds, while MSE and MAE can measure the error between the model's predicted value and the actual value, and evaluate the performance and pros and cons of the model from different angles. Assume that after experimental calculation, the AUC-ROC value of the optimized model in a certain verification is 0.92, MSE is 0.04, and MAE is 0.12. These indicators further illustrate the good performance of the model.
[0123] Practical application testing and feedback of the model
[0124] The optimized quality grading model for white shrimp was applied to actual production scenarios for a period of testing and verification. In different links such as breeding bases, fishing and transportation companies, and processing plants, a large number of shrimp samples were tested and predicted in real time, and the predicted results were compared and analyzed with the actual quality situation.
[0125] According to the feedback from actual applications, collect cases of errors or inaccuracies in the prediction process of the model, and analyze the reasons in depth. For example, are there some special breeding environments, transportation conditions or processing technologies that cause the quality characteristics of shrimp to change, and the model fails to accurately capture these changes; or is it due to errors in the data collection process or sample deviations that cause the model's prediction to deviate. In response to these problems, the model is further adjusted and optimized, and the performance and adaptability of the model are continuously improved so that it can better meet the quality grading needs in actual production. In the actual application test, it was found that for some shrimp samples that have undergone special preservation treatments, the prediction accuracy of the model is low. After analysis, it was found that these preservation treatments affect some physical and chemical indicators and odor characteristics of shrimp meat, which is different from the data distribution during model training. Therefore, in response to these special cases, the relevant data was re-collected and the model was further trained and optimized, which increased the prediction accuracy of the model by about 10 percentage points when facing similar samples.
[0126] By integrating data from multiple dimensions (physical and chemical indicators, microbial indicators, and freshness indicators, etc.), the model in this embodiment can more comprehensively reflect the true quality status of whiteleg shrimp, thereby improving the objectivity and accuracy of quality assessment.
[0127] It provides a scientific, accurate and easy-to-operate quality grading model, which simplifies the traditional manual sensory evaluation method and reduces the interference of subjective factors. The rapid evaluation ability of the model helps processing plants or buyers to quickly grade the quality of shrimp, reasonably arrange the subsequent processing, storage and transportation processes, and improve the efficiency of the entire industry chain.
[0128] Farmers can adjust the breeding environment, feed formula and feeding strategy in time according to the model evaluation results to improve the quality and growth performance of shrimp. In the market sales process, the quality grading model can provide objective quality information for dealers and consumers, and enhance the transparency and trust of the market. By clearly marking the quality grade and related information of the product, it will help promote fair competition in the market and promote the healthy development of the white shrimp industry. Different pricing strategies can be formulated according to different grades of shrimp to achieve high quality and high price and improve economic benefits. It can also provide a basis for quality traceability for processing companies. When a batch of products is found to have quality problems, the model can be used to analyze relevant data, trace the source of the problem, and take corresponding measures to improve and prevent it.
[0129] The embodiments described above are only descriptions of the preferred embodiments of the present invention and are not intended to limit the scope of the present invention. Without departing from the design spirit of the present invention, various modifications and improvements made to the technical solutions of the present invention by ordinary technicians in this field should all fall within the protection scope determined by the claims of the present invention.
Claims
1. A method for grading the quality of whiteleg shrimp based on multi-parameter fusion of machine learning algorithm, characterized in that: include: Collecting index data of whiteleg shrimp; wherein the index data includes: physical and chemical index data, microbial index data, and freshness index data; Preprocessing the indicator data; Using the preprocessed index data, training and verifying the preset machine learning model to obtain a South American shrimp grading model; The Penaeus vannamei grading model is used to grade the quality of the Penaeus vannamei to be tested.
2. The method for grading quality of Penaeus vannamei based on multi-parameter fusion of machine learning algorithm according to claim 1, characterized in that: The physical and chemical index data include: moisture content, protein content, fat content, pH value, TVB-N content; The microbial indicator data include: total bacterial colony count, E. coli count and Salmonella content; The freshness index data includes: odor component information related to freshness, hardness and elasticity texture parameters of shrimp meat.
3. The method for grading quality of Penaeus vannamei based on multi-parameter fusion of machine learning algorithm according to claim 1, characterized in that: Preprocessing the indicator data includes: Fill missing values; Handle outliers in the data; Perform data normalization.
4. The method for grading quality of Penaeus vannamei based on multi-parameter fusion of machine learning algorithm according to claim 1, characterized in that: Using the preprocessed indicator data, training and verifying the preset machine learning model includes: Performing feature selection and extraction on the preprocessed indicator data; Build machine learning models; Determine label data for the extracted features; Build a dataset based on the extracted features and corresponding label data; The data set is used to train and validate the machine learning model.
5. The method for grading quality of Penaeus vannamei based on multi-parameter fusion of machine learning algorithm according to claim 4 is characterized in that: The feature selection and extraction of the preprocessed indicator data includes: Calculate the Pearson correlation coefficients between various physical and chemical indicators, microbiological indicators and freshness indicators, and select indicators with absolute values of correlation coefficients greater than the preset threshold as the features for preliminary screening The principal component analysis is performed on the initially screened features to transform the initially screened features into mutually independent principal components.
6. The method for grading quality of Penaeus vannamei based on multi-parameter fusion of machine learning algorithm according to claim 4, characterized in that: Validation of the machine learning model using the dataset includes: The trained model was evaluated using the k-fold cross validation method; According to the results of cross-validation, the model is optimized and adjusted.
7. An electronic device, characterized in that: The method comprises a memory and a processor, wherein the memory is used to store a computer program, and the processor is used to call and run the computer program stored in the memory to execute the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Method for detecting pork freshness based on color and smell data fusion
CN109490306A
Crayfish grading method based on machine learning
CN111666986A
Chilled pomfret freshness evaluation method based on MU-SVM
CN111768402A
Pork freshness detection method based on color and smell data fusion
CN113567439A