Method, equipment, medium and product for automatic modeling of spectral nondestructive testing of agricultural products
Through a deep learning network that combines spectroscopic instruments and electrochemical detection, an accurate agricultural product quality detection model is generated, which solves the problems of time-consuming and insufficient accuracy of traditional detection methods, and achieves fast and accurate agricultural product quality detection.
Patent Information
- Application Number
- CN202410846249.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-27
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2044-06-27
AI Technical Summary
Traditional agricultural product quality detection methods are time-consuming, cumbersome, and costly. Spectral imaging technology has poor detection accuracy due to large individual differences and low signal-to-noise ratio, making it difficult to apply in practice.
Spectroscopic instruments are used to obtain spectral image data of agricultural product samples, and combined with electrochemical detection devices, a quality detection model is generated through a deep learning network. The sample data set and semantic information are used to optimize network parameters and improve the accuracy and efficiency of the detection model.
It achieves fast, accurate and non-destructive prediction of the content of various quality components of agricultural products, improves the accuracy of agricultural product quality detection, and solves the problem of insufficient accuracy of spectral imaging technology in agricultural product quality detection.
Smart Images

Figure CN118392801B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent agricultural technology, and in particular to a method, equipment, medium and product for automatic modeling of spectral non-destructive detection of agricultural products. Background Art
[0002] Traditional agricultural product quality and safety testing methods are time-consuming, cumbersome, and costly, so they cannot be tested online. In the agricultural field, deep learning generally faces the problem of "small data and big tasks", that is, the agricultural product sample data obtained through sampling is small data relative to the actual samples, and the acquisition of massive samples is often costly and impossible to obtain. At the same time, for agricultural product samples, their individual differences are large, and the calibration values used for modeling cannot be automatically obtained. As a result, although the feasibility of spectral detection technology has been confirmed by many studies, it is still difficult to apply in practice.
[0003] In the existing technology, HPLC-MS (High Performance Liquid Chromatography-Mass Spectrometry) and GC-MS (Gas Chromatography-Mass Spectrometry) are commonly used for quality component analysis of agricultural products. These technologies have high detection accuracy, but the detection cycle is too long, the price is high, and the samples need to be preprocessed. They are difficult to implement in real-time detection application scenarios, and are not convenient for obtaining large amounts of detection data. When faced with the demand for testing massive amounts of agricultural products, it is impossible to analyze all samples.
[0004] Although the technology based on spectral imaging combined with machine learning has high detection efficiency and fast results, agricultural products, as biological organisms, have large individual differences and a wide variety of varieties. At the same time, the spectral signal has a lot of interference and a low signal-to-noise ratio, which can easily lead to inaccurate detection results. Summary of the invention
[0005] The present invention provides a method, device, medium and product for automatic modeling of spectral nondestructive detection of agricultural products, so as to solve the problem of poor accuracy of spectral imaging technology in related technologies when detecting the quality of agricultural products.
[0006] The first aspect of the present invention provides a method for automatic modeling of spectral non-destructive testing of agricultural products, comprising the following steps: using a spectral instrument to obtain spectral image data of agricultural product samples, and transmitting the agricultural product samples to an electrochemical detection device to perform electrochemical detection to obtain electrochemical detection data; identifying sample images of agricultural product samples at different wavelengths in the spectral image data, and identifying quality indicators of samples to be tested of the agricultural product samples in the electrochemical detection data; generating a sample data set based on the sample images of the agricultural product samples at different wavelengths and the quality indicators of the samples to be tested, and generating a quality detection model using the sample data set and a deep learning network; inputting the spectral image of the agricultural product to be tested into the quality detection model, and the quality detection model outputs the quality indicators of the agricultural product to be tested.
[0007] Optionally, a quality detection model is generated using a sample data set and a deep learning network, including: randomly dividing the sample data set into a training set and a validation set; using sample images and sample quality indicators in the training set to train the deep learning network, obtaining quality prediction results of the agricultural product samples output by the deep learning network, correcting the training set and optimizing network parameters of the deep learning network according to the sample quality indicators and the quality prediction results; using the validation set to verify the trained deep learning network, optimizing the network parameters of the deep learning network according to the verification results, stopping the training until the quality prediction error of the quality prediction result meets the requirements, and using the trained deep learning network as a quality detection model.
[0008] Optionally, the training set is corrected and the network parameters of the deep learning network are optimized according to the sample quality index and the quality prediction results, including: calculating the semantic information and latent semantic entropy of the quality prediction error of the agricultural product sample according to the sample quality index and the quality prediction results, wherein the semantic information and the latent semantic entropy represent the credibility of the deep learning network for the training set, and adjusting the network structure and network parameters of the deep learning network according to the credibility; adjusting the sample quality index of the sample image and at least one of the target network levels of the deep learning network according to the semantic information and the latent semantic entropy, wherein the network of each network level is used to extract a feature map of the sample image, and determine the quality prediction result of the agricultural product sample based on the feature map.
[0009] Optionally, the calculation formula of semantic information is:
[0010]
[0011] in, is the feature level, is the sample quality indicator, is the number of feedback adjustments, is the semantic information for prediction, t For the test t sample images, For theu samples, is the total number of samples in the validation set, The semantic domain of cognitive error is to randomly sample and expand the training samples of the same prediction category, is the cognitive error semantic matrix.
[0012] The calculation formula of latent semantic entropy is:
[0013]
[0014] in, is the latent semantic entropy, For the division The number of business sets, is the number of partitioned quotient sets, is the dimension of the training sample, is the number of samples.
[0015] Optionally, spectral image data of agricultural product samples are obtained using a spectral instrument, and the agricultural product samples are transmitted to an electrochemical detection device for electrochemical detection to obtain electrochemical detection data, including: using an integrating sphere light source to uniformly illuminate the agricultural product samples at different wavelengths; collecting sample images of the agricultural product samples at different wavelengths, and generating spectral image data based on the sample images of the agricultural product samples at different wavelengths; analyzing the agricultural product samples through an electrochemical detection device, the electrochemical detection device outputting electrochemical detection data, and feeding back the electrochemical detection data to a main control module as a calibration value when training based on the spectral image data.
[0016] Optionally, the electrochemical detection device includes a grinding and crushing device and an electrochemical analysis unit, wherein the grinding and crushing device crushes the agricultural product sample and places it in a detection pool for stirring to obtain an electrolyte; the electrochemical analysis unit adopts an electrolyte-gate-controlled graphene field-effect transistor SGGT sensor array with multiple gate electrodes, including a single single-layer graphene channel and a gate electrode modified with multiple different functional materials, and uses a multi-gate structural design to select different functional materials according to different detection tasks, allowing simultaneous detection of multiple different detection indicators, wherein the gate electrodes modified with different functional materials include various types of aptamer-modified probes, and the electrolyte-gate-controlled graphene field-effect transistor performs quality detection on the electrolyte to obtain the quality indicator of the sample to be tested, and feeds back the quality indicator of the sample to be tested to the main control module as a calibration value.
[0017] Optionally, the integrating sphere light source includes a combination of light sources of different wavelengths, and the combination of light sources of each wavelength is rotationally symmetrically arranged.
[0018] The second aspect of the present invention provides a device for automatic modeling of spectral non-destructive testing of agricultural products, including: a sample transmission module for transmitting agricultural product samples; a light source imaging module for providing uniform illumination of different wavelengths for agricultural product samples, collecting sample images of agricultural product samples at different wavelengths, and generating spectral image data based on the sample images of agricultural product samples at different wavelengths; an electrochemical calibration module for performing electrochemical detection on agricultural product samples to obtain electrochemical detection data, and feeding back the electrochemical detection data as a quality indicator of the sample to be tested to a main control module; the main control module includes: a memory, a processor, and a computer program stored in the memory and runnable on the processor, the processor executes the program to implement the method for automatic modeling of spectral non-destructive testing of agricultural products as in the above embodiment.
[0019] A third aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, the program being executed by a processor to implement the method for automatic modeling of spectral nondestructive testing of agricultural products as described in the above embodiment.
[0020] A fourth aspect of the present invention provides a computer program product, including a computer program or instruction stored therein, which, when executed, is used to implement the method for automatic modeling of spectral non-destructive testing of agricultural products as in the above-mentioned embodiment.
[0021] Thus, the present invention includes the following beneficial effects:
[0022] The embodiment of the present invention can use sample images of agricultural product samples at different wavelengths and quality indicators of agricultural product samples for training quality detection models, thereby improving the accuracy and generation efficiency of training data, and facilitating efficient generation of relatively accurate quality detection models, thereby enabling rapid, accurate and lossless prediction of the content of multiple quality components of agricultural products based on spectral images and the constructed quality detection model, thereby improving the accuracy of agricultural product quality detection. Thus, the problem of poor accuracy of spectral imaging technology in agricultural product quality detection in related technologies is solved.
[0023] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] The above and / or additional aspects and advantages of the present invention will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:
[0025] Figure 1 A flowchart of a method for automatic modeling of spectral nondestructive detection of agricultural products provided according to an embodiment of the present invention;
[0026] Figure 2A design diagram of a multi-band composite LED (Light Emitting Diode) integrating sphere according to an embodiment of the present invention;
[0027] Figure 3 An example diagram of automatic modeling for spectral nondestructive detection of agricultural products provided according to an embodiment of the present invention;
[0028] Figure 4 An example diagram of a device for automatic modeling of spectral non-destructive detection of agricultural products provided according to an embodiment of the present invention;
[0029] Figure 5 A current response diagram of arsenic ions with different concentrations provided according to an embodiment of the present invention;
[0030] Figure 6 A current response diagram of mercury ions of different concentrations provided according to an embodiment of the present invention;
[0031] Figure 7 A current response diagram of lead ions with different concentrations according to one embodiment of the present invention;
[0032] Figure 8 The figure is a current response diagram of organic phosphorus with different concentrations according to one embodiment of the present invention. DETAILED DESCRIPTION
[0033] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present invention, and should not be construed as limiting the present invention.
[0034] The following describes the method, device, medium and product for automatic modeling of spectral non-destructive detection of agricultural products according to the embodiments of the present invention with reference to the accompanying drawings. In view of the problems mentioned in the above background technology, the present invention provides a method for automatic modeling of spectral non-destructive detection of agricultural products. In this method, by using sample images of agricultural product samples at different wavelengths and quality indicators of agricultural product samples for training of quality detection models, the accuracy and generation efficiency of training data are improved, which is conducive to the efficient generation of more accurate quality detection models, so that based on spectral images and the constructed quality detection models, the contents of various quality components of agricultural products can be quickly and accurately predicted non-destructively, thereby improving the accuracy of agricultural product quality detection. As a result, the problem of poor accuracy of spectral imaging technology in agricultural product quality detection in related technologies is solved.
[0035] Specifically, Figure 1 A schematic flow chart of a method for automatic modeling of spectral nondestructive testing of agricultural products provided in an embodiment of the present invention.
[0036] like Figure 1 As shown, the method for automatic modeling of spectral non-destructive detection of agricultural products includes the following steps:
[0037] In step S101, a spectral instrument is used to obtain spectral image data of agricultural product samples, and the agricultural product samples are transmitted to an electrochemical detection device to perform electrochemical detection to obtain electrochemical detection data.
[0038] In one embodiment of the present invention, spectral image data of agricultural product samples are obtained by using a spectral instrument, and the agricultural product samples are transmitted to an electrochemical detection device for electrochemical detection to obtain electrochemical detection data, including: using an integrating sphere light source to uniformly illuminate the agricultural product samples at different wavelengths; collecting sample images of the agricultural product samples at different wavelengths, and generating spectral image data based on the sample images of the agricultural product samples at different wavelengths; analyzing the agricultural product samples through the electrochemical detection device, the electrochemical detection device outputs the electrochemical detection data of the samples, and feeds back to the main control module as a calibration value when training based on the spectral image data.
[0039] The integrating sphere light source includes a combination of light sources of different wavelengths, and the combination of light sources of each wavelength is rotationally symmetrically arranged.
[0040] In order to achieve uniform light distribution and eliminate external interference to ensure lighting quality, the embodiment of the present invention optimizes the lighting conditions by using an integrating sphere light source, which is characterized by uniform illumination after diffuse reflection of the annular light source, highlighting the three-dimensional information of the object and effectively solving the problem of diagonal illumination shadows. At the same time, the light source is evenly distributed on the illuminated object through rotationally symmetrical lighting, such as Figure 2 As shown, the integrating sphere light source of the embodiment of the present invention includes a replaceable LED light source combination of different wavelengths. The agricultural product sample is evenly illuminated by the integrating sphere light source, and the agricultural product sample images at different wavelengths can be collected, and the spectral image data of the agricultural product sample is generated based on the sample image.
[0041] As a possible implementation method, an embodiment of the present invention can use adjustable bandwidth PWM (Pulse Width Modulation) to drive a 4-channel controller dedicated to dimming the LED digital visual light source. The LED light sources are selected to be four each in the visible to near-infrared band of 405nm, 550nm, 580nm, 680nm, 730nm, and 980nm, arranged in a square.
[0042] Optionally, in order to reduce the cost of later training, the embodiment of the present invention can pre-process the spectral image data, crop the high-resolution spectral image data into 640×640 image data, and in order to expand the data set, flip the spectral photos horizontally and vertically, and expand them to at least 3 times. Nimages.
[0043] Furthermore, the embodiment of the present invention can also send the agricultural product samples to be tested to the electrochemical detection device through a conveyor belt, which mainly includes functions such as automatic crushing, grinding, dissolving, and stirring of the samples. Among them, the electrochemical detection device includes a grinding and crushing device and an electrochemical analysis unit, wherein the grinding and crushing device crushes the agricultural product samples and places them in the detection pool for stirring to obtain an electrolyte; the electrochemical analysis unit adopts an electrolyte gate-controlled graphene field effect transistor SGGT sensor array with multiple gate electrodes, including a single single-layer graphene channel and a gate electrode modified with multiple different functional materials, and uses a multi-gate structural design to flexibly select different modified materials according to different detection tasks, and can simultaneously detect multiple different detection indicators, wherein the gate electrodes modified with different functional materials include various aptamer-modified probes, and the electrolyte gate-controlled graphene field effect transistor performs quality detection on the electrolyte to obtain the quality index of the sample to be tested, and feeds back the quality index of the sample to be tested to the main control module as a calibration value.
[0044] It can be understood that, with respect to the quality indicators that need to be measured for agricultural product samples, the embodiments of the present invention use an electrochemical analysis unit to perform rapid detection and analysis of sample quality, use an electrolyte-gate-controlled graphene field-effect transistor, and select functional materials to modify the gate according to the detection mechanism of the agricultural product quality target, thereby improving the sensitivity and accuracy of detection. Different modified materials can be flexibly selected to construct sensors for different detection qualities, and multiple different detection indicators can be detected simultaneously to obtain calibration values of the detection targets, and the measured calibration values can be used for subsequent model training.
[0045] In step S102, sample images of agricultural product samples at different wavelengths in the spectral image data are identified, and sample quality indicators of agricultural product samples to be tested in the electrochemical detection data are identified.
[0046] In step S103, a sample data set is generated according to sample images of agricultural product samples at different wavelengths and quality indicators of the samples to be tested, and a quality detection model is generated using the sample data set and a deep learning network.
[0047] It can be understood that, for agricultural product samples, the embodiments of the present invention detect sample quality indicators through an electrochemical rapid detection method, and extract sample images of the samples at different wavelengths, generate a sample data set based on the sample images and sample quality indicators of the agricultural product samples at different wavelengths, and input the sample data set into a deep learning network for training and learning to obtain a quality detection model for the agricultural product samples.
[0048] In one embodiment of the present invention, a quality detection model is generated using a sample data set and a deep learning network, including: randomly dividing the sample data set into a training set and a validation set; training the deep learning network using sample images and sample quality indicators in the training set, obtaining quality prediction results of agricultural product samples output by the deep learning network, correcting the training set and optimizing network parameters of the deep learning network according to the sample quality indicators and the quality prediction results; verifying the trained deep learning network using the validation set, optimizing the network parameters of the deep learning network according to the verification results, stopping the training until the quality prediction error of the quality prediction result reaches the target accuracy requirement, and using the trained deep learning network as a quality detection model.
[0049] It is understandable that the embodiment of the present invention can divide the sample data set into a training set and a validation set. S The embodiment of the present invention can be obtained from the total sample S Select the larger number of N A total of samples are used to quickly generate a large amount of training data to train the quality detection model. In addition, in order to ensure the detection accuracy of the detection model, S Select the smaller number of L The samples are used to verify whether the quality detection model meets the actual production requirements. If the detection model meets the requirements, the embodiment of the present invention outputs the deep learning network as a quality detection model for agricultural product quality detection; otherwise, the training set, network parameters and deep learning network are optimized to obtain an optimized quality detection model.
[0050] It should be noted that the optimization methods of the training set include: setting a more accurate correction model, providing environmental parameters as training data, etc.; the optimization methods of network parameters and deep learning networks are to add environmental parameters, adjust weights, loss functions, etc., and the model parameter optimization methods in the prior art can be used, which are not limited here.
[0051] Based on the detection results of the electrochemical analysis unit, the error value of the spectral image detection method is calculated. Correction based on this error value can eliminate the systematic error in the spectral image data. The systematic error that can be eliminated can be caused by one or a combination of the following reasons: (1) the state of the detection equipment, such as the aging state of the equipment, the state that can cause the internal part of the inspected object to present a specific arrangement with a high probability, thereby causing the detection result to have a systematic deviation; (2) the influence of the equipment, ambient temperature, and ambient humidity on the inspected object, thereby causing the detection result to have a systematic deviation; (3) the different habits of the inspectors and different equipment operation methods lead to systematic deviations in the detection results; (4) the different characteristics of the detection process lead to systematic deviations in the detection results. This systematic error may cause errors in the measured value, and in theory, this error cannot be avoided in this measurement system.
[0052] Therefore, the embodiment of the present invention can obtain sample quality index results based on the electrochemical analysis unit, and train a deep learning network based on sample images of agricultural product samples at different wavelengths to obtain the quality prediction results of the agricultural products to correct the training set, thereby eliminating the systematic error of the measurement data and improving the efficiency and accuracy of obtaining training data. At the same time, the training set can also be used to optimize the network parameters of the deep learning network to better ensure the detection accuracy of the quality detection model. Furthermore, the embodiment of the present invention can also use the verification set to verify the trained deep learning network to eliminate the error of the quality prediction results, which is conducive to generating a more accurate quality detection model. In the actual implementation process, the embodiment of the present invention can extract samples by random sampling. M The samples are used for correction calculation, where M < N , M + N + L < S .
[0053] In one embodiment of the present invention, the training set is corrected and the network parameters of the deep learning network are optimized according to the sample quality index and the quality prediction result, including: calculating the semantic information and potential semantic entropy of the quality prediction error of the agricultural product sample according to the sample quality index and the quality prediction result, wherein the semantic information and the potential semantic entropy represent the credibility of the deep learning network to the training set, and adjusting the network structure and network parameters of the deep learning network according to the credibility, adjusting the sample quality index of the sample image and at least one of the target network levels of the deep learning network according to the semantic information and the potential semantic entropy, wherein the network of each network level is used to extract a feature map of the sample image, and determining the quality prediction result of the agricultural product sample based on the feature map.
[0054] In an embodiment of the present invention, semantic information and latent semantic entropy represent the credibility of the deep learning network for the training set. In the actual execution process, the embodiment of the present invention can judge the credibility of the deep learning network for the training set based on the similarity function value of the semantic information and the latent semantic entropy. If the similarity function value is less than the error statistical threshold, it indicates that the current deep learning network has a high credibility for the training set. Otherwise, it is necessary to enable the self-optimization feedback adjustment strategy of the intra-layer recognition feature efficiency and the inter-layer recognition feature level, and strive to migrate to a more detailed multi-level knowledge space feature set to represent the sample to be identified for repeated identification.
[0055] Specifically, in the process of deep learning network training, the embodiment of the present invention sets the target network level as The characteristic diagram when ,in , Indicates convolution kernel Feature map of the sample image. Among them, is the target network level, is the number of feature maps, is the number of labeled samples, is the number of unlabeled samples.
[0056] Set up In the feedback process, based on the feature level , and sample quality indicators obtained through electrochemical analysis units , Middle Agricultural product samples tested The quality prediction result is .
[0057] Then we can define The semantic information of the quality prediction error is:
[0058]
[0059] in, is the feature level, is the sample quality indicator, is semantic information, For the u samples, is the total number of samples in the validation set, yes and the same cognitive category random sampling expansion sample data set dimensional cognitive error semantic domain, yes of dimensional cognitive error semantic matrix. Based on the equivalence relation, Divide and get the quotient , the more elements in the quotient set, the The larger the error in the current recognition process, the greater the error, and vice versa. In the The latent semantic entropy of the quality prediction error in the sub-feedback recognition process can be defined as:
[0060]
[0061] From the above formula, we can see that is the latent semantic entropy, The first A business set, is the number of partitioned quotient sets, is the dimension of the training sample, is the number of samples, where The smaller The detection error is also small. Therefore, in the feedback adjustment process, the optimal model can be adjusted arbitrarily within a certain range. and Make In summary, since the training set has been corrected, the more accurate electrochemical detection results are directly used as the expected results when verifying the model, thus improving the efficiency of model verification. The estimated standard error expresses the degree of deviation between the model prediction value and the expected value, and can be used to evaluate the accuracy of the model to a certain extent.
[0062] It should be noted that in the process of model building, training and testing model, and verifying and testing model, the main factors causing errors are tested, and the values of the main factors causing errors in the three processes are kept the same.
[0063] In step S104, the spectral image of the agricultural product to be detected is input into the quality detection model, and the quality detection model outputs the quality index of the agricultural product to be detected.
[0064] The embodiments of the present invention can quickly and non-destructively predict the content of various quality components of agricultural products based on spectral images and the quality detection model constructed by the above embodiments, and use the results of electrochemical analysis unit detection technology as big data training data for model training. At the same time, by utilizing the high accuracy and high sensitivity of electrochemical detection, the detection results of the spectral detection technology are corrected to make the output results of the quality detection model more accurate.
[0065] The present invention can be combined with Figure 3The method of automatic modeling for spectral nondestructive testing of agricultural products is explained, including: first, obtaining samples of agricultural products to be tested, and calibrating the light intensity of an integrating sphere to stabilize it within a set range; performing multispectral imaging on the samples of agricultural products to be tested; sending the samples of agricultural products to be tested to an electrochemical detection device via a conveyor belt, which mainly includes functions such as automatic crushing, grinding, dissolving, and stirring of the samples, and detecting the quality information of the target to be tested through electrochemical detection, and modeling the sample quality based on multispectral imaging and deep learning algorithms; and optimizing the model through the definition of semantic entropy function.
[0066] According to the method for automatic modeling of spectral nondestructive detection of agricultural products proposed in the embodiment of the present invention, sample images of agricultural product samples at different wavelengths and quality indicators of agricultural product samples can be used for training quality detection models, which improves the accuracy and generation efficiency of training data, and is conducive to the efficient generation of more accurate quality detection models, so that based on spectral images and the constructed quality detection model, the content of multiple quality components of agricultural products can be quickly and accurately predicted nondestructively, thereby improving the accuracy of agricultural product quality detection. Thus, the problem of poor accuracy of spectral imaging technology in agricultural product quality detection in related technologies is solved.
[0067] Next, the device for automatic modeling of spectral nondestructive detection of agricultural products proposed in accordance with an embodiment of the present invention will be described with reference to the accompanying drawings.
[0068] Figure 4 It is a block diagram of a device for automatic modeling of spectral nondestructive detection of agricultural products according to an embodiment of the present invention.
[0069] like Figure 4 As shown, the device 10 for automatic modeling of spectral non-destructive testing of agricultural products includes: a sample transmission module 100, a light source imaging module 200, an electrochemical calibration module 300 and a main control module 400.
[0070] Among them, the sample transmission module 100 is used to transmit agricultural product samples; the light source imaging module 200 is used to provide uniform illumination of different wavelengths for the agricultural product samples, collect sample images of the agricultural product samples at different wavelengths, and generate spectral image data based on the sample images of the agricultural product samples at different wavelengths; the electrochemical calibration module 300 is used to perform electrochemical detection on the agricultural product samples to obtain electrochemical detection data, and feed back the electrochemical detection data as a quality indicator of the sample to be tested to the main control module 400. The main control module 400 includes: a memory, a processor, and a computer program stored in the memory and runable on the processor. The processor executes the program to implement the method for automatic modeling of spectral non-destructive detection of agricultural products as in the above-mentioned embodiment.
[0071] The sample transmission module 100 comprises: a feed port at the front end of the conveyor belt and a discharge port at the rear end of the conveyor belt, which are used to transmit agricultural product samples.
[0072] In one embodiment of the present invention, the main control module 400 also includes a main control board for storing basic data, analyzing calculations, training, and optimizing models; the main control module 400 includes an image analysis and processing unit and a display unit. The image analysis and processing unit collects video streams and analyzes spectral images of agricultural product samples to extract corresponding spectral image features, and the display unit is used to display recognition results.
[0073] In one embodiment of the present invention, the electrochemical calibration module 300 includes an electrolyte-gated graphene field effect transistor sensor array with four gate electrodes, including a single monolayer graphene channel and four gate electrodes modified with different functional materials. A multi-gate structural design is used, and different modified materials can be flexibly selected according to different detection tasks, so that multiple different detection indicators can be detected simultaneously. Among them, the gate electrodes modified with four different functional materials include: the surface of the G1 gate is modified with an arsenic metal aptamer, which can realize the quantitative prediction of the metal arsenic content; the surface of the G2 gate is modified with a mercury ion aptamer probe to realize high-sensitivity quantitative detection of mercury; G3 is a gate modified with a lead ion aptamer to realize high-sensitivity quantitative detection of lead; G4 is a gate modified with acetylcholinesterase, which can realize quantitative detection of organic phosphorus.
[0074] In one embodiment of the present invention, the electrochemical calibration module 300 can select appropriate functional materials according to the target characteristics, modify each gate electrode and form a multi-gate electrolyte-gated graphene field effect transistor sensor array with the graphene channel. After obtaining the response, the corresponding relationship between the component concentration in the mixed sample and the array output response is calibrated, and the qualitative and quantitative identification of the sample under test is achieved through the quasi-solution. Figure 5-8 The sensing performance diagram of the functional material modified multi-electrode electrolyte gate-controlled graphene field effect transistor array shown in the figure shows the current response to different concentrations of metal ions and organic phosphorus, where: Figure 5 The current response diagram shows different concentrations of arsenic ions. Figure 6 The current response diagram showing different concentrations of mercury ions, Figure 7 The current response diagram showing different concentrations of lead ions, Figure 8 Graph showing the current response to different concentrations of organic phosphorus.
[0075] Furthermore, the electrochemical calibration module 300 also includes an electrochemical sensor, a sample cell, an electrode probe, and a Bluetooth transmission module. The electrochemical sensor can be replaced according to different detection targets. According to the redox characteristics of the detection target and the volt-ampere characteristics of the sensor, the calibration values of different qualities of different agricultural products are detected, and the detection results are input into the main control module 400.
[0076] It should be noted that the aforementioned explanation of the method embodiment for automatic modeling of agricultural product spectra for non-destructive testing is also applicable to the device for automatic modeling of agricultural product spectra for non-destructive testing in this embodiment, and will not be repeated here.
[0077] According to the device for automatic modeling of spectral nondestructive detection of agricultural products proposed in the embodiment of the present invention, sample images of agricultural product samples at different wavelengths and quality indicators of agricultural product samples can be used for training quality detection models, which improves the accuracy and generation efficiency of training data, and is conducive to the efficient generation of relatively accurate quality detection models, so that based on spectral images and the constructed quality detection models, the contents of various quality components of agricultural products can be quickly and accurately predicted nondestructively, thereby improving the accuracy of agricultural product quality detection. Thus, the problem of poor accuracy of spectral imaging technology in agricultural product quality detection in related technologies is solved.
[0078] An embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-mentioned method for automatic modeling of spectral non-destructive testing of agricultural products.
[0079] An embodiment of the present invention further provides a computer program product, including a computer program or instruction stored therein, which, when executed, is used to implement the method for automatic modeling of spectral non-destructive testing of agricultural products as in the above embodiment.
[0080] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials, or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described may be in any one or more embodiments. N In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples without contradicting each other.
[0081] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of the present invention, " N "A" means at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0082] Any process or method description in a flowchart or otherwise described herein may be understood to mean a process that includes one or more N The present invention also provides a module, segment or portion of a code of executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present invention includes alternative implementations, in which the functions may not be performed in the order shown or discussed, including performing the functions in a substantially simultaneous manner or in the reverse order according to the functions involved, which should be understood by those skilled in the art to which the embodiments of the present invention belong.
[0083] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. N Each step or method may be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it may be implemented by any one of the following technologies known in the art or a combination thereof: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array, a field programmable gate array, etc.
[0084] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.
[0085] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present invention.
Claims
1. A method for automatic modeling of spectral nondestructive testing of agricultural products, characterized in that: The following steps are involved: Acquiring spectral image data of agricultural product samples by using a spectral instrument, and transmitting the agricultural product samples to an electrochemical detection device to perform electrochemical detection to obtain electrochemical detection data; Identify sample images of agricultural product samples at different wavelengths in the spectral image data, and identify sample quality indicators of the agricultural product samples to be tested in the electrochemical detection data; Generate a sample data set based on sample images of the agricultural product samples at different wavelengths and quality indicators of the samples to be tested, and generate a quality detection model using the sample data set and a deep learning network; Inputting the spectral image of the agricultural product to be tested into the quality detection model, and the quality detection model outputs the quality index of the agricultural product to be tested; The method of generating a quality detection model using the sample data set and the deep learning network includes: randomly dividing the sample data set into a training set and a validation set; training the deep learning network using the sample images and sample quality indicators in the training set, obtaining the quality prediction results of the agricultural product samples output by the deep learning network, correcting the training set and optimizing the network parameters of the deep learning network according to the sample quality indicators and the quality prediction results; verifying the trained deep learning network using the validation set, optimizing the network parameters of the deep learning network according to the validation results, stopping the training until the quality prediction error of the quality prediction result reaches the target accuracy requirement, and using the trained deep learning network as the quality detection model; The method of correcting the training set and optimizing the network parameters of the deep learning network according to the sample quality index and the quality prediction result includes: calculating the semantic information and potential semantic entropy of the quality prediction error of the agricultural product sample according to the sample quality index and the quality prediction result, wherein the semantic information and the potential semantic entropy represent the credibility of the deep learning network to the training set, and adjusting the network structure and network parameters of the deep learning network according to the credibility; adjusting the sample quality index of the sample image and at least one of the target network levels of the deep learning network according to the semantic information and the potential semantic entropy, wherein the network of each network level is used to extract a feature map of the sample image, and determine the quality prediction result of the agricultural product sample based on the feature map; The calculation formula of the semantic information is: in, is the feature level, is the sample quality indicator, is the number of feedback adjustments, is the semantic information for prediction, t For the test t sample images, For the u samples, is the total number of samples in the validation set, The semantic domain of cognitive error is to randomly sample and expand the training samples of the same prediction category, is the cognitive error semantic matrix; The calculation formula of the latent semantic entropy is: in, is the latent semantic entropy, To divide The obtained Business Set , is the number of partitioned quotient sets, is the dimension of the training sample, is the number of samples.
2. The method for automatic modeling of spectral nondestructive testing of agricultural products according to claim 1 is characterized in that: The method of obtaining spectral image data of agricultural product samples by using a spectral instrument and transmitting the agricultural product samples to an electrochemical detection device for electrochemical detection to obtain electrochemical detection data includes: uniformly illuminating the agricultural product sample at different wavelengths using an integrating sphere light source; Collecting sample images of the agricultural product samples at different wavelengths, and generating the spectral image data based on the sample images of the agricultural product samples at different wavelengths; The agricultural product samples are analyzed by an electrochemical detection device, which outputs the electrochemical detection data and feeds back the electrochemical detection data to a main control module as a calibration value for training based on spectral image data.
3. The method for automatic modeling of agricultural product spectral nondestructive testing according to claim 2 is characterized in that: The electrochemical detection device comprises a grinding and pulverizing device and an electrochemical analysis unit, wherein: The grinding and crushing device crushes the agricultural product sample and places it in the detection tank for stirring to obtain an electrolyte; The electrochemical analysis unit adopts an electrolyte-gated graphene field-effect transistor SGGT sensor array with multiple gate electrodes, including a single monolayer graphene channel and a plurality of gate electrodes modified with different functional materials. A multi-gate structural design is used to select different functional materials according to different detection tasks, allowing for simultaneous detection of multiple different detection indicators, wherein the gate electrodes modified with different functional materials include various aptamer-modified probes. The electrolyte-gated graphene field-effect transistor performs quality detection on the electrolyte to obtain a quality indicator of the sample to be tested, and feeds back the quality indicator of the sample to be tested to the main control module as a calibration value.
4. The method for automatic modeling of spectral nondestructive testing of agricultural products according to claim 2 is characterized in that: The integrating sphere light source comprises a combination of light sources of different wavelengths, and the combination of light sources of each wavelength is arranged rotationally symmetrically.
5. A device for automatic modeling of spectral nondestructive testing of agricultural products, characterized in that: include: A sample transmission module, used to transmit agricultural product samples; A light source imaging module, used to provide uniform illumination of different wavelengths for the agricultural product samples, collect sample images of the agricultural product samples at different wavelengths, and generate the spectral image data based on the sample images of the agricultural product samples at different wavelengths; An electrochemical calibration module, used for performing electrochemical detection on the agricultural product samples to obtain electrochemical detection data, and feeding back the electrochemical detection data as a quality indicator of the sample to be tested to the main control module; The main control module includes: a memory, a processor, and a computer program stored in the memory and executable on the processor. The processor executes the program to implement the method for automatic modeling of spectral nondestructive testing of agricultural products as described in any one of claims 1-4.
6. A computer-readable storage medium having a computer program or instruction stored thereon, characterized in that: When the computer program or instruction is executed, the method for automatic modeling of spectral non-destructive testing of agricultural products as described in any one of claims 1-4 is implemented.
7. A computer program product comprising a computer program or instructions, characterized in that When the computer program or instruction is executed, the method for automatic modeling of spectral non-destructive testing of agricultural products as described in any one of claims 1-4 is implemented.
