A food authenticity discrimination method and system based on spectral imaging

By using a spectral imaging-based method, an adaptive large neighborhood search algorithm and locality-sensitive hashing technique are used to automatically find the optimal feature combination. Combined with deep Q-network for deep learning, this method solves the problems of low efficiency and poor accuracy in existing food authenticity identification methods, and achieves efficient and reliable food authenticity identification.

CN120028284BActive Publication Date: 2025-11-18CSSC HAISHEN MEDICAL TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411871027.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-18
Publication Date
2025-11-18
Estimated Expiration
2044-12-18

AI Technical Summary

Technical Problem

Existing methods for identifying the authenticity of food products suffer from problems such as slow detection speed, high cost, complex operation, poor model generalization ability, reliance on human experience for feature selection, significant influence of subjective factors on prediction results, and insufficient flexibility in adjusting model parameters.

Method used

This study employs a spectral imaging-based approach, collecting multi-dimensional spectral image information from food samples. It then utilizes an adaptive large neighborhood search algorithm and locality-sensitive hashing (LSH) to automatically find the optimal feature combination. This is combined with a deep Q-network within a reinforcement learning framework for deep learning, dynamically adjusting model parameters. Finally, an uncertainty quantification method is used for confidence assessment, generating high-confidence identification results.

Benefits of technology

It improves the efficiency and accuracy of feature selection, enhances the robustness and flexibility of the model, ensures the reliability and interpretability of prediction results, and provides solid technical support for food safety supervision.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120028284B_ABST
    Figure CN120028284B_ABST
Patent Text Reader

Abstract

The application provides a food authenticity identification method and system based on spectral imaging. Among them, the multi-dimensional spectral image information of the food sample is collected, the near-infrared and short-wave infrared regions are comprehensively considered, and a comprehensive spectral image data set is generated; based on the comprehensive spectral image data set, an adaptive large neighborhood search algorithm is used for feature space exploration, a local sensitive hashing technology is used for positioning screening, the feature selection efficiency and accuracy are improved, and an optimized spectral feature set is generated; based on the optimized spectral feature set, a deep Q network under a reinforcement learning framework is used for deep learning, the model parameters are dynamically adjusted, an uncertainty quantification method is used for confidence evaluation, and a high-confidence identification result is generated; based on the high-confidence identification result, combined with industry standards, a comprehensive authenticity identification result is generated. The technical scheme provided by the application enhances the generalization ability and robustness of the model, and significantly improves the accuracy and reliability of food authenticity identification.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The embodiment of the present application relates to the food detection technical field, and particularly relates to a food authenticity identification method and system based on spectral imaging. BACKGROUND

[0002] With the increasing concern about food safety, the food industry needs an efficient and accurate method to identify the authenticity of food to ensure food safety and consumer rights and interests, especially in the aspects of import and export trade, market supervision and combating fake and inferior products, fast and reliable identification technology is particularly important. Multidimensional spectral imaging technology has become an ideal choice for food authenticity identification due to its non-destructive and high information characteristics.

[0003] At present, the traditional food authenticity identification method mainly relies on chemical analysis, sensory test 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, complex operation and the like. In recent years, some researches have begun to explore the use of near-infrared and short-wave infrared spectral 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 large amount of manual intervention, and the detection results are greatly affected by subjective factors. In addition, existing spectral technology is prone to overfitting when processing high-dimensional data, resulting in poor model generalization ability. The feature selection process often relies on manual experience, lacks systematicness and automation, and is inefficient. In addition, existing methods are not flexible enough in adjusting model parameters when facing different types of food, making it difficult to adapt to complex identification tasks. Finally, the confidence evaluation of the prediction result is insufficient, and it cannot provide reliable risk assessment. SUMMARY

[0005] The embodiment of the present application provides a food authenticity identification method and system based on spectral imaging, which solves the problem of poor model generalization ability in the prior art.

[0006] In a first aspect, the embodiment of the present application provides a food authenticity identification method based on spectral imaging, comprising:

[0007] Collecting multi-dimensional spectral image information of food samples, generating a comprehensive spectral image dataset by integrating near-infrared and short-wave infrared regions;

[0008] Based on the comprehensive spectral image dataset, using an adaptive large neighborhood search algorithm to explore the feature space, automatically finding the best feature combination, using a local sensitive hashing technology for fast positioning and screening, improving the feature selection efficiency and accuracy, and generating an optimized spectral feature set;

[0009] Based on the optimized spectral feature set, a deep Q-network under the reinforcement learning framework is used for deep learning. The model parameters are dynamically adjusted to adapt to the identification tasks of different types of food authenticity. An uncertainty quantification method is used to evaluate the confidence of the prediction results and generate high-confidence identification results.

[0010] Based on the high-confidence identification results, combined with the food's biochemical characteristics and food industry standards, a comprehensive authenticity identification result is generated.

[0011] Optionally, based on the comprehensive spectral image dataset, an adaptive large neighborhood search algorithm is used to explore the feature space, automatically finding the optimal feature combination. Locality-sensitive hashing (LSH) technology is used for rapid localization and filtering, improving the efficiency and accuracy of feature selection, and generating an optimized spectral feature set, including:

[0012] Based on a comprehensive spectral image dataset, 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. By defining a fitness function for the accuracy of food authenticity identification, the effectiveness of different feature combinations is evaluated. After multiple iterations, the optimal feature combination is automatically found, and a preliminary feature combination is generated.

[0014] Based on the preliminary feature combination, local sensitive hashing technology is used to quickly locate and filter, efficiently identify highly similar spectral features, further refine the feature combination, improve the efficiency and accuracy of feature selection, 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 noisy features are removed, 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. A fitness function for food authenticity identification accuracy is defined to evaluate the effectiveness of different feature combinations. After multiple iterations, the optimal feature combination is automatically found, generating 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 initial search parameters are generated.

[0018] Based on the initial search parameters, a fitness function for food authenticity identification accuracy is defined. The classification accuracy of the feature combination training set and the independence between features are comprehensively considered to fully evaluate the effectiveness of different feature combinations and generate fitness evaluation criteria.

[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 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 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 kβ is the optimized value of the feature combination in the k-th iteration, used to evaluate the optimization degree of the feature combination in the current neighborhood; β is the balance coefficient of nonlinear adjustment and distance weighting, with a value range of [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, used to control the frequency of periodic changes; d i denoted as Σ(i=1)^n, where Σ is the distance between the current solution and its i-th neighboring solution; n is the neighborhood size of the current solution; σ and τ are the scale parameters in the distance weighting, used to control the degree of influence of the distance; η is the periodicity adjustment coefficient, used to introduce periodic changes; λ is the period length, used to control the frequency of periodic changes; ζ is the gain coefficient of the distance influence; μ is the scale parameter of the distance influence; ξ is the attenuation coefficient of the distance influence; v is the attenuation scale parameter of the distance influence; i is the index of the neighboring solutions of the current solution, from 1 to n, used to calculate the distance and influence between the current solution and each neighboring 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 excellent feature combinations are generated through multiple iterations.

[0032] Optionally, based on the initial feature combination, locality-sensitive hashing (LSH) technology is used for rapid location filtering and efficient identification of highly similar spectral features. Further refinement of the feature combination improves feature selection efficiency and accuracy, generating a refined spectral feature set, including:

[0033] Based on the preliminary feature combination, an index is constructed using locality-sensitive hashing (LSH) technology, and an appropriate hash function is set to efficiently identify highly similar spectral features and generate a similar feature index.

[0034] Based on the similarity feature index, each feature in the initial feature combination is quickly located and filtered, and a filtered feature set is generated based on the similarity with other features.

[0035] Based on the filtered feature set, further analysis of the correlation and independence between features is conducted, features that contribute little to the identification of food authenticity are removed, and a refined feature combination is generated.

[0036] Based on the aforementioned combination of refined features, a set of refined spectral features is generated by comprehensively considering the representativeness of the features and their contribution to the identification of food authenticity.

[0037] Optionally, based on the optimized spectral feature set, deep learning is performed using a deep Q-network within a reinforcement learning framework to dynamically adjust model parameters to adapt to different types of food authenticity identification tasks. An uncertainty quantification method is used to evaluate the confidence level of the prediction results, generating high-confidence identification results, including:

[0038] Based on the optimized spectral feature set, the network parameters and learning rate are initialized, a reward mechanism is set to better adapt to different types of food authenticity identification tasks, and initial model parameters are generated.

[0039] Based on the initial model parameters, a deep Q-network under the reinforcement learning framework is used for deep learning. Through multiple rounds of training, the model parameters are dynamically adjusted to achieve adaptive adjustment of internal weights, improve the accuracy of identifying the authenticity of different types of food, and generate a training optimization model.

[0040] Based on the trained and optimized model, the optimized spectral feature set is predicted, the confidence level is evaluated using an uncertainty quantification method, the probability distribution of the prediction results is calculated, the confidence level of the model is evaluated, and the confidence level of the prediction results is generated.

[0041] Based on the confidence level of the prediction results, a high-confidence identification result is generated by setting a confidence level threshold for filtering.

[0042] Optionally, based on the initialized model parameters, deep learning is performed using a deep Q-network within a reinforcement learning framework. Through multiple rounds of training, the model parameters are dynamically adjusted to adaptively adjust the internal weights, thereby improving the accuracy of identifying the authenticity of different types of food and generating a training and optimization model, including:

[0043] Based on the initial model parameters, the optimized spectral feature set is input into the model to start the training process. The model predicts and generates actions and environmental feedback to generate a preliminary training model.

[0044] Based on the aforementioned preliminary training model, a deep Q-network under the reinforcement learning framework is adopted to learn by randomly sampling samples from past experience, breaking the correlation between samples, improving the model's generalization ability, and generating an experience replay model.

[0045] Based on the aforementioned experience replay model, target network parameters are updated using target network technology to stabilize the learning process and generate a stable optimized model.

[0046] Based on the stable optimization model, performance tests are conducted using a validation set to evaluate the accuracy of identifying the authenticity of different types of food, select the optimal model parameters, and generate a training optimization model.

[0047] Optionally, based on the initial trained model, a deep Q-network under the reinforcement learning framework is used to learn by randomly sampling samples from past experience, breaking the correlation between samples, improving the model's generalization ability, and generating an experience replay model, including:

[0048] Based on the preliminary training model, a batch of samples is randomly drawn from the experience replay pool;

[0049] The similarity between each sample state action and the current state action is analyzed, and the similarity is measured by a Gaussian kernel function to generate empirical replay sampling weights;

[0050] The empirical replay sampling weights are calculated using the following formula:

[0051]

[0052] Among them, S t The empirical replay sampling weights are defined as follows: N is the number of samples in the empirical replay pool; s i and s t These represent the state of the i-th sample in the experience replay pool and the state at the current time step t, respectively; a i and a t These represent the action of the i-th sample in the experience replay pool and the action at the current time step t, respectively; σ s and σ a , respectively, are the similarity scale parameters for state and action; i is the index of the sample in the experience replay pool, from 1 to N; used to calculate the similarity between each sample and the current state and action;

[0053] Based on the aforementioned experience replay sampling weights, a batch of samples is drawn from the experience replay pool in a proportional manner to ensure that high-weight samples are selected first to update the model. Combined with the instant reward for each sample, backpropagation technology is used to generate updated model parameters.

[0054] The updated model parameters are calculated using the following formula:

[0055]

[0056] Where, θ t+1 The updated model parameters; θ t Here are the model parameters at the current time step t; α is the learning rate; B is the batch size of samples randomly drawn from the empirical replay pool; r i γ is the instantaneous reward for 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 These represent the state and action of the i-th sample, respectively; s i+1 Let θ be the next state of the i-th sample; - ... i+1 The optimal action among all possible actions; Q(s) i+1 ,a';θ - ) is in state s i+1The Q-value of the target network when the optimal action a' is taken;

[0057] Based on the updated model parameters, they are applied to the current model to reflect the latest learning results. The target network parameters are updated synchronously at a certain update frequency. The model parameters are optimized through multiple iterations to generate an experience playback model.

[0058] Optionally, based on the high-confidence identification result, combined with the food's biochemical characteristics and food industry standards, a comprehensive authenticity identification result is generated, including:

[0059] Based on the high-confidence identification results, combined with the physicochemical properties of the food, physicochemical verification is performed to generate physicochemical verification results.

[0060] Based on the physicochemical verification results, and with reference to food industry standards, the authenticity status of food samples is evaluated in a standardized manner, and standardized evaluation results are generated.

[0061] Based on the standardized assessment results, a comprehensive analysis of the food processing and storage conditions is conducted to assess potential adulteration risks and generate a comprehensive identification report.

[0062] Based on the comprehensive identification report, a detailed analysis of different states of authenticity of food products is conducted, specific handling suggestions are proposed for food products in different states of authenticity, and a comprehensive authenticity identification result is generated.

[0063] Secondly, embodiments of this application provide 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, and integrate the near-infrared and short-wave infrared regions to generate a comprehensive spectral image dataset.

[0065] The filtering module is used to explore the feature space based on the comprehensive spectral image dataset using an adaptive large neighborhood search algorithm, automatically find the best feature combination, and use locality-sensitive hashing technology for fast positioning and filtering, thereby improving the efficiency and accuracy of feature selection and generating an optimized spectral feature set.

[0066] The adjustment module is used to perform deep learning using a deep Q-network under the reinforcement learning framework based on the optimized spectral feature set, dynamically adjust the model parameters to adapt to different types of food authenticity identification tasks, and use uncertainty quantification methods to evaluate the confidence of the prediction results and generate high-confidence identification results.

[0067] The generation module is used to generate a comprehensive authenticity identification result based on the high-confidence identification result, combined with the food's biochemical characteristics and food industry standards.

[0068] In this embodiment, 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 dataset. Based on the comprehensive spectral image dataset, an adaptive large neighborhood search algorithm is used to explore the feature space, automatically finding the optimal feature combination. Locality-sensitive hashing (LSH) technology is used for rapid localization and filtering to improve the efficiency and accuracy of feature selection, generating 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, dynamically adjusting model parameters to adapt to different types of food authenticity identification tasks. An uncertainty quantification method is used to evaluate the confidence of the prediction results, generating a high-confidence identification result. Based on the high-confidence identification result, combined with the food's biochemical characteristics and food industry standards, a comprehensive authenticity identification result is generated.

[0069] The technical solution of this application has the following beneficial effects:

[0070] By collecting multi-dimensional spectral image information from food samples and integrating data from the near-infrared and short-wave infrared regions, a comprehensive spectral image dataset is generated, improving the richness and completeness of the data and enhancing the model's accuracy in identifying genuine and counterfeit food. An adaptive large neighborhood search algorithm is used to explore the feature space, automatically finding the optimal feature combination. Locality-sensitive hashing (LSH) technology is employed for rapid localization and filtering, significantly improving the efficiency and accuracy of feature selection, reducing redundant features, and enhancing the model's generalization ability. Deep learning using a deep Q-network within a reinforcement learning framework dynamically adjusts model parameters to adapt to the identification of different types of food, better handling complex and varied food samples and improving the model's robustness and accuracy. Uncertainty quantification methods are used to assess the confidence level of the prediction results, generating high-confidence identification results to ensure the reliability of the predictions and provide a solid foundation for decision-making. Based on the high-confidence identification results, combined with the physicochemical properties of food and food industry standards, a comprehensive genuine and counterfeit identification result is generated. This not only considers the model's prediction results but also incorporates actual physicochemical properties and industry standards, providing a more comprehensive and reliable identification conclusion.

[0071] Furthermore, by employing an adaptive large neighborhood search algorithm and locality-sensitive hashing (LSH) technology, the optimal feature combination can be automatically and efficiently found from a comprehensive spectral image dataset, and then quickly located and filtered. This significantly improves the efficiency and accuracy of feature selection, reduces manual intervention, and enhances the model's generalization ability. Based on the initial feature combination, LSH technology is used to further identify highly similar spectral features, eliminate redundant and noisy features, optimize the feature set, enhance the robustness and stability of the model, and ensure that the final optimized spectral feature set has higher quality and reliability. By defining a fitness function for food authenticity identification accuracy, the optimal feature combination is automatically found through multiple iterations. The resulting optimized spectral feature set can better reflect the authenticity characteristics of food, providing high-quality data support for subsequent deep learning models, thereby improving the overall accuracy and reliability of the identification process.

[0072] Furthermore, a deep Q-network within a reinforcement learning framework is employed for deep learning. Through multiple rounds of training, the model parameters are dynamically adjusted, enabling the model to adapt to the task of identifying the authenticity of different types of food. This enhances the model's flexibility and adaptability, allowing it to better handle complex and varied food samples. Uncertainty quantification methods are used to assess the confidence level of the prediction results, calculating their probability distribution and evaluating the model's confidence level. This ensures the reliability and credibility of the prediction results, providing a solid foundation for decision-making. Based on the confidence level of the prediction results, a confidence threshold is set for screening, generating high-confidence identification results. This improves the accuracy of the identification results, enhances their interpretability and practicality, and provides more reliable technical support for food safety supervision and consumers.

[0073] These or other aspects of this application will become more apparent in the following description of the embodiments. Attached Figure Description

[0074] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0075] Figure 1 A flowchart illustrating a method for identifying the authenticity of food based on spectral imaging, provided as an embodiment of this application;

[0076] Figure 2 A schematic diagram of the structure of a food authenticity identification system based on spectral imaging provided in this application embodiment;

[0077] Figure 3This is a schematic diagram of the structure of a computing device provided in an embodiment of this application. Detailed Implementation

[0078] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings.

[0079] In some of the processes described in the specification, claims, and accompanying drawings of this application, multiple operations appearing in a specific order are included. However, it should be clearly understood that these operations may not be executed in the order they appear herein, or may be executed in parallel. The operation numbers, such as 101, 102, etc., are merely used to distinguish different operations and do not themselves represent any execution order. Furthermore, these processes may include more or fewer operations, and these operations may be executed sequentially or in parallel. It should be noted that the descriptions such as "first," "second," etc., in this document are used to distinguish different messages, devices, modules, etc., and do not represent a chronological order, nor do they limit "first" and "second" to different types.

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

[0081] Figure 1 A flowchart of a food authenticity identification method based on spectral imaging is provided in this application embodiment, as shown below. 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 dataset;

[0083] Multidimensional spectral image information includes spectral data in the near-infrared and short-wave infrared regions, providing the absorption and reflection characteristics of food samples at different wavelengths. This information is used to comprehensively analyze the physical and chemical properties of food. Near-infrared spectroscopy mainly reflects information about components such as water, fat, and protein in food, while short-wave infrared spectroscopy can provide deeper information about chemical components such as sugars, cellulose, and pectin.

[0084] The comprehensive spectral image dataset is a dataset containing rich information by combining data from the near-infrared and short-wave infrared regions. It not only includes 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, thus providing a solid foundation for subsequent feature extraction, model training, and authenticity identification.

[0085] In this embodiment, firstly, a near-infrared spectrometer is used to scan the food sample, recording the spectral image of the sample in the near-infrared band (approximately 700-2500 nm). Near-infrared spectroscopy can reflect information about components such as water, fat, and protein in food. Secondly, a short-wave infrared spectrometer is used to scan the same sample, recording the spectral image of the sample in the short-wave infrared band (approximately 1000-2500 nm). Short-wave infrared spectroscopy can provide deeper information about chemical composition, such as sugars, cellulose, and pectin. Thirdly, the acquired 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 data quality and consistency. The preprocessing steps also include data smoothing and baseline correction to eliminate unnecessary interference signals. Finally, the processed near-infrared and short-wave infrared spectral image data are integrated to form a comprehensive spectral image dataset containing the spectral information of each sample in different bands, providing a foundation for subsequent feature extraction and model training.

[0086] Suppose we need to verify the authenticity of a batch of apples;

[0087] First, apple samples were scanned using a near-infrared spectrometer to acquire spectral images of each apple in the near-infrared band (approximately 700-2500 nm), reflecting information about components such as water, sugar, and fat in the apples. Second, the same batch of apples was scanned using a short-wave infrared spectrometer to acquire spectral images of each apple in the short-wave infrared band (approximately 1000-2500 nm), providing information about deeper chemical components such as cellulose and pectin in the apples. Third, the acquired near-infrared and short-wave infrared spectral images were preprocessed, including background noise removal, spectral drift correction, and spectral intensity normalization, to ensure data consistency and reliability. Finally, the processed near-infrared and short-wave infrared spectral image data were merged to form a comprehensive spectral image dataset containing spectral information of each apple in different bands, providing rich data support for subsequent feature extraction and model training.

[0088] The above steps generate a comprehensive spectral image dataset, providing a solid foundation for subsequent authentication of genuine and counterfeit apples.

[0089] 102. Based on the comprehensive spectral image dataset, an adaptive large neighborhood search algorithm is used to explore the feature space, automatically find the best feature combination, and locality-sensitive hashing technology is used for fast localization and filtering 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 systematically searching in the feature space. The algorithm can dynamically adjust the search range and step size to improve search efficiency.

[0091] Locality-sensitive hashing (LSH) is a technique for quickly finding similar features. It achieves efficient feature localization and filtering by mapping high-dimensional data to a low-dimensional space.

[0092] The optimized spectral feature set is the 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, firstly, the comprehensive spectral image dataset 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 the feature space, define the fitness function for food authenticity identification accuracy, evaluate the effectiveness of different feature combinations, and automatically find the optimal feature combination after multiple iterations to generate preliminary feature combinations. Thirdly, locality-sensitive hashing (LSH) technology is used to quickly locate and filter the preliminary feature combinations, efficiently identify highly similar spectral features, further refine the feature combinations, and improve the efficiency and accuracy of feature selection. Finally, the contribution of each feature is evaluated, redundant and noisy features are removed, and the final optimized spectral feature set is generated.

[0094] Optionally, step 102, which involves exploring the feature space using an adaptive large neighborhood search algorithm based on the comprehensive spectral image dataset, automatically finding the optimal feature combination, and employing locality-sensitive hashing (LSH) for rapid localization and filtering to improve feature selection efficiency and accuracy, and generating an optimized spectral feature set, includes: initializing algorithm parameters based on the comprehensive spectral image dataset, setting the search range and step size, and generating a preprocessing parameter configuration; exploring the feature space using the adaptive large neighborhood search algorithm based on the preprocessing parameter configuration, evaluating the effectiveness of different feature combinations by defining a fitness function for food authenticity identification accuracy, automatically finding the optimal feature combination after multiple iterations, and generating a preliminary feature combination; using LSH for rapid localization and filtering based on the preliminary feature combination, efficiently identifying highly similar spectral features, further refining the feature combination, improving feature selection efficiency and accuracy, and generating a refined spectral feature set; and evaluating and analyzing the contribution of each feature based on the refined spectral feature set, removing redundant and noisy features, and generating an optimized spectral feature set.

[0095] The process involves: exploring the feature space using an adaptive large neighborhood search algorithm based on the preprocessing parameter configuration; evaluating the effectiveness of different feature combinations by defining a fitness function for food authenticity identification accuracy; automatically finding the optimal feature combination after multiple iterations to generate a preliminary feature combination; and generating initial feature combinations based on the preprocessing parameter configuration by: initializing the starting point, defining the search space boundary and step size, clarifying the direction of the search process, and generating initial search parameters; defining the fitness function for food authenticity identification accuracy based on the initial search parameters, comprehensively considering the classification accuracy of the feature combination training set and the independence between features to fully evaluate the effectiveness of different feature combinations and generating a fitness evaluation criterion; systematically exploring the feature space using the adaptive large neighborhood search algorithm based on the fitness evaluation criterion, dynamically adjusting the search direction and search range according to the current solution performance in each iteration to find better feature combinations, generating an excellent feature combination after multiple iterations; and performing cross-validation based on the excellent feature combination to evaluate and adjust the generalization ability to generate a preliminary feature combination.

[0096] The comprehensive spectral image dataset contains spectral data including the near-infrared and short-wave infrared regions, which is used to provide the absorption and reflection characteristics of food samples at different wavelengths, enabling a comprehensive analysis of 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 systematically searching in the feature space. It can dynamically adjust the search range and step size to improve search efficiency.

[0098] Locality-sensitive hashing (LSH) is a technique for quickly finding similar features. It achieves efficient feature localization and filtering by mapping high-dimensional data to a low-dimensional space.

[0099] The optimized spectral feature set is the 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 search range and step size, etc., of the algorithm parameters before feature selection begins, 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 both 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 involves dividing the dataset into multiple subsets, using one subset as the validation set in turn, and using the remaining subsets as the training set to evaluate the model performance.

[0103] In this embodiment, firstly, based on a comprehensive spectral image dataset, the algorithm parameters are initialized, the search range and step size are set, and a 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, initial search parameters are generated, and a fitness function for food authenticity identification accuracy is defined. 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 criterion. Thirdly, based on the fitness evaluation criterion, 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 better feature combinations. After multiple iterations, excellent feature combinations are generated, and cross-validation is performed to evaluate the generalization ability and generate preliminary feature combinations. Finally, based on the preliminary feature combinations, locality-sensitive hashing technology is used for rapid location filtering, efficient identification of highly similar spectral features, further refinement of feature combinations, improvement of feature selection efficiency and accuracy, generation of a refined spectral feature set, evaluation and analysis of the contribution of each feature, elimination of redundant and noisy features, and generation of an optimized spectral feature set.

[0104] Suppose we need to authenticate a batch of wines;

[0105] First, near-infrared and short-wave infrared spectral images of wine samples were collected to form a comprehensive spectral image dataset. Second, based on this dataset, algorithm parameters were initialized, the search range and step size were set, and a preprocessing parameter configuration was generated. Then, based on this configuration, the starting point was initialized, the search space boundary and step size were defined, and the direction of the search process was clarified, generating initial search parameters. Next, based on these initial search parameters, a fitness function for food authenticity identification accuracy was defined, comprehensively considering the classification accuracy of the feature combination training set and the independence between features to comprehensively evaluate the effectiveness of different feature combinations, generating a fitness evaluation criterion. Finally, based on this fitness evaluation criterion, an adaptive... The large neighborhood search algorithm systematically explores the feature space. In each iteration, it dynamically adjusts the search direction and range based on the current solution performance to find better feature combinations. After multiple iterations, it generates excellent feature combinations. Next, based on the excellent feature combinations, cross-validation is performed to evaluate the generalization ability and generate preliminary feature combinations. Based on the preliminary feature combinations, locality-sensitive hashing (LSH) technology is used for rapid location and filtering to efficiently identify highly similar spectral features, further refining the feature combinations and improving the efficiency and accuracy of feature selection, generating a refined spectral feature set. Finally, based on the refined spectral feature set, the contribution of each feature is evaluated and analyzed, redundant and noisy features are removed, 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 order to comprehensively evaluate the classification accuracy and feature independence of feature combinations during the feature selection process, and to optimize feature combinations through nonlinear adjustment and distance weighting mechanisms, it introduces methods for calculating feature evaluation values ​​and feature combination optimization values, and quantifies the quality of feature combinations through mathematical models, 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. In each iteration, the search direction and search range are dynamically adjusted according to the current solution performance to find better feature combinations. After multiple iterations, excellent feature combinations are generated, including:

[0109] Based on the fitness evaluation criteria, the feature combinations are subjected to dimensionality reduction to remove noise and redundant information.

[0110] The model is trained on the training set using a selected classification algorithm to obtain the classification accuracy of feature combinations, thereby generating feature evaluation values.

[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 indexes 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, 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, so as to generate an 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 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 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 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, 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 power of the evaluation values ​​through nonlinear adjustment and distance weighting mechanisms.

[0120] In the feature evaluation value, the classification accuracy component α·(1-e -Acc(X,y) This section measures the classification accuracy of feature combinations on the training set, where α is a balancing coefficient that controls the weight of classification accuracy in the overall evaluation; Feature Independence Section This section measures the independence between features in a feature combination, reducing the impact of redundant information. Corr(x) i ,x j ) represents the correlation between features, and m represents the number of features;

[0121] Where α is usually set empirically and its value ranges from [0,1]; Acc(X,y) is calculated by training a model on the training set using a selected classification algorithm (such as support vector machine, random forest, etc.); Corr(x i ,x j The correlation coefficient () can be calculated using the Pearson correlation coefficient or other correlation measures; m is the number of features, which can be obtained directly from the dataset.

[0122] In the optimized value of the feature combination, the nonlinear adjustment part This section enhances the discriminative power of the evaluation values ​​through a nonlinear function, 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 a periodic adjustment coefficient, λ is the period length, ζ is the gain coefficient, μ is a scale parameter, ξ is the attenuation coefficient, and v is the attenuation scale parameter.

[0123] Among them, β is usually set empirically, with a value range of [0,1]; γ, δ, and θ are determined by experimental parameter tuning; d i is the distance between the current solution and the i-th neighboring solution, calculated using Euclidean distance or other distance metrics; n is the neighborhood size of the current solution, determined according to the search strategy; σ, τ, η, λ, ζ, μ, ξ, and ν are determined through experimental parameter tuning.

[0124] Suppose that in a food authenticity identification task, there is a dataset containing 5 spectral features that needs to be selected;

[0125] Assume the initial feature combination X = [x1, x2, x3, x4, x5]; the classification accuracy Acc(X, y) on the training set is 0.85; the correlation matrix between features is known; assume the parameters are α = 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 d1 = 0.1, d2 = 0.2, d3 = 0.3, d4 = 0.4, d5 = 0.5.

[0126]

[0127] Assuming a threshold of 0.65 is set, the optimized value of the feature combination, 0.6935, is greater than this threshold. This indicates that the current feature combination performs well in terms of classification accuracy and feature independence for 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, thereby improving the accuracy and reliability of food authenticity identification.

[0128] Optionally, the step of using Locality Sensitive Hashing (LSH) technology to quickly locate and filter high-similarity spectral features based on the preliminary feature combination, and further refine the feature combination to improve the efficiency and accuracy of feature selection, generating a refined spectral feature set, includes: constructing an index using LSH technology based on the preliminary feature combination, setting an appropriate hash function to efficiently identify high-similarity spectral features, and generating a similar feature index; quickly locating and filtering each feature in the preliminary feature combination based on the similarity index, and generating a filtered feature set based on similarity with other features; further analyzing the correlation and independence between features based on the filtered feature set, removing features that contribute little to the identification of food authenticity, and generating a refined feature combination; and generating a refined spectral feature set based on the refined feature combination, comprehensively considering feature representativeness and contribution to the identification of food authenticity.

[0129] Locality-sensitive hashing (LSH) is a technique for quickly finding similar features. It achieves efficient feature localization and filtering by mapping high-dimensional data to a low-dimensional space. By building an index and setting an appropriate hash function, it can efficiently identify highly similar spectral features in large-scale datasets.

[0130] The refined spectral feature set is a feature set generated through locality-sensitive hashing and further analysis. It contains the most representative and discriminative spectral features for subsequent model training and prediction.

[0131] In this embodiment, firstly, based on the preliminary feature combination, an index is constructed using locality-sensitive hashing (LSH) technology, and an appropriate hash function is set to efficiently identify highly similar 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 filtered, and a filtered feature set is generated based on the similarity to other features. Thirdly, based on the filtered feature set, the correlation and independence between features are further analyzed, and features that contribute little to the identification of food authenticity are removed to generate a refined feature combination. Finally, based on the refined feature combination, a refined spectral feature set is generated by comprehensively considering the representativeness of the features and their contribution to the identification of food authenticity.

[0132] Suppose we need to determine the authenticity of a batch of olive oil;

[0133] First, based on the preliminary feature combination, an index is constructed using locality-sensitive hashing (LSH) technology. An appropriate hash function is set to efficiently identify highly similar spectral features, generating a similar feature index. Second, based on the similar feature index, each feature in the preliminary feature combination is quickly located and filtered, using similarity to other features as the standard to generate a filtered feature set. Third, based on the filtered feature set, the correlation and independence between features are further analyzed, eliminating features that contribute little to the identification of genuine olive oil, generating a refined feature combination. Finally, based on the refined feature combination, considering both feature representativeness and contribution to the identification of genuine olive oil, a refined spectral feature set is generated.

[0134] The above steps generate a set of refined spectral features, improving the accuracy and reliability of identifying genuine olive oil.

[0135] 103. Based on the optimized spectral feature set, a deep Q-network under the reinforcement learning framework is used for deep learning. The model parameters are dynamically adjusted to adapt to the different types of food authenticity identification tasks. An uncertainty quantification method is used to evaluate the confidence of the prediction results and generate high-confidence identification results.

[0136] Deep Q-networks within the reinforcement learning framework are a method that combines deep learning and reinforcement learning. They dynamically adjust 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 assesses the confidence level of the model by calculating the probability distribution of the prediction results.

[0138] The high-confidence identification results are those with high reliability selected through uncertainty quantification methods, used to ensure the accuracy of predictions.

[0139] In this step, 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 task of identifying the authenticity of different types of food. Secondly, deep learning is performed using the deep Q-network under the reinforcement learning framework. Through multiple rounds of training, the model parameters are dynamically adjusted to achieve adaptive adjustment of internal weights, thereby improving the accuracy of identifying the authenticity of different types of food and generating a trained and optimized model. Thirdly, the trained and optimized model is used to predict the optimized spectral feature set. The probability distribution of the prediction results is calculated using the uncertainty quantification method to evaluate the confidence level of the model and generate the confidence level of the prediction results. Finally, a confidence threshold is set to filter and generate high-confidence identification results to ensure the reliability of the prediction results.

[0140] Optionally, step 103, which involves using a deep Q-network within a reinforcement learning framework to perform deep learning based on the optimized spectral feature set, dynamically adjusting model parameters to adapt to different types of food authenticity identification tasks, and using uncertainty quantification to evaluate the confidence of the prediction results and generate high-confidence identification results, includes: initializing network parameters and learning rate based on the optimized spectral feature set, setting a reward mechanism to better adapt to different types of food authenticity identification tasks, and generating initial model parameters; performing deep learning using a deep Q-network within a reinforcement learning framework based on the initial model parameters, dynamically adjusting model parameters through multiple rounds of training to adaptively adjust internal weights, improve the accuracy of authenticity identification for different types of food, and generating a trained and optimized model; predicting the optimized spectral feature set based on the trained and optimized model, evaluating the confidence using uncertainty quantification, calculating the probability distribution of the prediction results, evaluating the model confidence level, and generating prediction result confidence; and filtering by setting a confidence threshold based on the prediction result confidence to generate high-confidence identification results.

[0141] The process involves, based on the initialized model parameters, employing a deep Q-network within a reinforcement learning framework for deep learning. Through multiple training rounds, the model parameters are dynamically adjusted to adaptively adjust internal weights, improving the accuracy of identifying genuine and counterfeit food types and generating a training optimized model. This includes: inputting the optimized spectral feature set into the model based on the initialized model parameters, initiating the training process, and generating a preliminary training model by predicting actions and environmental feedback through the model; based on the preliminary training model, using a deep Q-network within a reinforcement learning framework, learning from randomly selected samples based on past experience to break down correlations between samples, improve model generalization ability, and generate an experience playback model; based on the experience playback model, updating the target network parameters using target network technology to stabilize the learning process and generate a stable optimized model; and based on the stable optimized model, conducting performance testing with a validation set to evaluate the accuracy of identifying genuine and counterfeit food types, selecting the best-performing model parameters, and generating a training optimized model.

[0142] Deep Q-networks within the reinforcement learning framework are a method that combines deep learning and reinforcement learning. They dynamically adjust model parameters through multiple rounds of training to adapt to different task requirements, utilize neural networks to estimate the action-value function Q-value, and continuously optimize the strategy through interaction with the environment.

[0143] Uncertainty quantification is a method used to evaluate the reliability of model prediction results. By calculating the probability distribution of the prediction results, it assesses the confidence level of the model and can provide a measure of the uncertainty of the prediction results, helping to screen out results with high confidence.

[0144] The high-confidence identification results are those with high reliability selected through uncertainty quantification methods, used to ensure the accuracy of predictions.

[0145] Initializing model parameters involves setting initial weights, biases, and hyperparameters such as the learning rate for the deep Q-network before training begins, to ensure that the model can start learning from a reasonable starting point.

[0146] Experience replay is a technique used to break the correlation between samples and improve the generalization ability of a model. It avoids the problem of correlation between consecutive samples by storing past experiences and randomly drawing samples from them for learning.

[0147] Target network technology is a technique used to stabilize the learning process. By maintaining a target network whose parameters are periodically updated to those of the main network, fluctuations during training are reduced, thus 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 this embodiment, firstly, based on the optimized spectral feature set, network parameters and learning rate are initialized, and a reward mechanism is set to better adapt to different types of food authenticity identification tasks, generating initial model parameters; secondly, based on the initial model parameters, the optimized spectral feature set is input into the model, the training process is started, and a preliminary training model is generated by predicting and generating actions and environmental feedback through the model; thirdly, based on the preliminary training model, a deep Q-network under the reinforcement learning framework is used to learn by randomly sampling samples from past experience, breaking the correlation between samples, improving the model's generalization ability, and generating an experience replay model; then... Based on the experience replay model, target network parameters are updated using target network technology to stabilize the learning process and generate a stable optimized model. Next, based on the stable optimized model, performance testing is conducted using a validation set to evaluate the accuracy of identifying the authenticity of different types of food. The best-performing model parameters are selected to generate a training optimized model. Finally, based on the training optimized model, predictions are made on the optimized spectral feature set. An uncertainty quantification method is used to assess confidence, calculate the probability distribution of the prediction results, evaluate the model's confidence level, generate prediction result confidence, and filter results by setting a confidence threshold to generate high-confidence identification results.

[0150] Suppose we need to determine the authenticity of a batch of honey;

[0151] 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 task of identifying the authenticity of different types of honey, generating initial model parameters. Second, based on the initial model parameters, the optimized spectral feature set is input into the model to start the training process. The model predicts and generates actions and environmental feedback to generate a preliminary training model. Third, based on the preliminary training model, a deep Q-network under the reinforcement learning framework is used to learn from samples randomly selected from past experience, breaking the correlation between samples and improving the model's generalization ability, generating an experience playback model. Then, based on the experience playback model, the target network parameters are updated using target network technology to stabilize the learning process, generating a stable optimized model. Next, based on the stable optimized model, performance testing is conducted using a validation set to evaluate the accuracy of identifying the authenticity of different types of honey, and the best-performing model parameters are selected to generate a training optimized model. Finally, based on the training optimized model, predictions are made on the optimized spectral feature set, and the confidence level is evaluated using an uncertainty quantification method. The probability distribution of the prediction results is calculated, the model's confidence level is evaluated, the prediction result confidence is generated, and a high-confidence identification result is generated by setting a confidence threshold.

[0152] Through the above steps, a high-confidence identification result is generated, providing reliable support for subsequent food safety supervision and consumers to identify the authenticity of honey.

[0153] This application takes into account that in deep Q-networks under the reinforcement learning framework, the experience replay technique is used to break the correlation between samples and improve the generalization ability of the model. By randomly drawing samples from the experience replay pool and sampling according to similarity weighting, it can be ensured that high-weight samples are selected first to update the model. In addition, the model parameters are updated through backpropagation technique to gradually optimize the model performance.

[0154] Optionally, based on the initial trained model, a deep Q-network under the reinforcement learning framework is used to learn by randomly sampling samples from past experience, breaking the correlation between samples, improving the model's generalization ability, and generating an experience replay model, including:

[0155] Based on the preliminary training model, a batch of samples is randomly drawn from the experience replay pool;

[0156] The similarity between each sample state action and the current state action is analyzed, and the similarity is measured by a Gaussian kernel function to generate empirical replay sampling weights;

[0157] The empirical replay sampling weights are calculated using the following formula:

[0158]

[0159] Among them, S t The empirical replay sampling weights are defined as follows: N is the number of samples in the empirical replay pool; s i and s t These represent the state of the i-th sample in the experience replay pool and the state at the current time step t, respectively; a i and a t These represent the action of the i-th sample in the experience replay pool and the action at the current time step t, respectively; σ s and σ a , respectively, are the similarity scale parameters for state and action; i is the index of the sample in the experience replay pool, from 1 to N; used to calculate the similarity between each sample and the current state and action;

[0160] Based on the aforementioned experience replay sampling weights, a batch of samples is drawn from the experience replay pool in a proportional manner to ensure that high-weight samples are selected first to update the model. Combined with the instant reward for each sample, backpropagation technology is used to generate updated model parameters.

[0161] The updated model parameters are calculated using the following formula:

[0162]

[0163] Where, θ t+1 The updated model parameters; θ tHere are the model parameters at the current time step t; α is the learning rate; B is the batch size of samples randomly drawn from the empirical replay pool; r i γ is the instantaneous reward for 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 These represent the state and action of the i-th sample, respectively; s i+1 Let θ be the next state of the i-th sample; - ... i+1 The optimal action among all possible actions; Q(s) i+1 ,a';θ - ) is in state s i+1 The Q-value of the target network when the optimal action a' is taken;

[0164] Based on the updated model parameters, they are applied to the current model to reflect the latest learning results. The target network parameters are updated synchronously at a certain update frequency. The model parameters are optimized through multiple iterations to generate an experience playback model.

[0165] This method aims to leverage past empirical data to break down the correlation between samples, thereby improving the model's generalization ability and stability. By introducing empirical replay sampling weights and gradient descent based on TD error, it can better balance the importance of different samples and stabilize the learning process by using a target network, reducing fluctuations during training.

[0166] In the empirical replay sampling weights, the state similarity component... Measure the current state s t The state s of the i-th sample in the experience replay pool i The similarity between samples is smoothed using a Gaussian kernel function, giving higher weights to samples that are closer to the current state; action similarity component Measure the current action a t Action a of the i-th sample in the experience replay pool i The similarity between samples is also smoothed through the Gaussian kernel function, so that samples that are closer to the current action have higher weights.

[0167] Where N is the number of samples in the experience replay pool, which is obtained directly from the experience replay pool; σ s and σ a The similarity scale parameter between states and actions is usually determined through experimental parameter tuning; s i and s tThese are the states of the i-th sample in the experience replay pool and the state at the current time step t, respectively, obtained from the experience replay pool; a i and a t These are the actions of the i-th sample in the experience replay pool and the action at the current time step t, respectively, which are obtained from the experience replay pool.

[0168] In the updated model parameters, the TD error component [r] i +γ·max a' Q(s i+1 ,a';θ - )-Q(s i ,a i ;θ t )]: Calculate the TD error for each sample, which is the difference between the predicted and actual values. This is the basis of gradient descent; gradient components Calculate the gradient of the Q-value function with respect to the parameter θ, which guides the direction of parameter updates; smoothing term breakdown. To prevent division by zero errors and smooth gradients, avoiding gradient explosion or vanishing problems;

[0169] The empirical replay sampling weights are defined as follows: The updated model parameters include: α, the learning rate (usually determined through experimental parameter tuning); B, the batch size of samples randomly drawn from the empirical replay pool (set according to the training strategy); and r. i The immediate reward for the i-th sample is obtained from the experience replay pool; γ is the discount factor, typically taking values ​​of 0.9 or 0.99; θ t The model parameters for the current time step t are obtained from the current model; θ - The parameters of the target network are periodically updated synchronously from the current model parameters; ∈ is the smoothing term, which is usually a small positive number, such as 0.0001;

[0170] Suppose that researchers have an experience replay pool containing 500 samples in a task to identify the authenticity of imported food, and they need to update the model parameters.

[0171] Assume 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 r i Given: the parameters θ of the target network - Given, and with the current model parameters θ t Synchronous updates; assuming 32 sample states s1, s2, ..., s 32 The values ​​are 0.1, 0.2, ..., 0.32 respectively; actions a1, a2, ..., a32 The values ​​are 0.1, 0.2, ..., 0.32 respectively; the instantaneous rewards are r1, r2, ..., 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(s1,a1;θ) t )=0.7,Q(s2,a2;θ t )=0.6,…,Q(s 32 ,a 32 ;θ t )=0.8;Q(s2,a';θ - )=0.8,Q(s3,a';θ - )=0.7,…,Q(s 33 ,a';θ - ) = 0.9; Assume θ t =0.5;

[0174]

[0175] Assuming a threshold of 0.501 is set, the result 0.50048 is less than this threshold, indicating that the changes in the currently updated model parameters are small, and the model is close to convergence. This means that the adjustment of model parameters in the current batch of training 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 technique 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 physical and chemical characteristics and food industry standards, a comprehensive authenticity identification result is generated.

[0177] Food biochemical properties refer to the physical and chemical attributes of food, such as its composition, structure, and reactions. These properties can provide additional information to verify the authenticity of food.

[0178] Food industry standards are norms and standards formulated by relevant organizations to guide food production and quality control, and to ensure food safety and compliance.

[0179] The comprehensive authenticity identification result is a complete and reliable conclusion on authenticity identification generated by combining high-confidence identification results, food chemical characteristics and industry standards.

[0180] In this step, firstly, based on the high-confidence identification results, and combined with the physical and chemical characteristics of the food, the identification results are further verified to ensure their scientific validity and rationality. Secondly, referring to food industry standards, the authenticity status of the food samples is standardized and assessed to ensure that the identification results meet industry norms and standards. Thirdly, a comprehensive analysis of the authenticity status of the food samples, including factors such as the food's source, processing process, and storage conditions, is conducted to provide a detailed authenticity identification report. Finally, based on the comprehensive analysis results, specific handling suggestions are proposed, such as recall, destruction, or re-inspection, to provide decision support for regulatory authorities and consumers, generating a comprehensive authenticity identification result.

[0181] Optionally, step 104, which involves generating a comprehensive authenticity identification result based on the high-confidence identification result, combined with the food's physicochemical characteristics and food industry standards, includes: performing physicochemical verification based on the high-confidence identification result and the food's physicochemical characteristics to generate a physicochemical verification result; conducting a standardized assessment of the authenticity status of the food sample based on the physicochemical verification result and referencing food industry standards to generate a standardized assessment result; comprehensively analyzing the food processing process and storage conditions based on the standardized assessment result to assess potential adulteration risks and generate a comprehensive identification report; and analyzing in detail different situations of food authenticity status based on the comprehensive identification report, proposing specific handling suggestions for foods in different authenticity statuses, and generating a comprehensive authenticity identification result.

[0182] The high-confidence identification results are those with high reliability selected through uncertainty quantification methods, used to ensure the accuracy of predictions.

[0183] The physicochemical properties of food are its physical and chemical attributes, such as composition, structure, and reaction. These properties can provide additional information to verify the authenticity of food.

[0184] Food industry standards are norms and standards formulated by relevant organizations to guide food production and quality control, and to ensure food safety and compliance.

[0185] A comprehensive authentication report is a complete and detailed report on authenticity generated by combining high-confidence authentication results, physicochemical verification results, standardized evaluation results, and analysis of processing and storage conditions.

[0186] Specific handling recommendations are based on comprehensive identification reports, proposing handling measures for food products in different authenticity states, such as recall, destruction, or re-inspection.

[0187] In this embodiment, firstly, based on the high-confidence identification results and combined with the physicochemical characteristics of the food, physicochemical verification is performed to generate physicochemical verification results; secondly, based on the physicochemical verification results and referring to food industry standards, the authenticity status of the food samples is standardized and evaluated to generate standardized evaluation results; thirdly, based on the standardized evaluation results, the food processing process and storage conditions are comprehensively analyzed to assess potential adulteration risks and generate a comprehensive identification report; finally, based on the comprehensive identification report, different situations of food authenticity status are analyzed in detail, and specific processing suggestions are proposed for foods in different authenticity statuses to generate a comprehensive authenticity identification result.

[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 and antioxidant content), physicochemical verification is conducted to generate physicochemical verification results. Second, based on the physicochemical verification results, and referring to relevant food industry standards of the Codex Alimentarius Commission and the European Union, the authenticity of the olive oil samples is standardized and assessed to generate standardized assessment results. Third, based on the standardized assessment results, the processing process (such as pressing technology and degree of refining) and storage conditions (such as temperature and humidity) of the olive oil are comprehensively analyzed to assess potential adulteration risks and generate a comprehensive identification report. Finally, based on the comprehensive identification report, different situations of olive oil authenticity are analyzed in detail, and specific handling suggestions are proposed for olive oil in different authenticity states. For example, olive oil confirmed to be genuine is recommended to be sold normally, olive oil suspected of being adulterated is recommended to undergo further laboratory testing, and olive oil confirmed to be counterfeit or substandard products is recommended to be immediately recalled and destroyed.

[0190] Through the above steps, a comprehensive authenticity verification result is generated, providing reliable support for subsequent food safety supervision and consumers in identifying the authenticity of imported olive oil.

[0191] Figure 2 This application provides a schematic diagram of the structure of a food authenticity identification system based on spectral imaging, as shown in the embodiment of the present application. Figure 2 As shown, the device includes:

[0192] 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 dataset;

[0193] The filtering module 22 is used to explore the feature space based on the comprehensive spectral image dataset using an adaptive large neighborhood search algorithm, automatically find the best feature combination, and use local sensitive hashing technology for fast positioning and filtering to improve the efficiency and accuracy of feature selection and generate an optimized spectral feature set.

[0194] The adjustment module 23 is used to perform deep learning using a deep Q-network under the reinforcement learning framework based on the optimized spectral feature set, dynamically adjust the model parameters to adapt to different types of food authenticity identification tasks, and use uncertainty quantification methods to evaluate the confidence of the prediction results and generate high-confidence identification results.

[0195] The generation module 24 is used to generate a comprehensive authenticity identification result based on the high confidence identification result, combined with the food's biochemical characteristics and food industry standards.

[0196] Figure 2 The aforementioned food authenticity identification system based on spectral imaging can perform... Figure 1 The implementation principle and technical effects of the food authenticity identification method based on spectral imaging described in the illustrated embodiment will not be repeated here. The specific operation methods of each module and unit in the food authenticity identification system based on spectral imaging in the above embodiments have been described in detail in the embodiments related to this method, and will not be elaborated upon here.

[0197] In one possible design, Figure 2 The food authenticity identification system based on spectral imaging shown in the 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 invoked 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 dataset; based on the comprehensive spectral image dataset, use an adaptive large neighborhood search algorithm to explore the feature space, automatically find the best feature combination, and use local sensitive hashing technology for fast positioning and filtering to improve the efficiency and accuracy of feature selection, generating an optimized spectral feature set; based on the optimized spectral feature set, use a deep Q-network under the reinforcement learning framework for deep learning, dynamically adjust the model parameters to adapt to different types of food authenticity identification tasks, use uncertainty quantification methods to evaluate the confidence of the prediction results, and generate high-confidence identification results; based on the high-confidence identification results, combine the food's biochemical characteristics and 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-described method. Alternatively, the processing component may be implemented as 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-described method.

[0201] 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 storage, flash memory, magnetic disk, or optical disk.

[0202] Of course, computing devices may also include other components, such as input / output interfaces, display components, communication components, etc.

[0203] Input / output interfaces provide interfaces between processing components and peripheral interface modules, which can be output devices, input devices, etc.

[0204] The communication components are configured to facilitate wired or wireless communication between computing devices and other devices.

[0205] The computing device can be a physical device or an elastic computing host provided by a cloud computing platform. In this case, the computing device can refer to a cloud server, and the aforementioned processing components, storage components, etc., can be basic server resources rented or purchased from the cloud computing platform.

[0206] This application also provides a computer storage medium storing a computer program, which, when executed by a computer, can perform the above-described functions. Figure 1 The illustrated embodiment presents a method for identifying the authenticity of food based on spectral imaging.

[0207] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0208] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0209] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments 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 this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.

Claims

1. A method for identifying the authenticity of food 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 dataset, an adaptive large neighborhood search algorithm is used to explore the feature space, automatically find the best feature combination, and locality-sensitive hashing technology is used for fast localization and filtering 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 the reinforcement learning framework is used for deep learning. The model parameters are dynamically adjusted to adapt to the identification tasks of different types of food authenticity. An uncertainty quantification method is used to evaluate the confidence of the prediction results and generate high-confidence identification results. Based on the high-confidence identification results, combined with the food's biochemical characteristics 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 dataset, an adaptive large neighborhood search algorithm is used to explore the feature space, automatically finding the optimal feature combination. Locality-sensitive hashing (LSH) technology is employed for rapid localization and filtering, improving the efficiency and accuracy of feature selection, and generating an optimized spectral feature set, including: Based on a comprehensive spectral image dataset, 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. By defining a fitness function for the accuracy of food authenticity identification, the effectiveness of different feature combinations is evaluated. After multiple iterations, the optimal feature combination is automatically found, and a preliminary feature combination is generated. Based on the preliminary feature combination, local sensitive hashing technology is used to quickly locate and filter, efficiently identify highly similar spectral features, further refine the feature combination, improve the efficiency and accuracy of feature selection, 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 noisy features are removed, and an optimized spectral feature set is generated.

3. The method according to claim 2, characterized in that, Based on the preprocessing parameter configuration, an adaptive large neighborhood search algorithm is used to explore the feature space. A fitness function for food authenticity identification accuracy is defined to evaluate the effectiveness of different feature combinations. After multiple iterations, the optimal feature combination is automatically found, generating 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 initial search parameters are generated. Based on the initial search parameters, a fitness function for food authenticity identification accuracy is defined. The classification accuracy of the feature combination training set and the independence between features are comprehensively considered to fully evaluate the effectiveness of different feature combinations and generate fitness evaluation criteria. 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 better feature combinations. After multiple iterations, an excellent feature combination is generated. Based on the superior feature combination, cross-validation is performed to evaluate the generalization ability and generate an initial feature combination.

4. The method according to claim 3, characterized in that, Based on the aforementioned 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 better feature combinations. After multiple iterations, excellent feature combinations are generated, including: Based on the fitness evaluation criteria, the feature combinations are subjected to dimensionality reduction to remove noise and redundant information. The model is trained on the training set using a selected classification algorithm to obtain the classification accuracy of feature combinations, thereby generating feature evaluation values. The feature evaluation value is calculated using the following formula: ; in, For feature combination The feature evaluation value is used to comprehensively evaluate the classification accuracy and feature independence of feature combinations; This is a balancing coefficient between classification accuracy and feature independence, with a value range of [value range missing]. ; For feature combination Classification accuracy on the training set; Features and The correlation between them; The number of features in the feature combination; and These are the indices of the features in the feature combination, ranging from 1 to... ,and , used to calculate pairwise correlations between features; Based on the aforementioned feature evaluation values, the distinguishing ability of the evaluation values ​​is enhanced through nonlinear adjustment, a distance weighting mechanism is introduced to evaluate the relative importance of solutions within the neighborhood, and a periodic adjustment term is added to simulate feature combinations in order to generate optimized values ​​of feature combinations. The optimal value of the feature combination can be calculated using the following formula: ; in, For the first The optimized value of the feature combination in the next iteration is used to evaluate the degree of optimization of the feature combination in the current neighborhood. The balance coefficient for nonlinear adjustment and distance weighting has a range of values. ; For feature combination Feature evaluation value; The gain coefficient is adjusted non-linearly. For periodic adjustment amplitude; This is the length of the sine term's period, used to control the frequency of the sine period's variation; For the current solution and the first The distance between neighboring solutions; The size of the neighborhood of the current solution; and These are the scale parameters in the distance-weighted calculation, used to control the degree of influence of distance; This is a periodic adjustment coefficient used to introduce periodic changes; The length of the cosine term's period is used to control the frequency of the cosine period's variation; This represents the gain coefficient due to the effect of distance. The scale parameter for the effect of distance; This is the attenuation coefficient due to the effect of distance; This is the attenuation scale parameter for the effect of distance; The indices of the neighboring solutions of the current solution, from 1 to... This is used to calculate the distance and influence between the current solution and each of its neighboring solutions; This represents 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 excellent feature combinations are generated through multiple iterations.

5. The method according to claim 2, characterized in that, Based on the initial feature combination, locality-sensitive hashing (LSH) technology is used for rapid location filtering and efficient identification of highly similar spectral features. The feature combination is further refined to improve feature selection efficiency and accuracy, generating a refined spectral feature set, including: Based on the preliminary feature combination, an index is constructed using locality-sensitive hashing (LSH) technology, and an appropriate hash function is set to efficiently identify highly similar spectral features and generate a similar feature index. Based on the similarity feature index, each feature in the initial feature combination is quickly located and filtered, and a filtered feature set is generated based on the similarity with other features. Based on the filtered feature set, further analysis of the correlation and independence between features is conducted, features that contribute little to the identification of food authenticity are removed, and a refined feature combination is generated. Based on the aforementioned combination of refined features, a set of refined spectral features is generated by comprehensively considering the representativeness of the features and their contribution to the identification of food authenticity.

6. The method according to claim 1, characterized in that, Based on the optimized spectral feature set, a deep Q-network under the reinforcement learning framework is used for deep learning to dynamically adjust the model parameters to adapt to different types of food authenticity identification tasks. An uncertainty quantification method is used to evaluate the confidence of the prediction results, generating high-confidence identification results, including: Based on the optimized spectral feature set, the network parameters and learning rate are initialized, a reward mechanism is set to better adapt to different types of food authenticity identification tasks, and initial model parameters are generated. Based on the initial model parameters, a deep Q-network under the reinforcement learning framework is used for deep learning. Through multiple rounds of training, the model parameters are dynamically adjusted to achieve adaptive adjustment of internal weights, improve the accuracy of identifying the authenticity of different types of food, and generate a training optimization model. Based on the trained and optimized model, the optimized spectral feature set is predicted, the confidence level is evaluated using an uncertainty quantification method, the probability distribution of the prediction results is calculated, the confidence level of the model is evaluated, and the confidence level of the prediction results is generated. Based on the confidence level of the prediction results, a high-confidence identification result is generated by setting a confidence level threshold for filtering.

7. The method according to claim 6, characterized in that, Based on the initialized model parameters, a deep Q-network under the reinforcement learning framework is used for deep learning. Through multiple rounds of training, the model parameters are dynamically adjusted to adaptively adjust the internal weights, thereby improving the accuracy of identifying the authenticity of different types of food and generating a training and optimization model, including: Based on the initial model parameters, the optimized spectral feature set is input into the model to start the training process. The model predicts and generates actions and environmental feedback to generate a preliminary training model. Based on the aforementioned preliminary training model, a deep Q-network under the reinforcement learning framework is adopted to learn by randomly sampling samples from past experience, breaking the correlation between samples, improving the model's generalization ability, and generating an experience replay model. Based on the aforementioned experience replay model, target network parameters are updated using target network technology to stabilize the learning process and generate a stable optimized model. Based on the stable optimization model, performance tests are conducted using a validation set to evaluate the accuracy of identifying the authenticity of different types of food, select the optimal model parameters, and generate a training optimization model.

8. The method according to claim 7, characterized in that, Based on the aforementioned preliminary training model, a deep Q-network under the reinforcement learning framework is employed. Learning is performed by randomly sampling samples from past experience, breaking down correlations between samples, improving the model's generalization ability, and generating an experience replay model, including: Based on the preliminary training model, a batch of samples is randomly drawn from the experience replay pool; The similarity between each sample state action and the current state action is analyzed, and the similarity is measured by a Gaussian kernel function to generate empirical replay sampling weights; The empirical replay sampling weights are calculated using the following formula: ; in, For the current time step Experience replay sampling weights; The number of samples in the experience replay pool; and The first in the experience replay pool The state and current time step of each sample The state; and The first in the experience replay pool Actions and current time steps for each sample The action; and These are the similarity scale parameters for states and actions, respectively; The index of the samples in the experience replay pool, from 1 to Used to calculate the similarity of each sample to the current state and action; Based on the aforementioned experience replay sampling weights, a batch of samples is drawn from the experience replay pool in a proportional manner to ensure that high-weight samples are selected first to update the model. Combined with the instant reward for each sample, backpropagation technology is used to generate updated model parameters. The updated model parameters are calculated using the following formula: ; in, These are the updated model parameters; For the current time step Model parameters; The learning rate; The batch size of samples randomly drawn from the experience replay pool; For the first Instant reward for each sample; Discount factor; The Q-value function of a deep Q-network is given by the following parameters: and The first The state and actions of each sample; For the first The next state of each sample; These are the parameters of the target network; To smooth out terms and prevent division by zero errors; For the index of a sample batch randomly drawn from the experience replay pool, from 1 to... This is used to calculate the TD error and gradient for each sample; In the state The optimal action among all possible actions; In the state Next, take the optimal action. The Q-value of the target network at that time; Based on the updated model parameters, they are applied to the current model to reflect the latest learning results. The target network parameters are updated synchronously at a certain update frequency. The model parameters are optimized through multiple iterations to generate an experience playback model.

9. The method according to claim 1, characterized in that, Based on the high-confidence identification results, combined with the food's biochemical characteristics and food industry standards, a comprehensive authenticity identification result is generated, including: Based on the high-confidence identification results, combined with the physicochemical properties of the food, physicochemical verification is performed to generate physicochemical verification results. Based on the physicochemical verification results, and with reference to food industry standards, the authenticity status of food samples is evaluated in a standardized manner, and standardized evaluation results are generated. Based on the standardized assessment results, a comprehensive analysis of the food processing and storage conditions is conducted to assess potential adulteration risks and generate a comprehensive identification report. Based on the comprehensive identification report, a detailed analysis of different states of authenticity of food products is conducted, specific handling suggestions are proposed for food products in different states of authenticity, 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, and integrate the near-infrared and short-wave infrared regions to generate a comprehensive spectral image dataset. The filtering module is used to explore the feature space based on the comprehensive spectral image dataset using an adaptive large neighborhood search algorithm, automatically find the best feature combination, and use locality-sensitive hashing technology for fast positioning and filtering, thereby improving the efficiency and accuracy of feature selection and generating an optimized spectral feature set. The adjustment module is used to perform deep learning using a deep Q-network under the reinforcement learning framework based on the optimized spectral feature set, dynamically adjust the model parameters to adapt to different types of food authenticity identification tasks, and use uncertainty quantification methods to evaluate the confidence of the prediction results and generate high-confidence identification results. The generation module is used to generate a comprehensive authenticity identification result based on the high-confidence identification result, combined with the food's biochemical characteristics and food industry standards.

Citation Information

Patent Citations

  • Construction method and application method of grid deep reinforcement learning model

    CN116307314A

  • Adulterated safflower rapid detection method based on deep learning model

    CN117554353A