A photoelectric detection model transmission sharing method of cloud service and an internet of things monitoring and evaluation system

By establishing temperature compensation and spectral transfer models, and utilizing autoencoder neural networks to achieve remote sharing and updating of agricultural product quality testing models, the problem of poor applicability of testing models among different instruments is solved, testing efficiency and accuracy are improved, and the diverse needs of consumers are met.

CN115758779BActive Publication Date: 2026-05-12JIANGSU UNIV
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
JIANGSU UNIV
Filing Date
2022-11-29
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

Existing spectral detection models have poor applicability across different instruments, making it difficult to achieve unified detection and model sharing of agricultural product quality, resulting in resource waste and low detection efficiency.

Method used

By establishing temperature compensation and spectral transfer models, and utilizing autoencoder neural networks to achieve remote sharing and updating of detection models, the quality of agricultural products can be remotely monitored and evaluated in conjunction with an Internet of Things (IoT) monitoring and evaluation system.

Benefits of technology

It enables the sharing of detection models among different detection terminals, improves the efficiency and accuracy of agricultural product quality detection, meets the multi-level needs of consumers, and reduces resource waste.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115758779B_ABST
    Figure CN115758779B_ABST
Patent Text Reader

Abstract

The application discloses a kind of photoelectric detection model transfer sharing method and internet of things monitoring evaluation system of cloud service, the transfer sharing method specifically is: by calling temperature compensation model and spectrum transfer model, the spectrum information of agricultural product sample is corrected, calling detection model is calculated to the corrected spectrum information, obtains the detection result of agricultural product sample;Internet of things monitoring evaluation system utilizes spectrum transfer sharing method to carry out spectrum information correction, and then calls detection model to calculate, and detection result is returned to detection terminal in real time, realizes remote monitoring and evaluation of agricultural product quality.The application can realize that detection model is shared in different detection terminal, and has wide application prospect in agricultural product quality sampling evaluation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of agricultural product quality sorting and monitoring, specifically to a cloud service photoelectric detection model transmission and sharing method and an Internet of Things monitoring and evaluation system. Background Technology

[0002] With the upgrading of consumer demand, after satisfying the quantity needs of agricultural products, people are paying more attention to their quality and safety. Due to the inherent natural characteristics of agricultural products, there are significant quality differences between individual products. Mixed sales of these products cannot satisfy the diverse needs and preferences of consumers, nor can they achieve the principle of "high quality, high price." Furthermore, in an environment of product homogenization, this can easily lead to vicious competition among enterprises, which is detrimental to the healthy development of the entire agricultural product industry. Therefore, quality grading of agricultural products can enable pricing based on quality and meet the diverse needs of consumers, which is of great significance for promoting effective matching of supply and demand for agricultural products and reducing resource waste.

[0003] In the internal quality testing of agricultural products, spectral analysis technology has shown great advantages. Spectroscopic analysis technology has advantages such as being non-destructive, having high detection efficiency, low cost, good reproducibility, generally requiring no pretreatment for sample measurement, and being suitable for on-site testing and online analysis. However, spectral analysis first requires the establishment of a spectral detection model between the spectral matrix X and the response matrix Y. However, due to differences in the spectrometer itself, instrument aging, or environmental changes, the spectra collected on different instruments vary. The established quantitative analysis model faces the following challenges in practical applications: (1) the analysis model established on a certain instrument cannot be used for a long time; (2) the analysis model established on a certain instrument cannot directly perform quantitative analysis on the spectra collected on another instrument; (3) due to the toxicity, unstable chemical properties, and high price of some samples, re-establishing a new model will consume a lot of manpower, material resources, and financial resources.

[0004] Currently, traditional agricultural product sorting equipment based on spectral analysis technology is mostly online, which is insufficient to meet monitoring needs. Furthermore, each device requires independent modeling, resulting in significant waste of manpower and resources. With the rise of the Internet of Things (IoT), big data, and cloud computing, spectrometers, as photoelectric sensors, are a natural component of the IoT. The combination of spectral analysis technology and information technology enables in-situ detection or monitoring of agricultural product quality, serving national agricultural departments, industry leaders, and national regulatory authorities. In addition, the IoT provides a means to share detection models, becoming a significant driving force for the commercialization of detection equipment.

[0005] Furthermore, with the development of the futures market, my country's futures market has become increasingly diverse and comprehensive, covering various sectors, including numerous agricultural futures products. For example, apple futures were listed and traded on the Zhengzhou Commodity Exchange, becoming my country's and the world's first fresh fruit futures product. There are many reasons why my country has vigorously promoted fruit futures. my country is the world's largest producer and consumer of fruit, with extensive planting areas and large yields. However, this massive supply also easily leads to situations where low fruit prices hurt farmers. The listing of fruit futures allows relevant enterprises and growers to hedge, discover prices, and mitigate risks as much as possible through apple futures. At the same time, fruit price fluctuations have a certain cyclical nature and significant amplitude, and the market size is large, providing the basic advantages for launching futures products. This is also an important factor in the successful listing and stable operation of fruit futures in my country. However, the standardization of fruit futures is currently low. For example, the appearance of apples is not entirely positively correlated with their internal quality, but this is considered an unqualified underlying asset for standardized apple futures. In addition, there is a significant contradiction between the storability requirements of futures products and the perishable nature of physical fruits.

[0006] To address the issue of poor applicability of spectral detection models, ensure the quality of agricultural products, enable rapid screening and evaluation of the quality and safety of raw materials and processed fruits, and enhance consumer confidence, it is necessary to develop a remote monitoring and evaluation system for agricultural product quality. Summary of the Invention

[0007] To address the shortcomings of existing technologies, this invention provides a cloud-based photoelectric detection model transfer and sharing method and an Internet of Things (IoT) monitoring and evaluation system. This system enables remote sharing and updating of detection models, solves the problem of difficult monitoring of the entire agricultural product quality supply chain, and realizes remote monitoring and evaluation of agricultural product quality.

[0008] The present invention achieves the above-mentioned technical objectives through the following technical means.

[0009] A method for sharing photoelectric detection models in cloud services:

[0010] Using the No. 0 detection terminal, spectral and temperature information of typical and representative agricultural product samples were acquired in batches, and a temperature compensation model was established.

[0011] The quality indicators of typical and representative samples of the agricultural products are obtained, and characteristic wavelengths are extracted based on the wavelength-corrected spectrum. A detection model is established based on the characteristic wavelengths and the quality indicators.

[0012] The spectral information of typical and representative samples of a batch of agricultural products was obtained using detection terminals 0 and 1, and then a spectral transfer model was established using an autoencoder neural network.

[0013] The spectral information of agricultural product samples is corrected by calling the temperature compensation model and the spectral transfer model, and the detection model is then used to calculate the corrected spectral information to obtain the detection results of the agricultural product samples.

[0014] A further technical solution involves establishing a spectral transfer model using an autoencoder neural network as follows:

[0015] The encoder encodes the spectral matrix S1 of detection terminal 1 into a low-dimensional latent variable h, and the decoder restores the latent variable h of the hidden layer to the spectral matrix S0 of detection terminal 0, so that the neural network learns the difference features between matrix S0 and matrix S1, thereby correcting matrix S1 to matrix S0.

[0016] The encoding process from the input layer to the hidden layer is as follows:

[0017] h=θ1(S1=w1X+b1

[0018] The decoding process from the hidden layer to the output layer is as follows:

[0019] S0=θ2(h=w2X+b2

[0020] Where: 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;

[0021] The spectral 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.

[0022] A further technical solution also includes using the new detection terminal to acquire spectral information of agricultural product samples in small batches when a new detection terminal is added, and using transfer learning methods to update the spectral transfer model.

[0023] A further technical solution involves updating the spectral transfer model using transfer learning, specifically by freezing the parameter matrix of the autoencoder neural network updated based on detection terminal 0 and detection terminal 1, adding a new decoder, and updating the parameter matrix of the new decoder using terminal 0 and the new detection terminal.

[0024] A further technical solution involves generating agricultural product sample serial numbers while obtaining the test results, extracting samples based on the serial numbers for actual testing, calculating the error between the test results and the actual test results, and updating the test model if the error exceeds a set threshold.

[0025] A further technical solution involves updating the detection model using both active and passive feedback mechanisms. The active feedback mechanism specifically involves selecting representative samples at key time points—after agricultural product harvesting, before warehousing, and before market launch—to actively update the detection model. The passive feedback mechanism specifically involves numbering samples according to the number of tests conducted during the detection process, dynamically selecting a certain number of samples to set as an independent validation set to validate the detection model, and updating the model using the independent validation set if the error between the detection result and the actual measurement result exceeds a pre-set threshold.

[0026] A further technical solution involves the following process for updating the model: selecting representative agricultural product samples from the independent validation set and then adding them to the training set of the established detection model.

[0027] A further technical solution involves using a wavelength calibration equation to correct the wavelength in the spectral information acquired by the detection terminal.

[0028] A further technical solution involves obtaining the wavelength calibration equation by: pre-selecting a characteristic wavelength with a characteristic absorption peak, acquiring the spectrum of the detection terminal using a standard light source, calibrating the characteristic wavelength, and obtaining the wavelength calibration equation.

[0029] An Internet of Things (IoT) monitoring and evaluation system, comprising:

[0030] At least one detection terminal acquires information about the agricultural product sample to be tested, including spectral information, temperature information, and geographical information;

[0031] The data server uses a spectral transfer and sharing method to correct spectral information and then calls the detection model for calculation. The detection results are transmitted back to the detection terminal in real time. The spectral transfer and sharing method and the detection model are established by the detection terminal by acquiring spectral information of typical and representative samples of agricultural products in batches, and the detection model is updated in real time using active feedback and passive feedback mechanisms.

[0032] The cloud-based data management platform is used for displaying test results, uploading spectral transfer models and test models, managing users, and controlling test terminals.

[0033] The detection terminal includes a light source, sensors, a positioning module, and a control module. The light source provides the active light source required for detecting agricultural product samples. The sensors are photoelectric sensors and temperature sensors. The positioning module is used to obtain the geographical information of the location of the agricultural product 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.

[0034] The detection terminal includes one or more combinations of handheld, portable, vehicle-mounted, and online types.

[0035] The beneficial effects of this invention are: compared with the prior art, this invention proposes a method for transmitting and sharing photoelectric detection models in cloud services and an Internet of Things monitoring and evaluation system.

[0036] (1) To address the problem of poor applicability of spectral detection models, this invention proposes a cloud service photoelectric detection model transfer and sharing method. By calling the temperature compensation model and the spectral transfer model, the spectral information of agricultural product samples is corrected. The detection model is then called to calculate the corrected spectral information to obtain the detection results of agricultural product samples. This method enables the detection model to be shared in different detection terminals.

[0037] (2) This invention proposes an Internet of Things monitoring and evaluation system, including a data server. The data server uses the spectral transfer sharing method to correct the spectral information and then calls the detection model to perform calculations. The detection results are transmitted back to the detection terminal in real time, realizing remote monitoring and evaluation of agricultural product quality. This system has broad application prospects in the sampling and evaluation of agricultural product quality. Attached Figure Description

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

[0039] Figure 1 This is a schematic diagram of the IoT monitoring and evaluation system for cloud services described in this invention.

[0040] Figure 2 This is a flowchart of the photoelectric detection model transfer and sharing method for cloud services described in this invention;

[0041] Figure 3 This is a schematic diagram of the autoencoder neural network used to establish the spectral transfer model according to the present invention;

[0042] Figure 4 This is a schematic diagram of the handheld detection terminal and data management platform described in this invention. Detailed Implementation

[0043] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0044] This invention proposes an Internet of Things (IoT) monitoring and evaluation system, such as... Figure 1 As shown, the system consists of at least one detection terminal, a data server, and a cloud-based data management platform. The detection terminal acquires information from the agricultural product sample to be tested, wirelessly uploads it to the data server, performs spectral information correction using a spectral transfer sharing method, and then calls the detection model for calculation. The detection results are transmitted back to the display screen of the detection terminal in real time and simultaneously sent to the cloud-based data management platform. The spectral transfer sharing method and the detection model are established by the detection terminal through batch acquisition of spectral information from typical and representative agricultural product samples, and the detection model is updated in real time using active and passive feedback mechanisms. This system can realize in-situ real-time detection and monitoring evaluation of agricultural product quality.

[0045] The detection terminal includes a light source, a sensor, a positioning module, a wireless communication module, a control module, a display screen, and a power supply, and is used for sensing the spectral information of agricultural product quality.

[0046] Furthermore, the control module controls the operation of the entire testing terminal and has functions such as photoelectric signal conversion, data display, and transmission. The light source uses either a halogen lamp or an LED to provide the active light source required for testing agricultural product samples. The sensors include a photoelectric sensor and a temperature sensor. The photoelectric sensor acquires the spectral information of the agricultural product under light illumination, and the temperature sensor senses the temperature of the agricultural product. The information collected by the sensors is transmitted to the data server through the control module, where the spectral information is corrected to meet the needs of multiple scenarios. The positioning module acquires the geographical information of the agricultural product quality testing terminal and sends it to the data server through the control module. Combined with the detection results of the detection model (e.g., soluble solids content), it enables visualized evaluation and display of the agricultural product's production area quality. The wireless communication module is used for wireless data transmission (including spectral information and data detected by the positioning module), enabling interaction between the control module and the data server. The display screen is connected to the control module and displays relevant information of the testing terminal, such as the testing terminal number, agricultural product temperature, detection results, and network connection status. The power supply uses a rechargeable battery to meet the long-term working requirements of all components of the testing terminal.

[0047] Furthermore, the detection terminal includes one or more combinations of handheld, portable, vehicle-mounted, and online types, which can meet the detection and monitoring needs of multiple scenarios such as agricultural product harvesting, storage, logistics, raw material sampling, and shelf-life quality evaluation.

[0048] The data server includes a data storage unit, a data processing unit, a data generation unit, and an execution unit, used to process the spectral information acquired by the detection terminal.

[0049] Furthermore, the wireless communication module wirelessly transmits the collected spectral, temperature, and location information to the data storage unit for storage. The data processing unit processes the spectral and temperature information, specifically by using a temperature compensation model and a spectral transfer model to correct the spectral information, and then calling 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 managers to view, manage, and evaluate. Simultaneously, it generates agricultural product sample serial numbers. Managers extract samples based on these serial numbers for actual testing, and the test results are imported into the data processing unit to calculate errors for updating the detection model.

[0050] The cloud-based data management platform is used for result display and control of the testing terminals, including one or more of computer display terminals, mobile phone display terminals, and tablet display terminals.

[0051] This invention proposes a method for sharing and transmitting photoelectric detection models in cloud services, such as... Figure 2 As shown, the method includes:

[0052] A1. Pre-select a characteristic wavelength with a characteristic absorption peak, obtain the spectrum of the detection terminal using a standard light source, calibrate the characteristic wavelength, and obtain a wavelength calibration equation.

[0053] A2. Use the No. 0 detection terminal to obtain the spectral and temperature information of typical and representative agricultural products in batches. Use the wavelength calibration equation corresponding to the No. 0 detection terminal to perform preliminary correction on the wavelength in the spectral information, and then establish a temperature compensation model.

[0054] A3. Obtain the quality indicators of typical and representative samples of the agricultural product (such as soluble solids content, hardness, acidity, etc., soluble solids content is obtained by refractometer, hardness is obtained by physical property instrument, and acidity is obtained by pH meter), extract characteristic wavelengths based on wavelength-corrected spectrum, and establish a detection model based on characteristic wavelengths and quality indicators.

[0055] A4. Use detection terminal 0 and detection terminal 1 to obtain the spectral information of typical and representative samples of batch agricultural products (the spectral information obtained by detection terminal 1 needs to be corrected using the corresponding wavelength calibration equation), and use autoencoder neural network to establish a spectral transfer model.

[0056] A5. The computer uploads the spectral transfer model, temperature compensation model, and detection model to the data server. By calling the temperature compensation model and spectral transfer model, the spectral information of the agricultural product sample is corrected. The detection model is then called to calculate the corrected spectral information to obtain the detection result (i.e., the quality result) of the agricultural product sample.

[0057] A6. When a new detection terminal is added to the IoT monitoring and evaluation system, the spectral information of agricultural product samples is obtained in small batches using the new detection terminal. The spectral information is initially corrected using the corresponding wavelength calibration equation and sent to the computer. The above spectral transfer model is updated using the transfer learning method and uploaded to the data server again to improve its generalization performance.

[0058] A7. At the same time as obtaining the test results, generate the agricultural product sample serial number, extract samples according to the serial number for actual testing, import the actual test results into the data processing unit to calculate the error between the test results and the actual test results, and if the error exceeds the set threshold, then update the test model.

[0059] In step A1, the calibration range is 400-2500nm, and the wavelength calibration equation is Y = a1x 1 +a2x 2 +…+a n x n +b, where Y represents the calibration wavelength, a1, a2…a n x represents the calibration coefficient. 1 x 2 …x n This represents a pre-selected characteristic wavelength, where b is a constant.

[0060] In step A2, the spectral information of typical and representative samples of agricultural products is obtained by detection terminal 0 through diffuse transmission or diffuse reflection; a temperature compensation model for the agricultural product to be tested is established by one or a combination of orthogonal signal correction, dynamic orthogonal projection and external parameter orthogonality.

[0061] In step A3, the method for extracting the feature wavelength includes one or a combination of the following: genetic optimization algorithm, joint interval algorithm, simulated annealing algorithm, ant colony optimization algorithm, and competitive adaptive reweighted sampling algorithm.

[0062] Optionally, the detection model includes a quantitative prediction model or a qualitative discrimination model. The quality index is one or more quality indicators of the agricultural product to be tested, such as one or more of the soluble solids content, firmness, acidity, and vitamin C content of apples, or one or more of the moisture content, fatty acids, and reducing sugars of rice. Each quality index corresponds to a quantitative prediction model or a qualitative discrimination model. A detection model for the quality of the agricultural product to be tested is established using one or a combination of methods such as multiple linear regression, partial least squares, artificial neural networks, principal component analysis, and support vector machines. The establishment process is based on existing technology. The detection model can be customized according to customer needs.

[0063] In the process of establishing the detection model, before extracting the characteristic wavelengths, the absorbance spectrum is automatically corrected and transformed from the total internal reflection spectrum and the dark noise spectrum into an absorbance spectrum (where the total internal reflection spectrum is pre-collected and stored by the photoelectric sensor, and the dark noise spectrum is collected and stored by the photoelectric sensor when the light source is off). A preprocessing method is then used to further correct the absorbance spectrum, removing spectral intervals with a signal-to-noise ratio lower than a preset signal-to-noise ratio at both ends of the absorbance spectrum. The corrected absorbance spectrum is then randomly divided into a training set and a test set at a ratio of 3:1. The preprocessing methods include: smoothing, multivariate scattering correction, standard normal transformation, first derivative, second derivative, or a combination thereof.

[0064] In step A4, the process of establishing a spectral transfer model using an autoencoder neural network is as follows: See Figure 3 The encoder encodes the spectral matrix S1 of detection terminal 1 (composed of detected spectral information) into a low-dimensional latent variable h. The decoder restores the latent variable h of the hidden layer to the spectral matrix S0 of detection terminal 0, so that the neural network learns the difference features between matrix S0 and matrix S1, thereby correcting matrix S1 to matrix S0.

[0065] The encoding process from the input layer to the hidden layer is as follows:

[0066] h=θ1(S1=w1X+b1

[0067] The decoding process from the hidden layer to the output layer is as follows:

[0068] S0=θ2(h=w2X+b2

[0069] Where: 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;

[0070] Therefore, the spectral transfer model contains an encoder and a decoder. The encoder contains a weight matrix w1 and a bias matrix b1, and the decoder contains a weight matrix w2 and a bias matrix b2.

[0071] In step A6, the spectral transfer model is updated using transfer learning. Specifically, the parameter matrix (including the weight matrix and bias matrix) of the autoencoder neural network updated based on detection terminals 0 and 1 is frozen. A new decoder is added, and its parameter matrix is ​​updated using terminal 0 and the new detection terminal. This enhances the robustness of the spectral transfer model with only a small number of samples, enabling the model to be shared across different detection terminals.

[0072] In step A7, the detection model is updated using both active and passive feedback mechanisms: Typical and representative samples are selected for active updating of the detection model at key time points such as after agricultural product harvesting, before warehousing, and before market launch; during the detection process, samples are numbered according to the number of tests conducted, and a certain number (greater than or equal to 30) of samples are dynamically selected as an independent validation set to validate the detection model. If the error between the detection result and the actual measurement result exceeds a pre-set threshold, passive feedback is initiated and the system administrator is alerted, allowing the model to be passively updated using the independent validation set.

[0073] Furthermore, the specific process of model updating is as follows: select representative agricultural product samples from the independent validation set, and then add them to the training set of the established detection model to expand the coverage and variation range of the original detection model samples, thereby improving the adaptability of the detection model and the prediction accuracy of new variety samples.

[0074] This embodiment takes apple futures as an example. It uses the photoelectric detection model transfer and sharing method and the Internet of Things monitoring and evaluation system of the cloud service to acquire near-infrared spectral datasets that characterize apple quality information in batches, establishes an apple quality detection model and spectral transfer and sharing method, and can realize the monitoring and evaluation of apple quality in different production areas.

[0075] The hardware of a handheld detection terminal mainly consists of a broadband LED light source, a near-infrared photoelectric sensor, a temperature sensor, a rechargeable lithium battery, a display screen, a control circuit, a light-shielding ring, rubber gaskets, and a housing. Figure 4 As shown, the built-in positioning module is used to obtain the geographical information of the apple production area. The 4G / 5G module is used to realize the wireless transmission of data and send the data to the data storage unit of the cloud server. At the same time, it is sent to the data processing unit, which calls the photoelectric detection model to transmit the sharing method and detection model for spectral correction and result calculation. After the detection is completed, the detection result is sent back to the display screen of the handheld detection terminal, and the result is sent to the cloud data management platform.

[0076] This embodiment takes multiple handheld detection terminals as an example. The detection model sharing and transmission method is implemented through the following steps:

[0077] A1. Five fixed wavelengths with characteristic absorption peaks are preset, and the calibration range is 400-1100nm. The spectrum of the mercury argon lamp standard light source is obtained using the detection terminal to calibrate the fixed wavelengths and obtain the wavelength calibration equation.

[0078] Wavelength calibration equation for detection terminal #0:

[0079] F0(x)=0.00001615x 3 -0.03863x 2 +31.67x-8089

[0080] Wavelength calibration equation for detection terminal No. 1:

[0081] F1(x) = 0.00001364x 3 -0.03228x 2 +26.34x-6597

[0082] Wavelength calibration equation for detection terminal No. 2:

[0083] F2(x)=0.00001526x 3 -0.03542x 2 +35.71x-8161.

[0084] A2. Using detection terminal 0, obtain diffuse reflectance spectral information and temperature information of typical and representative samples of apples to be tested. Perform preliminary wavelength calibration using the wavelength calibration equation of detection terminal 0, and establish a temperature compensation model using the external parameter orthogonal method.

[0085] The extrinsic parameter orthogonal method, based on principal component analysis, is used to reduce the spatial dimension of extrinsic parameters. Specifically, it projects the spectral information of the apple sample into an orthogonal space to filter out interference.

[0086] The spectral matrix X can be represented as:

[0087] X = X p +X q +R

[0088] Among them, X p X is the projection matrix of the useful part. q R is the projection matrix of the useless part (affected by temperature), and R is the redundant matrix;

[0089] X p The calculation steps are as follows: (1) Collect the spectral information of typical and representative samples of apples to be tested, and obtain the spectral matrix X. i , where X i It is a matrix composed of n×m dimensional spectra, where i=1,2,…p, representing different temperature levels; (2) Calculate the average spectrum x of the i matrices. i x i x represents the average spectrum of all apple samples tested at different temperature levels. i It is a row vector with row number 1 and column number m; (3) Calculate d i =x i -x j Where j is one of 1, 2, ..., p, and is used as a reference temperature, d1, d2, ..., d p(3) Combine them sequentially into the difference spectral matrix D; (4) Calculate the covariance matrix of D and perform singular value decomposition, i.e., SVD(D T D)=USV T (5) Take the first c columns of V to obtain a subset V of matrix V. s Filter out redundant parts. In principle, the singular values ​​in the first c columns account for more than 99% of the total; (6) Calculate the useless partial projection matrix. Then calculate the useful part X of the projection matrix. p =IQ, where I is the identity matrix.

[0090] A3. Obtain quality indicators of typical and representative apple samples, extract characteristic wavelengths based on wavelength-corrected spectra, and establish a detection model based on characteristic wavelengths and quality indicators.

[0091] The soluble solids content of apples was obtained using a refractometer. A competitive adaptive reweighted sampling algorithm was employed to extract 26 characteristic wavelengths. A quantitative prediction model for PLS (Polysoluble Solids Content) was established based on the soluble solids content 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

[0092] Where y is the predicted value of the detection model, and x represents the extracted feature wavelength value.

[0093] A4. Use detection terminals 0 and 1 to obtain the spectral information of typical and representative samples of a batch of apples to be tested (the spectral information obtained by detection terminal 1 needs to be corrected using the corresponding wavelength calibration equation). Using an autoencoder neural network, the encoder encodes the spectral matrix S1 of detection terminal 1 into a low-dimensional latent variable h, and the decoder restores the latent variable h of the hidden layer to the spectral matrix S0 of detection terminal 0, so that the neural network learns the difference features between matrix S0 and matrix S1, thereby correcting S1 to S0 and establishing a spectral transfer model.

[0094] A5. Upload the spectral transfer model, temperature compensation model, and detection model to the cloud server. The detection terminal obtains the spectral information of the apple to be tested, performs spectral correction by calling the temperature compensation model and spectral transfer model, and calculates the 26 characteristic wavelengths after correction by calling the detection model. The detection results are transmitted back to the detection terminal display screen in real time.

[0095] A6. Use detection terminal No. 2 to acquire the spectral information of apple samples to be tested in small batches and use the corresponding wavelength calibration equation for correction. Use transfer learning method to continuously update the detection model and improve the generalization performance of the spectral transfer model.

[0096] A7. When using detection terminal No. 2 to conduct apple sampling inspection, the apple samples to be tested are numbered, and the independent sample set for sampling inspection is set to 30. The data generation unit automatically generates 30 serial numbers. The user performs actual measurement of the soluble solids content of the apples according to the corresponding serial numbers and uploads the data. The data processing unit calculates the error. If the error exceeds the set threshold, the detection model is automatically updated. If the error does not exceed the threshold, the model continues to be used.

[0097] Although embodiments of the invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations all fall within the scope defined by the appended claims.

Claims

1. A method for transferring and sharing photoelectric detection models in cloud services, characterized in that: Using the No. 0 detection terminal, spectral and temperature information of typical and representative agricultural product samples were acquired in batches, and a temperature compensation model was established. The quality indicators of typical and representative samples of the agricultural products are obtained, and characteristic wavelengths are extracted based on the wavelength-corrected spectrum. A detection model is established based on the characteristic wavelengths and the quality indicators. The spectral information of typical and representative samples of a batch of agricultural products was obtained using detection terminals 0 and 1, and then a spectral transfer model was established using an autoencoder neural network. The spectral information of agricultural product samples is corrected by calling the temperature compensation model and the spectral transfer model, and the detection model is called to calculate the corrected spectral information to obtain the detection results of agricultural product samples. The process of establishing a spectral transfer model using an autoencoder neural network is as follows: The encoder encodes the spectral matrix S1 of detection terminal 1 into a low-dimensional latent variable h, and the decoder restores the latent variable h of the hidden layer to the spectral matrix S0 of detection terminal 0, so that the neural network learns the difference features between matrix S0 and matrix S1, thereby correcting matrix S1 to matrix S0. The encoding process from the input layer to the hidden layer is as follows: The decoding process from the hidden layer to the output layer is as follows: in: This is the weight matrix for the encoding process. This is the weight matrix for the decoding process. For the encoding process, This is a function for the decoding process. This is the bias matrix of the encoding process. This is the deviation matrix for the decoding process. Represents the spectral matrix; The spectral transfer model includes an encoder and a decoder, with the encoder containing a weight matrix. Sum and deviation matrix The decoder contains a weight matrix Sum and deviation matrix ; The photoelectric detection model transfer and sharing method also includes using the new detection terminal to acquire spectral information of agricultural product samples in small batches when a new detection terminal is added, and using transfer learning method to update the spectral transfer model; The method of updating the spectral transfer model using transfer learning specifically involves: freezing the parameter matrix of the autoencoder neural network updated based on detection terminal 0 and detection terminal 1, adding a new decoder, and updating the parameter matrix of the new decoder using terminal 0 and the new detection terminal. While obtaining the test results, an agricultural product sample serial number is generated. Samples are extracted according to the serial number for actual testing. The error between the test results and the actual test results is calculated. If the error exceeds a set threshold, the test model is updated. The detection model is updated using both active and passive feedback mechanisms. The active feedback mechanism involves selecting representative samples at key time points—after agricultural product harvesting, before storage, and before market launch—to actively update the detection model. The passive feedback mechanism involves numbering samples according to the number of tests conducted during the detection process, dynamically selecting a certain number of samples to set as an independent validation set to validate the detection model, and updating the model using the independent validation set if the error between the detection result and the actual measurement result exceeds a pre-set threshold.

2. The photoelectric detection model transfer and sharing method according to claim 1, characterized in that, The specific process of updating the model is as follows: select representative agricultural product samples from the independent validation set and then add them to the training set of the established detection model.

3. The photoelectric detection model transfer and sharing method according to claim 1, characterized in that, The wavelengths in the spectral information acquired by the detection terminal are corrected using a wavelength calibration equation.

4. The photoelectric detection model transfer and sharing method according to claim 3, characterized in that, The wavelength calibration equation is obtained by: pre-selecting a characteristic wavelength with a characteristic absorption peak, obtaining the spectrum of the detection terminal using a standard light source, calibrating the characteristic wavelength, and obtaining the wavelength calibration equation.

5. An Internet of Things (IoT) monitoring and evaluation system, characterized in that, include: At least one detection terminal acquires information about the agricultural product sample to be tested, including spectral information, temperature information, and geographical information; The data server, after performing spectral information correction using the transmission and sharing method described in any one of claims 1-4, calls the detection model for calculation, and the detection results are transmitted back to the detection terminal in real time; the transmission and sharing method and the detection model are established by the detection terminal acquiring spectral information of typical and representative samples of agricultural products in batches, and the detection model is updated in real time using active feedback and passive feedback mechanisms; A cloud-based data management platform is used for displaying test results and controlling the testing terminals.

6. The Internet of Things monitoring and evaluation system according to claim 5, characterized in that, The detection terminal includes a light source, sensors, a positioning module, and a control module. The light source provides the active light required for detecting agricultural product samples. The sensors include photoelectric sensors and temperature sensors. The positioning module acquires the geographical information of the detection terminal's location. The control module controls the operation of the entire detection terminal and has the functions of photoelectric signal conversion, data display, and transmission.

7. The Internet of Things monitoring and evaluation system according to claim 5, characterized in that, The detection terminal includes one or more combinations of handheld, portable, vehicle-mounted, and online types.