Method for transferring and sharing photoelectric detection models on cloud services and monitoring and evaluation system for Internet of Things
Through the cloud service's spectral detection model transfer method and automatic encoder network, the problem of poor spectral model universality between different devices is solved, remote monitoring and evaluation of agricultural product quality is realized, and detection efficiency and accuracy are improved.
Patent Information
- Application Number
- JP2023561868
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2022-11-29
- Filing Date
- 2022-12-20
- Publication Date
- 2025-02-04
- Estimated Expiration
- 2042-12-20
AI Technical Summary
In the prior art, the detection model of spectral analysis equipment is difficult to be universal among different equipment, and the traditional single-equipment model update consumes manpower and material resources, and cannot meet the rapid and accurate detection needs of agricultural product quality.
The spectrum detection model transfer method of cloud services is adopted, through temperature compensation and spectral transfer models, combined with the automatic encoder network, the spectrum information sharing and model updates between different devices are realized, and the spectrum transfer model is established using the automatic encoder network, and the detection model is optimized through active and passive feedback mechanisms.
The comparability of spectral information between different equipment is achieved, the remote monitoring and evaluation of agricultural product quality is supported, the universality and accuracy of the detection model is improved, and manpower and material consumption is reduced.
Smart Images

Figure 2025503350000001_ABST
Abstract
Description
[Technical field]
[0001] The present invention relates to the field of crop quality sorting and monitoring, and in particular to a method for transferring and sharing photoelectric detection models in cloud services and a monitoring and evaluation system for the Internet of Things. [Background technology]
[0002] With the improvement of consumer demand, people are increasingly concerned about the quality and safety of agricultural products when the demand for the number of agricultural products is met. Because agricultural products have natural characteristics, there are significant individual differences in quality. Mixed sales cannot meet the multi-layered needs and preferences of consumers, and cannot achieve high quality and low prices for agricultural products. In addition, in an environment where products are standardized, vicious competition between companies is likely to occur, which will not lead to the healthy development of the entire agricultural industry. Therefore, in promoting the supply-side structural reform of agricultural products, grading the quality of agricultural products is of great significance in realizing quality evaluation of agricultural products, meeting the multi-layered needs of consumers, promoting effective matching, improving the supply and demand balance of agricultural products, and reducing resource waste.
[0003] In the internal quality inspection of agricultural products, the spectral analysis technology has shown great advantages. The spectral analysis technology has the advantages of non-destructive, high detection efficiency, low cost, and good reproducibility, and the measurement of samples generally does not require pretreatment, making it suitable for on-site detection and online analysis. However, in the spectral analysis, it is necessary to first establish a spectral detection model between the spectral matrix X and the response matrix Y. However, due to factors such as the difference in the spectrometer itself, the aging of the instrument, and the change in the environment, there will be differences in the spectra collected by different instruments. When the quantitative analysis model established is put into practical use, there are problems such as (1) the analytical model established by one instrument cannot be used for a long time, (2) the analytical model established by one instrument cannot directly quantitatively analyze the spectra collected by other instruments, and (3) some samples are toxic, chemically unstable, and expensive, so re-establishing a new model will consume a lot of human, material, and financial resources.
[0004] At present, traditional crop sorting equipment designed based on spectrum analysis technology is mostly online, which makes it difficult to meet the needs of monitoring, and a single device is modeled independently, resulting in a lot of wasted human and material resources. With the rise of the Internet of Things, big data, and cloud computing, spectrometers, a type of photoelectric sensor, have naturally become part of the Internet of Things, and by combining spectrum analysis technology with information technology, it can detect or monitor the quality of agricultural crops on the spot, which can serve the national agricultural department, industry leaders, national regulators, etc. In addition, the Internet of Things provides an implementation path for sharing detection models, which has become an important driving force for the commercial promotion of detection equipment.
[0005] In addition, with the development of the futures market, China's futures army is becoming more and more rich and diversified, covering various fields including many agricultural crop futures varieties. For example, apple futures was listed for trading on the Zhengzhou Commodity Exchange, becoming the first fresh fruit futures variety in China and the world. There are many reasons why China is actively developing fruit futures trading, but the most important reason is that China has its own "poverty relief characteristics". China is the world's largest producer and consumer of fruit, with a relatively large planting area and large production volume, but it is because of the excessive supply that the price of fruit falls and farmers are easily hit hard. The listing of apple futures allows related enterprises and producers to use apple futures to hedge, discover prices, and eliminate risks as much as possible, while at the same time having the basic advantage that fruit price fluctuations are somewhat cyclical and the amplitude is relatively obvious, the market size is large, and 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 currently not very standardized. For example, the lack of a perfect positive correlation between the appearance and internal quality of apples is a disqualifying theme for standardized apple futures. Furthermore, there is a large discrepancy between the storability requirements of futures products and the storage intolerances of actual fruit.
[0006] In order to solve the problem of low applicability of spectral detection models, ensure the quality of agricultural crops, realize rapid screening, detection and evaluation of the quality and safety of agricultural raw materials and production and processing processes, and improve consumer trust, it is necessary to develop a remote monitoring and evaluation system for agricultural crop quality. Summary of the Invention
[0007] In response to the shortcomings of the prior art, the present invention provides a cloud service photoelectric detection model transfer and sharing method and an Internet of Things monitoring and evaluation system, which realizes remote sharing and updating of detection models, solves the difficulties of monitoring the entire supply chain of agricultural product quality, and realizes remote monitoring and evaluation of agricultural product quality.
[0008] The present invention achieves the above technical object by the following technical means.
[0009] The method for transferring and sharing the photoelectric detection model of the cloud service of the present invention is as follows: The 0th detection terminal obtains the spectrum information and temperature information of typical and representative samples of agricultural products in batches, and establishes a temperature compensation model; Obtaining quality indicators of typical and representative samples of the above agricultural products, extracting characteristic wavelengths based on the wavelength-calibrated spectrum, and establishing a detection model according to the above characteristic wavelengths and quality indicators; The 0th detection terminal and the 1st detection terminal obtain the spectral information of typical and representative samples of agricultural crops in batches, and then establish a spectral transfer model by an autoencoder neural network; The spectral information of the crop sample is calibrated by invoking the temperature compensation model and the spectral transfer model, and the calibrated spectral information is calculated by invoking the detection model to obtain the detection result of the crop sample.
[0010] In a further technical means, the process of establishing a spectral transfer model by the above autoencoder neural network includes: The encoder encodes the spectrum matrix S1 of the first detection terminal into a low-dimensional hidden variable h, and the decoder restores the hidden variable h of the hidden layer into the spectrum matrix S0 of the 0th detection terminal, trains the neural network on the differential 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 as follows: S0 = θ2(h) = w2X + b2, where w1 is the weight matrix of the encoding process, w2 is the weight matrix of the decoding process, θ1 is a function of the encoding process, θ2 is a function of the decoding process, b1 is the deviation matrix of the encoding process, b2 is the deviation matrix of the decoding process, and X represents the spectral matrix; The above spectrum transfer model includes one encoder and one decoder, where the encoder includes a weight matrix w1 and a deviation matrix b1, and the decoder includes a weight matrix w2 and a deviation matrix b2.
[0011] In a further technical means, when a new detection terminal is added, the new detection terminal acquires spectral information of agricultural crop samples in small batches, and updates the above-mentioned spectral transfer model by a transfer learning method.
[0012] In a further technical means, the above-mentioned spectral transfer model is updated by a transfer learning method, specifically by freezing the parameter matrix of the autoencoder neural network updated by the 0th detection terminal and the 1st detection terminal, adding one decoder, and updating the parameter matrix of the added decoder by the 0th terminal and the new detection terminal.
[0013] In a further technical means, a serial number of the agricultural product sample is generated while the detection result is obtained, the sample is extracted and measured based on the serial number, an error between the detection result and the actual measurement result is calculated, and if the error exceeds a set threshold, the detection model is updated.
[0014] In yet a further technical solution, the detection model is updated through an active feedback mechanism and a passive feedback mechanism, in which the active feedback mechanism specifically selects representative samples at key time points after the crop is harvested, before storage, and before it is put into the market, and the detection model is actively updated, and the passive feedback mechanism specifically numbers the samples according to the number of detections in the detection process, and a certain number of dynamically extracted samples are used as an independent validation set to validate the detection model, and if the error between the detection result and the actual measurement result is greater than a preset threshold, the independent validation set is used to update the model.
[0015] In yet a further technical means, the above-mentioned model updating process specifically selects representative crop samples from the independent validation set and adds them to the training set of the established detection model.
[0016] In a still further technical means, the wavelengths in the spectral information obtained by the detection terminal are calibrated according to a wavelength calibration formula.
[0017] In yet another technical means, the above wavelength calibration formula is obtained by previously selecting a characteristic wavelength having a characteristic absorption peak, obtaining a spectrum of a standard light source by the above detection terminal, and calibrating the above characteristic wavelength.
[0018] The monitoring and evaluation system for the Internet of Things of the present invention is at least one detection terminal for acquiring information of the detected crop sample, including spectral information, temperature information, and geographic information; a data server for calibrating the spectrum information through a spectrum transfer and sharing method, invoking and calculating a detection model, and sending back the detection result to the detection terminal in real time, where the above spectrum transfer and sharing method and the detection model are established by the above detection terminal acquiring the spectrum information of typical and representative samples of agricultural crops in batches, and updating the detection model in real time through active feedback and passive feedback mechanisms; It includes a cloud data management platform for displaying detection results, uploading spectrum transfer models and detection models, managing users, and controlling detection terminals. 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 required for detecting the crop sample, the sensor includes a photoelectric sensor and a temperature sensor, the positioning module is used to obtain geographic information of the location of the crop quality detection terminal, the control module controls the operation of the entire detection terminal, and has the functions of photoelectric signal conversion, data display, and transmission; The above-mentioned detection terminals include one or a combination of handheld, portable, vehicle-mounted, and online types. Effect 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 a cloud service and a monitoring and evaluation system for the Internet of Things.
[0020] (1) Regarding the problem of low applicability of the spectral detection model, the present invention provides a cloud service photoelectric detection model transfer and sharing method, which calibrates the spectral information of the crop sample by calling a temperature compensation model and a spectral transfer model, calculates the calibrated spectral information by calling the detection model, obtains the detection result of the crop sample, and realizes the sharing and sharing of the detection model among different detection terminals.
[0021] (2) The present invention provides an Internet of Things monitoring and evaluation system including a data server that calibrates data server spectrum information through a spectrum transfer and sharing method, invokes and calculates a detection model, and sends the detection result back to the detection terminal in real time, thereby realizing remote monitoring and evaluation of agricultural product quality. The system has a wide range of potential applications in sample testing and measurement evaluation of agricultural product quality.
[0022] In order to more clearly describe 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] FIG. 2 is a schematic diagram of the structure of the Internet of Things monitoring and evaluation system for cloud services in the present invention. [Diagram 2] FIG. 2 is a flow chart of a method for transferring and sharing a photoelectric detection model of a cloud service in the present invention. [Diagram 3] FIG. 1 is a schematic diagram of an autoencoder neural network of the established spectral transfer model in the present invention. [Figure 4] FIG. 1 is a schematic diagram of a handheld detection terminal and data management platform in the present invention. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0024] In order to make the objectives, technical means and advantages of the embodiments of the present invention clearer, the technical means in the embodiments of the present invention are clearly described below with reference to the drawings of the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, but are not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative efforts are included in the scope of protection of the present invention.
[0025] The present invention provides an Internet of Things monitoring and evaluation system, as shown in Fig. 1, the system includes at least one detection terminal, a data server, and a cloud data management platform. The detection terminal obtains information of crop samples detected, wirelessly uploads the information to the data server, calibrates the spectrum information by the spectrum transfer and sharing method, calculates by invoking the detection model, and sends the detection result back to the detection terminal display in real time, while transmitting it to the cloud data management platform. The above spectrum transfer and sharing method and detection model are established by the detection terminal obtaining the spectrum information of typical and representative samples of crops in batches, and updates the detection model in real time through active feedback and passive feedback mechanisms. The system can realize on-the-spot detection, monitoring and evaluation of crop quality in real time.
[0026] Wherein, the 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 agricultural crops.
[0027] In addition, the control module controls the operation of the entire detection terminal and has functions such as photoelectric signal conversion, data display, and transmission. The light source is a type of halogen lamp or LED, which is used to provide an active light source required for detecting the crop sample. The sensor includes a photoelectric sensor and a temperature sensor, the photoelectric sensor is used to obtain the spectrum information of the crop under the light source, the temperature sensor is used to sense the temperature of the crop, and the information collected by the sensor is transmitted to the data server through the control module, and the spectrum information is calibrated in the data server to meet the needs of adapting to multi-scenario. The positioning module is used to obtain the geographic information of the location of the detection terminal of the crop quality, and transmits it to the data server through the control module, and by combining it with the detection result of the detection model (e.g., the content of soluble solids), the quality of the crop origin can be visually evaluated and displayed. The 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 the relevant information of the detection terminal, such as the number of the detection terminal, the temperature of the crops, the detection result, the network connection status, etc. The above power source uses a rechargeable battery, which can meet the long-term operation requirements of each part of the detection terminal.
[0028] In addition, the above-mentioned detection terminals include one or a combination of handheld, portable, vehicle-mounted, and online types, which can meet the detection and monitoring needs of multi-scenario such as crop harvesting, warehousing, logistics process, raw material sampling inspection, and shelf life quality evaluation.
[0029] The above-mentioned data server includes a data storage unit, a data processing unit, a data generating unit and an executing unit, and is used for data processing of the spectrum information acquired by the detection terminal.
[0030] Furthermore, the wireless communication module wirelessly transmits the collected spectrum information, temperature information, and location information to the data storage unit for storage, the data processing unit processes the spectrum information and temperature information, specifically calibrates the spectrum information according to a temperature compensation model and a spectrum transfer model, and calls up the detection model for calculation. The data generation unit generates tables and graphs from the data processed by the data processing unit and uploads them to the cloud data management platform for the administrator to view, manage, and evaluate. At the same time, serial numbers of the crop samples are generated, samples are extracted and measured based on the administrator's serial numbers, and the actual measurement results are input to the data processing unit to calculate the error and are used to update the detection model.
[0031] The above-mentioned cloud data management platform is used for displaying the results and controlling the detection terminal, which includes one or more of a personal computer display terminal, a mobile phone display terminal, and a tablet display terminal.
[0032] The present invention provides a cloud service photoelectric detection model transfer and sharing method, as shown in FIG. 2, the method includes: A step A1 of selecting a characteristic wavelength having a characteristic absorption peak in advance, acquiring a spectrum of a standard light source by the detection terminal and calibrating the characteristic wavelength to obtain a wavelength calibration formula; A process A2, in which the 0th detection terminal obtains the spectrum information and temperature information of the typical and representative samples of the agricultural products in a batch, and initially calibrates the wavelength in the spectrum information according to the wavelength calibration formula corresponding to the 0th detection terminal, and establishes a temperature compensation model; A step A3 of obtaining quality indicators (such as soluble solids content, hardness, acidity, etc., where the soluble solids content is obtained by a refractometer, the hardness is obtained by a physical property meter, and the acidity is obtained by a pH meter) of a typical and representative sample of the agricultural product, extracting characteristic wavelengths based on the wavelength-calibrated spectrum, and establishing a detection model from the characteristic wavelengths and the quality indicators; A step A4 of obtaining the spectral information of typical and representative samples of agricultural crops in batches 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), and establishing a spectral transfer model by an autoencoder neural network; Step A5: the computer uploads the spectrum transfer model, the temperature compensation model, and the detection model to the data server, calibrates the spectrum information of the crop sample by invoking the temperature compensation model and the spectrum transfer model, calculates the calibrated spectrum information by invoking the detection model, and obtains the detection result of the crop sample (i.e., the quality result); A6, when a new detection terminal is added to the Internet of Things monitoring and evaluation system, the new detection terminal obtains the spectral information of the crop samples in small batches, initially calibrates the spectral information according to the corresponding wavelength calibration formula, transmits it to the computer, updates the above-mentioned spectral transfer model by the transfer learning method, and uploads it to the data server again to improve its generalization performance; The method includes a step A7 of obtaining the detection result and generating a serial number of the agricultural product sample, extracting and measuring the sample based on the serial number, inputting the actual measurement result into a data processing unit to calculate the error between the detection result and the actual measurement result, and updating the detection model if the error exceeds a set threshold value.
[0033] Here, in the above step A1, the calibration range is 400 nm to 2500 nm, and the above wavelength calibration formula is Y=a1x 1 +a2x 2 +…+a n x n +b, where Y represents the calibration wavelength and a1, a2...a n represents the calibration factor, and x 1 , x 2 …x n represents a preselected characteristic wavelength and b represents a constant.
[0034] Among them, in the above step A2, the method for obtaining the spectral information of the typical and representative sample of the agricultural crop by the detection terminal No. 0 uses diffuse transmission or diffuse reflection, and combines one or more of orthogonal signal calibration, dynamic orthogonal projection, and external parameter orthogonal to establish a temperature compensation model of the measured agricultural crop.
[0035] Among them, in the above step A3, the method for extracting the above characteristic wavelength includes one of a genetic optimization algorithm, a joint interval algorithm, a simulated annealing algorithm, an ant colony optimization algorithm, a competitive adaptive reweighted sampling algorithm, or a combination thereof.
[0036] Preferably, the above detection model includes a quantitative prediction model or a qualitative identification model, and the above quality indexes are one or more quality indexes of the agricultural products to be measured, such as one or more of the soluble solids content, hardness, acidity, and vitamin C content of apple, and one or more of the moisture content, fatty acid, and reducing sugar of rice, and each quality index corresponds to a quantitative prediction model or a qualitative identification model, and one or more of multiple linear regression, partial least squares method, artificial neural network, principal component analysis, support vector machine, etc. are used in combination to establish the detection model of the quality of the agricultural products to be measured, and the process of establishing is a conventional technology. The above detection model can be customized according to the needs of customers.
[0037] In the process of establishing the detection model, before extracting the characteristic wavelength, the total reflection spectrum and the dark noise spectrum are automatically calibrated and converted into an absorbance spectrum (wherein the total reflection spectrum is collected and stored in the photoelectric sensor in advance, and the dark spectrum is collected and stored by the photoelectric sensor when the light source is turned off), and the absorbance spectrum is further modified by a pre-processing method to remove the spectral regions where the signal-to-noise ratio at both ends of the absorbance spectrum is lower than the preset signal-to-noise ratio, and the modified absorbance spectrum is randomly divided into a training set and a test set in a ratio of 3:1, wherein the pre-processing method is one of the following, or a combination thereof: smoothing, multivariate scattering calibration, standard normal variate, first derivative, second derivative.
[0038] Among them, in the above step A4, in the process of establishing a spectral transfer model by an autoencoder neural network, as shown in FIG. 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 into 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 as follows: S0 = θ2(h) = w2X + b2, where w1 is the weight matrix of the encoding process, w2 is the weight matrix of the decoding process, θ1 is a function of the encoding process, θ2 is a function of the decoding process, b1 is the deviation matrix of the encoding process, b2 is the deviation matrix of the decoding process, and X represents the spectral matrix; Therefore, the spectral transfer model includes one encoder and one decoder, where the encoder includes a weight matrix w1 and a deviation matrix b1, and the decoder includes a weight matrix w2 and a deviation matrix b2.
[0039] Among them, in the above step A6, the spectral transfer model is updated by the transfer learning method, and the specific process is to freeze the parameter matrix (including the weight matrix and the deviation matrix) of the autoencoder neural network updated 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. The robustness of the spectral transfer model can be strengthened with only a small number of samples, thereby realizing the sharing and sharing of the model among different detection terminals.
[0040] Among them, in the above-mentioned step A7, updating the detection model through active feedback mechanism and passive feedback mechanism involves selecting typical and representative samples at important time points such as after harvesting of agricultural products, before storage, and before marketing to actively update the detection model, numbering the samples according to the number of detections in the detection process, dynamically extracting a certain number (30 or more) of samples and setting them as an independent validation set to validate the detection model, and if the error between the detection result and the actual measurement result is greater than a preset threshold, passive feedback is initiated to notify the system administrator, and passively updating the model through the independent validation set.
[0041] Furthermore, the above model updating process specifically selects representative crop samples from the independent validation set and adds them to the training set of the established detection model, expanding the coverage and variation range of the original detection model samples, and further enhancing the adaptability of the detection model and the prediction accuracy of new types of samples.
[0042] In this embodiment, apple futures is taken as an example, and by using the above-mentioned cloud service photoelectric detection model transfer and sharing method and Internet of Things monitoring and evaluation system, near-infrared spectral data sets representing apple quality information are obtained in batches, and an apple quality detection model and spectrum transfer and sharing method are established to realize apple quality monitoring and evaluation in different producing areas.
[0043] The hardware of the handheld detection terminal mainly consists of a wide-spectrum LED light source, a near-infrared photoelectric 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-growing area, and the 4G / 5G module realizes wireless transmission of data. The data is sent to the data storage unit of the cloud server, while the data processing unit is sent to the data processing unit, where the photoelectric detection model transfer and sharing method and the detection model are called up for spectrum calibration and result calculation. After detection is completed, the detection results are sent back to the display of the handheld detection terminal, while the results are sent to the cloud data management platform.
[0044] In this embodiment, taking multiple handheld detection terminals as an example, the method for sharing and transferring detection models is realized in the following steps.
[0045] In step A1, five fixed wavelengths with characteristic absorption peaks are set in advance, and the calibration range is 400 nm to 1100 nm. The detection terminal obtains the standard light source spectrum of a mercury-argon lamp, calibrates the fixed wavelengths, and obtains a wavelength calibration formula; The wavelength calibration formula for the 0th detector terminal is: F0(x)=0.00001615x 3 -0.03863x 2 +31.67x-8089, The wavelength calibration formula for the first detector is: F1(x)=0.00001364x 3 -0.03228x 2 +26.34x-6597, The wavelength calibration formula for the second detector is: F2(x)=0.00001526x 3 -0.03542x 2 +35.71x-8161.
[0046] In step A2, the No. 0 detection terminal is used to obtain the diffuse reflectance spectrum information and temperature information of a typical and representative sample of apple to be measured, the wavelength is initially calibrated according to the wavelength calibration formula of the No. 0 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 the external parameters. In the external parameter orthogonal method, the spectral information of the measured apple sample is projected into an orthogonal space and the interference information is filtered out, as follows:
[0048] The spectral 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, and X q is the projection matrix of the useless part (affected by temperature), R is the redundancy matrix, X p The calculation process is as follows: (1) collect typical and representative sample spectrum information of the apple to be measured, and generate a spectrum matrix X i where X i is a matrix of n × m dimensional spectra, where i = 1, 2, ... p, representing different temperature levels, and (2) the average spectrum x of the i matrices. i Calculate x i is the average of all apple sample spectra measured at different temperature levels, and x i is a row vector with one row number equal to 1, and the number of columns is m, and (3)d i =x i -x jwhere j is one of 1, 2, …p, and d1, d2, …d are the reference temperatures. p (4) Calculate the covariance matrix of D and perform the singular value decomposition SVD(D T D) = USV T (5) Take the first c columns of V and create a subset V of matrix V. s Then, the redundant parts are filtered out. In principle, the singular values of the first c columns account for more than 99% of the total. (6) The projection matrix of the useless parts
number
[0049] In step A3, quality indexes of typical and representative samples of apples are obtained, characteristic wavelengths are extracted based on the wavelength-calibrated spectrum, and a detection model is established from the characteristic wavelengths and the quality indexes.
[0050] The content of soluble solids in apples was obtained by refractometer, and 26 characteristic wavelengths were extracted according to the competitive adaptive reweighted sampling algorithm. A PLS quantitative prediction model was established from the content of soluble solids and the 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, where 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 obtain the spectral information of typical and representative samples of the apples to be measured in batches (the spectral information obtained by the 1st detection terminal needs to be calibrated according to the corresponding wavelength calibration formula), and an autoencoder neural network is used, in which 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 into the 0th detection terminal spectral matrix S0, and the neural network learns the differential characteristics between the matrix S0 and the matrix S1, and calibrates S1 to S0, thereby establishing a spectral transfer model.
[0052] In step A5, the spectrum transfer model, temperature compensation model, and detection model are uploaded to the cloud service, and the detection terminal is used to obtain the spectrum information of the apple to be measured, the spectrum is calibrated by invoking the temperature compensation model and the spectrum transfer model, the 26 calibrated characteristic wavelengths are calculated by invoking the detection model, and the detection result is sent back to the display of the detection terminal in real time.
[0053] In step A6, the second detection terminal is used to obtain the spectral information of the apple samples to be measured in small batches, and calibrate them according to the corresponding wavelength calibration formula, and the detection model is continuously updated by the transfer learning method to improve the generalization performance of the spectral transfer model.
[0054] In step A7, when apples are sample-tested by the second detection terminal, the apple samples to be measured are numbered, and the independent sample set to be sample-tested is set to 30, the data generation unit automatically generates 30 serial numbers, the user actually measures and uploads the soluble solids content of 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, and if the set threshold is not exceeded, the model is continued to be used.
[0055] Although the embodiments of the present invention have been described with reference to the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are included within the scope of the appended claims.
Claims
1. The 0th detection terminal obtains the spectrum information and temperature information of typical and representative samples of agricultural products in batches, and establishes a temperature compensation model; Obtaining a quality index of a typical and representative sample of the agricultural product, extracting characteristic wavelengths based on a wavelength-calibrated spectrum, and establishing a detection model according to the characteristic wavelengths and the quality index; The 0th detection terminal and the 1st detection terminal obtain the spectral information of typical and representative samples of agricultural crops in batches, and then establish a spectral transfer model by an autoencoder neural network; The spectral information of the crop sample is calibrated by invoking the temperature compensation model and the spectral transfer model, and the calibrated spectral information is calculated by invoking the detection model to obtain the detection result of the crop sample. The present invention relates to a method for transferring and sharing a photoelectric detection model in a cloud service.
2. The process of establishing a spectral transfer model by the autoencoder neural network includes: The encoder uses the spectral matrix S of the first detection terminal. 1 The decoder encodes the hidden variables h of the hidden layer into the 0th detection terminal spectrum matrix S 0 and matrix S 0 and Matrix S 1 The neural network learns the difference characteristics between 1 Let S be the matrix 0 The aim is to calibrate to The encoding process from the input layer to the hidden layer is h = θ 1 (S 1 ) = w 1 X+b 1 and The decoding process from the hidden layer to the output layer is as follows: S 0 = θ 2 (h)=w 2 X+b 2 and Here, w 1 is the weight matrix of the encoding process, and w 2 is the weight matrix of the decoding process, and θ 1 is a function of the encoding process, and θ 2 is a function of the decoding process, and b 1 is the deviation matrix of the encoding process, and b 2 is the deviation matrix of the decoding process, X represents the spectral matrix, The above-mentioned spectral transfer model includes one encoder and one decoder, and the encoder has a weight matrix w 1 and deviation matrix b 1 and the decoder includes a weight matrix w 2 and deviation matrix b 2 Includes The method for transferring and sharing a photoelectric detection model according to claim 1 .
3. The photoelectric detection model transfer and sharing method according to claim 2, further comprising, when a new detection terminal is added, obtaining spectral information of agricultural crop samples in small batches by the new detection terminal, and updating the spectral transfer model by a transfer learning method.
4. The method for transferring and sharing a photoelectric detection model according to claim 3, characterized in that the spectral transfer model is updated by the transfer learning method, specifically by freezing the parameter matrix of the autoencoder neural network updated by the 0th detection terminal and the 1st detection terminal, adding one decoder, and updating the parameter matrix of the added decoder by the 0th terminal and the new detection terminal.
5. The photoelectric detection model transfer and sharing method of claim 1, characterized in that, when the detection result is obtained, a serial number of the agricultural product sample is generated, the sample is extracted and measured based on the serial number, an error between the detection result and the actual measurement result is calculated, and the detection model is updated if the error exceeds a set threshold.
6. The method for transferring and sharing a photoelectric detection model as described in claim 5, wherein the detection model is updated through an active feedback mechanism and a passive feedback mechanism, the active feedback mechanism specifically comprises selecting representative samples at key time points after the crops are harvested, before storage, and before they are put into the market, and actively updating the detection model, and the passive feedback mechanism specifically comprises numbering the samples according to the number of detections in the detection process, and using a certain number of dynamically extracted samples as an independent validation set to validate the detection model, and when the error between the detection result and the actual measurement result is greater than a preset threshold, using the independent validation set to update the model.
7. The method for transferring and sharing a photoelectric detection model as described in claim 6, characterized in that the model updating process specifically comprises selecting representative crop samples from the independent validation set and adding them to the training set of the established detection model.
8. The method for transferring and sharing a photoelectric detection model according to claim 3, characterized in that: the wavelength in the spectrum information obtained by the detection terminal is calibrated according to a wavelength calibration formula.
9. The method for transferring and sharing a photoelectric detection model according to claim 8, characterized in that the wavelength calibration formula is obtained by pre-selecting a characteristic wavelength with a characteristic absorption peak, obtaining a spectrum of a standard light source using the detection terminal, and calibrating the characteristic wavelength.
10. at least one detection terminal for acquiring information of the detected crop sample, including spectral information, temperature information, and geographic information; a data server for calibrating the spectrum information through a spectrum transfer and sharing method, invoking and calculating a detection model, and sending back the detection result to the detection terminal in real time, the spectrum transfer and sharing method and the detection model being established by the detection terminal acquiring the spectrum information of typical and representative samples of agricultural crops in batches, and updating the detection model in real time through active feedback and passive feedback mechanisms; Cloud data management platform for displaying detection results and controlling detection terminals A monitoring and evaluation system for the Internet of Things, comprising:
11. The Internet of Things monitoring and evaluation system of claim 10, characterized in that 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 required for detecting the crop sample, the sensor includes a photoelectric sensor and a temperature sensor, the positioning module is used to obtain geographic information of the location of the crop quality detection terminal, and the control module controls the operation of the entire detection terminal and has the functions of photoelectric signal conversion, data display, and transmission.
12. The monitoring and evaluation system for the Internet of Things according to claim 10, characterized in that the detection terminal includes one or a combination of a handheld type, a portable type, a vehicle-mounted type, and an online type.
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