Method for Transferring and Sharing Photoelectric Detection Model of Cloud Service and Monitoring and Evaluation System of Internet of Things
The method for transferring and sharing a photoelectric detection model of cloud services, combined with an Internet of Things monitoring and evaluation system, addresses the low applicability of spectral detection models by enabling remote model sharing and updates, thus improving the consistency and effectiveness of agricultural product quality monitoring.
Patent Information
- Application Number
- JP2023561868
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2022-11-29
- Filing Date
- 2022-12-20
- Publication Date
- 2025-06-17
- Estimated Expiration
- 2042-12-20
AI Technical Summary
Existing spectral detection models for agricultural products have low applicability due to differences in spectrometers, equipment aging, and environmental changes, leading to model incompatibility and resource wastage across different devices.
A method for transferring and sharing a photoelectric detection model of cloud services, utilizing a monitoring and evaluation system for the Internet of Things, which includes establishing a temperature compensation model, a spectrum transfer model via autoencoder neural networks, and an active/passive feedback mechanism for model updates.
This solution enables the remote sharing and updating of detection models, improving the consistency and applicability of spectral analysis across different devices, thereby enhancing the monitoring and evaluation of agricultural product quality.
Smart Images

Figure 0007693241000002 
Figure 0007693241000003 
Figure 0007693241000004
Abstract
Description
Technical Field
[0001] The present invention relates to the field of sorting and monitoring the quality of agricultural products, and specifically relates to a method for transferring and sharing a photoelectric detection model of cloud service and a monitoring and evaluation system for the Internet of Things.
Background Art
[0002] With the improvement of consumers' demands, when the demand for the quantity of agricultural products is satisfied, people's concern about the quality and safety of agricultural products is increasing. Since agricultural products have natural characteristics, there are significant individual differences in quality. In mixed sales, the multi-layered needs and preferences of consumers cannot be met, and high quality and low price of agricultural products cannot be achieved. Also, in an environment where products are homogenized, malicious competition among enterprises is likely to occur, which is not conducive to the sound development of the entire agricultural product industry. Therefore, in promoting the supply-side structural reform of agricultural products, grading the quality of agricultural products is of great significance in realizing the quality evaluation of agricultural products, meeting the multi-layered needs of consumers, promoting effective matching, improving the supply-demand balance of agricultural products, and reducing waste of resources.
[0003] In the internal quality inspection of agricultural products, spectral analysis technology shows great advantages. Spectral analysis technology has the advantages of non-destruction, high detection efficiency, low cost, and good reproducibility. The measurement of samples generally does not require pretreatment and is suitable for on-site detection and online analysis. However, in spectral analysis, first, it is necessary to establish a spectral detection model between the spectral matrix X and the response matrix Y. However, due to factors such as differences in spectrometers themselves, aging of equipment, and changes in the environment, there are differences in the spectra collected by different devices. When the established quantitative analysis model is put into practical use, there are problems that (1) the analysis model established by a certain device cannot be used for a long time, (2) the analysis model established by a certain device cannot directly perform quantitative analysis on the spectra collected by other devices, and (3) for some samples, since they are toxic, chemically unstable, and expensive, a lot of human resources, material resources, and financial resources are consumed to re-establish a new model.
[0004] Currently, most of the conventional crop sorting devices designed based on spectral analysis technology are online, making it difficult to meet the monitoring needs. Since a single device is independently modeled, a lot of human and material resources are wasted. With the rise of the Internet of Things, big data, and cloud computing, spectrometers, which are a type of optoelectronic sensor, naturally become a part of the Internet of Things. By combining spectral analysis technology and information technology, the quality of crops can be detected or monitored on-site, which can be useful for the country's agricultural departments, industry leaders, national regulatory authorities, etc. Furthermore, the Internet of Things provides an implementation path for sharing detection models and has become an important driving force for the commercial promotion of detection devices.
[0005] In addition, with the development of the futures market, China's futures army is becoming increasingly rich and diversified, covering various fields including many agricultural crop futures varieties. For example, apple futures were listed for trading on the Zhengzhou Commodity Exchange and became the first fresh fruit futures variety in China and the world. There are many reasons for China to actively develop fruit futures trading, but the most important reason is that China has its own "poverty alleviation characteristics". China is the country with the largest fruit production and consumption in the world, with a relatively large planting area and high production. However, it is precisely because the supply is too much that the fruit price drops, which is likely to hit farmers. With the listing of apple futures, related enterprises and producers can use apple futures for hedging, price discovery, and eliminating risks as much as possible. At the same time, the price fluctuations of fruits are to a certain extent periodic, with relatively obvious amplitudes, a large market scale, and the basic advantage that futures varieties can be introduced. This is also an important factor in the successful listing and stable operation of China's fruit futures trading. However, fruit futures are not very standardized at present. For example, the lack of a complete positive correlation between the appearance and internal quality of apples is an ineligible subject for standardized apple futures. Furthermore, there is a big contradiction between the preservation requirements of futures commodities and the poor preservation tolerance of fresh fruits.
[0006] To solve the problem of low applicability of the spectral detection model, ensure the quality of agricultural products, realize the rapid screening and detection evaluation of the quality and safety of agricultural raw materials and production / processing processes, and improve consumers' trust, it is necessary to develop a remote monitoring and evaluation system for the quality of agricultural products.
Summary of the Invention
[0007] Regarding the deficiencies of the prior art, the present invention provides a method for transferring and sharing the optoelectronic detection model of cloud services and a monitoring and evaluation system for the Internet of Things, realizing the remote sharing and update of the detection model, solving the difficulty of monitoring the entire supply chain of the quality of agricultural products, and being able to realize the remote monitoring and evaluation of the quality of agricultural products.
[0008] The present invention achieves the above technical objectives by the following technical means.
[0009] The method for transferring and sharing the optoelectronic detection model of cloud services of the present invention is as follows. The 0th detection terminal batch-acquires the spectral information and temperature information of typical and representative samples of agricultural products, and establishes a temperature compensation model. Obtain the quality indicators of the above-mentioned typical and representative samples of agricultural products, extract characteristic wavelengths based on the wavelength-calibrated spectrum, and establish a detection model from the above-mentioned characteristic wavelengths and quality indicators. The 0th detection terminal and the 1st detection terminal batch-acquire the spectral information of typical and representative samples of agricultural products, and further establish a spectrum transfer model by an autoencoder neural network. Calibrate the spectral information of agricultural product samples by calling the temperature compensation model and the spectrum transfer model, calculate the calibrated spectral information by calling the detection model, and obtain the detection results of agricultural product samples.
[0010] In a further technical means, the process of establishing a spectrum transfer model by the above-mentioned autoencoder neural network is as follows. The encoder encodes the spectral matrix S1 of the first detection terminal into the low-dimensional hidden variable h, and the decoder restores the hidden variable h of the hidden layer to the spectral matrix S0 of the 0th detection terminal, and allows the neural network to learn the difference characteristics between the matrix S0 and the matrix S1, and calibrates the matrix S1 to the matrix S0. The encoding process from the input layer to the hidden layer is h = θ1(S1) = w1X + b1, The decoding process from the hidden layer to the output layer is S0 = θ2(h) = w2X + b2, Here, w1 is the weight matrix of the encoding process, w2 is the weight matrix of the decoding process, θ1 is the function of the encoding process, θ2 is the function of the decoding process, b1 is the bias matrix of the encoding process, b2 is the bias matrix of the decoding process, and X represents the spectral matrix. The above spectral transfer model includes one encoder and one decoder. The encoder includes the weight matrix w1 and the bias matrix b1, and the decoder includes the weight matrix w2 and the bias matrix b2.
[0011] In a further technical means, when a new detection terminal is added, the new detection terminal obtains the spectral information of the crop sample in small lots, and the above spectral transfer model is updated by the transfer learning method.
[0012] In a further technical means, updating the above spectral transfer model by the transfer learning method specifically freezes the parameter matrices of the autoencoder neural network updated by the 0th detection terminal and the 1st detection terminal, adds one decoder, and updates the parameter matrix of the added decoder by the 0th terminal and the new detection terminal.
[0013] In further technical means, when a detection result is obtained, a serial number of the agricultural crop sample is generated, the sample is extracted and actually measured based on the serial number, the error between the detection result and the actual measurement result is calculated, and when the above error exceeds a set threshold, the detection model is updated.
[0014] In further technical means, the detection model is updated by an active feedback mechanism and a passive feedback mechanism. Specifically, in the above active feedback mechanism, representative samples are selected at important time points after the agricultural crops are harvested, before storage, and before being put on the market, and the detection model is actively updated. Specifically, in the above passive feedback mechanism, in the detection process, samples are numbered according to the number of detections, a specific number of dynamically extracted samples are used as an independent verification set to verify the detection model, and when the error between the detection result and the actual measurement result is greater than a preset threshold, the model is updated using the independent verification set.
[0015] In further technical means, the above model update process specifically selects representative agricultural crop samples from the independent verification set and adds them to the training set of the established detection model.
[0016] In further technical means, the wavelength in the spectral information obtained by the detection terminal is calibrated according to a wavelength calibration formula.
[0017] In further technical means, the above wavelength calibration formula is obtained by selecting characteristic wavelengths with characteristic absorption peaks in advance, acquiring the spectrum of a standard light source by the above detection terminal, and calibrating the above characteristic wavelengths.
[0018] The single Internet monitoring and evaluation system of the present invention At least one detection terminal that acquires information of the measured agricultural crop sample including spectral information, temperature information, and geographical information Calibrate the spectral information by the spectral transfer and sharing method, call the detection model for calculation, and return the detection result to the detection terminal in real time. The above spectral transfer and sharing method and detection model are established by batch acquiring the spectral information of typical and representative samples of agricultural crops by the above detection terminal. A data server that updates the detection model in real time by active feedback and passive feedback mechanisms, and includes a cloud data management platform for display of detection results, uploading of spectral transfer models and detection models, user management, and control of detection terminals. The above detection terminal includes a light source, a sensor, a positioning module, and a control module. The above light source is used to provide an active light source required for the detection of agricultural crop samples. The above sensor includes a photoelectric sensor and a temperature sensor. The above positioning module is used to acquire the geographical information where the detection terminal for the quality of agricultural crops is located. The above control module controls the operation of the entire detection terminal and has functions of photoelectric signal conversion, data display, and transmission. The above detection terminal includes one or a combination of more than one of handheld, portable, in-vehicle, and online types.
Advantages of the Invention
[0019] The beneficial effect of the present invention is that, compared with the prior art, the present invention provides a method for transferring and sharing a photoelectric detection model of cloud service and a monitoring and evaluation system of the Internet of Things.
[0020] (1) Regarding the problem of low applicability of the spectral detection model, the present invention calibrates the spectral information of agricultural crop samples by calling a temperature compensation model and a spectral transfer model, calculates the calibrated spectral information by calling a detection model, obtains the detection result of the agricultural crop sample, and provides a method for transferring and sharing a photoelectric detection model of cloud service that can realize the sharing and sharing of detection models between different detection terminals.
[0021] (2) The present invention calibrates the data server spectrum information by a spectrum transfer and sharing method, calls a detection model for calculation, and returns the detection result to the detection terminal in real time, providing a monitoring and evaluation system for the Internet of Things including a data server that realizes remote monitoring and evaluation of crop quality. The system has broad application possibilities in the extraction inspection and measurement evaluation of crop quality.
[0022] To more clearly explain the embodiments of the present invention or the technical means of the prior art, the drawings necessary for the description of the embodiments or the prior art are briefly introduced below. It is obvious that the drawings in the following description are some embodiments of the present invention, and those skilled in the art can obtain other drawings based on these drawings without creative efforts.
Brief Description of the Drawings
[0023]
Figure 1
Figure 2
Figure 3
Figure 4
Modes for Carrying Out the Invention
[0024] To make the objectives, technical means, and advantages of the embodiments of the present invention clearer, with reference to the drawings of the embodiments of the present invention, the technical means in the embodiments of the present invention are clearly described below. Obviously, the described embodiments are part of but not all of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative efforts are included within the protection scope of the present invention.
[0025] The present invention provides a monitoring and evaluation system for the Internet of Things. As shown in FIG. 1, the above system consists of at least one detection terminal, a data server, and a cloud data management platform. The information of the crop sample measured by the detection terminal is acquired, wirelessly uploaded to the data server, the spectrum information is calibrated by the spectrum transfer and sharing method, calculated by calling the detection model, and the detection result is returned to the display of the detection terminal in real time while being sent to the cloud data management platform. The above spectrum transfer and sharing method and detection model are established by the above detection terminal batch-acquiring the spectrum information of typical and representative samples of crops, and the detection model is updated in real time by the active feedback and passive feedback mechanisms. This system can realize the on-site real-time detection, monitoring, and evaluation of the quality of crops.
[0026] Among them, the above detection terminal includes a light source, a sensor, a positioning module, a wireless communication module, a control module, a display, and a power source, and is used to sense the quality spectrum information of crops.
[0027] Furthermore, the above control module controls the operation of the entire detection terminal and has functions such as photoelectric signal conversion, data display, and transmission. The above light source uses one of a halogen lamp or an LED and is used to provide an active light source necessary for the detection of crop samples. The above sensor includes a photoelectric sensor and a temperature sensor. The photoelectric sensor is used to obtain the spectral information of the crop under the light source, and the temperature sensor is used to sense the temperature of the crop. The information collected by the sensor is transmitted to the data server through the control module, and the spectral information is calibrated by the data server to meet the needs of adapting to multi-scenarios. The above positioning module is used to obtain the geographical information where the detection terminal of the crop quality is located, transmit it to the data server through the control module, and combine it with the detection result of the detection model (for example, the content of soluble solids) to visually evaluate and display the quality of the crop production area. The above wireless communication module is used to wirelessly transmit data (spectral information, data detected by the positioning module) and realize the interaction between the control module and the data server. The above display is connected to the control module and is used to display relevant information of the detection terminal such as the number of the detection terminal, the temperature of the crop, the detection result, and the network connection status. The above power supply uses a rechargeable battery and can meet the long-term operation requirements of each component of the detection terminal.
[0028] Furthermore, the above detection terminal includes one or a combination of multiple types among handheld, portable, in-vehicle, and online types, and can meet the detection and monitoring needs of multi-scenarios such as crop harvesting, warehouse storage, logistics processes, raw material extraction inspections, and quality evaluations of the shelf life.
[0029] The above data server includes a data storage unit, a data processing unit, a data generation unit, and an execution unit, and is used for the data processing of the spectral information obtained by the detection terminal.
[0030] Furthermore, the above wireless communication module wirelessly transmits and stores the collected spectrum information, temperature information, and position information to the data storage unit. The above data processing unit processes the spectrum information and temperature information. Specifically, it calibrates the spectrum information using a temperature compensation model and a spectrum transfer model, and calls a detection model for calculation. The above data generation unit generates tables and graphs from the data processed by the data processing unit, uploads them to the cloud data management platform so that administrators can view, manage, and evaluate them. At the same time, a serial number of the crop sample is generated, samples are extracted and measured based on the administrator serial number, the measurement results are imported into the data processing unit to calculate errors, and they are used for updating the detection model.
[0031] The above cloud data management platform is used for result display and control of the detection terminal, and includes one or more of a display terminal of a personal computer, a display terminal of a mobile phone, and a display terminal of a tablet.
[0032] The present invention provides a method for transferring and sharing an optoelectronic detection model of cloud service. As shown in Figure 2, the method includes: Step A1 of obtaining a wavelength calibration formula by pre-selecting a characteristic wavelength with a characteristic absorption peak and calibrating the characteristic wavelength by acquiring the spectrum of a standard light source with the above detection terminal. Step A2 of batch-acquiring the spectrum information and temperature information of typical and representative samples of crops by the 0th detection terminal, initially calibrating the wavelength in the spectrum information according to the wavelength calibration formula corresponding to the 0th detection terminal, and establishing a temperature compensation model. Step A3 of obtaining quality indicators of typical and representative samples of the crop (such as the content of soluble solids, hardness, acidity, etc. The content of soluble solids is obtained by a refractometer, the hardness is obtained by a physical property meter, and the acidity is obtained by a pH meter), extracting characteristic wavelengths based on the wavelength-calibrated spectrum, and establishing a detection model from the characteristic wavelengths and quality indicators. The process A4 of batch - acquiring spectral information of typical and representative samples of agricultural crops by the 0th detection terminal and the 1st detection terminal (the spectral information obtained by the 1st detection terminal needs to be calibrated according to the corresponding wavelength calibration formula), The computer uploads the spectral transfer model, temperature compensation model, and detection model to the data server, calibrates the spectral information of the agricultural crop sample by calling the temperature compensation model and the spectral transfer model, calculates the calibrated spectral information by calling the detection model, and obtains the detection result (i.e., the quality result) of the agricultural crop sample, process A5. When a new detection terminal is added to the monitoring and evaluation system of the Internet of Things, the new detection terminal acquires the spectral information of the agricultural crop sample in small batches, initially calibrates the spectral information according to the corresponding wavelength calibration formula, sends it to the computer, updates the above - mentioned spectral transfer model by the transfer learning method, uploads it to the data server again to improve its generalization performance, process A6, and When the detection result is obtained, the serial number of the agricultural crop sample is generated, the sample is extracted and measured based on the serial number, the measured result is imported into the data processing unit to calculate the error between the detection result and the measured result, and when the above - mentioned error exceeds the set threshold, the detection model is updated, process A7.
[0033] Here, in the above - mentioned process A1, the calibration range is 400nm - 2500nm, and the above - mentioned wavelength calibration formula is Y = a1x 1 +a2x 2 +…+a n x n +b, where Y represents the calibrated wavelength, a1, a2…a n represents the calibration coefficient, x 1 , x 2 …x n represents the pre - selected characteristic wavelength, and b represents a constant.
[0034] Among them, in the above step A2, the method for obtaining the spectral information of typical and representative samples of agricultural crops by the 0th detection terminal uses diffuse transmission or diffuse reflection, and combines one or more of orthogonal signal calibration, dynamic orthogonal projection, and external parameter orthogonality to establish a temperature compensation model for the measured agricultural crops.
[0035] Among them, in the above step A3, the above method for extracting characteristic wavelengths includes one or a combination of genetic optimization algorithms, joint interval algorithms, simulated annealing algorithms, ant colony optimization algorithms, and competitive adaptive reweighted sampling algorithms.
[0036] Preferably, the above detection model includes a quantitative prediction model or a qualitative identification model, and the above quality indicators are one or more quality indicators of the measured agricultural crops. For example, one or more of the soluble solid content, hardness, acidity, and vitamin C content of apples, and one or more of the moisture content, fatty acid, and reducing sugar of rice. Each quality indicator corresponds to a quantitative prediction model or a qualitative identification model, and uses one or a combination of multiple linear regression, partial least squares method, artificial neural network, principal component analysis, support vector machine, etc. to establish a detection model for the quality of the measured agricultural crops, and the establishment process is a prior art. The above detection model can be customized according to the needs of customers.
[0037] In the process of establishing a detection model, before extracting characteristic wavelengths, the total reflection spectrum and the dark noise spectrum are automatically calibrated and converted into an absorbance spectrum (wherein the total reflection spectrum is pre-collected and stored in a photoelectric sensor, and the dark spectrum is collected and stored by the photoelectric sensor when the light source is turned off), the absorbance spectrum is further corrected by a preprocessing method, and the spectrum regions at both ends of the above absorbance spectrum with a signal-to-noise ratio lower than a preset signal-to-noise ratio are removed, and the corrected absorbance spectrum is randomly divided into a training set and a test set at a ratio of 3:1. Among them, the preprocessing method is one or a combination of smoothing processing, multivariate scatter correction, standard normal variate, first derivative, and second derivative.
[0038] Among them, in the above step A4, in the process of establishing a spectrum transfer model by an autoencoder neural network, as shown in Figure 3, the encoder encodes the spectrum matrix S1 (consisting of the detected spectrum information) of the first detection terminal into a low-dimensional hidden variable h, and the decoder restores the hidden variable h of the hidden layer to the spectrum matrix S0 of the 0th detection terminal, and makes the neural network learn the difference characteristics between the matrix S0 and the matrix S1, and calibrates the matrix S1 to the matrix S0. The encoding process from the input layer to the hidden layer is h = θ1(S1) = w1X + b1, The decoding process from the hidden layer to the output layer is S0 = θ2(h) = w2X + b2, Here, w1 is the weight matrix of the encoding process, w2 is the weight matrix of the decoding process, θ1 is the function of the encoding process, θ2 is the function of the decoding process, b1 is the bias matrix of the encoding process, b2 is the bias matrix of the decoding process, and X represents the spectrum matrix. Therefore, the spectrum transfer model includes one encoder and one decoder. The encoder includes a weight matrix w1 and a bias matrix b1, and the decoder includes a weight matrix w2 and a bias matrix b2.
[0039] Among them, in the above step A6, the spectrum transfer model is updated by the transfer learning method. The specific process is to freeze the parameter matrices (including the weight matrix and the bias matrix) of the updated autoencoder neural network by the 0th detection terminal and the 1st detection terminal, add one decoder, and update the parameter matrix of the added decoder by the 0th terminal and the new detection terminal. Since the robustness of the spectrum transfer model can be enhanced with only a few samples, sharing and sharing of the model among different detection terminals are realized.
[0040] Among them, in the above step A7, updating the detection model by the active feedback mechanism and the passive feedback mechanism means that at important times such as after the harvest, before storage, and before listing of agricultural crops, typical and representative samples are selected to actively update the detection model. In the detection process, the samples are numbered according to the number of detections, a specific number (30 or more) of samples are dynamically extracted and set as an independent verification set to verify the detection model. When the error between the detection result and the actual measurement result is greater than the preset threshold, passive feedback is started, the system administrator is notified, and the model is updated passively by the independent verification set.
[0041] Furthermore, the above model update process specifically selects representative agricultural crop samples from the independent verification set, adds them to the training set of the established detection model, expands the coverage range and variation range of the original detection model samples, and further improves the adaptability of the detection model and the prediction accuracy of new types of samples.
[0042] In this embodiment, taking the futures of apples as an example, by using the above-mentioned transfer and sharing method of the optoelectronic detection model of cloud services and the monitoring and evaluation system of the Internet of Things, a near-infrared spectrum dataset representing the quality information of apples is obtained in batches, and an apple quality detection model and a spectrum transfer and sharing method are established, so as to realize the monitoring and evaluation of apple quality in different production areas.
[0043] The hardware of the portable detection terminal mainly consists of a wide-spectrum LED light source, a near-infrared optoelectronic sensor, a temperature sensor, a rechargeable lithium battery, a display, a control circuit, a shading ring, a rubber gasket, and a casing. As shown in Figure 4, the built-in positioning module is used to obtain the geographical information of the apple production area, realizes wireless transmission of data through the 4G / 5G module, and while transmitting the data to the data storage part of the cloud server, it is transmitted to the data processing part, calls the transfer and sharing method of the optoelectronic detection model and the detection model for spectrum calibration and result calculation. After the detection is completed, while returning the detection result to the display of the portable detection terminal, the result is transmitted to the cloud data management platform.
[0044] In this embodiment, taking a plurality of portable detection terminals as an example, the sharing and transfer method of the detection model is realized through the following steps.
[0045] In step A1, five fixed wavelengths with characteristic absorption peaks are set in advance, the calibration range is 400nm to 1100nm, the mercury argon lamp standard light source spectrum is obtained by the detection terminal, the fixed wavelength is calibrated, and a wavelength calibration formula is obtained. The wavelength calibration formula of the 0th detection terminal is F0(x)=0.00001615x 3 -0.03863x 2 +31.67x - 8089, and The wavelength calibration formula of the 1st detection terminal is F1(x)=0.00001364x 3 -0.03228x 2 +26.34x - 6597, and The wavelength calibration formula of the second detection terminal is F2(x)=0.00001526x 3 -0.03542x 2 +35.71x - 8161.
[0046] In process A2, the 0th detection terminal is used to obtain the diffuse reflection spectrum information and temperature information of typical and representative samples of the measured apples, the wavelength is initially calibrated according to the wavelength calibration formula of the 0th detection terminal, and a temperature compensation model is established using the orthogonal method of external parameters.
[0047] The external parameter orthogonal method is based on principal component analysis and is used to reduce the spatial dimension of external parameters. In the external parameter orthogonal method, the spectrum information of the measured apple samples is projected into the orthogonal space, and the interference information is removed by a filter, which is specifically as follows.
[0048] The spectrum matrix X can be expressed as follows. X = X p + X q + R Among them, X p is the projection matrix of the effective part, X q is the projection matrix of the useless part (affected by temperature), and R is the redundant matrix. X p The calculation process of is as follows: (1) Collect the spectrum information of typical and representative apple samples to be measured to obtain the spectrum matrix X i Here, X i is a matrix composed of spectra of n×m dimensions, where i = 1, 2,..., p, representing different temperature levels. (2) Calculate the average spectrum x i of the i matrices. x i is the average value of all apple sample spectra measured at different temperature levels. x i is a row vector with the row number 1, and its number of columns is m. (3) d i = x i - x jCalculate, where j is one of 1, 2, … p, and d1, d2, …… d are used as reference temperatures p are sequentially combined into the difference spectrum matrix D, (4) Calculate the covariance matrix of D, and perform singular value decomposition SVD(D T D)=USV T By executing this, obtain the singular matrix V, (5) Obtain the first c columns of V, and obtain a subset V of matrix V s to obtain it, and remove the redundant part with a filter. In principle, the singular values of the first c columns account for more than 99% of the whole. (6) Projection matrix of the useless part
Number
[0049] In step A3, obtain the quality indicators of typical and representative samples of apples, extract characteristic wavelengths based on the wavelength-calibrated spectrum, and establish a detection model from the characteristic wavelengths and quality indicators
[0050] Obtain the soluble solid content of apples with a refractometer, extract 26 characteristic wavelengths according to the competitive adaptive reweighted sampling algorithm, and establish a PLS quantitative prediction model from the soluble solid content and 26 characteristic wavelengths. Specifically y=3.0485x1+2.1243x2+0.6999x3-0.7435x4-1.8286x5-2.5479x6-2.5548x7-2.7023x8-2.2712x9-1.6531x 10 -0.2221x 11 +0.0235x 12 +0.2166x 13 +0.5907x 14 +0.5023x 15 -0.0463x 16 -0.5329x 17 +0.1552x 18 +0.4554x 19 +1.1918x 20+2.0570x 21 +1.8016x 22 +1.3537x 23 +0.0881x 24 +1.5010x 25 +2.3522x 26 +5.0562. Among them, y is the predicted value of the detection model, and x represents the extracted characteristic wavelength value.
[0051] In step A4, the 0th detection terminal and the 1st detection terminal are used to batch obtain the spectral information of typical and representative samples of apples to be measured (the spectral information obtained by the 1st detection terminal needs to be calibrated according to the corresponding wavelength calibration formula). An autoencoder neural network is used. The encoder encodes the spectral matrix S1 of the 1st detection terminal into a low-dimensional hidden variable h, and the decoder restores the hidden variable h of the hidden layer to the spectral matrix S0 of the 0th detection terminal. The neural network is made to learn the difference characteristics between matrix S0 and matrix S1, and by calibrating S1 to S0, a spectral transfer model is established.
[0052] In step A5, the spectral transfer model, the temperature compensation model, and the detection model are uploaded to the cloud service. The detection terminal is used to obtain the spectral information of the apples to be measured. The spectrum is calibrated by calling the temperature compensation model and the spectral transfer model, and 26 characteristic wavelengths calibrated are calculated by calling the detection model, and the detection result is returned in real time to the display of the detection terminal.
[0053] In step A6, the 2nd detection terminal is used to obtain the spectral information of the apple samples to be measured in small lots, calibrate it according to the corresponding wavelength calibration formula, continuously update the detection model by the transfer learning method, and improve the generalization performance of the spectral transfer model.
[0054] In Project A7, when apples are extracted and inspected by the second detection terminal, the measured apple samples are numbered, the independent sample set to be extracted and inspected is set to 30, the data generation unit automatically generates 30 serial numbers, the user actually measures and uploads the soluble solid content of the apples according to the corresponding serial numbers, the data processing unit calculates the error, and if the set threshold is exceeded, the detection model is automatically updated; if the set threshold is not exceeded, the model continues to be used.
[0055] Although the embodiments of the present invention have been described in relation to the accompanying drawings, those skilled in the art can make various modifications and deformations without departing from the spirit and scope of the present invention, and such modifications and deformations are included within the scope of the appended claims.
Claims
1. The spectral information and temperature information of typical and representative samples of agricultural crops are obtained in batches by the 0th detection terminal, and a temperature compensation model is established. The quality indicators of the typical and representative samples of the above-mentioned agricultural crops are obtained, characteristic wavelengths are extracted based on the wavelength-calibrated spectrum, and a detection model is established from the above-mentioned characteristic wavelengths and quality indicators. The spectral information of typical and representative samples of agricultural crops is obtained in batches by the 0th detection terminal and the 1st detection terminal, and a spectrum transfer model is established by an autoencoder neural network. By calling the temperature compensation model and the spectrum transfer model, the spectral information of the agricultural crop sample is calibrated, and by calling the detection model, the calibrated spectral information is calculated to obtain the detection result of the quality of the agricultural crop sample. The process of establishing a spectrum transfer model by the above-mentioned autoencoder neural network is as follows: The encoder encodes the spectral matrix S1 of the 1st detection terminal into a low-dimensional hidden variable h, the decoder restores the hidden variable h of the hidden layer to the spectral matrix S0 of the 0th detection terminal, and the neural network is made to learn the difference characteristics between the matrix S0 and the matrix S1, and calibrate the matrix S1 to the matrix S0. The encoding process from the input layer to the hidden layer is as follows: h = θ1(S1) = w1X + b1. The decoding process from the hidden layer to the output layer is as follows: S0 = θ2(h) = w2X + b2. Here, w1 is the weight matrix of the encoding process, w2 is the weight matrix of the decoding process, θ1 is the function of the encoding process, θ2 is the function of the decoding process, b1 is the bias matrix of the encoding process, b2 is the bias matrix of the decoding process, and X represents the spectral matrix. The above spectral transfer model includes one encoder and one decoder. The encoder includes a weight matrix w1 and a bias matrix b1, and the decoder includes a weight matrix w2 and a bias matrix b2. Further, when a new detection terminal is added, it includes acquiring the spectral information of the crop sample in small lots by the new detection terminal and updating the above spectral transfer model by the transfer learning method. A method for transferring and sharing a photoelectric detection model of cloud service, characterized by the above.
2. Updating the spectral transfer model by the above transfer learning method specifically freezes the parameter matrices of the autoencoder neural network updated by the 0th detection terminal and the 1st detection terminal, adds one decoder, and updates the parameter matrix of the added decoder by the 0th terminal and the new detection terminal. The method for transferring and sharing a photoelectric detection model according to claim 1, characterized by this.
3. When a detection result is obtained, a serial number of the crop sample is generated, the sample is extracted based on the serial number, the quality index is actually measured, the error between the detection result and the actual measurement result is calculated, and when the above error exceeds the set threshold, the detection model is updated. The method for transferring and sharing a photoelectric detection model according to claim 1, characterized by this.
4. The detection model is updated by an active feedback mechanism and a passive feedback mechanism. Specifically, the active feedback mechanism is that representative samples are selected at important time points after the harvest of agricultural crops, before storage, and before being put on the market, and the detection model is actively updated. The passive feedback mechanism is that, specifically, in the detection process, samples are numbered according to the number of detections, and a specific number of dynamically extracted samples are used as an independent verification set to verify the detection model. When the error between the detection result and the actual measurement result is greater than a preset threshold, the model is updated using the independent verification set. The method for transferring and sharing the optoelectronic detection model according to claim 3, characterized in that.
5. The model update process is specifically characterized in that a representative agricultural crop sample is selected from the independent verification set and added to the training set of the established detection model. The method for transferring and sharing the optoelectronic detection model according to claim 4, characterized in that.
6. Calibrating the wavelength in the spectral information obtained by the detection terminal according to a wavelength calibration formula. The method for transferring and sharing the optoelectronic detection model according to claim 1, characterized in that.
7. The wavelength calibration formula is obtained by selecting characteristic wavelengths with characteristic absorption peaks in advance, obtaining the spectrum of a standard light source using the detection terminal, and calibrating the characteristic wavelengths. The method for transferring and sharing the optoelectronic detection model according to claim 6, characterized in that.
8. At least one detection terminal for obtaining information on the measured agricultural crop samples including spectral information, temperature information, and geographical information. Calibrate the spectral information by the spectral transfer and sharing method, call the quality detection model for calculation, and return the detection result to the detection terminal in real time. The above spectral transfer and sharing method and quality detection model are established by the above detection terminal batch-acquiring the spectral information of typical and representative samples of agricultural crops, and a data server that updates the quality detection model in real time by an active feedback and passive feedback mechanism, and A cloud data management platform for the display of detection results and the control of detection terminals are included, The calibration by the above spectral transfer and sharing method is to batch-acquire the spectral information of typical and representative samples of agricultural crops by the 0th detection terminal and the 1st detection terminal, further establish a spectral transfer model by an autoencoder neural network, and calibrate the spectral information of the agricultural crop sample by calling the temperature compensation model and the spectral transfer model. The process of establishing a spectral transfer model by the above autoencoder neural network is The encoder encodes the spectral matrix S1 of the 1st detection terminal into a low-dimensional hidden variable h, the decoder restores the hidden variable h of the hidden layer to the spectral matrix S0 of the 0th detection terminal, and makes the neural network learn the difference characteristics between the matrix S0 and the matrix S1 to calibrate the matrix S1 to the matrix S0. The encoding process from the input layer to the hidden layer is h = θ1(S1) = w1X + b1, The decoding process from the hidden layer to the output layer is S0 = θ2(h) = w2X + b2, Here, w1 is the weight matrix of the encoding process, w2 is the weight matrix of the decoding process, θ1 is the function of the encoding process, θ2 is the function of the decoding process, b1 is the bias matrix of the encoding process, b2 is the bias matrix of the decoding process, X represents the spectrum matrix, The above spectrum transfer model includes an encoder and a decoder. The encoder includes a weight matrix w1 and a bias matrix b1, and the decoder includes a weight matrix w2 and a bias matrix b2. A monitoring and evaluation system for the Internet of Things, characterized by the above.
9. The detection terminal includes a light source, a sensor, a positioning module, and a control module. The light source is used to provide an active light source necessary for detecting crop samples. The sensor includes a photoelectric sensor and a temperature sensor. The positioning module is used to obtain geographical information where the detection terminal for the quality of the crop is located. The control module controls the operation of the entire detection terminal and has functions of photoelectric signal conversion, data display, and transmission. The monitoring and evaluation system for the Internet of Things according to claim 8.
10. The detection terminal according to claim 8, characterized in that it includes one or a combination of more than one of handheld, portable, in-vehicle, and online types.
Citation Information
Patent Citations
A Method for Constructing Temperature Compensation Model of Multispectral Crop Growth Sensor
CN104251824B
Handheld near infrared spectrum detection system and detection method for quality of fruits and vegetables
CN106323909A
Method for transferring spectral information among spectrometers
US5347475A
Apparatus and method for measuring and correlating characteristics of fruit with visible / near infra-red spectrum
WO2001069191A1
System and method of detecting concentration of plurality of chemical residue in an agricultural produce
WO2021191770A1