A pesticide residue detection method and system based on unmanned aerial vehicle hyperspectral technology

By combining UAV hyperspectral technology with a lightweight fully convolutional neural network model, the problems of low efficiency and high cost in pesticide residue detection have been solved, enabling rapid, accurate, and non-destructive detection of pesticide residues in crops. This method is applicable to the detection of pesticide residues in various crops.

CN116977877BActive Publication Date: 2026-05-19WUHAN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
WUHAN UNIV
Filing Date
2023-07-18
Publication Date
2026-05-19

AI Technical Summary

Technical Problem

Existing pesticide residue detection methods are inefficient, costly, and destructive. Furthermore, methods based on hyperspectral technology have small sample datasets, leading to biases in identification and classification results and insufficient feature extraction.

Method used

This paper adopts UAV hyperspectral technology combined with a lightweight fully convolutional neural network model. By planning the flight path of the UAV, hyperspectral imaging is performed and data preprocessing is carried out. The lightweight fully convolutional neural network is used for pesticide residue detection, including a preprocessing module, a feature extraction module and a classification module. Depth-separable convolutional layers and spectral attention mechanism are used to improve the model performance.

Benefits of technology

It achieves automated, non-destructive, pollution-free, rapid and efficient detection of pesticide residues in crops, has real-time monitoring capabilities, is applicable to the detection of pesticide residues in various crops, and provides more timely and accurate quality assurance for agricultural products.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116977877B_ABST
    Figure CN116977877B_ABST
Patent Text Reader

Abstract

The application discloses a pesticide residue detection method and system based on unmanned aerial vehicle hyperspectral technology, first, the flight route of the unmanned aerial vehicle is planned; then the unmanned aerial vehicle hovers after reaching the specified position, and hyperspectral imaging is performed on the crops to be measured, and data preprocessing is performed; finally, a lightweight fully convolutional neural network is used for pesticide residue detection; the lightweight fully convolutional neural network comprises a pretreatment module, a feature extraction module and a classification module; the pretreatment module comprises two convolution layers arranged in series; the feature extraction module comprises a first spectral attention mechanism layer, a first lightweight convolution layer, a second spectral attention mechanism layer and a second lightweight convolution layer arranged in series; the classifier module is composed of a full connection layer and a Softmax activation function, wherein the input channel number of the full connection layer is the feature dimension, and the output channel number is the number of pesticide categories. The application can realize rapid detection of pesticide residues in crops, and has important significance for guaranteeing food safety and promoting healthy diet.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of food safety testing technology, and relates to a pesticide residue detection method and system, particularly a pesticide residue detection method and system based on UAV hyperspectral technology and a lightweight fully convolutional neural network model. Background Technology

[0002] Pesticide residues in crops have received increasing attention, and timely detection and removal of pesticide residues are crucial (Reference 1). Traditional pesticide residue detection methods require analysis of trace pesticide residues in test samples in a laboratory environment. However, these methods often only identify information on a single pesticide and are costly and inefficient in large-scale planting areas (References 2-3).

[0003] Hyperspectral technology is a non-contact, pollution-free, and non-destructive method for pesticide residue detection, capable of simultaneously utilizing spatial and spectral information for precise quantitative and qualitative analysis of samples (Reference 4). Currently, pesticide residue detection methods based on hyperspectral technology have achieved certain research results and application effects. The main idea of ​​these methods is to acquire hyperspectral images of crop samples and use hyperspectral data processing techniques and machine learning algorithms to identify and classify different pesticide residue types (References 5-7). However, these methods still have some problems. First, current pesticide residue detection methods based on hyperspectral technology often use small sample datasets, leading to biases in identification and classification results. Therefore, it is necessary to improve the reliability of the algorithms by increasing the number of samples or compressing the model size. Second, hyperspectral images of pesticide residues contain a large amount of redundant information, requiring the development of effective feature extraction algorithms to extract representative features. Existing methods still have shortcomings in feature extraction, necessitating further research and optimization of algorithms.

[0004] [1] Zhu Kaixiang, Li Yaoxin, Dong Quan. Research progress in pesticide residue analysis and detection technology [J]. China Food and Nutrition, 2011, 17(1): 16-19.

[0005] [2] Li Wenjin, Liu Xia, Li Rongzhuo, et al. Research progress of electrochemical sensors in pesticide residue detection [J]. Food and Machinery, 2013, 29(4): 241-245.

[0006] [3] Xu Xuan. Research progress on pesticide residue detection technology in vegetables [J]. Guizhou Agricultural Sciences, 2009, 37(1): 178-181.

[0007] [4] Xue Long, Li Jing, Liu Muhua. Experimental study on pesticide residue detection on fruit surface based on hyperspectral imaging technology [J]. Acta Optica Sinica, 2008, 28(12): 2277-2280.

[0008] [5] Sun Jun, Zhang Meixia, Mao Hanping, et al. Study on the identification of pesticide residues in mulberry leaves based on hyperspectral images [J]. Transactions of the Chinese Society for Agricultural Machinery, 2015, 46(6): 251-256.

[0009] [6] Xu Jie, Yang Jie, Sun Jingtao, et al. Discriminant analysis of pesticide residues on the surface of Hami melon based on hyperspectral technology [J]. Jiangsu Agricultural Sciences, 2016, 44(12): 338-340.

[0010] [7] Ji Haiyan, Ren Zhanqi, Rao Zhenhong. Identification of pesticide residues in spinach leaves using hyperspectral imaging technology [J]. Chinese Journal of Luminescence, 2018, 39(12): 1778-1784. Summary of the Invention

[0011] To address the problems of low detection efficiency, high cost, and destructive testing in existing detection methods, this invention proposes a pesticide residue detection method and system based on UAV hyperspectral technology and a lightweight fully convolutional neural network model, which can be applied to pesticide residue detection in crops such as tea.

[0012] The technical solution adopted by the method of the present invention is: a pesticide residue detection method based on UAV hyperspectral technology, comprising the following steps:

[0013] Step 1: Plan the drone's flight path;

[0014] Step 2: After the drone arrives at the designated location and hovers, it performs hyperspectral imaging of the crop to be tested and performs data preprocessing.

[0015] Step 3: Detect pesticide residues using a lightweight fully convolutional neural network;

[0016] The lightweight fully convolutional neural network includes a preprocessing module, a feature extraction module, and a classification module;

[0017] The preprocessing module includes two convolutional layers arranged in series; the feature extraction module includes a first spectral attention mechanism layer, a first lightweight convolutional layer, a second spectral attention mechanism layer, and a second lightweight convolutional layer arranged in series; both the first and second lightweight convolutional layers are depthwise separable convolutional layers composed of depthwise convolutional layers and pointwise convolutional layers; a normalization layer is added after both the first and second lightweight convolutional layers, and an activation layer is added before each; the classifier module consists of a fully connected layer and a Softmax activation function, wherein the number of input channels of the fully connected layer is the feature dimension, and the number of output channels is the number of pesticide categories.

[0018] As a preferred option, in step 1, the flight path of the drone is autonomously planned using a ground computer based on specific planting area data and crop production data.

[0019] Preferably, in step 2, the data preprocessing includes noise reduction and normalization of the hyperspectral data. The former uses wavelet transform to remove some outliers and noise in the data, while the latter uses maximum and minimum value normalization to eliminate the differences between sample data collected at different locations and times.

[0020] Preferably, in step 3, the preprocessing module includes two convolutional layers arranged in series, with the first and second layers being convolutional layers with a kernel size of 1 and a stride of 1.

[0021] Preferably, in step 3, the depthwise convolutional layer performs convolution operations on each input channel, using a kernel size of 3 and a stride of 1; the pointwise convolutional layer performs convolution operations on all channels, combining the feature maps obtained from the depthwise convolutional layer to produce the final output result, using a kernel size of 1 and a stride of 1; the spectral attention mechanism layer first compresses the information of each channel into a scalar, that is, performs global average pooling on the feature map of each channel, and then learns the channel attention weights of each channel through a fully connected layer, and multiplies the original feature map by the channel attention, adaptively adjusting the weights of each channel, thereby improving the performance of the model.

[0022] Preferably, the lightweight fully convolutional neural network mentioned in step 3 is a trained lightweight fully convolutional neural network.

[0023] The training process includes:

[0024] The hyperspectral dataset is divided into a training set and a validation set. The training set is used to train a lightweight fully convolutional neural network, while the validation set is used to evaluate model performance and tune hyperparameters.

[0025] The samples in the training set are fed into a lightweight fully convolutional neural network, which calculates the output through forward propagation. A loss function is calculated to measure the difference between the model's predictions and the true labels by comparing them with the labels in the training set.

[0026] Then, the gradient of the loss function is backpropagated to each layer of the network using the backpropagation algorithm. The weights and biases of the model are updated based on the gradient, thereby minimizing the loss function.

[0027] The aforementioned forward and backward propagation processes iterate continuously until the model's performance converges or a preset stopping condition is met.

[0028] To avoid overfitting the model to the training set, a validation set is needed to monitor the model's performance. By evaluating metrics such as accuracy, recall, and F1 score on the validation set, optimal model parameters and hyperparameters can be selected, and strategies such as early stopping can be implemented to prevent the model from overfitting to the training set.

[0029] The technical solution adopted by the system of the present invention is: a pesticide residue detection system based on UAV hyperspectral technology, comprising:

[0030] One or more processors;

[0031] A storage device for storing one or more programs, which, when executed by one or more processors, enable the one or more processors to implement the pesticide residue detection method based on UAV hyperspectral technology.

[0032] This invention uses hyperspectral technology that combines image and spectrum analysis with a lightweight fully convolutional neural network model to detect pesticide residues in crops, which has the advantages of automation, non-destructive operation, no pollution, speed and efficiency.

[0033] This invention combines hyperspectral technology with a lightweight fully convolutional neural network model to achieve pesticide residue detection in crops. The lightweight fully convolutional neural network model has fewer parameters and lower computational complexity, enabling efficient processing of hyperspectral image data with a small number of training samples. This invention automates pesticide residue detection in crops. Compared to traditional detection methods, this method does not require damage to crop samples, the use of chemical reagents, or environmental pollution. Furthermore, due to the use of the lightweight fully convolutional neural network model, this method is fast and efficient, enabling real-time pesticide residue detection. This provides agricultural production with a more timely and accurate means of monitoring pesticide residues, helping to ensure the quality and safety of agricultural products. Finally, this invention has a certain degree of versatility. Through training and optimization on different crops and pesticides, this method can be applied to the detection of pesticide residues in various types of crops, providing broader application prospects for agricultural production and pesticide management. Attached Figure Description

[0034] The technical solutions described herein are further illustrated below using examples and specific implementation methods. Additionally, accompanying drawings are used in the description of the technical solutions. Those skilled in the art can, without any creative effort, obtain other drawings and the intent of the present invention based on these drawings.

[0035] Figure 1 This is a flowchart of a method according to an embodiment of the present invention;

[0036] Figure 2 This is a flight route diagram according to an embodiment of the present invention;

[0037] Figure 3 This is a diagram of a lightweight fully convolutional neural network structure according to an embodiment of the present invention. Detailed Implementation

[0038] To facilitate understanding and implementation of the present invention by those skilled in the art, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the embodiments described herein are for illustration and explanation only and are not intended to limit the present invention.

[0039] This embodiment uses the detection of pesticide residues in tea as an example to further illustrate the present invention. Please see... Figure 1 This embodiment provides a pesticide residue detection method based on UAV hyperspectral technology, which includes the following steps:

[0040] Step 1: Autonomously plan the flight route using a ground-based computer;

[0041] Please see Figure 2 In one implementation, the flight path is determined based on the specific planting area. Information such as the crop planting location, growth height, and area shape are determined through on-site surveys, and the autonomous flight route of the drone is planned.

[0042] Step 2: After the drone arrives at the designated location and hovers, it performs hyperspectral imaging of the crop to be tested and performs data preprocessing.

[0043] In one implementation, data preprocessing includes denoising and normalization of hyperspectral data. The denoising is achieved by using wavelet transform to remove some outliers and noise from the data, and the normalization is achieved by using maximum-minimum normalization to eliminate differences between sample data collected at different locations and times.

[0044] Step 3: Use a lightweight fully convolutional neural network model to detect pesticide residues.

[0045] Please see Figure 3The lightweight fully convolutional neural network model includes a preprocessing module, a feature extraction module, and a classification module. The preprocessing module includes two convolutional layers arranged in series. The feature extraction module includes a first spectral attention mechanism layer, a first lightweight convolutional layer, a second spectral attention mechanism layer, and a second lightweight convolutional layer arranged in series. Both the first and second lightweight convolutional layers are depthwise separable convolutional layers composed of depthwise convolutional layers and pointwise convolutional layers. A normalization layer is added after both the first and second lightweight convolutional layers, and an activation layer is added before each. The classifier module consists of a fully connected layer and a Softmax activation function, wherein the number of input channels of the fully connected layer is the feature dimension, and the number of output channels is the number of pesticide categories.

[0046] In one embodiment, the preprocessing module includes two convolutional layers arranged in series, the first layer and the second layer being convolutional layers with a kernel size of 1 and a stride of 1.

[0047] In one implementation, the feature extraction module includes two lightweight convolutional layers and two spectral attention mechanism layers arranged in series. The lightweight convolutional layers are depthwise separable convolutional layers composed of depthwise convolutional layers and pointwise convolutional layers. The depthwise convolutional layers perform convolution operations on each input channel, using a kernel size of 3 and a stride of 1. The pointwise convolutional layers perform convolution operations on all channels, combining the feature maps obtained from the depthwise convolutional layers to produce the final output, using a kernel size of 1 and a stride of 1. Depthwise separable convolution decomposes the standard convolution operation into two lightweight operations, significantly reducing computational complexity and the number of parameters. Each lightweight convolutional layer is followed by a normalization layer and preceded by an activation layer. The spectral attention mechanism layers first compress the information of each channel into a scalar, i.e., perform global average pooling on the feature map of each channel, making subsequent computations more efficient. Then, a fully connected layer learns the channel attention weights for each channel, multiplies the original feature map by the channel attention, and adaptively adjusts the weights of each channel, thereby improving the model's performance.

[0048] In one embodiment, the lightweight fully convolutional neural network is a pre-trained lightweight fully convolutional neural network; the training process includes:

[0049] The hyperspectral dataset is divided into a training set and a validation set. The training set is used to train a lightweight fully convolutional neural network, while the validation set is used to evaluate model performance and tune hyperparameters.

[0050] The samples in the training set are fed into a lightweight fully convolutional neural network, which calculates the output through forward propagation. A loss function is calculated to measure the difference between the model's predictions and the true labels by comparing them with the labels in the training set.

[0051] Then, the gradient of the loss function is backpropagated to each layer of the network using the backpropagation algorithm. The weights and biases of the model are updated based on the gradient, thereby minimizing the loss function.

[0052] The aforementioned forward and backward propagation processes iterate continuously until the model's performance converges or a preset stopping condition is met.

[0053] To avoid overfitting the model to the training set, a validation set is needed to monitor the model's performance. By evaluating metrics such as accuracy, recall, and F1 score on the validation set, optimal model parameters and hyperparameters can be selected, and strategies such as early stopping can be implemented to prevent the model from overfitting to the training set.

[0054] This invention also provides a pesticide residue detection system based on UAV hyperspectral technology, comprising:

[0055] One or more processors;

[0056] A storage device for storing one or more programs, which, when executed by one or more processors, enable the one or more processors to implement the pesticide residue detection method based on UAV hyperspectral technology.

[0057] This invention enables accurate detection of pesticide residues in tea leaves, and has the advantages of fast detection speed, low cost and simple operation. It can also be widely applied to the detection of pesticide residues in other crops, and has a good prospect for promotion and application.

[0058] It should be understood that the above description of the preferred embodiments is quite detailed, but it should not be considered as a limitation on the scope of protection of this invention. Those skilled in the art, under the guidance of this invention, can make substitutions or modifications without departing from the scope of protection of the claims of this invention, and all such substitutions or modifications fall within the scope of protection of this invention. The scope of protection of this invention should be determined by the appended claims.

Claims

1. A method for detecting pesticide residues based on UAV hyperspectral technology, characterized in that, Includes the following steps: Step 1: Plan the drone's flight path; Step 2: After the drone arrives at the designated location and hovers, it performs hyperspectral imaging of the crop to be tested and performs data preprocessing. Step 3: Detect pesticide residues using a lightweight fully convolutional neural network; The lightweight fully convolutional neural network includes a preprocessing module, a feature extraction module, and a classification module; The preprocessing module includes two convolutional layers arranged in series; the feature extraction module includes a first spectral attention mechanism layer, a first lightweight convolutional layer, a second spectral attention mechanism layer, and a second lightweight convolutional layer arranged in series; both the first and second lightweight convolutional layers are depthwise separable convolutional layers composed of depthwise convolutional layers and pointwise convolutional layers; a normalization layer is added after both the first and second lightweight convolutional layers, and an activation layer is added before each; the classification module consists of a fully connected layer and a Softmax activation function, wherein the number of input channels of the fully connected layer is the feature dimension, and the number of output channels is the number of pesticide categories; The deep convolutional layer performs convolution operations on each input channel, using a kernel size of 3 and a stride of 1. The pointwise convolutional layer performs convolution operations on all channels, combining the feature maps obtained from the deep convolutional layer to produce the final output, using a kernel size of 1 and a stride of 1. The spectral attention mechanism layer first compresses the information of each channel into a scalar, that is, it performs global average pooling on the feature map of each channel, and then learns the channel attention weights of each channel through a fully connected layer, and multiplies the original feature map by the channel attention, adaptively adjusting the weights of each channel to improve the performance of the model. The lightweight fully convolutional neural network is a pre-trained lightweight fully convolutional neural network; the training process includes: The hyperspectral dataset is divided into a training set and a validation set; the training set is used to train a lightweight fully convolutional neural network, while the validation set is used to evaluate model performance and tune hyperparameters. The samples in the training set are input into a lightweight fully convolutional neural network, and the network calculates the output results through forward propagation; by comparing them with the labels in the training set, a loss function is calculated to measure the difference between the model's prediction results and the true labels. Then, the gradient of the loss function is backpropagated to each layer of the network using the backpropagation algorithm. The weights and biases of the model are updated according to the gradient, thereby minimizing the loss function. The above forward and backward propagation processes are iterated continuously until the model's performance converges or a preset stopping condition is met; To avoid overfitting the model to the training set, a validation set is needed to monitor the model's performance. By evaluating the model's accuracy, recall, and F1 score on the validation set, the optimal model parameters and hyperparameters can be selected, and an early stopping strategy can be implemented to prevent the model from overfitting to the training set.

2. The pesticide residue detection method based on UAV hyperspectral technology according to claim 1, characterized in that: In step 1, the flight path of the drone is autonomously planned using a ground computer based on specific planting area data and crop production data.

3. The pesticide residue detection method based on UAV hyperspectral technology according to claim 1, characterized in that: In step 2, the data preprocessing includes noise reduction and normalization of hyperspectral data. The former uses wavelet transform to remove some outliers and noise in the data, while the latter uses maximum and minimum value normalization to eliminate the differences between sample data collected at different locations and times.

4. The pesticide residue detection method based on UAV hyperspectral technology according to claim 1, characterized in that: In step 3, the preprocessing module includes two convolutional layers arranged in series. The first and second layers are both convolutional layers with a kernel size of 1 and a stride of 1.

5. A pesticide residue detection system based on UAV hyperspectral technology, characterized in that, include: One or more processors; A storage device for storing one or more programs, which, when executed by one or more processors, cause the one or more processors to implement the pesticide residue detection method based on UAV hyperspectral technology as described in any one of claims 1 to 4.