Portable dual-mode spectrum detection device and method for quality indexes of agricultural and animal products

Through the portable dual-mode spectral detection device and deep learning spectral fusion model, the problems of expensive equipment, complex data processing and poor model versatility in agricultural and livestock product quality detection are solved, and a fast, accurate and low-cost detection effect is achieved.

CN119935907APending Publication Date: 2025-05-06SHIHEZI UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411792518.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-07
Publication Date
2025-05-06

AI Technical Summary

Technical Problem

The prior art has problems such as expensive equipment, complex data processing and poor model versatility in the quality inspection of agricultural and livestock products, which is difficult to meet the needs of green, real-time, accurate and non-destructive testing.

Method used

The portable dual-mode spectral detection device is adopted to collect the reflection spectrum and fluorescence spectrum of agricultural and animal products through spectral sensors, and an end-to-end spectral fusion detection model is established in combination with deep learning methods to achieve rapid and accurate detection of agricultural and animal product quality indicators.

Benefits of technology

It realizes quality inspection of agricultural and livestock products with low equipment cost, fast detection speed, high model accuracy and robustness, which can effectively solve the shortcomings of traditional testing methods, and provides technical support and theoretical reference to the field of food testing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119935907A_ABST
    Figure CN119935907A_ABST
Patent Text Reader

Abstract

The invention relates to a portable dual-mode spectrum detection device and a portable dual-mode spectrum detection method for quality indexes of agricultural and livestock products, in particular to a method for detecting the quality indexes of the agricultural and livestock products by utilizing a self-developed portable dual-mode spectrum detection device and a spectrum fusion model. The quality indexes of the agricultural and animal products include but are not limited to total volatile basic nitrogen (TVB N) and total colony count (TVC), tenderness, hardness, sugar degree, maturity and freshness; the portable dual-mode spectrum detection device comprises a spectrum sensor, a reflection spectrum light source, a fluorescence excitation light source, a collimating lens, an optical fiber, an optical fiber connecting base, a lifting platform, a sample platform, a cooling fan, a power supply module, a data acquisition and analysis module and a display screen, the novel dual-mode spectrum acquisition and detection device is developed, molecular vibration information and fluorophore information are effectively fused, quality indexes of agricultural and animal products can be rapidly and accurately detected, and the developed detection device is easy to operate, good in portability and low in cost and has high market popularization and application value.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of nondestructive detection of agricultural and livestock product quality, and specifically relates to a portable dual-mode spectrum detection device and method for agricultural and livestock product quality indicators. Background Art

[0002] With the continuous growth of population and the increasing complexity of the agricultural and livestock product supply chain, ensuring the nutritional quality and safety quality of agricultural and livestock products has become a global challenge. Usually, agricultural and livestock products need to go through many processes such as transportation, storage, processing, and sales before reaching the consumer's table. In this process, food quality and safety problems such as quality deterioration, microbial contamination, and harmful substance residues are prone to occur. Food safety accidents not only threaten people's health, but also have a negative impact on the development of the agricultural and livestock product industry and economic stability. Therefore, it is particularly important to accurately assess the quality and safety of agricultural and livestock products. However, the traditional physical and chemical analysis methods commonly used to detect and characterize the quality indicators of agricultural and livestock products have achieved good detection results, but usually require chemical reagents, have a long detection cycle, and are destructive, which is difficult to meet the current agricultural and livestock product supply chain requirements for green, real-time, accuracy, and non-destructiveness. In this case, the use of rapid detection technology can quickly and comprehensively detect the quality of agricultural and livestock products, thereby improving the quality and safety of agricultural and livestock products. In recent years, non-destructive technologies such as machine vision and electronic nose have been widely used to detect the quality of agricultural and livestock products, gradually replacing traditional physical and chemical testing methods, but there are still different disadvantages. For example, machine vision can only obtain the surface color and texture information of the sample to be tested, and the detection accuracy is low. The electronic nose detection equipment is expensive and easily affected by temperature and humidity, and the detection time is long. Therefore, it is crucial to develop a fast and accurate agricultural and livestock product quality detection device.

[0003] Spectroscopic technology is a detection method based on the reflection and reflection characteristics of materials to light of different wavelengths. It can quickly and contactlessly detect changes in the internal and external components of the sample to be tested, and has gradually become an effective means to evaluate the quality of agricultural and livestock products. Among them, visible near-infrared spectroscopy, hyperspectral imaging, and fluorescence hyperspectral imaging have been used to detect the quality of agricultural and livestock products such as storage quality indicators, harmful substance residues, and internal lesions in fruits. However, expensive equipment and massive data restrict the market application of spectral technology. Spectral sensors have the advantages of small size and low cost, and the spectral detection system developed based on spectral sensors has the advantages of good portability and fast detection speed, showing good application prospects in the fields of agriculture and food detection. However, the information obtained from the spectral data of a single band or a single mode is limited, which is also the main reason for the unsatisfactory prediction results of the single band or single mode spectrum. In addition, for the analysis and processing of spectral data, the spectral data analysis and fusion methods based on feature engineering and traditional machine learning have the disadvantages of being time-consuming and labor-intensive, and being greatly affected by subjective factors, resulting in the lack of universality of the established model, and the accuracy and stability of the model are difficult to guarantee. Therefore, it is necessary to combine deep learning methods to establish an end-to-end spectral fusion detection model that integrates feature extraction and fusion. Summary of the invention

[0004] The purpose of the present invention is to provide a portable dual-mode spectral detection device and method for agricultural and livestock product quality indicators. Agricultural and livestock products of different qualities have different internal components and external colors and textures. These differences will cause their spectral reflection characteristics and fluorescence characteristics to show different degrees of differences. By collecting the reflection spectrum and fluorescence spectrum of agricultural and livestock products, and establishing an end-to-end spectral fusion detection model for predicting agricultural and livestock product quality indicators, the present invention aims to solve the problems of expensive equipment required for spectral detection of agricultural and livestock product quality indicators, complex data processing, and poor model versatility.

[0005] The technical solution adopted by the present invention is as follows: A portable dual-mode spectral detection device and method for agricultural and livestock product quality indicators, characterized by: building a dual-mode spectral detection device for agricultural and livestock product quality indicator detection, preparing modeling samples, obtaining the reflection spectrum and fluorescence spectrum of the sample through the built portable dual-mode spectral detection device, establishing a spectral fusion model for predicting agricultural and livestock sample quality indicators, transplanting detection software, and then using the developed portable dual-mode spectral detection device to detect agricultural and livestock product quality indicators; The portable dual-mode spectral detection device for agricultural and livestock product quality indicators comprises: a spectral sensor, a reflection spectrum light source, a fluorescence excitation light source, a collimating lens, an optical fiber, an optical fiber connection base, a lifting platform, a sample platform, a cooling fan, a power module, a data acquisition and analysis module, and a display screen; the lifting platform is used to adjust the collection height; the sample platform is located above the lifting platform and is used to place the sample to be tested; the cooling fan is used to dissipate the heat generated by the operation of the device; the power module provides stable power for the device; the spectral sensor is connected to the collimating lens through the optical fiber, and the diffuse reflected light emitted by the reflection spectrum light source irradiating the sample and the emitted fluorescence generated by the sample under the excitation of the fluorescence excitation light source are transmitted to the spectral sensor through the collimating lens and the optical fiber; the optical fiber connection base is used to connect the light and the spectral sensor; the data acquisition and analysis module is used to collect spectral data and preprocess, and call the fusion model to detect the quality indicators of the sample to be tested; the display screen is used for human-computer interaction and result display; the detection software is used for acquisition parameter setting, data preprocessing, model calling and reasoning, result display and storage; The specific steps of establishing the spectral fusion model for agricultural and livestock product quality indicators are as follows: Step 1: Obtain and prepare farm animal samples of different qualities; Step 2: Place the sample to be tested on the sample stage, determine the acquisition height and light source angle, set the acquisition parameters, and use the developed dual-mode spectrum detection device to collect the original reflection spectrum data and fluorescence spectrum data of different positions of the sample to obtain representative original spectrum data; Step 3: Determine the reference value of agricultural and livestock product quality indicators through physical and chemical experiments on the samples to be tested after collecting the original spectral data; Step 4: Preprocess the collected raw spectral data to obtain representative reflectance spectra and fluorescence spectra after preprocessing; Step 5: Divide the obtained representative reflectance spectrum and fluorescence spectrum data sets into training set, validation set and test set according to independent samples; Step 6: Use the training set spectral data to train the fusion model to determine the coefficient (R 2 ), root mean square error (RMSE) and relative prediction deviation (RPD) are used as evaluation indicators of the fusion model. 2 When the RPD is greater than 0.8 and 2, respectively, the model is proved to be applicable, the model structure and parameters are determined and saved, and the detection software is transplanted; The method and specific steps of using the developed portable dual-mode spectral detection device to detect the quality indicators of agricultural and livestock products are as follows: Step A: obtaining and preparing the sample to be tested; Step B: Open the detection software to preheat the device, determine the acquisition height and light source angle, and set the acquisition parameters; Step C: Collecting spectral data: placing the sample to be tested on the sample stage, turning on the reflective light source, and collecting raw reflective spectral data of multiple positions on the sample to be tested; turning off the reflective light source, turning on the fluorescent excitation light source, and collecting raw fluorescent spectral data of multiple positions on the sample to be tested; Step D: preprocessing the collected spectral data to obtain representative reflection spectra and fluorescence spectra of the sample to be tested; Step E: Input the representative reflection spectrum and fluorescence spectrum into the transplanted model, and the detection software outputs and displays the detection results of the quality indicators of the samples to be tested.

[0006] The portable dual-mode spectral detection device for agricultural and livestock product quality indicators is characterized in that: the spectral sensor includes but is not limited to a single visible spectrum sensor, a single ultraviolet-visible spectrum sensor, a combination of a visible or ultraviolet-visible spectrum sensor and a near-infrared spectrum sensor; the optical fiber includes but is not limited to a single-branch optical fiber; the reflective spectrum light source and the fluorescent excitation light source are both plug-in lamp cups with adjustable angles and replaceable lamps; the adjustable range of the light source irradiation angle is 0°~45°; the reflective spectrum light source covers a wavelength range of 200-2500 nm; the excitation wavelength of the fluorescent excitation light source includes but is not limited to 350 nm, 365nm, 380 nm, 395 nm, and 405 nm; the lifting platform is a height-adjustable Z-axis displacement platform for adjusting the collection height; the sample stage is used to place samples to be tested, including but not limited to trays, which can be replaced according to the shape of the samples to be tested; the cooling fan has a size of 40 mm×40 mm, a rotation speed of 2000 rpm, and a rated voltage of 12 V; the power module is a replaceable, reusable lightweight lithium battery with an output voltage of 12 V; the data acquisition and analysis module uses a microcomputer; the display uses a 7-inch high-definition display screen.

[0007] In the above step 4 and step D, the preprocessing includes but is not limited to smoothing filtering, correction, differentiation, and integration; wherein, in order to reduce the dark current and background interference of the system, the collected spectral data is corrected using formula 1, where: R is the original spectrum, B is the black reference spectrum, W is the white reference spectrum, R C The corrected spectrum .

[0008] In the above step six, when constructing the spectral fusion model, it is considered that traditional spectral analysis includes: preprocessing method, wavelength extraction method and model establishment, and their "golden combination" is difficult to determine, lacks universality, and accuracy and stability are difficult to guarantee; the present invention uses a deep learning algorithm to establish an end-to-end spectral fusion model; the optional fusion strategies include: data layer fusion, feature layer fusion and decision layer fusion; the model architecture includes two one-dimensional convolutional neural network branches (input layer and convolution layer), fusion layer and output layer (fully connected layer and Regression layer), which are used to extract and fuse reflectance spectrum features and fluorescence spectrum features; the spectral features are fused at the end of each branch feature extraction, and the fused spectral features are fed to the fully connected layer, and the quality index detection results are output through the Regression layer; the spectral feature fusion method includes but is not limited to direct splicing, weighting and summation; the size of the input layer of a single spectral branch of the model is 1× N ( N is the spectral dimension of the sensor), the convolutional layer is stacked with residual blocks; the sizes of the fully connected layers are 512 and 1 respectively, the activation function and optimizer are determined to be ReLu and Adam respectively. During training, the maximum number of iterations is set to 300. Through multiple rounds of learning, the model structure, optimal learning rate and batch size are determined.

[0009] Compared with the prior art, the present invention has the following advantages: First, the dual-mode spectrum detection device of the present invention has the advantages of green operation, rapidity, low cost, good portability and easy promotion; Second, the spectrum fusion model of the present invention can automatically and parallelly extract dual-mode spectrum features, has the advantages of high precision and strong robustness, and can effectively extract and fuse dual-mode spectra and achieve accurate prediction; Third, the present invention provides technical support and theoretical reference for the prediction of agricultural and livestock product quality indicators and the development of low-cost, miniaturized spectral systems. It also provides new ideas and methods for the fusion of reflectance spectroscopy and fluorescence spectroscopy in other food detection fields. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] Figure 1 Schematic diagram of a dual-mode spectrum detection system according to Embodiment 1 of the present invention; Figure 2 The reflectance spectrum curves and fluorescence spectrum curves involved in Example 1 and Example 2 of the present invention are: (a) reflectance spectrum curves of all samples; (b) fluorescence spectrum curves of all samples; (c) average reflectance spectrum curves of different TVB-N contents; (d) average fluorescence spectrum curves of different TVB-N contents; (e) average reflectance spectrum curves of different TVC contents; (f) average fluorescence spectrum curves of different TVC contents; Figure 3 This is a diagram of the architecture of a spectral fusion model based on a data layer fusion method according to Embodiment 2 of the present invention; Figure 4 This is a diagram of the architecture of a spectral fusion model based on a feature layer fusion method according to Embodiment 2 of the present invention; The symbols in the accompanying drawings are explained as follows: 1: spectral sensor; 2: optical fiber connection base; 3: data acquisition and analysis module; 4: display screen; 5: collimating lens; 6: reflected spectrum light source; 7: light source angle adjustment knob; 8: lifting platform; 9: housing; 10: sample table; 11: fluorescence excitation light source; 12: optical fiber; 13: cooling fan; 14: power module. DETAILED DESCRIPTION

[0011] In order to make the purpose and advantages of the present invention more clear, the present invention is further described below in conjunction with specific embodiments.

[0012] Example 1: A portable dual-mode spectral detection device and method for agricultural and livestock product quality indicators, structure of a portable dual-mode spectral detection device and its use Part A: A portable dual-mode spectral detection device and method for agricultural and livestock product quality indicators Portable dual-mode spectral detection device structure Figure 1 It is a schematic diagram of a portable dual-mode spectral detection device for agricultural and livestock product quality indicators. Figure 1 As shown, the portable dual-mode spectral detection device for agricultural and livestock product quality indicators includes: a spectral sensor 1, a reflection spectrum light source 6, a fluorescence excitation light source 11, a light source angle adjustment knob 7, a collimating lens 5, an optical fiber 12, an optical fiber connection base 2, a lifting platform 8, a sample platform 10, a cooling fan 13, a power module 15, 3 data acquisition and analysis modules, and 4 display screens; the lifting platform 8 adjusts the collection height; the sample platform 10 is fixed on the lifting platform for placing samples to be tested; the cooling fan 13 is used to dissipate the heat generated by the device; the power module 14 provides stable power for the device; the spectral sensor 1 is connected to the collimating lens 5 through the optical fiber 12 and the optical fiber connecting base 2, the diffuse reflected light emitted by the sample irradiated by the reflected spectrum light source 6 and the emitted fluorescence generated by the sample under the excitation of the fluorescence excitation light source 11 are transmitted to the spectrum sensor 1 through the collimating lens 5 and the optical fiber; the light source angle adjustment knob 7 is used to adjust the light source irradiation angle; the data acquisition and analysis module 3 is used to collect spectrum data and preprocess, and call the fusion model to detect the quality index of the sample to be tested; the display screen 4 is used for human-computer interaction and result display; the detection software is used for acquisition parameter setting, data preprocessing, model calling and reasoning, result display and storage.

[0013] Specifically, according to the position of the fluorescence emission peak related to the quality of agricultural and livestock products, the spectral sensor uses a spectral sensor with a working wavelength range of 340-850 nm, a small size (20.1 mm × 12.5 mm × 10.1 mm), and a light weight (about 5 g); the reflective spectrum light source uses a halogen lamp with a rated power of 35 W, a rated voltage of 12 V, and a wavelength range of 200-2500 nm; the fluorescence excitation light source is preferably a UV lamp with an excitation wavelength of 365 nm, a rated power of 10 W, and a rated voltage of 12 V according to the fluorescence excitation and emission peak positions related to the freshness of mutton; the optical fiber 13 is a single-branch optical fiber with a core diameter of 600 μm; the optical fiber connection base is SMA905; the cooling fan has a size of 40 mm×40 mm, a rotation speed of 2000 rpm, and a rated voltage of 12 V; the power module is a lightweight lithium battery with a capacity of 9800 mAh and an output voltage of 12 V; the sample stage is a height-adjustable Z-axis lifting stage; the data acquisition and analysis module uses a microcomputer; the display uses a 7-inch high-definition display screen.

[0014] Part b: A portable dual-mode spectral detection device and method for agricultural and livestock product quality indicators The steps for using the portable dual-mode spectral detection device are as follows: b1. First, open the acquisition software and preheat it for 5-10 minutes to reduce the influence of dark current and environmental noise; b2. Click the "Collect" button on the software interface. The collected spectrum is saved as black reference spectrum data. b3. Adjust the angle of the halogen light source and the fluorescent excitation light source to 30° with the surface of the sample stage. At the same time, turn on the halogen light source and preheat it for 5-10 minutes to stabilize the light source to reduce the impact of uneven light. b4. Place the standard reflective white plate in the center of the sample stage in the sample chamber (directly below the collimating lens), keep the distance between its upper surface and the collimating lens at 10 cm, and set the integration time to 150 ms. At this time, the intensity of the collected spectral signal is appropriate and not easy to be exposed. The collected white plate data is saved as white reference spectral data; b5. Place the prepared sample in the center of the sample stage, click the "Collect" button on the software interface to collect the reflectance spectrum of the sample. The software interface can display the collected reflectance spectrum data in real time. Click the "Save" button to save the collected reflectance spectrum data according to the preset path. By moving the sample, the reflectance spectrum data of different points of the sample can be obtained; b6. Turn off the halogen lamp, turn on the UV lamp, set the integration time to 500 ms, click the "Collect" button on the software interface to collect the fluorescence spectrum of the same sample. The software interface can display the collected fluorescence spectrum data in real time, and click the "Save" button to save the collected fluorescence spectrum data according to the preset path. By moving the sample, the fluorescence spectrum data of different points of the same sample can be obtained; b7. Load the white reference spectrum, black reference spectrum and original spectrum in the spectrum processing interface of the host computer to perform black and white correction, obtain the corrected spectrum, and obtain the representative reflection spectrum data and fluorescence spectrum data of the same sample by averaging multiple points. The corrected reflection spectrum and fluorescence spectrum are as follows: Figure 2 shown.

[0015] Example 2: Dual-mode spectral fusion model of a portable dual-mode spectral detection device and method for agricultural and livestock product quality indicators Part c: Establishing a spectral fusion model for predicting mutton freshness indicators TVB-N and TVC c1. Sample preparation The experimental materials were lamb front leg and lamb hind leg meat. First, the obvious fascia and tissue of the lamb leg meat after acid drainage were removed, and it was divided into lamb samples with a shape of 50 × 40 × 10 mm and a weight of about 30 g. The lamb samples were placed on a fresh food tray made of PP food grade material and covered with food grade plastic wrap and stored in a -3±1 ℃ refrigerator. The samples were divided based on the number of days. In order to ensure the representativeness and balance of the samples, 20 samples were collected on the first day and every five days in the first 30 days, and 40 samples were collected every five days in the next 30 days, for a total of 60 days, totaling 380 (380 = 7×20 + 6×40) lamb samples.

[0016] c2. Collect the reflectance spectrum and fluorescence spectrum of the sample The portable dual-mode spectrum detection device includes: a spectrum sensor, a reflection spectrum light source, a fluorescence excitation light source, a collimating lens, an optical fiber, a sample stage, a cooling fan, a power module, a data acquisition and analysis module, and a display screen; First, open the acquisition software and turn on the halogen lamp at the same time, and preheat it for 5-10 minutes;

[0017] Place the prepared sample in the center of the sample stage, click the "Collect" button on the software interface to collect the reflectance spectrum of the sample, and click the "Save" button to save the collected visible spectrum data according to the preset path. By moving the sample, you can obtain the reflectance spectrum data of different points of the sample;

[0018] Turn off the halogen lamp, turn on the UV lamp, set the integration time to 500 ms, click the "Collect" button on the software interface to collect the fluorescence spectrum of the same sample, and click the "Save" button to save the collected fluorescence spectrum data according to the preset path. By moving the sample, you can obtain the fluorescence spectrum data of different points of the same sample;

[0019] Load the white reference spectrum, black reference spectrum and original spectrum in the spectrum processing interface for black and white correction, obtain the corrected spectrum, and obtain representative reflectance spectrum data and fluorescence spectrum data of the same sample by multi-point averaging.

[0020] c3. Sample data division In this study, a total of 380 mutton samples were prepared, each of which corresponded to one representative visible spectrum and one representative fluorescence spectrum. All samples were independently divided into training set, validation set and external test set. First, the model was trained using the training set, then the model parameters were adjusted according to the validation set to obtain a more accurate model, and finally the model stability was tested and evaluated using the external test set. Among them, the samples collected every day were divided into training set, validation set and test set in a ratio of 7:2:1. Therefore, the number of samples contained in the training set, validation set and test set were 266, 76 and 38, respectively.

[0021] c4. Determination of spectral fusion model structure According to the demand for predicting the freshness index of mutton, firstly, a dual-mode spectral data layer fusion model is established with the fused spectral data obtained by splicing representative reflectance spectra and fluorescence spectra as input. The model architecture includes: an input layer, multiple basic residual blocks, a fully connected layer and a Regression layer; the size of the input layer is 1×346, and the input layer contains a convolution layer, a batch normalization layer and a maximum pooling layer; each residual block includes two residual layers, each residual layer realizes nonlinear mapping by connecting the ReLu activation function, and each residual layer contains two layers of convolution, and the sizes of the fully connected layers are 512 and 1 respectively. In addition, a dual-mode spectral feature layer fusion network is proposed with representative reflectance spectral data and fluorescence spectra as the input of the two spectral branches respectively. A single spectral branch consists of an input layer, multiple basic residual blocks, a fully connected layer and a Regression layer; the size of the input layer is 1×173, and the input layer contains a convolution layer, a batch normalization layer and a maximum pooling layer; each residual block includes two residual layers, each residual layer realizes nonlinear mapping by connecting the ReLu activation function, each residual layer contains two layers of convolution, and the sizes of the fully connected layers are 512 and 1 respectively; the number of residual blocks directly affects the feature extraction ability and computational complexity of the network. Therefore, the influence of the number of residual blocks (1, 2, 3 and 4) on the prediction results of the fusion model is discussed. During model training, the maximum number of iterations is set to 300, and the optimizer selects Adam. The prediction results of the dual-mode spectral data layer and feature layer fusion model based on different numbers of residual blocks for TVB-N and TVC content are shown in Table 1;

[0022] As shown in Table 1, by comparing the prediction models based on different numbers of residual blocks, it can be found that as the number of residual blocks increases, the prediction performance of the fusion model increases. This is because the increase in residual blocks improves the network's ability to learn and extract deep effective features. When the full-band reflectance spectrum and fluorescence spectrum are used as input, the TVB-N and TVC prediction models based on three residual blocks have achieved relatively high training, validation and test results. When the number of residual blocks is 3, and the learning rate and Mini-batch combination is (0.0001, 16), for the independent test set, the dual-mode spectral data layer fusion model predicts the R of TVB-N. 2 , RMSE and RPD were 0.849, 3.075 and 2.576 respectively; the R of the dual-mode spectral data layer fusion model for predicting TVC 2 , RMSE and RPD were 0.856, 0.698 and 2.701 respectively; the dual-mode spectral feature layer fusion model predicted the R 2 , RMSE and RPD were 0.871, 2.843 and 2.786 respectively; the R of the dual-mode spectral feature layer fusion model for predicting TVC2 , RMSE and RPD are 0.863, 0.691 and 2.701 respectively. From the comparison results, it can be seen that the feature layer fusion model obtains better results than the data layer fusion model in predicting TVB-N content and TVC content. The possible reason is that the fusion data obtained based on data layer fusion has a higher dimension and contains mixed background and environmental noise from different light sources. The architectures of the spectral data layer fusion model and the spectral feature layer fusion model are as follows: Figure 3 and Figure 4 shown.

[0023] The present invention uses two embodiments to explain the operating procedures of a portable dual-mode spectral detection device and method for agricultural and livestock product quality indicators from the perspectives of the structure and use of the detection device, and the establishment of a dual-mode spectral fusion model. It can be seen from the detection results that the present invention optimizes and establishes an end-to-end dual-mode spectral fusion model by making full use of the differences in meat reflection characteristics and fluorescence characteristics caused by changes in meat quality due to microbial growth during meat storage. The model can extract and fuse important and complementary features in the reflection spectrum and fluorescence spectrum without manual participation in feature extraction and fusion, thereby achieving accurate prediction of mutton storage quality indicators during storage, and providing theoretical reference and technical support for the prediction of other agricultural and livestock product quality indicators and the development of portable and miniaturized spectral detection systems.

[0024] The detection device based on different miniaturized sensors (image, mechanics and acoustics) and its fused sensor information can be used to detect other food quality indicators, and the detection method and detection process proposed in the present invention can be used for operation.

[0025] The above implementation modes are only used to illustrate the present invention and are not used to limit the present invention. Any modifications, equivalent substitutions and improvements made on the basis of the technical essence of the present invention within the spirit and principles of the present invention shall be included in the scope of the present invention. The patent protection scope of the present invention is defined by the claims.

Claims

1. A portable dual-mode spectral detection device and method for agricultural and livestock product quality indicators, characterized in that: Build a dual-mode spectral detection device for detecting agricultural and livestock product quality indicators, prepare modeling samples, obtain the reflectance spectrum and fluorescence spectrum of the samples through the built portable dual-mode spectral detection device, establish a spectral fusion model for predicting agricultural and livestock sample quality indicators, transplant the detection software, and then use the developed portable dual-mode spectral detection device to detect agricultural and livestock product quality indicators; The portable dual-mode spectral detection device for agricultural and livestock product quality indicators comprises: a spectral sensor, a reflection spectrum light source, a fluorescence excitation light source, a collimating lens, an optical fiber, an optical fiber connection base, a lifting platform, a sample platform, a cooling fan, a power module, a data acquisition and analysis module, and a display screen; the lifting platform is used to adjust the collection height; the sample platform is fixed above the lifting platform for placing the sample to be tested; the cooling fan is used to dissipate the heat generated by the operation of the device; the power module provides stable power for the device; the spectral sensor is connected to the collimating lens through the optical fiber, and the diffuse reflected light emitted by the reflection spectrum light source irradiating the sample and the emitted fluorescence generated by the sample under the excitation of the fluorescence excitation light source are transmitted to the spectral sensor through the collimating lens and the optical fiber; the optical fiber connection base is used to connect the light and the spectral sensor; the data acquisition and analysis module is used to collect spectral data and preprocess, and call the fusion model to detect the quality indicators of the sample to be tested; the display screen is used for human-computer interaction and result display; the detection software is used for acquisition parameter setting, data preprocessing, model calling and reasoning, result display and storage; The specific steps of establishing the spectral fusion model for agricultural and livestock product quality indicators are as follows: Step 1: Obtain and prepare farm animal samples of different qualities; Step 2: Place the sample to be tested on the sample stage, determine the acquisition height and light source angle, set the acquisition parameters, and use the developed dual-mode spectrum detection device to collect the reflection spectrum data and fluorescence spectrum data of different positions of the sample to obtain the original spectrum data; Step 3: Determine the reference value of agricultural and livestock product quality indicators through physical and chemical experiments on the samples to be tested after collecting the original spectral data; Step 4: Preprocess the collected raw spectral data to obtain representative reflectance spectra and fluorescence spectra after preprocessing; Step 5: Divide the obtained representative reflectance spectrum and fluorescence spectrum data sets into training set, validation set and test set according to independent samples; Step 6: Use the training set spectral data to train the fusion model to determine the coefficient (R 2 ), root mean square error (RMSE) and relative prediction deviation (RPD) are used as evaluation indicators of the fusion model. 2 When the RPD is greater than 0.8 and 2, respectively, the model is proved to be applicable, the model structure and parameters are determined and saved, and the detection software is transplanted; The method and specific steps of using the developed portable dual-mode spectral detection device to detect the quality indicators of agricultural and livestock products are as follows: Step A: obtaining and preparing the sample to be tested; Step B: Open the detection software to preheat the device, determine the acquisition height and light source angle, and set the acquisition parameters; Step C: Collecting spectral data: placing the sample to be tested on the sample stage, turning on the reflective light source, and collecting raw reflective spectral data of multiple positions on the sample to be tested; turning off the reflective light source, turning on the fluorescent excitation light source, and collecting raw fluorescent spectral data of multiple positions on the sample to be tested; Step D: preprocessing the collected spectral data to obtain representative reflection spectra and fluorescence spectra of the sample to be tested; Step E: Input the representative reflection spectrum and fluorescence spectrum into the transplanted model, and the detection software outputs and displays the detection results of the quality indicators of the samples to be tested.

2. A portable dual-mode spectrum detection device for agricultural and livestock product quality indicators according to claim 1, characterized in that: Spectral sensors include but are not limited to a single visible spectrum sensor, a single ultraviolet-visible spectrum sensor, a combination of a visible or ultraviolet-visible spectrum sensor and a near-infrared spectrum sensor; optical fibers include but are not limited to single-branch optical fibers and Y-type splitter optical fibers; both the reflective spectrum light source and the fluorescent excitation light source are pluggable lamp cups with adjustable angles and replaceable lamps; the adjustable range of the light source irradiation angle is 0°~45°; the reflective spectrum light source covers a wavelength range of 200-2500 nm; the excitation wavelength of the fluorescent excitation light source includes but is not limited to 350 nm, 365 nm, 380 nm, 395 nm, and 405 nm; the lifting platform is a height-adjustable Z-axis displacement platform for adjusting the collection height; the sample stage is used to place the samples to be tested, including but not limited to trays, which can be replaced according to the shape of the samples to be tested; the cooling fan has a size of 40 mm×40 mm, a rotation speed of 2000 rpm, and a rated voltage of 12 V; the power module is a replaceable, reusable lightweight lithium battery with an output voltage of 12 V; a microcomputer is used for the data acquisition and analysis module; and a 7-inch high-definition display is used for the display.

3. The portable dual-mode spectrum detection device and method for agricultural and livestock product quality indicators according to claim 1, characterized in that: In the above step 4 and step D, the preprocessing includes but is not limited to smoothing filtering, correction, differentiation, and integration; wherein, in order to reduce the system dark current and background interference, the collected spectral data is corrected using formula 1, where: R is the original spectrum, B is the black reference spectrum, W is the white reference spectrum, R C is the corrected spectrum, .

4. The portable dual-mode spectrum detection device and method for agricultural and livestock product quality indicators according to claim 1, characterized in that: In the above step six, when constructing the spectral fusion model, considering that traditional spectral analysis includes: preprocessing method, wavelength extraction method and model establishment, their "golden combination" is difficult to determine, lacks versatility, and accuracy and stability are difficult to guarantee; the present invention uses a deep learning algorithm to establish an end-to-end spectral fusion model; the optional fusion strategies include: data layer fusion, feature layer fusion and decision layer fusion; the model architecture includes two one-dimensional convolutional neural network branches (input layer and convolution layer), fusion layer and output layer (fully connected layer and regression layer), which are used to extract and fuse reflectance spectrum features and fluorescence spectrum features; the spectral features are fused at the end of feature extraction of each branch, and the fused spectral features are fed to the fully connected layer, and the quality index detection results are output through the regression layer; the spectral feature fusion method includes but is not limited to direct splicing, weighting and summation; the size of the input layer of a single spectral branch of the model is 1× N ( N is the spectral dimension of the sensor), the convolutional layer is stacked with residual blocks; the sizes of the fully connected layers are 512 and 1 respectively, the activation function and optimizer are determined to be ReLu and Adam respectively. During training, the maximum number of iterations is set to 300. Through multiple rounds of learning, the model structure, optimal learning rate and batch size are determined.