Inspection model construction method, system and equipment for quality control of precious traditional Chinese medicinal materials and field inspection of pesticide residues

The quality control and on-site inspection model of Chinese medicine materials constructed through the width neural algorithm and PCA algorithm solves the problem of time-consuming and cost-effective detection of Chinese medicine materials, achieves fast, low-cost and efficient detection effects, and improves detection accuracy and applicability.

CN120277989APending Publication Date: 2025-07-08MACAU UNIV OF SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510230039.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-28
Publication Date
2025-07-08

AI Technical Summary

Technical Problem

In the prior art, Chinese medicinal materials testing relies on chemical analysis methods in the laboratory, which is time-consuming and costly, cannot meet the needs of rapid on-site testing, and is highly dependent on professionals.

Method used

The initial inspection model is constructed using the width neural algorithm. By setting up training samples and optimizing loss functions, combining PCA algorithm and feature extraction model, optimizing model structure and parameters, and using independent test data sets to verify the model, building a fast and low-cost detection system.

Benefits of technology

It realizes rapid and low-cost testing of quality control of traditional Chinese medicine materials and on-site inspection of pesticide residues, improves detection efficiency and accuracy, reduces dependence on professionals, and enhances the generalization ability and applicability of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120277989A_ABST
    Figure CN120277989A_ABST
Patent Text Reader

Abstract

The invention discloses a method, a system and equipment for constructing an inspection model for quality control of precious traditional Chinese medicinal materials and field inspection of pesticide residues, and belongs to the technical field of detection technologies and neural networks. According to the method, the initial test model is constructed through the width neural algorithm, and rapid, low-cost and high-efficiency detection of the traditional Chinese medicinal materials is realized. On the premise of ensuring the detection precision, the operation process is simplified, the detection efficiency, especially the detection efficiency in the field detection process, is improved, meanwhile, the dependence on high-skill operators is reduced, and the detection cost is reduced; by optimizing the loss function of the initial test model, the generalization ability of the test model is enhanced, and overfitting is prevented, so that the detection efficiency is further improved on the basis of ensuring the reliability of the detection result; through independent test of the data set, the trained test model is verified and adjusted to obtain the final test model, so that the reliability of processing different data in the field test process of the test model is further improved, and the applicability is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical fields of detection technology and neural network technology, and particularly relates to a method, system and device for constructing an inspection model for the quality control of precious traditional Chinese medicine materials and on-site inspection of agricultural residues. Background Art

[0002] In the technical field of traditional Chinese medicine material detection and quality control, the current situation mainly relies on chemical analysis methods in laboratories, such as high performance liquid chromatography (HPLC), gas chromatography (GC) and mass spectrometry (MS), etc.

[0003] The detection methods provided by the above-mentioned prior art can provide accurate chemical component analysis, but usually require complex sample pretreatment, which is time-consuming and costly, and depends on professional technical personnel for operation. As a result, in the process of on-site use of the above methods, it usually takes a long time, and it cannot meet the scenarios where urgent test results are needed to ensure the quality and safety of traditional Chinese medicine materials, and the professional equipment also increases the maintenance cost. Summary of the Invention

[0004] To solve the problems of the prior art, embodiments of the present invention provide a method, system and device for constructing an inspection model for the quality control of precious traditional Chinese medicine materials and on-site inspection of agricultural residues, including:

[0005] On the one hand, a method for constructing an inspection model for the quality control of precious traditional Chinese medicine materials and on-site inspection of agricultural residues is provided, and the method includes:

[0006] Construct an initial inspection model through a width neural algorithm;

[0007] Set training samples corresponding to traditional Chinese medicine materials of multiple morphologies and multiple shapes;

[0008] Optimize the loss function of the initial inspection model;

[0009] Train the initial inspection model through the training samples and the loss function to obtain a trained inspection model;

[0010] Verify and adjust the trained inspection model through an independent test data set to obtain a final inspection model.

[0011] Optionally, the constructing an initial inspection model through a width neural algorithm includes:

[0012] Set a feature extraction model;

[0013] Set the feature nodes of the width neural algorithm according to the features mapped by the feature extraction model;

[0014] Set the initial parameter matrix of the width neural algorithm;

[0015] After completing the feature nodes and the initial parameter matrix, the initial inspection model is obtained.

[0016] Optionally, the setting of the feature extraction model includes:

[0017] Set a plurality of original feature extraction channels corresponding to the input of the detection device;

[0018] Through the PCA algorithm, set a feature extraction model corresponding to the plurality of original feature extraction channels.

[0019] Optionally, the setting of the training samples corresponding to the traditional Chinese medicines of the plurality of forms and the plurality of shapes includes:

[0020] Input the traditional Chinese medicines of the plurality of forms and the plurality of shapes into the mass spectrometer respectively to obtain corresponding multiple groups of original features;

[0021] Set multiple groups of expected test results corresponding to the multiple groups of original features respectively;

[0022] Set the multiple groups of original features and the multiple groups of expected test results as the training samples.

[0023] Optionally, the optimization of the loss function of the initial inspection model includes:

[0024] Add a penalty term to the loss function to obtain the optimized loss function.

[0025] Optionally, the training of the initial inspection model by using the training samples and the loss function to obtain the trained inspection model includes:

[0026] Input the training samples into the initial inspection model to obtain multiple groups of inspection results;

[0027] Adjust the initial inspection model according to the multiple groups of inspection results and the multiple groups of expected test results until the condition for stopping training is met.

[0028] Optionally, the method further includes:

[0029] Set a feature node optimization strategy;

[0030] Set a training stop strategy;

[0031] Train the initial inspection model according to the feature node optimization strategy and the training stop strategy to obtain the trained inspection model.

[0032] Optionally, the verification and adjustment of the trained inspection model by using an independent test data set to obtain the final inspection model includes:

[0033] Set up an independent test dataset;

[0034] Set up the accuracy rate, recall rate, and F1 score corresponding to the independent test dataset, where the F1 score is used to balance the accuracy rate and the recall rate;

[0035] Verify and adjust the trained inspection model according to the independent test dataset, the accuracy rate, the recall rate, and the F1 score to obtain the final inspection model.

[0036] On the other hand, provided is an inspection model construction system for the quality control of precious traditional Chinese medicine materials and on-site pesticide residue inspection. The system includes a sampling device and an inspection device, wherein:

[0037] The inspection device is used to construct an initial inspection model through a width neural algorithm;

[0038] The sampling device is used to set training samples corresponding to traditional Chinese medicine materials in multiple forms and multiple shapes;

[0039] The inspection device is used to optimize the loss function of the initial inspection model;

[0040] The inspection device is used to train the initial inspection model through the training samples and the loss function to obtain a trained inspection model;

[0041] The sampling device is used to set the independent test dataset

[0042] The inspection device is used to verify and adjust the trained inspection model through the independent test dataset to obtain the final inspection model.

[0043] Optionally, the inspection device is used for:

[0044] Set up a feature extraction model;

[0045] Set the feature nodes of the width neural algorithm according to the features mapped by the feature extraction model;

[0046] Set the initial parameter matrix of the width neural algorithm;

[0047] After completing the feature nodes and the initial parameter matrix, obtain the initial inspection model.

[0048] Optionally, the sampling device is used for:

[0049] Set up multiple original feature extraction channels corresponding to the input of the detection device;

[0050] Set up a feature extraction model corresponding to the multiple original feature extraction channels through the PCA algorithm.

[0051] Optionally, the inspection device is used for:

[0052] Input traditional Chinese medicines of multiple forms and multiple shapes into a mass spectrometer respectively to obtain corresponding multiple groups of original features;

[0053] Set multiple groups of expected test results corresponding to the multiple groups of original features respectively;

[0054] Set the multiple groups of original features and the multiple groups of expected test results as the training samples.

[0055] Optionally, the inspection device is used for:

[0056] Add a penalty term to the loss function to obtain the optimized loss function.

[0057] Optionally, the inspection device is used for:

[0058] Input the training samples into the initial inspection model to obtain multiple groups of inspection results;

[0059] Adjust the initial inspection model according to the multiple groups of inspection results and the multiple groups of expected test results until the condition for stopping training is met.

[0060] Optionally, the inspection device is used for:

[0061] Set a feature node optimization strategy;

[0062] Set a training stop strategy;

[0063] Train the initial inspection model according to the feature node optimization strategy and the training stop strategy to obtain a trained inspection model.

[0064] Optionally, the sampling device is used for setting an independent test data set;

[0065] The inspection device is used for:

[0066] Set the accuracy rate, recall rate and F1 score corresponding to the independent test data set, and the F1 score is used to balance the accuracy rate and the recall rate;

[0067] Verify and adjust the trained inspection model according to the independent test data set, the accuracy rate, the recall rate and the F1 score to obtain a final inspection model.

[0068] On the other hand, provided is an inspection model construction device for quality control of precious traditional Chinese medicines and on-site inspection of agricultural residues, and the inspection model construction device includes:

[0069] An algorithm construction module for constructing an initial inspection model through a width neural algorithm;

[0070] An optimization module for optimizing the loss function of the initial inspection model;

[0071] A training module for training the initial inspection model through training samples and the loss function to obtain a trained inspection model;

[0072] A verification module for verifying and adjusting the trained inspection model through an independent test data set to obtain a final inspection model.

[0073] Optionally, the algorithm construction module is used for:

[0074] Setting a feature extraction model;

[0075] Setting the feature nodes of the width neural algorithm according to the features mapped by the feature extraction model;

[0076] Setting the initial parameter matrix of the width neural algorithm;

[0077] After completing the feature nodes and the initial parameter matrix, the initial inspection model is obtained.

[0078] Optionally, the algorithm construction module is used for:

[0079] Setting a plurality of original feature extraction channels corresponding to the input of the detection device;

[0080] Setting a feature extraction model corresponding to the plurality of original feature extraction channels through a PCA algorithm.

[0081] Optionally, the optimization module is used for:

[0082] Adding a penalty term to the loss function to obtain the optimized loss function.

[0083] Optionally, the training module is used for:

[0084] Inputting the training samples into the initial inspection model to obtain multiple groups of inspection results;

[0085] Adjusting the initial inspection model according to the multiple groups of inspection results and the multiple groups of expected test results until the condition for stopping training is met.

[0086] Optionally, the optimization module is used for:

[0087] Setting a feature node optimization strategy;

[0088] Setting a training stop strategy;

[0089] Train the initial inspection model according to the feature node optimization strategy and the training stop strategy to obtain a trained inspection model.

[0090] Optionally, the verification module is used to:

[0091] Set an independent test data set;

[0092] Set the accuracy rate, recall rate, and F1 score corresponding to the independent test data set, where the F1 score is used to balance the accuracy rate and the recall rate;

[0093] Verify and adjust the trained inspection model according to the independent test data set, the accuracy rate, the recall rate, and the F1 score to obtain a final inspection model.

[0094] The present invention has at least the following beneficial effects:

[0095] 1. By using the width neural algorithm, an initial inspection model is constructed to realize the rapid, low-cost, and high-efficiency detection of Chinese medicinal materials. On the premise of ensuring the detection accuracy, the operation process is simplified, the detection efficiency is improved, especially the detection efficiency in the on-site detection process, while reducing the dependence on highly skilled operators and lowering the detection cost;

[0096] 2. By optimizing the loss function of the initial inspection model, the generalization ability of the inspection model is enhanced and overfitting is prevented, thereby further improving the detection efficiency on the basis of ensuring the reliability of the detection results;

[0097] 3. Through the independent test data set, the trained inspection model is verified and adjusted to obtain a final inspection model, which further improves the reliability of the inspection model in processing different data during on-site detection, and further improves the applicability of the detection by improving the generalization ability of the model. Description of the Drawings

[0098] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0099] Figure 1 It is a schematic flowchart of a method for constructing an inspection model for the quality control of precious Chinese medicinal materials and on-site inspection of agricultural residues provided by an embodiment of the present invention;

[0100] Figure 2 It is a schematic flowchart of a method for constructing an inspection model for the quality control of precious Chinese medicinal materials and on-site inspection of agricultural residues provided by an embodiment of the present invention;

[0101] Figure 3 Schematic diagram of the width neural algorithm model provided by an embodiment of the present invention;

[0102] Figure 4 Schematic diagram of the inspection model construction system for the quality control of precious traditional Chinese medicine materials and on-site inspection of agricultural residues provided by an embodiment of the present invention;

[0103] Figure 5 Schematic diagram of the structure of the inspection model construction equipment for the quality control of precious traditional Chinese medicine materials and on-site inspection of agricultural residues provided by an embodiment of the present invention. Detailed implementation manners

[0104] To make the objectives, technical solutions and advantages of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Apparently, the described embodiments are only a part rather than all of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0105] Refer to Figure 1 As shown, a method for constructing an inspection model for the quality control of precious traditional Chinese medicine materials and on-site inspection of agricultural residues is provided, and the method includes:

[0106] 101. Construct an initial inspection model through the Broad Learning System (BLS);

[0107] 102. Set training samples corresponding to traditional Chinese medicine materials with multiple forms and multiple shapes;

[0108] 103. Optimize the loss function of the initial inspection model;

[0109] 104. Train the initial inspection model through the training samples and the loss function to obtain a trained inspection model;

[0110] 105. Verify and adjust the trained inspection model through an independent test data set to obtain a final inspection model.

[0111] Optionally, constructing the initial inspection model through the width neural algorithm in step 101 includes:

[0112] 201. Set a feature extraction model;

[0113] 202. Set the feature nodes of the width neural algorithm according to the features mapped by the feature extraction model;

[0114] 203. Set the initial parameter matrix of the width neural algorithm;

[0115] After completing the feature nodes and the initial parameter matrix, an initial test model is obtained.

[0116] Optionally, referring to Figure 3 As shown, the feature extraction model is set to include:

[0117] Set multiple original feature extraction channels corresponding to the input of the detection device;

[0118] Through the PCA (principal components analysis) algorithm, set the feature extraction model corresponding to the multiple original feature extraction channels.

[0119] Optionally, the training samples corresponding to Chinese herbal medicines of multiple morphologies and multiple shapes are set to include:

[0120] Input Chinese herbal medicines of multiple morphologies and multiple shapes into the mass spectrometer respectively to obtain corresponding multiple groups of original features;

[0121] Set multiple groups of expected test results corresponding to the multiple groups of original features respectively;

[0122] Set the multiple groups of original features and the multiple groups of expected test results as training samples.

[0123] Optionally, optimizing the loss function of the initial test model includes:

[0124] Add a penalty term to the loss function to obtain an optimized loss function.

[0125] Specifically, in order to enhance the generalization ability of the model and prevent overfitting, regularization techniques will be adopted. Regularization limits the complexity of the model parameters by adding additional terms (such as L1 or L2 penalty terms) to the loss function, thereby reducing the risk of the model overfitting to the training data.

[0126] Optionally, through the training samples and the loss function, training the initial test model to obtain a trained test model includes:

[0127] Input the training samples into the initial test model to obtain multiple groups of test results;

[0128] Adjust the initial test model according to the multiple groups of test results and the multiple groups of expected test results until the conditions for stopping training are met.

[0129] Referring to Figure 3 As shown in the width neural algorithm model, the above process can be specific as:

[0130] Set the training samples and n feature maps φ i, if \(i = 1, 2, \ldots, n\), then the \(i\)-th mapping feature is:

[0131] Z i =\(\varphi\) i (XW ei +\(\beta\) ei ), \(i = 1, 2, \ldots, n\)

[0132] where the weight \(W\) ei and the bias term \(\beta\) ei are randomly generated matrices with appropriate dimensions.

[0133] Let \(Z\) n =[\(Z_1, Z_2, \ldots, Z\) n represent the set of \(n\) groups of feature nodes. Then, \(Z\) n is connected to the enhancement node layer.

[0134] Similarly, the model is represented by

[0135] H j =\(\xi\) j (Z n W hj +\(\beta\) hj ), \(j = 1, 2, \ldots, m\)

[0136] to represent the output of the \(j\)-th group of enhancement nodes, where \(\xi\) j is a non-linear activation function. In addition, the model is represented by \(H\) m =[\(H_1, H_2, \ldots, H\) m to represent the output of the enhancement layer.

[0137] Finally, the output \(Y\) of BLS is in the following form:

[0138] Y = [\(Z_1, Z_2, \ldots, Z\) n , \(H_1, H_2, \ldots, H\) m W m

[0139] where \(W\) m is the weight connecting the feature node layer and the enhancement node layer to the output layer, and can be calculated through the pseudo-inverse \([Z\) n , \(H\) m + .

[0140] ​During the above training process, since BLS is flat in structure, where the original input is transformed into random features in "feature nodes" and then expanded in terms of width in "enhanced nodes", that is, in BLS, the input data is first transformed into random features through some feature mappings and then connected to the enhanced nodes through a non-linear activation function. Then, the random features (nodes) are connected to the output layer together with the output of the enhanced layer, and the weights of the output layer are determined by the fast pseudo-inverse of the system equation or the iterative gradient descent training algorithm.

[0141] For the arrival of new inputs or the expansion of enhanced nodes, an incremental learning algorithm is used.

[0142] Optionally, the method further includes:

[0143] Setting a feature node optimization strategy;

[0144] Setting a training stop strategy;

[0145] By dropout, setting a feature node optimization strategy, that is, randomly ignoring some nodes in the network through dropout to reduce overfitting;

[0146] By early stopping, setting a training stop strategy, that is, stopping training when the performance on the validation dataset stops improving through the early stopping technique.

[0147] Through the above feature node optimization strategy and training stop strategy, optimize the model structure to achieve more efficient and more robust performance.

[0148] According to the feature node optimization strategy and training stop strategy, train the initial inspection model to obtain a trained inspection model.

[0149] Optionally, through an independent test dataset, validating and adjusting the trained inspection model to obtain the final inspection model includes:

[0150] Setting an independent test dataset;

[0151] Setting the accuracy rate, recall rate, and F1 score corresponding to the independent test dataset, and the F1 score is used to balance the accuracy rate and recall rate;

[0152] According to the independent test dataset, accuracy rate, recall rate, and F1 score, validate and adjust the trained inspection model to obtain the final inspection model.

[0153] The above process can be specifically:

[0154] The core task in the model validation stage is to evaluate the performance of the model on unseen data, which is achieved by using an independent test dataset. In this stage, the performance evaluation of the model is not limited to accuracy (the proportion of correct predictions by the model), but also includes recall (the ability of the model to correctly identify positive samples) and F1-score (the harmonic mean of accuracy and recall, used to balance the two).

[0155] Preferably, other metrics can be set for evaluation, such as precision (the proportion of actual positives among the samples predicted as positive by the model) and area under the ROC curve (AUC, a method to measure the classification performance of the model). Through these comprehensive metrics, the performance of the model in processing different types of data can be comprehensively evaluated, ensuring that the model not only performs well on a specific dataset but also has good generalization ability.

[0156] In summary, according to the method for constructing an inspection model for the quality control of precious traditional Chinese medicine materials and on-site inspection of agricultural residues described in the embodiments of the present invention, the constructed inspection model for the quality control of precious traditional Chinese medicine materials and on-site inspection of agricultural residues, in the quality control of precious traditional Chinese medicine materials and on-site inspection of agricultural residues, compared with the prior art, can effectively process a large amount of data while maintaining low computational complexity and shorter training time through the width learning algorithm. This enables the detection device to not only quickly learn and adapt to new data but also provide accurate analysis results immediately, thereby improving the accuracy and reliability of data analysis in the detection process. Compared with the traditional methods that require long-time data processing and analysis, the present invention significantly improves the processing speed, enabling the detection results to be obtained almost immediately.

[0157] Refer to Figure 4 As shown, a system for constructing an inspection model for the quality control of precious traditional Chinese medicine materials and on-site inspection of agricultural residues is provided. The system includes a sampling device and an inspection device. In actual application, there can be multiple sampling devices to provide sample information from different sources to the inspection device, where:

[0158] The inspection device is used to construct an initial inspection model through the width neural algorithm;

[0159] The sampling device is used to set training samples corresponding to traditional Chinese medicine materials with multiple forms and multiple shapes;

[0160] The inspection device is used to optimize the loss function of the initial inspection model;

[0161] The inspection device is used to train the initial inspection model through the training samples and the loss function to obtain a trained inspection model;

[0162] The sampling device is used to set an independent test dataset

[0163] The inspection device is used to verify and adjust the trained inspection model through the independent test dataset to obtain a final inspection model.

[0164] Optionally, the inspection device is used for:

[0165] Set the feature extraction model;

[0166] Set the feature nodes of the width neural algorithm according to the features mapped by the feature extraction model;

[0167] Set the initial parameter matrix of the width neural algorithm;

[0168] After completing the feature nodes and the initial parameter matrix, an initial inspection model is obtained.

[0169] Optionally, the sampling device is used for:

[0170] Set multiple original feature extraction channels corresponding to the input of the detection device;

[0171] Set the feature extraction model corresponding to the multiple original feature extraction channels through the PCA algorithm.

[0172] Optionally, the inspection device is used for:

[0173] Input Chinese medicinal materials of multiple morphologies and multiple shapes into the mass spectrometer respectively to obtain corresponding multiple sets of original features;

[0174] Set multiple sets of expected test results corresponding to the multiple sets of original features respectively;

[0175] Set the multiple sets of original features and the multiple sets of expected test results as training samples.

[0176] Optionally, the inspection device is used for:

[0177] Add a penalty term to the loss function to obtain an optimized loss function.

[0178] Optionally, the inspection device is used for:

[0179] Input the training samples into the initial inspection model to obtain multiple sets of inspection results;

[0180] Adjust the initial inspection model according to the multiple sets of inspection results and the multiple sets of expected test results until the condition for stopping training is met.

[0181] Optionally, the inspection device is used for:

[0182] Set the feature node optimization strategy;

[0183] Set the training stop strategy;

[0184] Train the initial inspection model according to the feature node optimization strategy and the training stop strategy to obtain a trained inspection model.

[0185] Optionally, the sampling device is used to set up an independent test data set;

[0186] The inspection device is used for:

[0187] Setting up the accuracy rate, recall rate, and F1 score corresponding to the independent test data set, where the F1 score is used to balance the accuracy rate and the recall rate;

[0188] Validating and adjusting the trained inspection model based on the independent test data set, the accuracy rate, the recall rate, and the F1 score to obtain the final inspection model.

[0189] Refer to Figure 5 As shown, an inspection model construction device for the quality control of precious traditional Chinese medicine materials and on-site pesticide residue inspection is provided. The inspection model construction device includes:

[0190] An algorithm construction module for constructing an initial inspection model through a width neural algorithm;

[0191] An optimization module for optimizing the loss function of the initial inspection model;

[0192] A training module for training the initial inspection model through training samples and the loss function to obtain a trained inspection model;

[0193] A validation module for validating and adjusting the trained inspection model through an independent test data set to obtain the final inspection model.

[0194] Optionally, the algorithm construction module is used for:

[0195] Setting up a feature extraction model;

[0196] Setting up the feature nodes of the width neural algorithm according to the features mapped by the feature extraction model;

[0197] Setting up the initial parameter matrix of the width neural algorithm;

[0198] After completing the feature nodes and the initial parameter matrix, the initial inspection model is obtained.

[0199] Optionally, the algorithm construction module is used for:

[0200] Setting up multiple original feature extraction channels corresponding to the input of the detection device;

[0201] Setting up a feature extraction model corresponding to the multiple original feature extraction channels through the PCA algorithm.

[0202] Optionally, the optimization module is used for:

[0203] Adding a penalty term to the loss function to obtain an optimized loss function.

[0204] Optionally, the training module is configured to:

[0205] Input training samples into the initial inspection model to obtain multiple groups of inspection results;

[0206] Adjust the initial inspection model according to the multiple groups of inspection results and multiple groups of expected test results until the conditions for stopping training are met.

[0207] Optionally, the optimization module is configured to:

[0208] Set the feature node optimization strategy;

[0209] Set the training stop strategy;

[0210] Train the initial inspection model according to the feature node optimization strategy and the training stop strategy to obtain the trained inspection model.

[0211] Optionally, the verification module is configured to:

[0212] Set an independent test data set;

[0213] Set the accuracy rate, recall rate, and F1 score corresponding to the independent test data set, where the F1 score is used to balance the accuracy rate and the recall rate;

[0214] Verify and adjust the trained inspection model according to the independent test data set, the accuracy rate, the recall rate, and the F1 score to obtain the final inspection model.

[0215] The above several specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in some embodiments for the sake of brevity.

[0216] The technical features of the above embodiments can be combined arbitrarily (as long as there is no contradiction in the combination of these technical features). For the sake of concise description, not all possible combinations of the technical features in the above embodiments are described; these embodiments that are not explicitly written out should also be considered to be within the scope described in this specification.

[0217] In the foregoing, the present invention has been described in a relatively specific and detailed manner through general descriptions and specific embodiments. It should be noted that, without departing from the concept of the present invention, it is obvious that several modifications and improvements can still be made to these specific embodiments, and these all fall within the protection scope of this application. Therefore, the protection scope of the patent of this application should be subject to the appended claims.

[0218] The above are only the preferred embodiments of the present invention, and are not intended to limit the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention should all be included within the protection scope of the present invention.

Claims

1. A method for constructing an inspection model for quality control and on-site inspection of pesticide residues in precious traditional Chinese medicine materials, characterized in that, The method includes: Constructing an initial inspection model through a width neural algorithm; Setting training samples corresponding to traditional Chinese medicines of multiple morphologies and multiple shapes; Optimizing the loss function of the initial inspection model; Training the initial inspection model through the training samples and the loss function to obtain a trained inspection model; Validating and adjusting the trained inspection model through an independent test dataset to obtain a final inspection model.

2. The method according to claim 1, wherein The constructing an initial inspection model through a width neural algorithm includes: Setting a feature extraction model; Setting feature nodes of the width neural algorithm according to the features mapped by the feature extraction model; Setting an initial parameter matrix of the width neural algorithm; After completing the feature nodes and the initial parameter matrix, obtaining the initial inspection model.

3. The method according to claim 2, wherein The setting a feature extraction model includes: Setting a plurality of original feature extraction channels corresponding to the input of the detection device; Setting a feature extraction model corresponding to the plurality of original feature extraction channels through a PCA algorithm.

4. The method according to claim 3, wherein The setting training samples corresponding to traditional Chinese medicines of multiple morphologies and multiple shapes includes: Respectively inputting traditional Chinese medicines of multiple morphologies and multiple shapes into a mass spectrometer to obtain corresponding multiple groups of original features; Setting multiple groups of expected test results corresponding to the multiple groups of original features respectively; Setting the multiple groups of original features and the multiple groups of expected test results as the training samples.

5. The method according to claim 4, wherein The optimizing the loss function of the initial inspection model includes: Adding a penalty term to the loss function to obtain the optimized loss function.

6. The method according to claim 5, characterized in that, The training the initial inspection model through the training samples and the loss function to obtain a trained inspection model includes: Inputting the training samples into the initial inspection model to obtain multiple groups of inspection results; Adjusting the initial inspection model according to the multiple groups of inspection results and the multiple groups of expected test results until the conditions for stopping training are met.

7. The method according to claim 6, wherein The method further includes: Setting a feature node optimization strategy; Setting a training stop strategy; Training the initial inspection model according to the feature node optimization strategy and the training stop strategy to obtain a trained inspection model.

8. The method according to claim 7, characterized in that The validating and adjusting the trained inspection model through an independent test dataset to obtain a final inspection model includes: Setting an independent test dataset; Setting an accuracy rate, a recall rate, and an F1 score corresponding to the independent test dataset, where the F1 score is used to balance the accuracy rate and the recall rate; Validating and adjusting the trained inspection model according to the independent test dataset, the accuracy rate, the recall rate, and the F1 score to obtain a final inspection model.

9. A system for constructing an inspection model for quality control and on-site inspection of pesticide residues in precious traditional Chinese medicine materials, characterized in that, The system includes a sampling device and an inspection device, where: The inspection device is used to construct an initial inspection model through a width neural algorithm; The sampling device is used to set training samples corresponding to traditional Chinese medicines of multiple morphologies and multiple shapes; The inspection device is used to optimize the loss function of the initial inspection model; The inspection device is used to train the initial inspection model through the training samples and the loss function to obtain a trained inspection model; The sampling device is used to set the independent test data set The inspection device is used to verify and adjust the trained inspection model through the independent test data set to obtain the final inspection model.

10. An inspection model construction device for quality control and on-site inspection of pesticide residues in precious traditional Chinese medicine materials, characterized in that, The inspection model construction device includes: An algorithm construction module, which is used to construct an initial inspection model through a width neural algorithm; An optimization module, which is used to optimize the loss function of the initial inspection model; A training module, which is used to train the initial inspection model through training samples and the loss function to obtain a trained inspection model; A verification module, which is used to verify and adjust the trained inspection model through the independent test data set to obtain the final inspection model.