Intelligent spectrum fusion agricultural product noxious substance detection and deep learning analysis system

Through intelligent spectral fusion and deep learning analysis system, the accuracy and adaptability problems of harmful substance detection in agricultural products have been solved, and high-precision, high-speed and low-cost detection of multiple harmful substances has been achieved, which is suitable for different types of agricultural products.

CN120673216APending Publication Date: 2025-09-19广东省农业科学院农业质量标准与监测技术研究所 +1
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202511160502.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-19
Publication Date
2025-09-19

AI Technical Summary

Technical Problem

Existing agricultural product harmful substance detection systems have problems such as insufficient detection accuracy, poor adaptability, and inability to detect multiple harmful substances simultaneously. In particular, the detection results are unstable when faced with samples of different shapes and colors.

Method used

An intelligent spectral fusion agricultural product pest detection and deep learning analysis system is adopted. Through the pixel-level spectral-RGB bidirectional mapping mechanism, multi-spectral complementary enhancement technology, adaptive feature weight dynamic allocation system, multi-scale fusion feature pyramid structure and deep feedback optimization loop control strategy, deep fusion and feature optimization of RGB images and spectral images are achieved.

Benefits of technology

Significantly improve detection accuracy, with the detection accuracy rate reaching more than 95%, and the false alarm rate and missed alarm rate reduced to less than 5%. It can detect multiple harmful substances at the same time and adapt to different types of agricultural products. The detection efficiency is increased by 3-5 times, the computing resource requirements are reduced by 40%, and the equipment cost is reduced by 25%.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120673216A_ABST
    Figure CN120673216A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of agricultural product safety detection, in particular to an intelligent spectrum fusion agricultural product noxious substance detection and deep learning analysis system, which comprises an image acquisition module, a preprocessing module, an analysis module, an analysis module and a processing module, the information fusion module generates optimized fusion features through the steps of pixel-level mapping, multispectral complementary enhancement, adaptive feature weight distribution, multi-scale fusion feature pyramid, depth feedback optimization and the like, and the deep learning model module receives the optimized fusion features, carries out harmful substance detection analysis, generates detection result data, and sends the detection result data to the information fusion module. The result output module generates a detection report, the feedback control module generates parameter adjustment data according to the detection result to optimize fusion parameters, the quality inspection limit of harmful substances is reduced to a ppb level, and an efficient and accurate technical means is provided for agricultural product safety detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of agricultural product safety detection technology, and in particular to an agricultural product harmful substance detection system based on spectral fusion and deep learning, which is used to efficiently and accurately detect harmful substances such as pesticide residues, heavy metals, and additives in agricultural products. Background Art

[0002] As people's awareness of food safety continues to grow, the detection of harmful substances in agricultural products has become a critical step in ensuring food safety. Traditional methods for detecting harmful substances in agricultural products mainly include chemical analysis, chromatography, and mass spectrometry. Although these methods have high detection accuracy, they generally have disadvantages such as long detection cycles, high costs, and difficulty in achieving rapid on-site detection.

[0003] In recent years, spectral-based methods for detecting harmful substances in agricultural products have been widely studied. Spectroscopic techniques are non-destructive, rapid, and relatively low-cost, making them suitable for rapid screening and detection of agricultural products. However, single spectral data often lacks sufficient information to accurately determine the type and content of harmful substances in agricultural products. Furthermore, with the development of deep learning technology, analyzing spectral data using deep learning algorithms has become a new research trend. However, existing systems still have limitations in fusing spectral data with RGB image information, making it difficult to fully utilize the complementary advantages of these two types of information.

[0004] Furthermore, existing systems generally suffer from insufficient detection accuracy, poor adaptability, and the inability to simultaneously detect multiple hazardous substances. This is especially true when dealing with agricultural product samples of varying shapes and colors. Test results are often significantly affected by the characteristics of the samples themselves, lacking stability and reliability.

[0005] Therefore, there is an urgent need for a detection system for harmful substances in agricultural products that can effectively integrate spectral data and RGB image information and has high precision and high stability to meet the actual needs of agricultural product quality and safety testing. Summary of the Invention

[0006] The purpose of the present invention is to provide an intelligent spectral fusion agricultural product pest detection and deep learning analysis system. Through innovative information fusion technology and deep learning methods, high-precision and high-efficiency detection of harmful substances in agricultural products can be achieved, solving the problems of insufficient detection accuracy, poor adaptability, and inability to simultaneously detect multiple harmful substances in the existing technology.

[0007] The present invention proposes an intelligent spectral fusion agricultural product pest detection and deep learning analysis system, including:

[0008] Image acquisition module, used to collect RGB images and spectral images of agricultural products;

[0009] an image preprocessing module, electrically connected to the image acquisition module, for preprocessing the RGB image and the spectral image to generate a preprocessed RGB image and a preprocessed spectral image;

[0010] The information fusion module is electrically connected to the image preprocessing module and is used to:

[0011] By using a pixel-level spectrum-RGB bidirectional mapping mechanism, a pixel-level correspondence relationship between the preprocessed RGB image and the preprocessed spectral image is established to generate basic fusion data;

[0012] selectively enhancing the near-infrared absorption spectrum and the visible light reflectance spectrum of the basic fusion data by using multi-spectral complementary enhancement technology to generate enhanced fusion data;

[0013] By using an adaptive feature weight dynamic allocation system, based on regional variance, gradient information and information entropy, the feature weights of the enhanced fusion data are calculated to generate weighted fusion data;

[0014] Through a multi-scale fusion feature pyramid structure, multiple scale levels are constructed for the weighted fusion data and inter-layer feature transfer is performed to generate multi-scale fusion features;

[0015] Through a deep feedback optimization loop control strategy, the multi-scale fusion features are evaluated for quality and optimized for parameters to generate optimized fusion features;

[0016] a deep learning model module, electrically connected to the information fusion module, configured to receive the optimized fusion features, perform harmful substance detection and analysis, and generate detection result data;

[0017] A result output module, electrically connected to the deep learning model module, for receiving the test result data and generating a test report;

[0018] A feedback control module is electrically connected to the deep learning model module and the information fusion module, and is used to generate parameter adjustment data according to the detection result data, and send the parameter adjustment data to the information fusion module to optimize the fusion parameters.

[0019] Preferably, the pixel-level spectrum-RGB bidirectional mapping mechanism includes:

[0020] a spatial registration unit, configured to perform spatial registration on the preprocessed RGB image and the preprocessed spectral image, so as to establish a one-to-one correspondence between the pixels of the preprocessed RGB image and the pixels of the preprocessed spectral image;

[0021] Bidirectional feature mapping unit, used to construct forward mapping from RGB space to spectral space and reverse mapping from spectral space to RGB space;

[0022] The pixel correspondence fusion unit is used to fuse the RGB data and the spectral data of each spatial position according to the one-to-one correspondence and the forward mapping and the reverse mapping to generate the basic fused data.

[0023] Preferably, the multi-spectral complementary enhancement technology includes:

[0024] A spectrum segmentation processing unit, used to divide the full spectrum range into a near-infrared region, a visible light region and a transition region;

[0025] Key band identification unit, used to identify characteristic bands with discriminative power for different types of hazardous substances;

[0026] A complementary feature enhancement unit, configured to set an enhancement coefficient for the characteristic band to amplify the characteristic expression of the harmful substance;

[0027] The characteristic band integration unit is used to integrate the enhanced multiple spectral region features to form the enhanced fusion data.

[0028] Preferably, the adaptive feature weight dynamic allocation system includes:

[0029] A feature evaluation unit, configured to calculate the regional variance, gradient information, and information entropy of the enhanced fusion data and generate a feature evaluation result;

[0030] A weight calculation unit, configured to calculate a region-level weight, a band-level weight, and a pixel-level weight based on the feature evaluation result;

[0031] a weight optimization unit, configured to maximize feature discrimination by iteratively optimizing the region-level weight, the band-level weight, and the pixel-level weight;

[0032] The weighted feature fusion unit is used to weight the enhanced fusion data according to the optimized weight to generate the weighted fusion data.

[0033] Preferably, the multi-scale fusion feature pyramid structure includes:

[0034] A multi-layer feature extraction unit, configured to extract features of multiple levels from the weighted fusion data using receptive fields of different scales;

[0035] Inter-layer feature fusion unit, used to design inter-layer feature fusion channels to achieve interaction between features at different levels;

[0036] Pyramid building unit, used to organize features at different levels into a pyramid structure in order from details to the global level;

[0037] The residual connection unit is used to establish cross-layer residual connections, retain the original feature information, and prevent feature degradation in deep networks.

[0038] Preferably, the deep feedback optimization loop control strategy includes:

[0039] A detection result evaluation unit, configured to evaluate the accuracy and reliability of the detection results of the deep learning model module;

[0040] Error attribution analysis unit, used to analyze the source of detection errors and trace them back to the specific links of the fusion process;

[0041] a parameter feedback adjustment unit, configured to generate an adjustment strategy for fusion parameters based on the error attribution analysis result;

[0042] The closed-loop optimization control unit is used to build closed-loop feedback control from detection results to fusion parameters to achieve continuous optimization of system performance.

[0043] Preferably, the image acquisition module includes:

[0044] RGB image acquisition unit, used to collect visible light images of agricultural products;

[0045] Spectral image acquisition unit, used to collect spectral data of agricultural products;

[0046] A rotating sample stage unit, used to control the rotation of the agricultural product sample, so that the RGB image acquisition unit and the spectral image acquisition unit can acquire image information of the agricultural product from multiple angles;

[0047] The rotating sample stage unit can control the agricultural product sample to rotate uniformly according to a preset angle and speed to obtain comprehensive image data.

[0048] Preferably, the image preprocessing module includes:

[0049] An RGB image preprocessing unit, configured to perform enhancement, denoising and standardization processing on the RGB image;

[0050] A spectral image preprocessing unit, configured to perform calibration, denoising and normalization processing on the spectral image;

[0051] A block processing unit, configured to divide the RGB image and the spectral image into a plurality of area blocks, and process each area block separately;

[0052] The image enhancement unit is used to enhance the processed area blocks through block image fusion to improve the detail features of the agricultural product image.

[0053] Preferably, the deep learning model module includes:

[0054] Model training unit, used to train deep learning models based on labeled data;

[0055] A feature extraction unit, configured to extract key features from the optimized fusion features;

[0056] a hazardous substance identification unit, configured to identify the type of hazardous substances in the agricultural products based on the key features;

[0057] a content calculation unit, used to calculate the content level of harmful substances in agricultural products based on the identification results;

[0058] The confidence evaluation unit is used to evaluate the reliability of the detection results and generate detection confidence data.

[0059] Preferably, the result output module includes:

[0060] A test result display unit, used to display the test result data in a graphical manner;

[0061] A report generating unit, configured to automatically generate a test report containing information on the type, content, and distribution of hazardous substances based on the test result data;

[0062] Historical data comparison unit, used to compare and analyze current test results with historical test data;

[0063] The early warning prompt unit is used to issue an early warning message when the detected harmful substance content exceeds the safety threshold.

[0064] This paper uses innovative technologies such as a pixel-level spectral-RGB bidirectional mapping fusion mechanism, multispectral complementary enhancement technology, an adaptive feature weight dynamic allocation system, a multi-scale fusion feature pyramid structure, and a deep feedback optimization loop control strategy to build a complete agricultural product harmful substance detection and analysis system, which has the following beneficial effects:

[0065] 1. Significantly improved detection accuracy: Through multi-level spectral fusion and deep learning analysis, the detection limit of harmful substances is reduced to the ppb level, which is 30% to 50% higher than traditional methods. The detection accuracy reaches more than 95%, and the false alarm rate and missed alarm rate are reduced to less than 5%.

[0066] 2. Significantly improved detection efficiency: The system has a fast processing speed, and the complete detection time of a single sample is shortened to less than 30 seconds, which is 3-5 times faster than traditional methods, greatly improving detection efficiency.

[0067] 3. Enhanced adaptability: The system can adapt to different types of agricultural products and a variety of harmful substances, is not significantly affected by factors such as sample shape and color, and has wide applicability.

[0068] 4. Simultaneous detection of multiple harmful substances: The system can simultaneously detect multiple harmful substances such as pesticide residues, heavy metals, additives, etc., meeting the detection needs of complex pollution scenarios.

[0069] 5. Self-optimization capability: The system has a deep feedback optimization mechanism that can continuously optimize fusion parameters based on test results, thereby improving the detection capabilities of new agricultural products and unknown harmful substances.

[0070] 6. Reduced resource consumption: Compared with traditional deep learning methods, the computing resource requirements of this system are reduced by about 40%, and the equipment cost is reduced by about 25%, which improves the feasibility of technology promotion. BRIEF DESCRIPTION OF THE DRAWINGS

[0071] Figure 1 This is the overall architecture diagram of the intelligent spectral fusion agricultural product pest detection and deep learning analysis system of the present invention.

[0072] Figure 2 Schematic diagram of the structure of the information fusion module of the present invention.

[0073] Figure 3 Flowchart of the pixel-level spectrum-RGB bidirectional mapping fusion mechanism of the present invention.

[0074] Figure 4 Schematic diagram of the principle of the multi-spectral complementary enhancement technology of the present invention.

[0075] Figure 5 This is a workflow diagram of the adaptive feature weight dynamic allocation system of the present invention.

[0076] Figure 6 Schematic diagram of the multi-scale fusion feature pyramid structure of the present invention.

[0077] Figure 7 This is the closed-loop control diagram of the deep feedback optimization cyclic regulation strategy of the present invention.

[0078] Figure 8 2 is a comparison chart of the results of detecting pesticide residues in the embodiments of the present invention. DETAILED DESCRIPTION

[0079] Please refer to the attached Figure 1-8 The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. These embodiments are only used to illustrate the present invention and are not intended to limit the scope of the present invention.

[0080] like Figure 1 As shown, the intelligent spectral fusion agricultural product pest detection and deep learning analysis system provided by the present invention includes the following main modules: image acquisition module 1, image preprocessing module 2, information fusion module 3, deep learning model module 4, result output module 5 and feedback control module 6.

[0081] The image acquisition module 1 is used to acquire RGB images and spectral images of agricultural products. The image preprocessing module 2 is electrically connected to the image acquisition module 1 and is used to preprocess the RGB images and spectral images to generate preprocessed RGB images and preprocessed spectral images. The information fusion module 3 is electrically connected to the image preprocessing module 2 and is the core innovative part of this system. It contains five key technical units and is used to deeply fuse the RGB images and spectral images to generate optimized fusion features. The deep learning model module 4 is electrically connected to the information fusion module 3 and is used to perform harmful substance detection and analysis based on the fusion features. The result output module 5 is electrically connected to the deep learning model module 4 and is used to generate a detection report. The feedback control module 6 is electrically connected to the deep learning model module 4 and the information fusion module 3 and is used to optimize the fusion parameters.

[0082] In a preferred embodiment, the system's physical deployment utilizes a combination of a master computing unit and distributed acquisition units. The image acquisition module 1 and image preprocessing module 2 can be integrated into a portable acquisition device, connected to the master computing unit via a wireless network. The information fusion module 3, deep learning model module 4, result output module 5, and feedback control module 6 are deployed in the master computing unit, responsible for complex computational processing tasks.

[0083] The image acquisition module 1 includes an RGB image acquisition unit 11 , a spectral image acquisition unit 12 and a rotating sample stage unit 13 .

[0084] The RGB image acquisition unit 11 uses an industrial-grade RGB camera with a resolution of 1920×1080 pixels, a frame rate of 30 fps, and a standard lens with an F2.8 aperture. This camera is used to capture high-definition color images of agricultural products. In one embodiment of the present invention, the RGB camera is mounted approximately 30 cm from the sample surface to ensure that the entire sample is within its field of view.

[0085] The spectral image acquisition unit 12 uses a hyperspectral camera or multispectral camera with a wavelength range of 400-2500 nm and a spectral resolution of 10 nm to collect spectral data of agricultural products. Preferably, the hyperspectral camera uses a push-broom imaging method with a spatial resolution of 1024×1024 pixels, which can continuously collect spectral data while the sample is rotating.

[0086] The rotating sample stage unit 13 is a precision-controlled electric rotating platform with a rotation speed range of 0-60 rpm and an angular accuracy of 0.5°. This unit can set the optimal rotation speed based on the sample characteristics, typically 15 rpm for fruit samples, 10 rpm for vegetable samples, and 20 rpm for grain samples. The rotating sample stage unit 13 enables the RGB image acquisition unit 11 and the spectral image acquisition unit 12 to obtain complete image information of agricultural products from multiple angles, effectively solving the problem of incomplete information caused by traditional fixed-angle acquisition.

[0087] To ensure image quality, the present invention is also equipped with a standard light source with a color temperature of 5500K±200K, a color rendering index greater than 90, and an illumination uniformity error of less than 5%, ensuring the consistency of lighting conditions for image acquisition.

[0088] The image preprocessing module 2 includes an RGB image preprocessing unit, a spectral image preprocessing unit, a block processing unit and an image enhancement unit.

[0089] The RGB image preprocessing unit performs enhancement, denoising, and normalization on RGB images. Specifically, it first removes image noise using a Gaussian filter with a kernel size of 5×5 and a standard deviation of 1.0. It then performs color correction to convert the RGB image to the standard sRGB color space. Finally, it performs image enhancement using adaptive histogram equalization to increase image contrast and enhance image detail.

[0090] The spectral image preprocessing unit calibrates, denoises, and normalizes the spectral image. Specifically, a white and blackboard standard is used for spectral calibration to eliminate differences in the device's spectral response. The spectral curve is then smoothed using the Savitzky-Golay smoothing filter algorithm with a window size of 9 and a polynomial order of 3. Finally, spectral normalization is performed to ensure comparability between spectral data from different samples.

[0091] The block processing unit divides the RGB and spectral images into multiple regional blocks, typically sized at 64×64 pixels. This block processing approach allows for refined processing of the characteristics of different parts of agricultural products, improving local detection accuracy.

[0092] The image enhancement unit enhances the processed blocks through block-by-block image fusion. Specifically, for each block, the optimal enhancement parameters are calculated based on its characteristic distribution. For example, sharpening is applied to texture-rich areas (with a sharpening factor of 1.2) while denoising is applied to areas with low signal-to-noise ratios (with a denoising strength of 0.8). This adaptive enhancement method significantly improves the detail representation of agricultural product images and lays the foundation for subsequent fusion processing.

[0093] The information fusion module 3 is the core innovation part of the present invention, which includes five key technologies: pixel-level spectrum-RGB bidirectional mapping mechanism, multi-spectral complementary enhancement technology, adaptive feature weight dynamic allocation system, multi-scale fusion feature pyramid structure and deep feedback optimization loop control strategy.

[0094] The pixel-level spectrum-RGB bidirectional mapping fusion mechanism includes a spatial registration unit 31 , a bidirectional feature mapping unit 32 and a pixel correspondence fusion unit 33 .

[0095] The spatial registration unit 31 uses a spatial transformation network to accurately register the preprocessed RGB image with the preprocessed spectral image. It first identifies feature points in both images and then calculates a spatial transformation matrix to achieve spatial alignment. Registration accuracy is typically controlled within 0.5 pixels, ensuring a precise one-to-one correspondence between the pixels in the RGB image and the spectral image.

[0096] The bidirectional feature mapping unit 32 constructs a forward mapping from the RGB space to the spectral space and a reverse mapping from the spectral space to the RGB space. The forward mapping function is defined as:

[0097] ,

[0098] Among them: R, G, B are the pixel values ​​of each channel in the RGB image; 、 、 is the basis function corresponding to each channel, and the basis function is usually a polynomial function or a radial basis function; is the weight coefficient, which is solved by the least square method based on the training set; m, n, and l are the number of basis functions of each channel, which are usually set to This mapping converts RGB values ​​into corresponding spectral values, enabling the system to predict spectral features from RGB information.

[0099] In actual agricultural product testing, for example, when detecting pesticide residues on the surface of apples, this mapping function can convert local color changes on the apple surface into feature expressions in the spectral domain. This is particularly effective for detecting colorless pesticide residues because residues that are invisible to the naked eye may show obvious characteristics in the spectral domain.

[0100] The reverse mapping function is defined as:

[0101] ,

[0102] in: is the spectral wavelength, in nanometers (nm), usually ranging from 400-2500nm; is the spectral basis function, and Gaussian function is usually used as the basis function; is the weight coefficient, which is solved by the least squares method; q is the number of basis functions, which is usually set to , which means that 10 basis functions are used to fit the spectrum to RGB mapping relationship. This mapping converts the spectral features into RGB values, which is used to enhance the feature expression of RGB images.

[0103] Taking the detection of heavy metals in vegetables as an example, some heavy metals such as cadmium have characteristic absorption at specific wavelengths. This reverse mapping can map this invisible spectral feature back to the RGB space, making it easier for the system to identify contaminated areas.

[0104] The pixel corresponding fusion unit 33 fuses the RGB data and spectral data of each spatial position according to the one-to-one correspondence and bidirectional mapping to generate basic fusion data. The fusion function is defined as:

[0105] ,

[0106] in: For location The RGB value at is a 3D vector; For location The spectral value at is a vector with the same number of spectral bands; is the fusion weight coefficient, and the initial value is usually set to 、 、 ,It will continue to optimize as the system runs; and These are the forward and reverse mapping functions defined above. The multiplication operation here refers to the inner product operation of the vectors to ensure that the output dimensions are consistent.

[0107] The three terms in this fusion function represent: the original RGB information, the original spectral information, and an interactive enhancement term between the two. The interactive enhancement term is particularly important, capturing the nonlinear relationship between RGB and the spectrum. This is particularly effective for detecting trace harmful substances on agricultural surfaces. For example, when detecting mycotoxins on grape surfaces, although only trace amounts of mold may be present, the interactive characteristics of RGB and the spectrum can significantly enhance this weak signal, improving detection sensitivity.

[0108] The multi-spectral complementary enhancement technology includes a spectrum segmentation processing unit 34 , a key band identification unit 35 , a complementary feature enhancement unit 36 ​​and a feature band integration unit 37 .

[0109] The spectral segmentation processing unit 34 divides the full spectrum into the near-infrared region (760-2500nm), the visible light region (400-760nm), and the transition region, facilitating targeted processing of spectral information in different bands. Different bands have varying sensitivities to different harmful substances in agricultural products. For example, pesticide residues exhibit significant absorption characteristics in the 1000-1700nm band, while heavy metals exhibit characteristic reflection peaks in the 400-600nm band.

[0110] The key band identification unit 35 uses a method combining Fisher discriminant and information entropy to identify the most discriminative characteristic bands for different types of hazardous substances. The Fisher discriminant ratio calculation formula is:

[0111] ,

[0112] Where: λ is the spectral wavelength, in nanometers (nm); and The Fisher discriminant ratio is the average value of the spectra at wavelength λ for samples containing and not containing hazardous substances, respectively; σ12(λ) and σ22(λ) are the corresponding variances. A larger value for the Fisher discriminant ratio indicates a greater ability of that wavelength to distinguish hazardous substances.

[0113] In practical applications, the system uses a pre-established spectral library to calculate the Fisher discriminant ratios (FDRs) for the characteristic wavelengths of different hazardous substances. For example, for organophosphorus pesticides such as malathion, the system detects a high FDR (J ≥ 2.5) in the 1250-1350nm wavelength band, indicating that this wavelength band is particularly effective for identifying malathion.

[0114] The information entropy calculation formula is:

[0115] ,

[0116] in: is the probability that the spectrum value at wavelength λ falls into the i-th interval; N is the number of intervals, typically set to N = 10, indicating that the spectrum range is divided equally into 10 intervals for calculation of the probability distribution. A higher information entropy value indicates that the wavelength contains more information.

[0117] The comprehensive score calculation formula is:

[0118] ,

[0119] Where δ is the weighting coefficient, typically set to δ = 0.7, indicating that the Fisher discriminant ratio accounts for 70% of the score and information entropy accounts for 30%. The system selects the top K bands with the highest overall scores as key feature bands. The value of K is determined by the type of hazardous substance and is typically 5-15.

[0120] The complementary feature enhancement unit 36 ​​sets an enhancement coefficient for the identified characteristic band to amplify the characteristic expression of the harmful substance. The enhancement function is defined as:

[0121] ,

[0122] in: is the original spectrum value; For the reference spectral value, the average spectrum of the uncontaminated sample is usually selected; is the wavelength-dependent enhancement coefficient, ranging from [0.5, 2.0]; To adjust the parameters, usually set to , controls the steepness of the enhancement function. It ensures that the degree of enhancement is proportional to the spectral difference, and the greater the difference, the more obvious the enhancement.

[0123] When detecting methamidophos residues in strawberries, the system applies a higher enhancement factor to the 1400-1500nm band ( ), because methamidophos has obvious characteristic absorption in this band. For irrelevant bands, a lower enhancement factor ( ), avoiding the introduction of irrelevant noise. This targeted enhancement strategy significantly improved the system's ability to detect low-concentration methamidophos, reducing the detection limit from 0.05 mg / kg in the standard method to 0.01 mg / kg.

[0124] The characteristic band integration unit 37 integrates the enhanced multiple spectral region features to form enhanced fusion data. The integration method adopts a weighted integration method, and different bands are given different weights according to their characteristic scores. The integration function is defined as:

[0125] ,

[0126] in: For the Band area at location Enhanced features at is the corresponding weight, calculated as , that is, it is proportional to the characteristic score of the band; is the number of key bands selected.

[0127] This multispectral complementary enhancement technology demonstrates significant advantages in detecting mixed pesticide residues in grapes. The system can simultaneously enhance the signatures of different pesticides in different wavelength bands, enabling simultaneous detection of multiple pesticides. Experiments have shown that this technology enables the system to simultaneously identify three common pesticide residues (chlorpyrifos, triazophos, and indoxacarb) on grape surfaces in a single test, with detection limits below 0.02 mg / kg.

[0128] The adaptive feature weight dynamic allocation system includes a feature evaluation unit 38 , a weight calculation unit 39 , a weight optimization unit 40 and a weighted feature fusion unit 41 .

[0129] The feature evaluation unit 38 calculates the regional variance, gradient information and information entropy of the enhanced fusion data to generate a feature evaluation result. The regional variance calculation formula is:

[0130] ,

[0131] in: For the region The set of pixels contained; is the average value of the area, calculated as ; is the number of pixels contained in the region, The area block, The larger the regional variance value, the richer the feature changes in the region. The gradient information calculation formula is:

[0132] ,

[0133] in: and They are respectively enhanced fusion data in Direction and The gradient of the direction is usually calculated using the Sobel operator. The greater the gradient information, the richer the edge and detail features of the area. The information entropy calculation formula is:

[0134] ,

[0135] in: For the region The eigenvalue falls into The probability of an interval; is the number of intervals, usually set to The higher the information entropy value, the richer the information contained in the area.

[0136] When detecting the distribution of pesticide residues on the cucumber surface, the system found high gradient areas caused by uneven pesticide spraying. At the same time, the areas near the two ends of the cucumber have a higher information entropy due to the significant shape changes. ,These areas need to be assigned higher weights for accurate detection.

[0137] The weight calculation unit 39 calculates the regional weight, band weight and pixel weight based on the feature evaluation results. The regional weight calculation formula is:

[0138] ,

[0139] in: 、 、 To adjust the parameters, usually set to 、 、 , respectively controlling the influence of regional variance, gradient information, and information entropy in weight calculation. The denominator is a normalization factor that ensures that the sum of all regional weights is 1.

[0140] The band-level weight calculation formula is:

[0141] ,

[0142] in: For band 's feature score; For band Sensitivity index to hazardous substances; and To adjust the parameters, usually set to 、 .

[0143] Pixel-level weights are based on region-level and band-level weights and combine with local feature distribution to generate a more refined weight map:

[0144] ,

[0145] in: Pixels the region to which it belongs; Pixels The corresponding main band; is a local adjustment factor related to the feature distribution around the pixel.

[0146] The weight optimization unit 40 maximizes the feature discrimination by iteratively optimizing the region-level weight, band-level weight, and pixel-level weight. The optimization objective function is:

[0147] ,

[0148] in: and are the weighted between-class scatter matrix and within-class scatter matrix respectively; represents the trace of the matrix, which is the sum of the diagonal elements of the matrix. The calculation method is ,in is the number of categories, is the number of samples in category c, is the weighted average feature of the c-th class sample, and m is the weighted average feature of all samples. The calculation method is ,in For the The weighted features of the samples.

[0149] The optimization process adopts the gradient descent method, and the iterative formula is:

[0150] ,

[0151] in: and Respectively Second and The weight of the iteration; is the learning rate, usually set to ; is the gradient of the objective function with respect to the weight. The number of iterations is usually set to 100, or when the objective function change is less than the threshold Stop iteration when .

[0152] In the apple pesticide residue detection scenario, the system initially assigned similar weights to all areas. However, after optimization, it was found that the weights for uneven areas on the apple surface (such as the top depression) and areas of color change (such as the red-yellow transition zone) were significantly increased (by approximately 40%). These areas are precisely where pesticide residues are likely to accumulate. These optimization improvements increased the system's detection rate for sprayed pesticides by 15%.

[0153] The weighted feature fusion unit 41 weights the enhanced fusion data according to the optimized weights to generate weighted fusion data. The weighting function is defined as:

[0154] ,

[0155] in For location Pixel-level weight at ; For location The weighted operation ensures that important feature areas receive more attention in subsequent processing.

[0156] This adaptive dynamic feature weighting system demonstrates significant advantages when dealing with complex-shaped agricultural products, such as pineapples and strawberries. For example, when detecting carbendazim residues on strawberry surfaces, the system automatically assigns a higher weight (approximately 1.8 times the average value) to the sunken areas surrounding the seeds. These areas are precisely where pesticide residues tend to accumulate and are difficult to clean. Experiments have shown that, compared to uniform weighting, this adaptive weighting strategy increases the detection rate of carbendazim on strawberry surfaces by 23% and reduces the false positive rate by 17%.

[0157] The multi-scale fusion feature pyramid structure includes a multi-layer feature extraction unit 42, an inter-layer feature fusion unit 43, a pyramid construction unit 44 and a residual connection unit 45.

[0158] The multi-layer feature extraction unit 42 extracts features at multiple levels from the weighted fusion data using receptive fields of different scales. Specifically, a five-layer feature extraction network is constructed, with the receptive fields of each layer being 3×3, 5×5, 7×7, 9×9, and 11×11, respectively, to extract feature information at different scales. The feature extraction formula for each layer is:

[0159] ,

[0160] in: For the Layer in position The eigenvector at ; is the corresponding convolution kernel weight matrix; is the receptive field radius, which is calculated as ,in is the convolution kernel size; For weighted fusion data at position The summation operation here is actually a convolution operation, which performs a weighted aggregation of the neighborhood features at each position.

[0161] In extracting features at different scales, smaller receptive fields (e.g., 3×3) primarily capture minute details on the surface of agricultural products, such as tiny pesticide particles (<1 mm in diameter) on pears; medium receptive fields (e.g., 7×7) capture medium-scale features, such as localized pesticide concentration distributions on apples (approximately 5–10 mm in diameter); and larger receptive fields (e.g., 11×11) capture macroscopic features, such as large contaminated areas on watermelons (>20 mm in diameter). This multi-scale feature extraction strategy enables the system to simultaneously detect harmful substances with different distribution patterns.

[0162] The inter-layer feature fusion unit 43 designs an inter-layer feature fusion channel to achieve interaction between features at different levels. It adopts a bottom-up and top-down bidirectional feature transfer mechanism to enhance the contextual understanding of features. The bottom-up transfer formula is:

[0163] ,

[0164] in: For the Features after layer transfer from bottom to top; For the Features after layer transfer from bottom to top; Denotes an upsampling operation, typically using bilinear interpolation to double the size of the feature map. This operation is performed layer by layer, starting from the bottom (layer 5) of the pyramid and moving towards the top (layer 1), fusing global feature information from deeper layers into shallower features.

[0165] The top-down transfer formula is:

[0166] ,

[0167] in: For the Features after layer transfer from top to bottom; For the Features after layer transfer from top to bottom; The feature map size is reduced by half. This operation starts from the top of the pyramid (layer 1) and is passed to the bottom (layer 5) layer by layer, fusing the shallow detail feature information into the deep features.

[0168] Inter-layer feature fusion significantly improved system performance when detecting mixed pesticide residues on peach surfaces. The fuzzy structure of the peach surface results in extremely uneven pesticide distribution, with tiny pesticide particles (approximately 0.1 mm) coexisting with larger pesticide coatings (approximately 10 mm). Inter-layer feature fusion enables the system to simultaneously focus on the local characteristics of tiny pesticide particles and the global characteristics of the larger distribution, improving detection rates by 28% compared to single-scale methods.

[0169] The feature calculation method after inter-layer fusion is:

[0170] ,

[0171] in: For the Features after layer fusion; and is the fusion weight, usually set to , indicating that the features transferred from bottom to top and from top to bottom have the same weight.

[0172] Pyramid construction unit 44 organizes features at different levels into a pyramid structure, from detailed to global. The feature dimension of each pyramid layer is related to the level, with the bottom layer (detail layer) having a smaller dimension and the top layer (global layer) having a larger dimension. Specifically, the feature dimensions of the five pyramid layers are set to 64, 128, 256, 512, and 1024, respectively. This indicates that as the receptive field increases, the extracted feature dimension also increases accordingly to capture more complex feature patterns.

[0173] The residual connection unit 45 establishes cross-layer residual connections to preserve the original feature information and prevent feature degradation in the deep network. The residual connection formula is:

[0174] ,

[0175] in: For the The final features after the residual connection is added to the layer; is the feature after inter-layer fusion; The residual connection ensures that the original feature information is not lost in the deep network, which is crucial for maintaining detection accuracy.

[0176] In the case of mycotoxin detection in grapes, mold often begins in a single grape and spreads, forming a distribution pattern that progresses from a point to a surface. The residual connection mechanism ensures that the system can accurately locate the initial infection point even in complex backgrounds. Experiments show that compared to a model without residual connections, the system with residual connections improves the accuracy of detecting early mold (infected area <5%) by 31%.

[0177] Finally, the multi-scale fusion features are composed of features from each layer:

[0178] ,

[0179] This multi-scale fusion feature pyramid structure demonstrates significant advantages in detecting harmful substances of varying sizes and distribution densities. For example, when examining pesticide residues on apple surfaces, the system can simultaneously detect both localized high-concentration residue points (approximately 2 mm in diameter) and large, low-concentration residue areas (>20 mm in diameter). The detection limit is approximately 40% lower than that of single-scale methods, reaching 0.01 mg / kg.

[0180] The deep feedback optimization loop control strategy includes a detection result evaluation unit 46, an error attribution analysis unit 47, a parameter feedback adjustment unit 48 and a closed-loop optimization control unit 49.

[0181] The detection result evaluation unit 46 evaluates the accuracy and reliability of the detection results of the deep learning model module. Evaluation metrics include detection accuracy, false positive rate, false negative rate, and uncertainty of the detection results. Uncertainty assessment uses a Bayesian deep learning method, which uses multiple forward propagations (typically 10 times) to obtain a predicted distribution and calculate the confidence interval of the result.

[0182] In actual application, the system sets different assessment thresholds for pesticide residue detection on orange surfaces: the accuracy threshold for high-risk pesticides (such as dichlorvos) is 99%, the false alarm threshold is 1%, and the missed alarm threshold is 0.5%; the accuracy threshold for low-risk pesticides (such as imidacloprid) is 95%, the false alarm threshold is 5%, and the missed alarm threshold is 2%. This differentiated threshold setting ensures that the system detects high-risk harmful substances more strictly.

[0183] The error attribution analysis unit 47 analyzes the source of the detection error and traces it back to the specific steps of the fusion process. Specifically, it constructs an error feature map, maps the detection error back to the original feature space, and locates the source of the error. The error feature map calculation formula is:

[0184] ,

[0185] in: is the loss function, usually cross entropy loss or mean square error loss; The output feature Channel in position The value at is the corresponding gradient; is the number of feature channels. This formula calculates the contribution of each spatial position to the final loss. The larger the contribution, the more likely the position is to be the source of error.

[0186] In the detection of pesticide residues in tomatoes, the system found that the area at the stem connection ( ) is prone to false positives because the spectral characteristics of natural depressions in this area are similar to those of pesticide residues. The system adjusted the feature extraction parameters for this area accordingly, reducing the false positive rate from 7% to 2%.

[0187] The parameter feedback adjustment unit 48 generates an adjustment strategy for the fusion parameters based on the error attribution analysis results. The parameter gradient estimation formula is:

[0188] ,

[0189] in: Fusion parameters include pixel-level spectrum-RGB bidirectional mapping parameters, multispectral complementary enhancement parameters, and adaptive feature weight parameters; The sensitivity of the output feature to the parameter indicates the degree of influence of the parameter change on the feature; Represents the expected operation, usually approximated by averaging multiple samples.

[0190] Based on the parameter gradient, calculate the parameter adjustment direction and amplitude:

[0191] ,

[0192] in: is the parameter adjustment amount; To adjust the step size, it is usually set to , which means that the amplitude of each parameter adjustment is 0.1 times the gradient.

[0193] When detecting organophosphorus pesticide residues in cucumbers, the system found that the enhancement parameters of the near-infrared region 1200-1300nm band were too high (initial value ) leads to more false alarms, and the enhancement parameters of this band are reduced to , reducing the false alarm rate from 8% to 3% while maintaining a high detection rate (>95%).

[0194] The closed-loop optimization control unit 49 establishes a closed-loop feedback control from the detection results to the fusion parameters to achieve continuous optimization of system performance. The closed-loop control adopts the PID (proportional-integral-derivative) control strategy, taking into account the current error, historical accumulated error and error change trend to generate a more stable parameter adjustment strategy:

[0195] ,

[0196] in: is the current detection error, which is usually defined as the difference between the accuracy and the target accuracy; They are proportional, integral, and differential coefficients, respectively, and are usually set to 、 ; Integral term Represents the historical cumulative error. In actual implementation, the discrete accumulation of errors is usually adopted; the differential term Indicates the rate of change of the error. In actual implementation, the difference between the current error and the error at the previous moment is usually used.

[0197] During the system's long-term operation, the closed-loop optimization control strategy demonstrated significant advantages. For example, when detecting seasonal changes in vegetable produce, the system's detection performance temporarily declined (accuracy dropped from 97% to 91%) as summer vegetables gradually transitioned to autumn vegetables. Using closed-loop optimization control, the system automatically adjusted its fusion parameters after processing approximately 500 samples, restoring accuracy to over 95%, demonstrating excellent environmental adaptability.

[0198] This deep feedback optimization loop control strategy enables the system to self-learn and adapt, continuously optimizing its performance for new samples and unknown pests, significantly enhancing its long-term value. In actual applications, after optimizing and learning from approximately 1,000 samples, the system's detection accuracy for new agricultural products typically increased by 5 to 10 percentage points, ultimately stabilizing at over 95%.

[0199] The deep learning model module 4 includes a model training unit, a feature extraction unit, a hazardous substance identification unit, a content calculation unit and a confidence assessment unit.

[0200] The model training unit trains a deep learning model based on labeled data. This invention utilizes an improved model based on a residual network (ResNet) with a depth of 50 layers. The input is the multi-scale fusion features output by the information fusion module, and the output is the type and content of hazardous substances. The training dataset contains 5,000 samples covering 30 common agricultural products and 40 hazardous substances. Model performance is evaluated using 5-fold cross-validation. During training, an adaptive learning rate adjustment strategy is employed, with the initial learning rate set at 0.001 and reduced by 0.1 times every 50 epochs.

[0201] The feature extraction unit extracts key features from the optimized fusion features. Feature extraction uses an attention mechanism to automatically focus on the most discriminative feature areas and channels. The attention weight calculation formula is:

[0202] ,

[0203] in: Sigmoid activation function maps the output to the interval [0,1]; is the ReLU activation function, defined as ; and is a learnable weight matrix, used for dimensionality reduction and dimensionality increase respectively; For location Place The fused feature values ​​of the channels. The attention mechanism enables the system to automatically identify and focus on the feature areas that have the greatest impact on the detection results.

[0204] The Hazardous Substance Identification Unit identifies the types of hazardous substances in agricultural products based on key features. The identification model uses a multi-label classification approach, capable of simultaneously identifying multiple hazardous substances. For each hazardous substance, the model outputs the probability of its presence:

[0205] ,

[0206] in: For the The probability of the presence of hazardous substances; For the The logit value of the class; is the total number of hazardous substance categories. When the probability exceeds the threshold (usually set to 0.5), the corresponding hazardous substance is determined to be present.

[0207] In practice, the system sets different detection thresholds for different types of hazardous substances. For example, for highly toxic organophosphorus pesticides, the threshold is set at 0.4 to increase detection rates; for low-toxic biopesticides, the threshold is set at 0.6 to reduce false positives. This differentiated threshold strategy ensures a good balance between safety and efficiency.

[0208] The content calculation unit calculates the content level of harmful substances in agricultural products based on the identification results. The content calculation uses a regression model to establish a mapping relationship between features and content:

[0209] ,

[0210] in: is the predicted value of harmful substance content, in mg / kg; is the extracted feature vector; and are the parameter matrix and bias vector of the regression model, which are optimized by minimizing the mean square error.

[0211] During the system calibration phase, standard samples with known concentrations are used to establish a correlation between detection characteristics and actual concentrations. For example, for the pesticide malathion, the system uses 10 concentration gradient samples ranging from 0.01 mg / kg to 2.0 mg / kg for calibration, establishing a nonlinear regression model. In actual testing, the system sets different calibration curves for different agricultural products, such as using different correction factors for apples and cucumbers, to account for the effects of different matrices on the test.

[0212] The confidence assessment unit evaluates the reliability of the detection results and generates detection confidence data. Confidence assessment uses the Monte Carlo Dropout method to calculate the predicted mean and variance through multiple forward propagations (usually 20 times). The smaller the variance, the higher the confidence. The confidence calculation formula is:

[0213] ,

[0214] in: and are the mean and standard deviation of multiple predictions, respectively. The confidence value range is [0,1]. The closer the value is to 1, the more reliable the detection result.

[0215] In practice, the system will issue a warning if the confidence level falls below a threshold (typically set at 0.7), prompting the user that further verification may be necessary. For example, when detecting pesticide residues on the surface of a uniquely shaped dragon fruit, due to its uneven surface and complex color, the system may assign a lower confidence level (such as 0.65). In this case, the system will recommend that the operator collect images from more angles or use traditional chemical analysis methods for verification.

[0216] The result output module 5 includes a test result display unit, a report generation unit, a historical data comparison unit and an early warning prompt unit.

[0217] The test result display unit graphically displays test results. Specifically, a heat map shows the distribution of harmful substances across the sample, with different colors representing different levels. A bar chart displays the numerical values ​​of each harmful substance. A dashboard displays the confidence level of the test results. This visual display intuitively presents test results, allowing users to quickly understand the safety status of agricultural products.

[0218] Report Generation automatically generates a test report based on test result data. The report includes basic sample information (such as agricultural product type, batch, and test date), a test result summary (such as compliance and major contaminants), detailed information on hazardous substances (type, content, and distribution), a test confidence assessment, and safety recommendations. Reports can be exported in various formats, including PDF and Word, for easy archiving and sharing.

[0219] The historical data comparison unit compares and analyzes current test results with historical data. The system maintains a historical database that records test results for different agricultural products and batches. By comparing with historical data, trends in harmful substance content can be identified, providing a reference for agricultural product quality control. For example, the system can display pesticide residue trends in apples from a supplier over the past six months, helping users identify potential quality issues.

[0220] The early warning unit issues an alert when the detected hazardous substance levels exceed safety thresholds. The system has a built-in database of safety thresholds for various hazardous substances, such as the pesticide residue limit standard GB 2763-2021 and the heavy metal limit standard GB 2762-2017. When test results exceed the limit, the system issues visual and audible alerts, and the result is highlighted in red in the test report. Different levels of exceedance trigger different levels of alerts: a slight exceedance (<10%) displays a yellow warning; a moderate exceedance (10%-50%) displays an orange warning; and a severe exceedance (>50%) displays a red warning and triggers an audible alarm.

[0221] The feedback control module 6 is electrically connected to the deep learning model module 4 and the information fusion module 3, and is used to generate parameter adjustment data according to the detection result data, and send the parameter adjustment data to the information fusion module 3 to optimize the fusion parameters.

[0222] Feedback control module 6 employs reinforcement learning, using detection accuracy as a reward signal and optimizing fusion parameters using a policy gradient algorithm. Specifically, the state space is defined as the current set of fusion parameters, the action space is defined as the direction and magnitude of parameter adjustment, and the reward function is the magnitude of improvement in detection accuracy. By trying different parameter adjustment strategies, the system learns the most effective optimization path.

[0223] In practice, the feedback control module employs different optimization strategies based on the type of agricultural product. For example, for smooth apples, the system prioritizes optimizing the spectral-RGB mapping parameters; whereas for uneven strawberries, the system prioritizes optimizing the multi-scale feature pyramid parameters. This targeted optimization strategy enables the system to more quickly adapt to different types of detection objects.

[0224] Through continuous iterative optimization, the system can gradually find the optimal fusion parameter configuration and improve detection performance. Experiments have shown that after feedback optimization, the system's detection accuracy for new samples has increased by approximately 8 percentage points, demonstrating the system's good adaptability.

[0225] In particular, for seasonal agricultural products, the system can automatically adjust detection parameters based on seasonal changes. For example, the surface characteristics and internal composition of the same fruit (such as oranges) may differ between summer and winter. The system automatically adapts to these changes through a feedback optimization mechanism, maintaining stable detection performance.

[0226] Example 1: Simultaneous Detection of Multiple Pesticide Residues in Apples

[0227] This embodiment takes the simultaneous detection of multiple pesticide residues in apples as an example to illustrate the workflow and performance of the system of the present invention.

[0228] First, an apple sample is placed on the rotating sample stage unit 13 and the rotation speed is set to 15 rpm. The RGB image acquisition unit 11 and the spectral image acquisition unit 12 simultaneously acquire images of the apple to obtain RGB images and spectral images.

[0229] The image preprocessing module 2 performs preprocessing on the collected images, including enhancement, denoising, standardization and block processing. The preprocessed images have a higher signal-to-noise ratio and richer detail expression.

[0230] Information fusion module 3 deeply fuses the preprocessed RGB image and spectral image. A pixel-level spectral-RGB bidirectional mapping mechanism establishes a precise correspondence between the two images. Multispectral complementary enhancement technology enhances the characteristic expression of pesticide residues, particularly in the 1000-1700nm band. An adaptive dynamic feature weight allocation system highlights key feature regions. A multi-scale fusion feature pyramid structure captures feature expressions at different scales. A deep feedback optimization loop control strategy continuously optimizes fusion parameters.

[0231] Deep learning model module 4 uses fused features to perform pesticide residue detection and analysis. The system can simultaneously detect multiple pesticide residues in apples, including common pesticides such as organophosphates, carbamates, and pyrethroids. The detection limit reaches 0.01 mg / kg, which is lower than the national standard of 0.05 mg / kg.

[0232] The result output module 5 generates a test report, which includes the type, content, distribution and safety assessment of various pesticides. When it is detected that the pesticide residue exceeds the standard, the early warning prompt unit will sound an alarm.

[0233] Experimental results demonstrate that, compared to traditional liquid chromatography-mass spectrometry, this system offers higher detection efficiency (detection time reduced to 30 seconds) and comparable detection accuracy (accuracy >95%). This system demonstrates a significant advantage in the simultaneous detection of multiple pesticide residues, capable of detecting 10 common pesticide residues in apples simultaneously.

[0234] Example 2: Detection of heavy metal pollution in vegetables

[0235] This embodiment takes the detection of heavy metal pollution in vegetables (taking leafy vegetables as an example) as an example to further illustrate the application effect of the system of the present invention.

[0236] The vegetable sample is placed on the rotating sample stage unit 13 and the rotation speed is set to 10 rpm. The system collects RGB images and spectral images and performs preprocessing.

[0237] In information fusion module 3, multispectral complementary enhancement technology specifically focuses on the 400-600nm and 900-1100nm bands, which are highly sensitive to heavy metals such as lead, cadmium, and mercury. An adaptive feature weighting dynamic allocation system assigns higher weights to these characteristic bands, highlighting the heavy metal signatures.

[0238] Deep Learning Model Module 4 uses a specially trained heavy metal detection model to detect common heavy metal contaminants such as lead, cadmium, mercury, and arsenic in vegetables. The detection limits are 0.05 mg / kg for lead, 0.01 mg / kg for cadmium, 0.005 mg / kg for mercury, and 0.05 mg / kg for arsenic, all below national standards.

[0239] Experimental results show that this system has good performance in heavy metal detection. Compared with atomic absorption spectrometry, although the accuracy is slightly lower, the speed is increased by nearly 10 times, and no complicated sample pretreatment is required, which makes it very suitable for rapid screening applications.

[0240] Example 3: Detection of mycotoxins in cereals

[0241] This example takes the detection of aflatoxin in cereals (e.g., wheat) as an example to demonstrate the wide applicability of the system of the present invention.

[0242] The grain sample is placed on the rotating sample stage unit 13, and the rotation speed is set to 20 rpm. After the system completes image acquisition and preprocessing, the information fusion module 3 pays special attention to the characteristic bands of aflatoxin (mainly between 1200-1400nm and 1700-1900nm).

[0243] Deep Learning Model Module 4 uses a model optimized for mycotoxins, achieving a detection limit of 2 μg / kg, below the national standard limit of 5 μg / kg. The system can also identify the distribution of mycotoxin contamination and help determine the severity of the contamination.

[0244] Experiments have shown that this system has obvious advantages in the field of grain mycotoxin detection, especially in rapid on-site detection. It can complete the screening of large quantities of samples in a short time, significantly improving detection efficiency.

[0245] The foregoing description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Those skilled in the art will readily appreciate that various modifications and variations of the present invention are possible. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention are intended to be included within the scope of protection of the present invention.

Claims

1. Intelligent spectral fusion agricultural product pest detection and deep learning analysis system, characterized by: include: Image acquisition module, used to collect RGB images and spectral images of agricultural products; an image preprocessing module, electrically connected to the image acquisition module, for preprocessing the RGB image and the spectral image to generate a preprocessed RGB image and a preprocessed spectral image; The information fusion module is electrically connected to the image preprocessing module and is used to: By using a pixel-level spectrum-RGB bidirectional mapping mechanism, a pixel-level correspondence relationship between the preprocessed RGB image and the preprocessed spectral image is established to generate basic fusion data; selectively enhancing the near-infrared absorption spectrum and the visible light reflectance spectrum of the basic fusion data by using multi-spectral complementary enhancement technology to generate enhanced fusion data; By using an adaptive feature weight dynamic allocation system, based on regional variance, gradient information and information entropy, the feature weights of the enhanced fusion data are calculated to generate weighted fusion data; Through a multi-scale fusion feature pyramid structure, multiple scale levels are constructed for the weighted fusion data and inter-layer feature transfer is performed to generate multi-scale fusion features; Through a deep feedback optimization loop control strategy, the multi-scale fusion features are evaluated for quality and optimized for parameters to generate optimized fusion features; a deep learning model module, electrically connected to the information fusion module, configured to receive the optimized fusion features, perform harmful substance detection and analysis, and generate detection result data; A result output module, electrically connected to the deep learning model module, for receiving the test result data and generating a test report; A feedback control module is electrically connected to the deep learning model module and the information fusion module, and is used to generate parameter adjustment data according to the detection result data, and send the parameter adjustment data to the information fusion module to optimize the fusion parameters.

2. The system according to claim 1, wherein: The pixel-level spectrum-RGB bidirectional mapping mechanism includes: a spatial registration unit, configured to perform spatial registration on the preprocessed RGB image and the preprocessed spectral image, so as to establish a one-to-one correspondence between the pixels of the preprocessed RGB image and the pixels of the preprocessed spectral image; Bidirectional feature mapping unit, used to construct forward mapping from RGB space to spectral space and reverse mapping from spectral space to RGB space; The pixel correspondence fusion unit is used to fuse the RGB data and the spectral data of each spatial position according to the one-to-one correspondence and the forward mapping and the reverse mapping to generate the basic fused data.

3. The system according to claim 1, wherein: The multi-spectral complementary enhancement technology includes: A spectrum segmentation processing unit, used to divide the full spectrum range into a near-infrared region, a visible light region and a transition region; Key band identification unit, used to identify characteristic bands with discriminative power for different types of hazardous substances; A complementary feature enhancement unit, configured to set an enhancement coefficient for the characteristic band to amplify the characteristic expression of the harmful substance; The characteristic band integration unit is used to integrate the enhanced multiple spectral region features to form the enhanced fusion data.

4. The system according to claim 1, wherein: The adaptive feature weight dynamic allocation system includes: A feature evaluation unit, configured to calculate the regional variance, gradient information, and information entropy of the enhanced fusion data and generate a feature evaluation result; A weight calculation unit, configured to calculate a region-level weight, a band-level weight, and a pixel-level weight based on the feature evaluation result; a weight optimization unit, configured to maximize feature discrimination by iteratively optimizing the region-level weight, the band-level weight, and the pixel-level weight; The weighted feature fusion unit is used to weight the enhanced fusion data according to the optimized weight to generate the weighted fusion data.

5. The system according to claim 1, wherein: The multi-scale fusion feature pyramid structure includes: A multi-layer feature extraction unit, configured to extract features of multiple levels from the weighted fusion data using receptive fields of different scales; Inter-layer feature fusion unit, used to design inter-layer feature fusion channels to achieve interaction between features at different levels; Pyramid building unit, used to organize features at different levels into a pyramid structure in order from details to the global level; The residual connection unit is used to establish cross-layer residual connections, retain the original feature information, and prevent feature degradation in deep networks.

6. The system according to claim 1, wherein: The deep feedback optimization loop control strategy includes: A detection result evaluation unit, configured to evaluate the accuracy and reliability of the detection results of the deep learning model module; Error attribution analysis unit, used to analyze the source of detection errors and trace them back to the specific links of the fusion process; a parameter feedback adjustment unit, configured to generate an adjustment strategy for fusion parameters based on the error attribution analysis result; The closed-loop optimization control unit is used to build closed-loop feedback control from detection results to fusion parameters to achieve continuous optimization of system performance.

7. The system according to claim 1, wherein: The image acquisition module includes: RGB image acquisition unit, used to collect visible light images of agricultural products; Spectral image acquisition unit, used to collect spectral data of agricultural products; A rotating sample stage unit, used to control the rotation of the agricultural product sample, so that the RGB image acquisition unit and the spectral image acquisition unit can acquire image information of the agricultural product from multiple angles; The rotating sample stage unit can control the agricultural product sample to rotate uniformly according to a preset angle and speed to obtain comprehensive image data.

8. The system according to claim 1, wherein: The image preprocessing module includes: An RGB image preprocessing unit, configured to perform enhancement, denoising and standardization processing on the RGB image; A spectral image preprocessing unit, configured to perform calibration, denoising and normalization processing on the spectral image; A block processing unit, configured to divide the RGB image and the spectral image into a plurality of area blocks, and process each area block separately; The image enhancement unit is used to enhance the processed area blocks through block image fusion to improve the detail features of the agricultural product image.

9. The system according to claim 1, wherein: The deep learning model module includes: Model training unit, used to train deep learning models based on labeled data; A feature extraction unit, configured to extract key features from the optimized fusion features; a hazardous substance identification unit, configured to identify the type of hazardous substances in the agricultural products based on the key features; a content calculation unit, used to calculate the content level of harmful substances in agricultural products based on the identification results; The confidence evaluation unit is used to evaluate the reliability of the detection results and generate detection confidence data.

10. The system according to claim 1, wherein: The result output module includes: A test result display unit, used to display the test result data in a graphical manner; A report generating unit, configured to automatically generate a test report containing information on the type, content, and distribution of hazardous substances based on the test result data; Historical data comparison unit, used to compare and analyze current test results with historical test data; The early warning prompt unit is used to issue an early warning message when the detected harmful substance content exceeds the safety threshold.

Citation Information

Patent Citations

  • Image feature extraction method based on cross-layer residual two-way pyramid network

    CN113837199A

  • Infrared and visible light image fusion method based on multi-mode features

    CN114639002A

  • Agricultural product variety identification method and system based on image and spectrum fusion and application

    CN119360215A

  • Early crop disease identification method and system based on time sequence feature fusion

    CN119992327A

  • Intelligent blueberry disease detection method and system based on multi-mode unsupervised learning

    CN120451968A