Food authenticity identification method and system based on spectral imaging
Through a spectral imaging-based method, combined with adaptive large neighborhood search algorithm, locally sensitive hashing technology and deep Q network, the problem of feature selection and model training in food authenticity identification is solved, and efficient, accurate and reliable food authenticity identification is achieved.
Patent Information
- Application Number
- CN202411871027.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-18
- Publication Date
- 2025-05-23
- Estimated Expiration
- 2044-12-18
AI Technical Summary
The existing food authenticity identification methods have problems such as slow detection speed, high cost, complex operation and poor generalization capabilities of models, especially in feature selection and model training.
Using a spectral imaging-based method, we collect multi-dimensional spectral image information of food samples, integrate data from near-infrared and short-wave infrared regions, and use adaptive large neighborhood search algorithm and local sensitive hashing technology to explore and select feature space to generate an optimized spectral feature set. Then, deep Q networks under the reinforcement learning framework are used for deep learning, model parameters are dynamically adjusted, confidence evaluation is performed through uncertainty quantization method, and high confidence identification results are generated.
It improves the accuracy and efficiency of food authenticity identification, enhances the generalization ability and robustness of the model, ensures the reliability and credibility of the predicted results, and provides a more comprehensive and reliable identification conclusion.
Smart Images

Figure CN120028284A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of food detection technology, and in particular to a method and system for food authenticity identification based on spectral imaging. Background Art
[0002] As food safety issues are gaining increasing attention, the food industry needs an efficient and accurate method to identify the authenticity of food to ensure food safety and consumer rights. Especially in import and export trade, market supervision, and combating counterfeit and shoddy products, fast and reliable identification technology is particularly important. Multi-dimensional spectral imaging technology has become an ideal choice for food authenticity identification due to its non-destructive and high information content.
[0003] At present, traditional methods for identifying the authenticity of food mainly rely on chemical analysis, sensory testing and simple spectral technology. Although these methods can identify the authenticity of food to a certain extent, they have problems such as slow detection speed, high cost and complex operation. In recent years, some studies have begun to explore the use of near-infrared and short-wave infrared spectroscopy technology for food authenticity identification, but these methods still need to be improved in feature selection and model training.
[0004] Traditional methods usually require a lot of manual intervention, and the test results are greatly affected by subjective factors. In addition, existing spectral technologies are prone to overfitting when processing high-dimensional data, resulting in poor model generalization ability. The feature selection process often relies on manual experience, lacks systematicity and automation, and is inefficient. In addition, when facing different types of food, the existing methods are not flexible enough in adjusting model parameters and are difficult to adapt to complex identification tasks. Finally, the confidence assessment of the prediction results is insufficient and cannot provide reliable risk assessment. Summary of the invention
[0005] The embodiments of the present application provide a method and system for food authenticity identification based on spectral imaging, so as to solve the problem of poor generalization ability of the model in the prior art.
[0006] In a first aspect, the present application provides a method for food authenticity identification based on spectral imaging, comprising:
[0007] Collect multi-dimensional spectral image information of food samples, integrate near-infrared and short-wave infrared regions, and generate a comprehensive spectral image dataset;
[0008] Based on the comprehensive spectral image data set, an adaptive large neighborhood search algorithm is used to explore the feature space, automatically find the best feature combination, and a local sensitive hashing technology is used for rapid positioning and screening to improve the efficiency and accuracy of feature selection and generate an optimized spectral feature set;
[0009] Based on the optimized spectral feature set, a deep Q network under a reinforcement learning framework is used for deep learning, model parameters are dynamically adjusted to adapt to different types of food authenticity identification tasks, and an uncertainty quantification method is used to perform confidence assessment on the prediction results to generate high-confidence identification results;
[0010] Based on the high-confidence identification results, combined with the food's physical and chemical properties and food industry standards, a comprehensive authenticity identification result is generated.
[0011] Optionally, based on the comprehensive spectral image data set, an adaptive large neighborhood search algorithm is used to explore the feature space, automatically find the best feature combination, and a local sensitive hashing technology is used for rapid positioning and screening to improve the efficiency and accuracy of feature selection and generate an optimized spectral feature set, including:
[0012] Based on the comprehensive spectral image data set, the algorithm parameters are initialized, the search range and step size are set, and the preprocessing parameter configuration is generated;
[0013] Based on the preprocessing parameter configuration, an adaptive large neighborhood search algorithm is used to explore the feature space, and a fitness function for food authenticity identification accuracy is defined to evaluate the effectiveness of different feature combinations. After multiple iterations, the best feature combination is automatically found to generate a preliminary feature combination.
[0014] Based on the preliminary feature combination, local sensitive hashing technology is used to perform rapid positioning and screening, efficiently identify high-similarity spectral features, further refine the feature combination, improve feature selection efficiency and accuracy, and generate a refined spectral feature set;
[0015] Based on the refined spectral feature set, the contribution of each feature is evaluated and analyzed, redundant and noise features are eliminated, and an optimized spectral feature set is generated.
[0016] Optionally, based on the preprocessing parameter configuration, an adaptive large neighborhood search algorithm is used to explore the feature space, and a fitness function for food authenticity identification accuracy is defined to evaluate the effectiveness of different feature combinations. After multiple iterations, the best feature combination is automatically found to generate a preliminary feature combination, including:
[0017] Based on the preprocessing parameter configuration, the starting point is initialized, the search space boundary and step size are defined, the direction of the search process is clarified, and the initialization search parameters are generated;
[0018] Based on the initialization search parameters, a fitness function for food authenticity identification accuracy is defined, and the classification accuracy of the feature combination training set and the independence between features are comprehensively considered to comprehensively evaluate the effectiveness of different feature combinations and generate a fitness evaluation standard;
[0019] Based on the fitness evaluation criteria, the adaptive large neighborhood search algorithm is used to systematically explore the feature space. In each iteration, the search direction and search range are dynamically adjusted according to the performance of the current solution to find a better feature combination. After multiple iterations, an excellent feature combination is generated;
[0020] Based on the excellent feature combination, cross-validation is performed to evaluate and adjust the generalization ability, and a preliminary feature combination is generated.
[0021] Optionally, based on the fitness evaluation criteria, the adaptive large neighborhood search algorithm is used to systematically explore the feature space. In each iteration, the search direction and search range are dynamically adjusted according to the performance of the current solution to find a better feature combination. After multiple iterations, an excellent feature combination is generated, including:
[0022] Based on the fitness evaluation criteria, dimensionality reduction processing is performed on the feature combination to remove noise and redundant information;
[0023] Use the selected classification algorithm to train the model on the training set, obtain the classification accuracy of the feature combination, and generate a feature evaluation value;
[0024] The feature evaluation value is calculated through the following formula:
[0025]
[0026] where E(X) is the feature evaluation value of the feature combination X, which is used to comprehensively evaluate the classification accuracy and feature independence of the feature combination; α is the balance coefficient of classification accuracy and feature independence, and its value range is [0,1]; Acc(X,y) is the classification accuracy of the feature combination X on the training set; Corr(x i ,x j ) is the correlation between feature x i and x j ; m is the number of features in the feature combination; i and j are the indices of the features in the feature combination, ranging from 1 to m, and i < j, which are used to calculate the pairwise correlation between features;
[0027] Based on the feature evaluation value, the discrimination ability of the evaluation value is enhanced through non-linear adjustment, a distance weighting mechanism is introduced to evaluate the relative importance of solutions in the neighborhood, and a periodic adjustment term is added to simulate the feature combination to generate an optimized value of the feature combination;
[0028] The optimized value of the feature combination is calculated through the following formula:
[0029]
[0030] where O kis the optimized value of the feature combination of the kth iteration, which is used to evaluate the optimization degree of the feature combination in the current neighborhood; β is the balance coefficient of nonlinear adjustment and distance weighting, and its value range is [0,1]; E(X) is the feature evaluation value of feature combination X; γ is the gain coefficient of nonlinear adjustment; δ is the periodic adjustment amplitude; θ is the period length, which is used to control the frequency of periodic changes; d i is the distance between the current solution and the i-th neighbor solution; n is the neighborhood size of the current solution; σ and τ are the scale parameters in the distance weighting, which are used to control the influence of distance; η is the periodic adjustment coefficient, which is used to introduce periodic changes; λ is the period length, which is used to control the frequency of periodic changes; ζ is the gain coefficient of distance influence; μ is the scale parameter of distance influence; ξ is the attenuation coefficient of distance influence; v is the attenuation scale parameter of distance influence; i is the index of the neighbor solution of the current solution, from 1 to n, which is used to calculate the distance and influence between the current solution and each neighbor solution; k is the number of iterations;
[0031] Based on the optimized value of the feature combination, the optimal feature combination is selected in the neighborhood of the current solution through neighborhood search, other solutions in the neighborhood are updated, and an excellent feature combination is generated through multiple iterative processes.
[0032] Optionally, based on the preliminary feature combination, the local sensitive hashing technology is used to perform rapid positioning screening, efficiently identify high-similarity spectral features, further refine the feature combination, improve feature selection efficiency and accuracy, and generate a refined spectral feature set, including:
[0033] Based on the preliminary feature combination, an index is constructed using local sensitive hashing technology, a suitable hash function is set, high-similarity spectral features are efficiently identified, and a similar feature index is generated;
[0034] Based on the similar feature index, each feature in the preliminary feature combination is quickly located and screened, and a screened feature set is generated based on the similarity with other features;
[0035] Based on the screened feature set, further analyzing the correlation and independence between features, eliminating features that contribute less to food authenticity identification, and generating a refined feature combination;
[0036] Based on the refined feature combination, a refined spectral feature set is generated by comprehensively considering the feature representativeness and contribution to food authenticity identification.
[0037] Optionally, based on the optimized spectral feature set, a deep Q network under a reinforcement learning framework is used for deep learning, model parameters are dynamically adjusted to adapt to different types of food authenticity identification tasks, and an uncertainty quantification method is used to perform confidence assessment on the prediction results to generate high-confidence identification results, including:
[0038] Based on the optimized spectral feature set, network parameters and learning rate are initialized, a reward mechanism is set to better adapt to different types of food authenticity identification tasks, and initialization model parameters are generated;
[0039] Based on the initialized model parameters, deep learning is performed using a deep Q network under a reinforcement learning framework, and the model parameters are dynamically adjusted through multiple rounds of training to achieve adaptive adjustment of internal weights, improve the accuracy of authenticity identification of different types of food, and generate a training optimization model;
[0040] Based on the training optimization model, the optimized spectral feature set is predicted, the confidence is evaluated by using an uncertainty quantification method, the probability distribution of the prediction result is calculated, the model confidence level is evaluated, and the prediction result confidence is generated;
[0041] Based on the confidence of the prediction result, a confidence threshold is set for screening to generate a high-confidence identification result.
[0042] Optionally, based on the initialized model parameters, deep learning is performed using a deep Q network under a reinforcement learning framework, and the model parameters are dynamically adjusted through multiple rounds of training to achieve adaptive adjustment of internal weights, improve the accuracy of authenticity identification of different types of food, and generate a training optimization model, including:
[0043] Based on the initialization model parameters, the optimized spectral feature set is input into the model, a training process is started, and a preliminary training model is generated by generating action and environmental feedback through model prediction;
[0044] Based on the preliminary training model, a deep Q network under the reinforcement learning framework is used to randomly extract samples from past experience for learning, break the correlation between samples, improve the generalization ability of the model, and generate an experience replay model;
[0045] Based on the experience replay model, target network parameters are updated using target network technology to stabilize the learning process and generate a stable optimization model;
[0046] Based on the stable optimization model, performance testing is performed in combination with the validation set to evaluate the accuracy of authenticity identification of different types of food, select the best performing model parameters, and generate a training optimization model.
[0047] Optionally, based on the preliminary training model, a deep Q network under a reinforcement learning framework is used to randomly extract samples from past experience for learning, break the correlation between samples, improve the generalization ability of the model, and generate an experience replay model, including:
[0048] Based on the preliminary training model, a batch of samples are randomly drawn from the experience replay pool;
[0049] Analyze the similarity between each sample state action and the current state action, measure the similarity through the Gaussian kernel function to generate the experience replay sampling weight;
[0050] The experience replay sampling weight is calculated using the following formula:
[0051]
[0052] Among them, S t is the experience replay sampling weight for the current time step t; N is the number of samples in the experience replay pool; s i and t are the state of the i-th sample in the experience replay pool and the state of the current time step t respectively; a i and a t are the action of the i-th sample in the experience replay pool and the action of the current time step t respectively; σ s and σ a are the similarity scale parameters of states and actions respectively; i is the index of the sample in the experience replay pool, from 1 to N; it is used to calculate the similarity of each sample with the current state and action;
[0053] Based on the experience replay sampling weights, a batch of samples are drawn from the experience replay pool in proportion to ensure that high-weight samples are preferentially selected to update the model, and combined with the instant reward of each sample, back-propagation technology is used to generate updated model parameters;
[0054] The updated model parameters are calculated using the following formula:
[0055]
[0056] Among them, θ t+1 is the updated model parameter; θ t is the model parameter of the current time step t; α is the learning rate; B is the batch size of samples randomly drawn from the experience replay pool; r i is the instant reward of the i-th sample; γ is the discount factor; Q(s,a;θ) is the Q value function of the deep Q network, with parameter θ; s i and a i are the state and action of the i-th sample respectively; s i+1 is the next state of the i-th sample; θ - is the parameter of the target network; ∈ is a smoothing term to prevent zero division errors; i is the index of a sample batch randomly drawn from the experience replay pool, from 1 to B, used to calculate the TD error and gradient of each sample; a' is the error in state s i+1 The best action among all possible actions; Q(s i+1 ,a';θ - ) is in state s i+1The Q value of the target network when taking the optimal action a';
[0057] Based on the updated model parameters, the current model is applied to reflect the latest learning results, the target network parameters are synchronously updated at a certain update frequency, and the model parameters are optimized through multiple iterations to generate an experience replay model.
[0058] Optionally, the high-confidence identification result is combined with the chemical properties of the food and the food industry standards to generate a comprehensive authenticity identification result, including:
[0059] Based on the high-confidence identification results, combined with the physical and chemical properties of the food, physical and chemical level verification is performed to generate physical and chemical verification results;
[0060] Based on the physical and chemical verification results, with reference to food industry standards, a standardized evaluation is performed on the authenticity of the food sample to generate a standardized evaluation result;
[0061] Based on the standardized assessment results, comprehensively analyze the food processing and storage conditions, assess the potential adulteration risk, and generate a comprehensive identification report;
[0062] Based on the comprehensive identification report, different situations of food authenticity are analyzed in detail, specific treatment suggestions are put forward for foods with different authenticity states, and a comprehensive authenticity identification result is generated.
[0063] In a second aspect, the present application provides a food authenticity identification system based on spectral imaging, comprising:
[0064] The collection module is used to collect multi-dimensional spectral image information of food samples, integrate near-infrared and short-wave infrared regions, and generate a comprehensive spectral image data set;
[0065] A screening module is used to explore the feature space based on the comprehensive spectral image data set using an adaptive large neighborhood search algorithm, automatically find the best feature combination, use local sensitive hashing technology for rapid positioning and screening, improve feature selection efficiency and accuracy, and generate an optimized spectral feature set;
[0066] An adjustment module is used to perform deep learning based on the optimized spectral feature set using a deep Q network under a reinforcement learning framework, dynamically adjust model parameters to adapt to different types of food authenticity identification tasks, use an uncertainty quantification method to perform confidence assessment on the prediction results, and generate high-confidence identification results;
[0067] A generation module is used to generate a comprehensive authenticity identification result based on the high-confidence identification result, combined with the chemical properties of the food and the food industry standards.
[0068] In an embodiment of the present application, multi-dimensional spectral image information of food samples is collected, and near-infrared and short-wave infrared regions are integrated to generate a comprehensive spectral image data set; based on the comprehensive spectral image data set, an adaptive large neighborhood search algorithm is used to explore the feature space, automatically find the best feature combination, and use local sensitive hashing technology for rapid positioning and screening to improve feature selection efficiency and accuracy, and generate an optimized spectral feature set; based on the optimized spectral feature set, a deep Q network under a reinforcement learning framework is used for deep learning, and model parameters are dynamically adjusted to adapt to different types of food authenticity identification tasks. An uncertainty quantification method is used to perform confidence assessment on the prediction results to generate a high-confidence identification result; based on the high-confidence identification result, a comprehensive authenticity identification result is generated in combination with the food's physical and chemical properties and food industry standards.
[0069] The technical solution of this application has the following beneficial effects:
[0070] By collecting multi-dimensional spectral image information of food samples and integrating data from near-infrared and short-wave infrared regions, a comprehensive spectral image data set is generated, which improves the richness and completeness of the data and enhances the accuracy of the model in identifying the authenticity of food; the adaptive large neighborhood search algorithm is used to explore the feature space, automatically find the best feature combination, and use local sensitive hashing technology for rapid positioning and screening, which significantly improves the efficiency and accuracy of feature selection, reduces redundant features, and improves the generalization ability of the model; the deep Q network under the reinforcement learning framework is used for deep learning, and the model parameters are dynamically adjusted to adapt to the authenticity identification tasks of different types of food, which can better handle complex and changeable food samples and improve the robustness and accuracy of the model; the confidence of the prediction results is evaluated through the uncertainty quantification method, and high-confidence identification results are generated, which ensures the reliability of the prediction results and provides a solid foundation for decision-making. Based on the high-confidence identification results, combined with the physical and chemical properties of food and food industry standards, a comprehensive authenticity identification result is generated, which not only considers the prediction results of the model, but also combines the actual physical and chemical properties and industry standards, providing a more comprehensive and reliable identification conclusion.
[0071] Furthermore, through the adaptive large neighborhood search algorithm and local sensitive hashing technology, it is possible to efficiently and automatically find the best feature combination from the comprehensive spectral image data set, and quickly locate and screen it, which significantly improves the efficiency and accuracy of feature selection, reduces manual intervention, and improves the generalization ability of the model; on the basis of the preliminary feature combination, the local sensitive hashing technology is used to further identify high-similarity spectral features, eliminate redundant and noise features, optimize the feature set, enhance the robustness and stability of the model, and ensure that the final generated optimized spectral feature set has higher quality and reliability; by defining the accuracy fitness function of food authenticity identification, the best feature combination is automatically found after multiple iterations, and the generated optimized spectral feature set can better reflect the authenticity characteristics of the food, providing high-quality data support for subsequent deep learning models, thereby improving the accuracy and reliability of the entire identification.
[0072] Furthermore, deep learning is performed using a deep Q network under the reinforcement learning framework, and model parameters are dynamically adjusted through multiple rounds of training, so that the model can adapt to the authenticity identification tasks of different types of food, thereby enhancing the flexibility and adaptability of the model and enabling it to better handle complex and changeable food samples; the prediction results are evaluated for confidence through uncertainty quantification methods, the probability distribution of the prediction results is calculated, and the confidence level of the model is evaluated, thereby ensuring the reliability and credibility of the prediction results and providing a solid foundation for decision-making; based on the confidence of the prediction results, screening is performed by setting a confidence threshold to generate high-confidence identification results, thereby improving the accuracy of the identification results, enhancing the interpretability and practicality of the results, and providing more reliable technical support for food safety supervision and consumers.
[0073] These and other aspects of the present application will become more clearly understood in the description of the following embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0074] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0075] Figure 1 A flowchart of a method for food authenticity identification based on spectral imaging provided in an embodiment of the present application;
[0076] Figure 2 A schematic diagram of the structure of a food authenticity identification system based on spectral imaging provided in an embodiment of the present application;
[0077] Figure 3A schematic diagram of the structure of a computing device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0078] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.
[0079] In some of the processes described in the specification and claims of this application and the above-mentioned figures, multiple operations that appear in a specific order are included, but it should be clearly understood that these operations may not be executed in the order in which they appear in this article or executed in parallel. The serial numbers of the operations, such as 101, 102, etc., are only used to distinguish between different operations, and the serial numbers themselves do not represent any execution order. In addition, these processes may include more or fewer operations, and these operations may be executed in sequence or in parallel. It should be noted that the descriptions of "first", "second", etc. in this article are used to distinguish different messages, devices, modules, etc., do not represent the order of precedence, and do not limit the "first" and "second" to be different types.
[0080] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.
[0081] Figure 1 A flowchart of a method for food authenticity identification based on spectral imaging is provided for an embodiment of the present application, such as Figure 1 As shown, the method includes:
[0082] 101. Collect multi-dimensional spectral image information of food samples, integrate near-infrared and short-wave infrared regions, and generate a comprehensive spectral image data set;
[0083] Multi-dimensional spectral image information includes spectral data in the near-infrared and short-wave infrared regions, which provides the absorption and reflection characteristics of food samples at different wavelengths, and is used to comprehensively analyze the physical and chemical properties of food. The near-infrared spectrum mainly reflects the information of water, fat, protein and other components in the food, while the short-wave infrared spectrum can provide deeper chemical composition information, such as sugars, cellulose, pectin, etc.
[0084] The comprehensive spectral image dataset is a dataset that combines data from the near-infrared and short-wave infrared regions to form a dataset that contains rich information. It not only contains the spectral information of food samples in different bands, but also provides a more comprehensive and detailed description of food characteristics by integrating data from multiple bands, providing a solid foundation for subsequent feature extraction, model training, and authenticity identification.
[0085] In the embodiment of the present application, first, a near-infrared spectrometer is used to scan the food sample, and the spectral image of the sample in the near-infrared band (about 700-2500 nanometers) is recorded. The near-infrared spectrum can reflect the information of the components such as water, fat, and protein in the food; secondly, a short-wave infrared spectrometer is used to scan the same sample, and the spectral image of the sample in the short-wave infrared band (about 1000-2500 nanometers) is recorded. The short-wave infrared spectrum can provide deeper chemical composition information, such as sugars, cellulose, pectin, etc.; thirdly, the collected near-infrared and short-wave infrared spectral images are preprocessed. This includes steps such as removing background noise, correcting spectral drift, and normalizing spectral intensity to ensure the quality and consistency of the data. The preprocessing step also includes data smoothing and baseline correction to eliminate unnecessary interference signals; finally, the processed near-infrared and short-wave infrared spectral image data are integrated together to form a comprehensive spectral image data set, which contains the spectral information of each sample in different bands, providing a basis for subsequent feature extraction and model training.
[0086] Suppose you need to identify the authenticity of a batch of apples;
[0087] First, the apple samples were scanned using a near-infrared spectrometer to obtain the spectral image of each apple in the near-infrared band (about 700-2500 nanometers), which reflects the information of components such as water, sugar and fat in apples; secondly, the same batch of apples were scanned using a short-wave infrared spectrometer to obtain the spectral image of each apple in the short-wave infrared band (about 1000-2500 nanometers), which provides information on deep chemical components such as cellulose and pectin in apples; thirdly, the collected near-infrared and short-wave infrared spectral images were preprocessed, including removing background noise, correcting spectral drift, normalizing spectral intensity and other steps to ensure the consistency and reliability of the data; finally, the processed near-infrared and short-wave infrared spectral image data were merged to form a comprehensive spectral image dataset, which contains the spectral information of each apple in different bands, providing rich data support for subsequent feature extraction and model training.
[0088] Through the above steps, a comprehensive spectral image dataset was generated, providing a solid foundation for subsequent apple authenticity identification.
[0089] 102. Based on the comprehensive spectral image data set, an adaptive large neighborhood search algorithm is used to explore the feature space, automatically find the best feature combination, and a local sensitive hashing technology is used for rapid positioning and screening to improve the efficiency and accuracy of feature selection and generate an optimized spectral feature set;
[0090] The adaptive large neighborhood search algorithm is an optimization algorithm for feature selection. It automatically finds the optimal feature combination by conducting a systematic search in the feature space. The algorithm can dynamically adjust the search range and step size to improve the search efficiency.
[0091] Locality-sensitive hashing is a technology used to quickly find similar features. It achieves efficient feature location and screening by mapping high-dimensional data into low-dimensional space.
[0092] The optimized spectral feature set is a feature set generated by the above method, which contains the most representative and discriminative spectral features and is used for subsequent model training and prediction.
[0093] In this step, first, the comprehensive spectral image data set is preprocessed, the search range and step size are set, and the parameters of the adaptive large neighborhood search algorithm are initialized; secondly, the adaptive large neighborhood search algorithm is used to explore in the feature space, and the fitness function of the accuracy of food authenticity identification is defined. The effectiveness of different feature combinations is evaluated, and after multiple iterations, the best feature combination is automatically found to generate a preliminary feature combination; thirdly, the local sensitive hashing technology is used to quickly locate and screen the preliminary feature combination, efficiently identify high-similarity spectral features, further refine the feature combination, and improve the efficiency and accuracy of feature selection; finally, the contribution of each feature is evaluated, redundant and noise features are eliminated, and the final optimized spectral feature set is generated.
[0094] Optionally, the method in step 102 is based on the comprehensive spectral image data set, uses an adaptive large neighborhood search algorithm to explore the feature space, automatically finds the best feature combination, uses local sensitive hashing technology to quickly locate and screen, improves the efficiency and accuracy of feature selection, and generates an optimized spectral feature set, including: based on the comprehensive spectral image data set, initializes the algorithm parameters, sets the search range and step size, and generates a preprocessing parameter configuration; based on the preprocessing parameter configuration, uses an adaptive large neighborhood search algorithm to explore the feature space, defines a fitness function for the accuracy of food authenticity identification to evaluate the effectiveness of different feature combinations, automatically finds the best feature combination after multiple iterations, and generates a preliminary feature combination; based on the preliminary feature combination, uses local sensitive hashing technology to quickly locate and screen, efficiently identifies high-similarity spectral features, further refines the feature combination, improves the efficiency and accuracy of feature selection, and generates a refined spectral feature set; based on the refined spectral feature set, evaluates and analyzes the contribution of each feature, eliminates redundant and noise features, and generates an optimized spectral feature set.
[0095] Among them, based on the preprocessing parameter configuration, an adaptive large neighborhood search algorithm is used to explore the feature space, and the validity of different feature combinations is evaluated by defining a fitness function for the accuracy of food authenticity identification. After multiple iterations, the best feature combination is automatically found to generate a preliminary feature combination, including: based on the preprocessing parameter configuration, the starting point is initialized, the search space boundary and step size are defined, the direction of the search process is clarified, and the initialization search parameters are generated; based on the initialization search parameters, a fitness function for the accuracy of food authenticity identification is defined, and the classification accuracy of the feature combination training set and the independence between features are comprehensively considered to comprehensively evaluate the validity of different feature combinations and generate a fitness evaluation standard; based on the fitness evaluation standard, an adaptive large neighborhood search algorithm is used to systematically explore the feature space, and in each iteration, the search direction and search range are dynamically adjusted according to the current solution performance to find a better feature combination, and an excellent feature combination is generated after multiple iterations; based on the excellent feature combination, cross-validation is performed to evaluate the adjustment generalization ability and generate a preliminary feature combination.
[0096] The comprehensive spectral image dataset includes spectral data in the near-infrared and short-wave infrared regions, which is used to provide the absorption and reflection characteristics of food samples at different wavelengths and comprehensively analyze the physical and chemical properties of food.
[0097] The adaptive large neighborhood search algorithm is an optimization algorithm that automatically finds the optimal feature combination by conducting a systematic search in the feature space. It can dynamically adjust the search range and step size to improve the search efficiency.
[0098] Locality-sensitive hashing is a technology used to quickly find similar features. It achieves efficient feature location and screening by mapping high-dimensional data into low-dimensional space.
[0099] The optimized spectral feature set is a feature set generated by the above method, which contains the most representative and discriminative spectral features and is used for subsequent model training and prediction.
[0100] The preprocessing parameters are configured to initialize the algorithm parameters such as the search range and step size before starting feature selection to ensure the effectiveness of the search process.
[0101] The fitness function is a function used to evaluate the effectiveness of different feature combinations, taking into account the classification accuracy of the feature combination on the training set and the independence between features.
[0102] Cross-validation is a method for evaluating the generalization ability of a model. It divides the dataset into multiple subsets, and uses one of the subsets as a validation set and the remaining subsets as training sets in turn to evaluate the model performance.
[0103] In the embodiment of the present application, first, based on the comprehensive spectral image data set, the algorithm parameters are initialized, the search range and step size are set, and the preprocessing parameter configuration is generated; secondly, based on the preprocessing parameter configuration, the starting point is initialized, the search space boundary and step size are defined, the direction of the search process is clarified, the initialization search parameters are generated, and the fitness function of the accuracy of food authenticity identification is defined, and the classification accuracy of the feature combination training set and the independence between features are comprehensively considered to comprehensively evaluate the effectiveness of different feature combinations and generate a fitness evaluation standard; thirdly, based on the fitness evaluation standard, an adaptive large neighborhood search algorithm is used to systematically explore the feature space, and the search direction and search range are dynamically adjusted according to the current solution performance in each iteration to find a better feature combination. After multiple iterations, an excellent feature combination is generated, and cross-validation is performed to evaluate the adjustment generalization ability and generate a preliminary feature combination; finally, based on the preliminary feature combination, the local sensitive hashing technology is used for rapid positioning and screening, and high-similarity spectral features are efficiently identified, and the feature combination is further refined to improve the efficiency and accuracy of feature selection, and a refined spectral feature set is generated, and the contribution of each feature is evaluated and analyzed, and redundant and noise features are eliminated to generate an optimized spectral feature set.
[0104] Suppose you need to verify the authenticity of a batch of wine;
[0105] Firstly, near-infrared and short-wave infrared spectral images of wine samples are collected to form a comprehensive spectral image data set; secondly, based on the comprehensive spectral image data set, the algorithm parameters are initialized, the search range and step size are set, and the preprocessing parameter configuration is generated; then, based on the preprocessing parameter configuration, the starting point is initialized, the search space boundary and step size are defined, the direction of the search process is clarified, and the initialization search parameters are generated; then, based on the initialization search parameters, the fitness function of the accuracy of food authenticity identification is defined, and the classification accuracy of the feature combination training set and the independence between features are comprehensively considered to comprehensively evaluate the effectiveness of different feature combinations and generate a fitness evaluation standard; then, based on the fitness evaluation standard, an adaptive The large neighborhood search algorithm systematically explores the feature space. In each iteration, it dynamically adjusts the search direction and search range according to the current solution performance to find a better feature combination, and generates an excellent feature combination after multiple iterations. Again, based on the excellent feature combination, cross-validation is performed to evaluate the adjustment of generalization ability and generate a preliminary feature combination. Based on the preliminary feature combination, the local sensitive hashing technology is used to perform rapid positioning and screening, efficiently identify high-similarity spectral features, further refine the feature combination, improve the efficiency and accuracy of feature selection, and generate a refined spectral feature set. Finally, based on the refined spectral feature set, the contribution of each feature is evaluated and analyzed, redundant and noise features are eliminated, and an optimized spectral feature set is generated.
[0106] Through the above steps, an optimized spectral feature set was generated, providing high-quality data support for subsequent deep learning models, thereby improving the accuracy and reliability of wine authenticity identification.
[0107] This application takes into account that in the feature selection process, in order to comprehensively evaluate the classification accuracy and feature independence of the feature combination, and optimize the feature combination through nonlinear adjustment and distance weighting mechanism, a calculation method of feature evaluation value and feature combination optimization value is introduced, and the quality of the feature combination is quantified through a mathematical model, thereby guiding the adaptive large neighborhood search algorithm to find the optimal feature combination.
[0108] Optionally, based on the fitness evaluation criteria, an adaptive large neighborhood search algorithm is used to systematically explore the feature space, and in each iteration, the search direction and search range are dynamically adjusted according to the current solution performance to find a better feature combination, and an excellent feature combination is generated after multiple iterations, including:
[0109] Based on the fitness evaluation criteria, the feature combination is subjected to dimensionality reduction processing to remove noise and redundant information;
[0110] Use the selected classification algorithm to train the model on the training set and obtain the classification accuracy of the feature combination to generate a feature evaluation value;
[0111] The feature evaluation value is calculated using the following formula:
[0112]
[0113] Among them, E(X) is the feature evaluation value of the feature combination X, which is used to comprehensively evaluate the classification accuracy and feature independence of the feature combination; α is the balance coefficient of classification accuracy and feature independence, and its value range is [0,1]; Acc(X,y) is the classification accuracy of the feature combination X on the training set; Corr(x i ,x j ) is the correlation between feature x i and x j ; m is the number of features in the feature combination; i and j are the indices of the features in the feature combination respectively, ranging from 1 to m, and i < j, which are used to calculate the pairwise correlation between features;
[0114] Based on the feature evaluation value, the discrimination ability of the evaluation value is enhanced through non-linear adjustment, the distance weighting mechanism is introduced to evaluate the relative importance of the solutions in the neighborhood, and a periodic adjustment term is added to simulate the feature combination, so as to generate the optimized value of the feature combination;
[0115] The optimized value of the feature combination is calculated through the following formula:
[0116]
[0117] Among them, O k is the optimized value of the feature combination in the k-th iteration, which is used to evaluate the optimization degree of the feature combination in the current neighborhood; β is the balance coefficient of non-linear adjustment and distance weighting, and its value range is [0,1]; E(X) is the feature evaluation value of the feature combination X; γ is the gain coefficient of non-linear adjustment; δ is the periodic adjustment amplitude; θ is the period length, which is used to control the frequency of periodic change; d i is the distance between the current solution and the i-th neighbor solution; n is the neighborhood size of the current solution; σ and τ are the scale parameters in distance weighting respectively, which are used to control the influence degree of the distance; η is the periodic adjustment coefficient, which is used to introduce periodic changes; λ is the period length, which is used to control the frequency of periodic change; ζ is the gain coefficient of distance influence; μ is the scale parameter of distance influence; ξ is the attenuation coefficient of distance influence; v is the attenuation scale parameter of distance influence; i is the index of the neighbor solution of the current solution, ranging from 1 to n, which is used to calculate the distance and influence between the current solution and each neighbor solution; k is the number of iterations;
[0118] Based on the optimized value of the feature combination, the optimal feature combination is selected in the neighborhood of the current solution through neighborhood search, and other solutions in the neighborhood are updated. Through multiple iterative processes, excellent feature combinations are generated.
[0119] This method aims to provide a comprehensive and flexible evaluation system that can simultaneously consider the classification accuracy of feature combinations and the independence between features, and enhance the discriminative ability of evaluation values through nonlinear adjustment and distance weighting mechanisms.
[0120] In the feature evaluation value, the classification accuracy part α·(1-e -Acc(X,y) ): This part is used to measure the classification accuracy of the feature combination on the training set, where α is the balance coefficient, which controls the weight of the classification accuracy in the overall evaluation; feature independence part This part is used to measure the independence between features in the feature combination and reduce the impact of redundant information. i ,x j ) is the correlation between features, and m is the number of features;
[0121] Among them, α is usually set based on experience and has a value range of [0,1]; Acc(X,y) is obtained by training the model on the training set through the selected classification algorithm (such as support vector machine, random forest, etc.); Corr(x i ,x j ) can be calculated by Pearson correlation coefficient or other correlation measurement methods; m is the number of features, which is directly obtained from the data set;
[0122] In the optimization value of feature combination, the nonlinear adjustment part This part enhances the distinguishing ability of the evaluation value through nonlinear functions, where β is the balance coefficient, γ is the gain coefficient, δ is the periodic adjustment amplitude, and θ is the period length; distance weighted part This part evaluates the relative importance of solutions in the neighborhood through a distance weighted mechanism and introduces periodic changes, where σ and τ are scale parameters, η is the periodic adjustment coefficient, λ is the period length, ζ is the gain coefficient, μ is the scale parameter, ξ is the attenuation coefficient, and v is the attenuation scale parameter;
[0123] Among them, β is usually set based on experience and its value range is [0,1]; γ, δ and θ are determined based on experimental parameters; d i is the distance between the current solution and the i-th neighbor solution, calculated by Euclidean distance or other distance measurement methods; n is the neighborhood size of the current solution, determined according to the search strategy; σ, τ, η, λ, ζ, μ, ξ and ν are determined according to experimental parameters;
[0124] Suppose in a food authenticity identification task, there is a data set containing 5 spectral features that need to be selected;
[0125] Assume that the initial feature combination X = [x 1 ,x 2 ,x 3 ,x4 ,x 5 ],; the classification accuracy on the training set Acc(X,y)=0.85; the correlation matrix between features is known; the parameters are assumed to be α=0.7, β=0.5, γ=1.5, δ=0.2, θ=10, σ=0.5, τ=0.5, η=0.1, λ=5, ζ=0.1, μ=1, ξ=0.1, v=1; the neighborhood size of the current solution is n=5; the distances are d 1 =0.1,d 2 =0.2,d 3 =0.3,d 4 =0.4,d 5 =0.5;
[0126]
[0127] Assuming that the threshold is set to 0.65, since the optimized value of the feature combination is 0.6935, which is greater than the set threshold, it shows that the current feature combination performs well in terms of classification accuracy and feature independence in food authenticity identification, and is suitable for further use or as the final feature combination. Through the above steps, the optimal spectral feature combination can be effectively screened out, thereby improving the accuracy and reliability of food authenticity identification.
[0128] Optionally, based on the preliminary feature combination, locally sensitive hashing technology is used to perform rapid positioning and screening, efficiently identify high-similarity spectral features, further refine the feature combination, improve feature selection efficiency and accuracy, and generate a refined spectral feature set, including: based on the preliminary feature combination, locally sensitive hashing technology is used to build an index, set a suitable hash function, efficiently identify high-similarity spectral features, and generate a similarity feature index; based on the similarity feature index, each feature in the preliminary feature combination is quickly positioned and screened, and the similarity with other features is used as the standard to generate a screened feature set; based on the screened feature set, the correlation and independence between features are further analyzed, and features with less contribution to food authenticity identification are eliminated to generate a refined feature combination; based on the refined feature combination, a refined spectral feature set is generated by comprehensively considering the representativeness of the features and the contribution to food authenticity identification.
[0129] Locality-sensitive hashing technology is a technology used to quickly find similar features. It achieves efficient feature location and screening by mapping high-dimensional data into low-dimensional space. By building indexes and setting appropriate hash functions, it can efficiently identify spectral features with high similarity in large-scale data sets.
[0130] The refined spectral feature set is a feature set generated by local sensitive hashing technology and further analysis, which contains the most representative and discriminative spectral features for subsequent model training and prediction.
[0131] In an embodiment of the present application, firstly, based on the preliminary feature combination, an index is constructed using the local sensitive hashing technology, and a suitable hash function is set to efficiently identify high-similarity spectral features and generate a similar feature index; secondly, based on the similar feature index, each feature in the preliminary feature combination is quickly located and screened, and a screened feature set is generated based on the similarity with other features; thirdly, based on the screened feature set, the correlation and independence between features are further analyzed, and features with less contribution to food authenticity identification are eliminated to generate a refined feature combination; finally, based on the refined feature combination, the representativeness of the features and the contribution to food authenticity identification are comprehensively considered to generate a refined spectral feature set.
[0132] Suppose you need to verify the authenticity of a batch of olive oil;
[0133] Firstly, based on the preliminary feature combination, the local sensitive hashing technology is used to build an index, and the appropriate hash function is set to efficiently identify high-similarity spectral features and generate a similar feature index; secondly, based on the similar feature index, each feature in the preliminary feature combination is quickly located and screened, and the similarity with other features is used as the standard to generate a screened feature set; thirdly, based on the screened feature set, the correlation and independence between features are further analyzed, and the features with less contribution to the authenticity identification of olive oil are eliminated to generate a refined feature combination; finally, based on the refined feature combination, the representativeness of the features and the contribution to the authenticity identification of olive oil are comprehensively considered to generate a refined spectral feature set.
[0134] Through the above steps, a refined spectral feature set was generated, which improved the accuracy and reliability of olive oil authenticity identification.
[0135] 103. Based on the optimized spectral feature set, a deep Q network under a reinforcement learning framework is used for deep learning, model parameters are dynamically adjusted to adapt to different types of food authenticity identification tasks, and an uncertainty quantification method is used to perform confidence assessment on the prediction results to generate high-confidence identification results;
[0136] The deep Q network under the reinforcement learning framework is a method that combines deep learning and reinforcement learning. It dynamically adjusts model parameters through multiple rounds of training to adapt to different task requirements.
[0137] Uncertainty quantification is a method used to evaluate the reliability of model prediction results. It evaluates the confidence level of the model by calculating the probability distribution of the prediction results.
[0138] High-confidence identification results are identification results with high reliability screened out by uncertainty quantification methods and are used to ensure the accuracy of predictions.
[0139] In this step, first, based on the optimized spectral feature set, the parameters and learning rate of the deep Q network are initialized, and a reward mechanism is set to better adapt to the authenticity identification task of different types of food; secondly, the deep Q network under the reinforcement learning framework is used for deep learning, and the model parameters are dynamically adjusted through multiple rounds of training to achieve adaptive adjustment of internal weights, improve the accuracy of authenticity identification of different types of food, and generate a training optimization model; thirdly, the trained optimization model is used to predict the optimized spectral feature set, and the uncertainty quantification method is used to calculate the probability distribution of the prediction results, evaluate the confidence level of the model, and generate the confidence of the prediction results; finally, screening is performed by setting a confidence threshold to generate high-confidence identification results to ensure the reliability of the prediction results.
[0140] Optionally, the method in step 103 is based on the optimized spectral feature set, uses a deep Q network under a reinforcement learning framework to perform deep learning, dynamically adjusts model parameters to adapt to different types of food authenticity identification tasks, uses an uncertainty quantification method to perform confidence assessment on the prediction results, and generates a high-confidence identification result, including: based on the optimized spectral feature set, initializes network parameters and learning rate, sets a reward mechanism to better adapt to different types of food authenticity identification tasks, and generates initialized model parameters; based on the initialized model parameters, uses a deep Q network under a reinforcement learning framework to perform deep learning, and dynamically adjusts model parameters through multiple rounds of training to achieve adaptive adjustment of internal weights, improve the accuracy of authenticity identification of different types of food, and generate a training optimization model; based on the training optimization model, predicts the optimized spectral feature set, uses an uncertainty quantification method to perform confidence assessment, calculates the probability distribution of the prediction result, evaluates the model confidence level, and generates the prediction result confidence; based on the prediction result confidence, screens by setting a confidence threshold to generate a high-confidence identification result.
[0141] Among them, based on the initialization model parameters, deep learning is performed using a deep Q network under a reinforcement learning framework, and through multiple rounds of training, the model parameters are dynamically adjusted to achieve adaptive adjustment of internal weights, improve the accuracy of authenticity identification of different types of food, and generate a training optimization model, including: based on the initialization model parameters, the optimized spectral feature set is input into the model, the training process is started, and action and environmental feedback are generated through model prediction to generate a preliminary training model; based on the preliminary training model, a deep Q network under a reinforcement learning framework is used to randomly extract samples from past experience for learning, break the correlation between samples, improve the generalization ability of the model, and generate an experience replay model; based on the experience replay model, the target network parameters are updated using target network technology to stabilize the learning process and generate a stable optimization model; based on the stable optimization model, performance testing is performed in combination with a validation set to evaluate the accuracy of authenticity identification of different types of food, select the best performance model parameters, and generate a training optimization model.
[0142] The deep Q-network under the reinforcement learning framework is a method that combines deep learning and reinforcement learning. It dynamically adjusts model parameters through multiple rounds of training to adapt to different task requirements, uses neural networks to estimate the action value function Q value, and continuously optimizes the strategy through interaction with the environment.
[0143] The uncertainty quantification method is a method used to evaluate the reliability of model prediction results. By calculating the probability distribution of the prediction results and evaluating the confidence level of the model, it can provide a measure of the uncertainty of the prediction results and help screen out high-confidence results.
[0144] High-confidence identification results are identification results with high reliability screened out by uncertainty quantification methods and are used to ensure the accuracy of predictions.
[0145] Initializing the model parameters means setting the initial weights and biases, as well as hyperparameters such as learning rate, for the deep Q network before starting training to ensure that the model can learn from a reasonable starting point.
[0146] Experience replay technology is a technology used to break the correlation between samples and improve the generalization ability of the model. It avoids the correlation problem between consecutive samples by storing past experience and randomly extracting samples from it for learning.
[0147] The target network technology is a technology used to stabilize the learning process. By maintaining a target network, its parameters are regularly updated to the parameters of the main network, thereby reducing fluctuations in the training process and improving stability.
[0148] The validation set is a dataset used to evaluate model performance, independent of the training set, and is used to select the best performing model parameters.
[0149] In the embodiment of the present application, firstly, based on the optimized spectral feature set, the network parameters and the learning rate are initialized, and a reward mechanism is set to better adapt to different types of food authenticity identification tasks, and the initialization model parameters are generated; secondly, based on the initialization model parameters, the optimized spectral feature set is input into the model, the training process is started, and the action and environmental feedback are generated through model prediction to generate a preliminary training model; thirdly, based on the preliminary training model, a deep Q network under the reinforcement learning framework is used to randomly extract samples from past experience for learning, break the correlation between samples, improve the generalization ability of the model, and generate an experience playback model; then Based on the experience replay model, the target network technology is used to update the target network parameters to stabilize the learning process and generate a stable optimization model; then, based on the stable optimization model, a performance test is performed in combination with a validation set to evaluate the accuracy of authenticity identification of different types of food, select the best performance model parameters, and generate a training optimization model; finally, based on the training optimization model, the optimized spectral feature set is predicted, and the confidence is evaluated using an uncertainty quantification method, the probability distribution of the prediction results is calculated, the model confidence level is evaluated, the prediction result confidence is generated, and screening is performed by setting a confidence threshold to generate a high-confidence identification result.
[0150] Suppose you need to identify the authenticity of a batch of honey;
[0151] Firstly, based on the optimized spectral feature set, the parameters and learning rate of the deep Q network are initialized, and a reward mechanism is set to better adapt to the authenticity identification task of different types of honey, and the initialization model parameters are generated; secondly, based on the initialization model parameters, the optimized spectral feature set is input into the model, the training process is started, and the action and environmental feedback are generated through model prediction to generate a preliminary training model; thirdly, based on the preliminary training model, the deep Q network under the reinforcement learning framework is used to randomly extract samples through past experience for learning, break the correlation between samples, improve the generalization ability of the model, and generate an experience replay model; then, based on the experience replay model, the target network parameters are updated using the target network technology to stabilize the learning process and generate a stable optimization model; then, based on the stable optimization model, a performance test is performed in combination with a validation set to evaluate the accuracy of authenticity identification of different types of honey, select the best performance model parameters, and generate a training optimization model; finally, based on the training optimization model, the optimized spectral feature set is predicted, the uncertainty quantification method is used for confidence evaluation, the probability distribution of the prediction result is calculated, the model confidence level is evaluated, the prediction result confidence is generated, and the confidence threshold is set for screening to generate a high-confidence identification result.
[0152] Through the above steps, a high-confidence identification result was generated, providing reliable support for honey authenticity identification for subsequent food safety supervision and consumers.
[0153] This application takes into account that in the deep Q network under the reinforcement learning framework, experience replay technology is used to break the correlation between samples and improve the generalization ability of the model. By randomly extracting samples from the experience replay pool and weighting the sampling according to the similarity, it can ensure that high-weight samples are preferentially selected to update the model. In addition, the model parameters are updated through the back-propagation technology to gradually optimize the model performance.
[0154] Optionally, based on the preliminary training model, a deep Q network under a reinforcement learning framework is used to randomly extract samples from past experience for learning, break the correlation between samples, improve the generalization ability of the model, and generate an experience replay model, including:
[0155] Based on the preliminary training model, a batch of samples are randomly drawn from the experience replay pool;
[0156] Analyze the similarity between each sample state action and the current state action, measure the similarity through the Gaussian kernel function to generate the experience replay sampling weight;
[0157] The experience replay sampling weight is calculated using the following formula:
[0158]
[0159] Among them, S t is the experience replay sampling weight for the current time step t; N is the number of samples in the experience replay pool; s i and t are the state of the i-th sample in the experience replay pool and the state of the current time step t respectively; a i and a t are the action of the i-th sample in the experience replay pool and the action of the current time step t respectively; σ s and σ a are the similarity scale parameters of states and actions respectively; i is the index of the sample in the experience replay pool, from 1 to N; it is used to calculate the similarity of each sample with the current state and action;
[0160] Based on the experience replay sampling weights, a batch of samples are drawn from the experience replay pool in proportion to ensure that high-weight samples are preferentially selected to update the model, and combined with the instant reward of each sample, back-propagation technology is used to generate updated model parameters;
[0161] The updated model parameters are calculated using the following formula:
[0162]
[0163] Among them, θ t+1 is the updated model parameter; θ tis the model parameter at the current time step t; α is the learning rate; B is the batch size of samples randomly drawn from the experience replay pool; r i is the instant reward of the i-th sample; γ is the discount factor; Q(s,a;θ) is the Q value function of the deep Q network, with parameter θ; s i and a i are the state and action of the i-th sample respectively; s i+1 is the next state of the i-th sample; θ - is the parameter of the target network; ∈ is a smoothing term to prevent zero division errors; i is the index of a sample batch randomly drawn from the experience replay pool, from 1 to B, used to calculate the TD error and gradient of each sample; a' is the error in state s i+1 The best action among all possible actions; Q(s i+1 ,a';θ - ) is in state s i+1 The Q value of the target network when taking the optimal action a';
[0164] Based on the updated model parameters, the current model is applied to reflect the latest learning results, the target network parameters are synchronously updated at a certain update frequency, and the model parameters are optimized through multiple iterations to generate an experience replay model.
[0165] This method aims to utilize past experience data, break the correlation between samples, and improve the generalization ability and stability of the model. By introducing experience replay sampling weights and a gradient descent method based on TD error, it can better balance the importance of different samples, and stabilize the learning process through the use of the target network to reduce fluctuations during training.
[0166] In the experience replay sampling weight, the state similarity is divided into Measure the current state t and the state s of the i-th sample in the experience replay pool i The similarity between them is smoothed through the Gaussian kernel function, so that samples closer to the current state have higher weights; action similarity sub-items Measure the current action a t and the action a of the i-th sample in the experience replay pool i The similarity between them is also smoothed through the Gaussian kernel function, so that samples closer to the current action have higher weights;
[0167] Where N is the number of samples in the experience replay pool, which is directly obtained from the experience replay pool; σ s and σ a is the similarity scale parameter of state and action, which is usually determined by experimental adjustment; i and tare the state of the i-th sample in the experience replay pool and the state of the current time step t, respectively, obtained from the experience replay pool; a i and a t are the action of the i-th sample in the experience replay pool and the action of the current time step t, respectively, obtained from the experience replay pool;
[0168] In the updated model parameters, the TD error term [r i +γ·max a' Q(s i+1 ,a';θ - )-Q(s i ,a i θ t )]: Calculate the TD error of each sample, that is, the difference between the predicted value and the actual value, which is the basis of gradient descent; Gradient sub-item Calculate the gradient of the Q value function to the parameter θ to guide the direction of parameter update; smoothing term sub-item Prevent division by zero errors and smooth gradients to avoid gradient explosion or vanishing problems;
[0169] Among them, the experience replay sampling weight part: the updated model parameter part: α is the learning rate, which is usually determined according to the experimental parameter adjustment; B is the sample batch size randomly drawn from the experience replay pool, which is set according to the training strategy; r i is the instant reward of the i-th sample, obtained from the experience replay pool; γ is the discount factor, usually 0.9 or 0.99; θ t is the model parameter of the current time step t, obtained from the current model; θ - is the parameter of the target network, which is regularly updated synchronously from the current model parameters; ∈ is a smoothing term, which is usually a small positive number, such as 0.0001;
[0170] Assume that researchers have an experience replay pool of 500 samples in an imported food authenticity identification task and need to update the model parameters;
[0171] Assume that the parameter is σ s =0.5,σ a =0.5,α=0.001,γ=0.9,∈=0.0001,B=32; each sample state s in the experience replay pool i and action a i And instant rewards i Known; the parameters of the target network θ - Known and consistent with the current model parameters θ t Synchronous update; assuming the 32 sample states s are extracted 1 ,s 2 ,…,s 32The values are 0.1, 0.2, …, 0.32 respectively; action a 1 ,a 2 ,…,a 32 The values of are 0.1, 0.2, …, 0.32 respectively; the immediate reward r 1 ,r 2 ,…,r 32 The values are 0.5, 0.6, …, 0.8 respectively; assuming the current state s t =0.2, action a t =0.2;
[0172]
[0173] Assume Q(s 1 ,a 1 θ t )=0.7,Q(s 2 ,a 2 θ t )=0.6,…,Q(s 32 ,a 32 θ t )=0.8;Q(s 2 ,a';θ - )=0.8,Q(s 3 ,a';θ - )=0.7,…,Q(s 33 ,a';θ - )=0.9; Assume θ t =0.5;
[0174]
[0175] Assuming that the threshold is set to 0.501, since the result 0.50048 is less than the set threshold, it indicates that the current updated model parameters have changed little and the model is close to convergence. This means that in the current batch of training, the adjustment of the model parameters is very small, the model tends to be stable, and further training may not bring significant performance improvement. Through the above steps, the experience replay technology can be effectively used to break the correlation between samples, improve the generalization ability and stability of the model, and thus improve the accuracy and reliability of food authenticity identification.
[0176] 104. Based on the high-confidence identification results, combined with the food's chemical properties and food industry standards, a comprehensive authenticity identification result is generated.
[0177] Food physicochemical properties are the physical and chemical attributes of food, such as composition, structure, reactivity, etc. These properties can provide additional information to verify the authenticity of food.
[0178] Food industry standards are specifications and standards formulated by relevant organizations to guide food production and quality control to ensure food safety and compliance.
[0179] Comprehensive authenticity identification results are comprehensive and reliable authenticity identification conclusions generated by combining high-confidence identification results, food chemical properties and industry standards.
[0180] In this step, first, based on the high-confidence identification results, combined with the physical and chemical properties of the food, the identification results are further verified to ensure their scientificity and rationality; second, with reference to the food industry standards, the authenticity of the food samples is standardized and evaluated to ensure that the identification results meet the industry norms and standards; third, the authenticity of the food samples is comprehensively analyzed, including factors such as the source, processing, and storage conditions of the food, to provide a detailed authenticity identification report; finally, based on the comprehensive analysis results, specific handling suggestions are put forward, such as recall, destruction, or re-inspection, to provide decision-making support for regulatory authorities and consumers and generate comprehensive and integrated authenticity identification results.
[0181] Optionally, the step 104 generates a comprehensive authenticity identification result based on the high-confidence identification result in combination with the physical and chemical properties of the food and the food industry standards, including: based on the high-confidence identification result, combined with the physical and chemical properties of the food, physical and chemical level verification is performed to generate a physical and chemical verification result; based on the physical and chemical verification result, with reference to the food industry standards, a standardized assessment of the authenticity of the food sample is performed to generate a standardized assessment result; based on the standardized assessment result, a comprehensive analysis of the food processing process and storage conditions is performed to assess the potential adulteration risk and generate a comprehensive identification report; based on the comprehensive identification report, different situations of the authenticity of the food are analyzed in detail, specific processing suggestions are made for foods with different authenticity states, and a comprehensive authenticity identification result is generated.
[0182] High-confidence identification results are identification results with high reliability screened out by uncertainty quantification methods and are used to ensure the accuracy of predictions.
[0183] Food physicochemical properties are the physical and chemical attributes of food, such as composition, structure, reactivity, etc. These properties can provide additional information to verify the authenticity of food.
[0184] Food industry standards are specifications and standards formulated by relevant organizations to guide food production and quality control to ensure food safety and compliance.
[0185] A comprehensive authentication report is a comprehensive and detailed authenticity authentication report generated by combining high-confidence authentication results, physical and chemical verification results, standardized evaluation results, and analysis of processing and storage conditions.
[0186] Specific handling recommendations are proposed for foods with different authenticity status based on the comprehensive identification report, such as recall, destruction or re-inspection.
[0187] In the embodiments of the present application, firstly, based on the high-confidence identification result, combined with the physical and chemical properties of the food, a physical and chemical level verification is performed to generate a physical and chemical verification result; secondly, based on the physical and chemical verification result, with reference to the food industry standards, a standardized evaluation of the authenticity of the food sample is performed to generate a standardized evaluation result; thirdly, based on the standardized evaluation result, a comprehensive analysis of the food processing process and storage conditions is performed to evaluate the potential adulteration risk, and a comprehensive identification report is generated; finally, based on the comprehensive identification report, different situations of the authenticity of the food are analyzed in detail, specific processing suggestions are proposed for foods with different authenticity states, and a comprehensive authenticity identification result is generated.
[0188] Suppose a large wholesaler needs to verify the authenticity of a batch of imported olive oil;
[0189] First, based on the high-confidence identification results, combined with the physicochemical properties of olive oil (such as fatty acid composition, antioxidant content, etc.), physical and chemical level verification is carried out to generate physical and chemical verification results; secondly, based on the physicochemical verification results, with reference to the relevant food industry standards of the Codex Alimentarius Commission and the European Union, the authenticity status of olive oil samples is standardized and evaluated to generate standardized evaluation results; thirdly, based on the standardized evaluation results, the processing process of olive oil (such as pressing process, refining degree, etc.) and storage conditions (such as temperature, humidity, etc.) are comprehensively analyzed to evaluate the potential adulteration risk and generate a comprehensive identification report; finally, based on the comprehensive identification report, the different situations of the authenticity status of olive oil are analyzed in detail, and specific handling suggestions are put forward for olive oils with different authenticity status. For example, it is recommended to sell olive oil confirmed to be authentic normally, and it is recommended to conduct further laboratory testing for olive oil suspected of being adulterated, and it is recommended to recall and destroy olive oil confirmed to be counterfeit and inferior products immediately.
[0190] Through the above steps, a comprehensive authenticity identification result was generated, providing reliable support for the authenticity identification of imported olive oil for subsequent food safety supervision and consumers.
[0191] Figure 2 A structural schematic diagram of a food authenticity identification system based on spectral imaging is provided for an embodiment of the present application, such as Figure 2 As shown, the device comprises:
[0192] A collection module 21 is used to collect multi-dimensional spectral image information of food samples, integrate near infrared and short-wave infrared regions, and generate a comprehensive spectral image data set;
[0193] A screening module 22 is used to perform feature space exploration based on the comprehensive spectral image data set using an adaptive large neighborhood search algorithm, automatically find the best feature combination, use local sensitive hashing technology for rapid positioning and screening, improve feature selection efficiency and accuracy, and generate an optimized spectral feature set;
[0194] An adjustment module 23 is used to perform deep learning based on the optimized spectral feature set using a deep Q network under a reinforcement learning framework, dynamically adjust model parameters to adapt to different types of food authenticity identification tasks, use an uncertainty quantification method to perform confidence assessment on the prediction results, and generate a high-confidence identification result;
[0195] The generation module 24 is used to generate a comprehensive authenticity identification result based on the high-confidence identification result, combined with the chemical properties of the food and the food industry standards.
[0196] Figure 2 The food authenticity identification system based on spectral imaging can be performed Figure 1 The implementation principle and technical effect of the food authenticity identification method based on spectral imaging described in the illustrated embodiment will not be described in detail. The specific manner in which each module and unit performs operations in the food authenticity identification system based on spectral imaging in the above embodiment has been described in detail in the embodiment of the method, and will not be described in detail here.
[0197] In one possible design, Figure 2 A food authenticity identification system based on spectral imaging in the illustrated embodiment can be implemented as a computing device, such as Figure 3 As shown, the computing device may include a storage component 31 and a processing component 32;
[0198] The storage component 31 stores one or more computer instructions, wherein the one or more computer instructions are called and executed by the processing component 32 .
[0199] The processing component 32 is used to: collect multi-dimensional spectral image information of food samples, integrate near-infrared and short-wave infrared regions, and generate a comprehensive spectral image data set; based on the comprehensive spectral image data set, use an adaptive large neighborhood search algorithm to explore the feature space, automatically find the best feature combination, use local sensitive hashing technology for rapid positioning and screening, improve feature selection efficiency and accuracy, and generate an optimized spectral feature set; based on the optimized spectral feature set, use a deep Q network under a reinforcement learning framework to perform deep learning, dynamically adjust model parameters to adapt to different types of food authenticity identification tasks, use an uncertainty quantification method to conduct confidence assessment on the prediction results, and generate a high-confidence identification result; based on the high-confidence identification result, combine the food's physical and chemical properties with food industry standards to generate a comprehensive authenticity identification result.
[0200] The processing component 32 may include one or more processors to execute computer instructions to complete all or part of the steps in the above method. Of course, the processing component may also be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to perform the above method.
[0201] The storage component 31 is configured to store various types of data to support operations at the terminal. The storage component can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0202] Of course, the computing device may also include other components, such as input / output interfaces, display components, communication components, etc.
[0203] The input / output interface provides an interface between the processing component and the peripheral interface module, which may be an output device, an input device, etc.
[0204] The communication component is configured to facilitate, among other things, wired or wireless communications between the computing device and other devices.
[0205] Among them, the computing device can be a physical device or an elastic computing host provided by a cloud computing platform, etc. In this case, the computing device can refer to a cloud server, and the above-mentioned processing components, storage components, etc. can be basic server resources rented or purchased from the cloud computing platform.
[0206] The present application also provides a computer storage medium storing a computer program, wherein the computer program can achieve the above-mentioned Figure 1 The illustrated embodiment is a method for food authenticity identification based on spectral imaging.
[0207] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0208] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0209] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0210] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for food authenticity identification based on spectral imaging, characterized in that: include: Collect multi-dimensional spectral image information of food samples, integrate near-infrared and short-wave infrared regions, and generate a comprehensive spectral image dataset; Based on the comprehensive spectral image data set, an adaptive large neighborhood search algorithm is used to explore the feature space, automatically find the best feature combination, and a local sensitive hashing technology is used for rapid positioning and screening to improve the efficiency and accuracy of feature selection and generate an optimized spectral feature set; Based on the optimized spectral feature set, a deep Q network under a reinforcement learning framework is used for deep learning, model parameters are dynamically adjusted to adapt to different types of food authenticity identification tasks, and an uncertainty quantification method is used to perform confidence assessment on the prediction results to generate high-confidence identification results; Based on the high-confidence identification results, combined with the food's physical and chemical properties and food industry standards, a comprehensive authenticity identification result is generated.
2. The method according to claim 1, characterized in that Based on the comprehensive spectral image data set, the adaptive large neighborhood search algorithm is used to explore the feature space, automatically find the best feature combination, and use the local sensitive hashing technology for rapid positioning and screening to improve the efficiency and accuracy of feature selection and generate an optimized spectral feature set, including: Based on the comprehensive spectral image data set, the algorithm parameters are initialized, the search range and step size are set, and the preprocessing parameter configuration is generated; Based on the preprocessing parameter configuration, an adaptive large neighborhood search algorithm is used to explore the feature space, and a fitness function for food authenticity identification accuracy is defined to evaluate the effectiveness of different feature combinations. After multiple iterations, the best feature combination is automatically found to generate a preliminary feature combination. Based on the preliminary feature combination, local sensitive hashing technology is used to perform rapid positioning and screening, efficiently identify high-similarity spectral features, further refine the feature combination, improve feature selection efficiency and accuracy, and generate a refined spectral feature set; Based on the refined spectral feature set, the contribution of each feature is evaluated and analyzed, redundant and noise features are eliminated, and an optimized spectral feature set is generated.
3. The method according to claim 2, characterized in that Based on the preprocessing parameter configuration, the adaptive large neighborhood search algorithm is used to explore the feature space, and the food authenticity identification accuracy fitness function is defined to evaluate the effectiveness of different feature combinations. After multiple iterations, the best feature combination is automatically found to generate a preliminary feature combination, including: Based on the preprocessing parameter configuration, the starting point is initialized, the search space boundary and step size are defined, the direction of the search process is clarified, and the initialization search parameters are generated; Based on the initial search parameters, a fitness function for food authenticity identification accuracy is defined, and the classification accuracy of the feature combination training set and the independence between features are comprehensively considered to comprehensively evaluate the effectiveness of different feature combinations and generate a fitness evaluation standard; Based on the fitness evaluation criteria, an adaptive large neighborhood search algorithm is used to systematically explore the feature space. In each iteration, the search direction and search range are dynamically adjusted according to the current solution performance to find a better feature combination. After multiple iterations, an excellent feature combination is generated. Based on the excellent feature combination, cross validation is performed to evaluate and adjust the generalization ability and generate a preliminary feature combination.
4. The method according to claim 3, characterized in that Based on the fitness evaluation criteria, the adaptive large neighborhood search algorithm is used to systematically explore the feature space. In each iteration, the search direction and search range are dynamically adjusted according to the current solution performance to find a better feature combination. After multiple iterations, an excellent feature combination is generated, including: Based on the fitness evaluation criteria, the feature combination is subjected to dimensionality reduction processing to remove noise and redundant information; Use the selected classification algorithm to train the model on the training set and obtain the classification accuracy of the feature combination to generate a feature evaluation value; The feature evaluation value is calculated using the following formula: Among them, E(X) is the feature evaluation value of the feature combination X, which is used to comprehensively evaluate the classification accuracy and feature independence of the feature combination; α is the balance coefficient of the classification accuracy and feature independence, and its value range is [0,1]; Acc(X,y) is the classification accuracy of the feature combination X on the training set; Corr(x i ,x j ) is the correlation between feature x i and x j ; m is the number of features in the feature combination; i and j are the indices of the features in the feature combination, ranging from 1 to m, and i < j, which are used to calculate the pairwise correlation between features; Based on the feature evaluation values, the ability to distinguish the evaluation values is enhanced through nonlinear adjustment, a distance weighting mechanism is introduced to evaluate the relative importance of solutions in the neighborhood, and a periodic adjustment term is added to simulate the feature combination to generate an optimized value of the feature combination; The optimized value of the feature combination is calculated by the following formula: Among them, O k is the optimized value of the feature combination of the kth iteration, which is used to evaluate the optimization degree of the feature combination in the current neighborhood; β is the balance coefficient of nonlinear adjustment and distance weighting, and its value range is [0,1]; E(X) is the feature evaluation value of feature combination X; γ is the gain coefficient of nonlinear adjustment; δ is the periodic adjustment amplitude; θ is the period length, which is used to control the frequency of periodic changes; d i is the distance between the current solution and the i-th neighbor solution; n is the neighborhood size of the current solution; σ and τ are the scale parameters in the distance weighting, which are used to control the influence of distance; η is the periodic adjustment coefficient, which is used to introduce periodic changes; λ is the period length, which is used to control the frequency of periodic changes; ζ is the gain coefficient of distance influence; μ is the scale parameter of distance influence; ξ is the attenuation coefficient of distance influence; v is the attenuation scale parameter of distance influence; i is the index of the neighbor solution of the current solution, from 1 to n, which is used to calculate the distance and influence between the current solution and each neighbor solution; k is the number of iterations; Based on the optimized value of the feature combination, the optimal feature combination is selected in the neighborhood of the current solution through neighborhood search, other solutions in the neighborhood are updated, and an excellent feature combination is generated through multiple iterative processes.
5. The method according to claim 2, characterized in that: Based on the preliminary feature combination, the local sensitive hashing technology is used to perform rapid positioning and screening, efficiently identify high-similarity spectral features, further refine the feature combination, improve the efficiency and accuracy of feature selection, and generate a refined spectral feature set, including: Based on the preliminary feature combination, an index is constructed using local sensitive hashing technology, a suitable hash function is set, high-similarity spectral features are efficiently identified, and a similar feature index is generated; Based on the similar feature index, each feature in the preliminary feature combination is quickly located and screened, and a screened feature set is generated based on the similarity with other features; Based on the screened feature set, further analyzing the correlation and independence between features, eliminating features that contribute less to food authenticity identification, and generating a refined feature combination; Based on the refined feature combination, a refined spectral feature set is generated by comprehensively considering the feature representativeness and contribution to food authenticity identification.
6. The method according to claim 1, characterized in that Based on the optimized spectral feature set, the deep Q network under the reinforcement learning framework is used for deep learning, the model parameters are dynamically adjusted to adapt to different types of food authenticity identification tasks, and the uncertainty quantification method is used to evaluate the confidence of the prediction results to generate high-confidence identification results, including: Based on the optimized spectral feature set, network parameters and learning rate are initialized, a reward mechanism is set to better adapt to different types of food authenticity identification tasks, and initialization model parameters are generated; Based on the initialized model parameters, deep learning is performed using a deep Q network under a reinforcement learning framework, and the model parameters are dynamically adjusted through multiple rounds of training to achieve adaptive adjustment of internal weights, improve the accuracy of authenticity identification of different types of food, and generate a training optimization model; Based on the training optimization model, the optimized spectral feature set is predicted, the confidence is evaluated by using an uncertainty quantification method, the probability distribution of the prediction result is calculated, the model confidence level is evaluated, and the prediction result confidence is generated; Based on the confidence of the prediction result, a confidence threshold is set for screening to generate a high-confidence identification result.
7. The method according to claim 6, characterized in that Based on the initialization model parameters, deep learning is performed using a deep Q network under a reinforcement learning framework, and the model parameters are dynamically adjusted through multiple rounds of training to achieve adaptive adjustment of internal weights, improve the accuracy of authenticity identification of different types of food, and generate a training optimization model, including: Based on the initialization model parameters, the optimized spectral feature set is input into the model, a training process is started, and a preliminary training model is generated by generating action and environmental feedback through model prediction; Based on the preliminary training model, a deep Q network under the reinforcement learning framework is used to randomly extract samples from past experience for learning, break the correlation between samples, improve the generalization ability of the model, and generate an experience replay model; Based on the experience replay model, target network parameters are updated using target network technology to stabilize the learning process and generate a stable optimization model; Based on the stable optimization model, performance testing is performed in combination with the validation set to evaluate the accuracy of authenticity identification of different types of food, select the best performing model parameters, and generate a training optimization model.
8. The method according to claim 7, characterized in that Based on the preliminary training model, a deep Q network under the reinforcement learning framework is used to randomly extract samples from past experience for learning, break the correlation between samples, improve the generalization ability of the model, and generate an experience replay model, including: Based on the preliminary training model, a batch of samples are randomly drawn from the experience replay pool; Analyze the similarity between each sample state action and the current state action, measure the similarity through the Gaussian kernel function to generate the experience replay sampling weight; The experience replay sampling weight is calculated using the following formula: Among them, S t is the experience replay sampling weight for the current time step t; N is the number of samples in the experience replay pool; s i and t are the state of the i-th sample in the experience replay pool and the state of the current time step t respectively; a i and a t are the action of the i-th sample in the experience replay pool and the action of the current time step t respectively; σ s and σ a are the similarity scale parameters of states and actions respectively; i is the index of the sample in the experience replay pool, from 1 to N; it is used to calculate the similarity of each sample with the current state and action; Based on the experience replay sampling weights, a batch of samples are drawn from the experience replay pool in proportion to ensure that high-weight samples are preferentially selected to update the model, and combined with the instant reward of each sample, back-propagation technology is used to generate updated model parameters; The updated model parameters are calculated using the following formula: Among them, θ t+1 is the updated model parameter; θ t is the model parameter at the current time step t; α is the learning rate; B is the batch size of samples randomly drawn from the experience replay pool; r i is the instant reward of the i-th sample; γ is the discount factor; Q(s,a;θ) is the Q value function of the deep Q network, with parameter θ; s i and a i are the state and action of the i-th sample respectively; s i+1 is the next state of the i-th sample; θ - is the parameter of the target network; ∈ is a smoothing term to prevent zero division errors; i is the index of a sample batch randomly drawn from the experience replay pool, from 1 to B, used to calculate the TD error and gradient of each sample; a' is the error in state s i+1 The best action among all possible actions; Q(s i+1 ,a';θ - ) is in state s i+1 The Q value of the target network when taking the optimal action a'; Based on the updated model parameters, the current model is applied to reflect the latest learning results, the target network parameters are synchronously updated at a certain update frequency, and the model parameters are optimized through multiple iterations to generate an experience replay model.
9. The method according to claim 1, characterized in that: Based on the high-confidence identification results, the comprehensive authenticity identification results are generated in combination with the chemical properties of the food and the food industry standards, including: Based on the high-confidence identification results, combined with the physical and chemical properties of the food, physical and chemical level verification is performed to generate physical and chemical verification results; Based on the physical and chemical verification results, with reference to food industry standards, a standardized evaluation is performed on the authenticity of the food sample to generate a standardized evaluation result; Based on the standardized assessment results, comprehensively analyze the food processing and storage conditions, assess the potential adulteration risk, and generate a comprehensive identification report; Based on the comprehensive identification report, different situations of food authenticity are analyzed in detail, specific treatment suggestions are put forward for foods with different authenticity states, and a comprehensive authenticity identification result is generated.
10. A food authenticity identification system based on spectral imaging, characterized in that: include: The collection module is used to collect multi-dimensional spectral image information of food samples, integrate near-infrared and short-wave infrared regions, and generate a comprehensive spectral image data set; A screening module is used to explore the feature space based on the comprehensive spectral image data set using an adaptive large neighborhood search algorithm, automatically find the best feature combination, use local sensitive hashing technology for rapid positioning and screening, improve feature selection efficiency and accuracy, and generate an optimized spectral feature set; An adjustment module is used to perform deep learning based on the optimized spectral feature set using a deep Q network under a reinforcement learning framework, dynamically adjust model parameters to adapt to different types of food authenticity identification tasks, use an uncertainty quantification method to perform confidence assessment on the prediction results, and generate high-confidence identification results; A generation module is used to generate a comprehensive authenticity identification result based on the high-confidence identification result, combined with the chemical properties of the food and the food industry standards.
Citation Information
Patent Citations
Hyperspectral image recognition method and device based on spatial spectrum group covariance characteristics
CN113537252A
Hyperspectral image band selection method based on reinforcement learning
CN113936219A
Construction method and application method of grid deep reinforcement learning model
CN116307314A
Adulterated safflower rapid detection method based on deep learning model
CN117554353A
Food safety detection system based on spectral analysis
CN118730953A