Field aphid rapid counting method and device
By constructing aphid counting model based on computer vision and deep learning, using deformable convolutional network and self-attention module, the problems of low efficiency and poor accuracy of aphid counting in fields are solved, and efficient and accurate aphid recognition and counting are achieved, supporting Intelligent management of modern agriculture.
Patent Information
- Application Number
- CN202411256493.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-09
- Publication Date
- 2024-12-27
AI Technical Summary
In the prior art, the field aphid counting method is inefficient and the accuracy is affected by subjective factors, making it difficult to effectively identify and count small variable aphids in complex environments.
Using computer vision and deep learning methods, aphid counting model of deformable convolutional networks and self-attention modules is constructed. Through training data and preprocessing technology, aphid images are recognized and counted, and counting efficiency and accuracy are improved.
It significantly improves the efficiency and accuracy of field aphid counting, reduces the labor intensity and cost of manual counting, and provides automated and intelligent pest management support.
Smart Images

Figure CN119206780A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of aphid counting, and in particular to a method and a device for quickly counting aphids in a field. Background Art
[0002] Pests are a major factor affecting crop growth. Aphids are common and recurrent pests in soybean production. When they harm soybeans, they not only suck plant juice and affect soybean development, but also spread a variety of viral diseases. Accurately estimating pest density is the basis for pest prediction and forecasting. Timely acquisition of pest density is the basis for analyzing pest population dynamics and pest damage, and is also a necessary condition for obtaining the economic threshold of pest control. Currently, the most common method of counting aphids is manual counting. Since aphids are small, long-term visual observation is not only labor-intensive and inefficient, but also the counting accuracy is affected by subjective factors.
[0003] In this context, a method for rapid counting of aphids in the field based on computer vision and deep learning technology has emerged. However, the field environment is complex and changeable, aphids are small in size, large in number, and have different shapes, and are often affected by multiple factors such as light, shadow, and occlusion, which makes it difficult for traditional image processing methods to effectively deal with them. Summary of the invention
[0004] The purpose of the invention is to provide a method and a device for quickly counting aphids in a field, which can improve the counting efficiency of aphids in a field.
[0005] To achieve the above object, the present invention provides the following solutions:
[0006] A method for rapid counting of aphids in a field, comprising:
[0007] Acquire the image to be detected;
[0008] The image to be detected is input into an aphid counting model, and the aphid counting model is used to identify and directly count aphids in the image to obtain a field aphid detection result; the aphid counting model is constructed based on a deformable convolutional network and a self-attention module; the field aphid detection result includes whether aphids exist in the image to be detected and the number of target boxes when aphids exist.
[0009] Optionally, before inputting the image to be detected into the aphid counting model, the method further includes: training the aphid counting model;
[0010] The specific process of training the aphid counting model is as follows:
[0011] Acquire training data; the training data includes historically collected images of aphids and corresponding labels; the labels include whether aphids exist in the historically collected images of aphids and the number of target frames when aphids exist;
[0012] Constructing a pre-trained model; the pre-trained model includes a deformable convolutional network and a self-attention module connected in sequence;
[0013] The training data is input into the deformable convolutional network, the preliminary detection result output by the deformable convolutional network is used as the input of the self-attention module, and training is performed with the goal of minimizing the loss between the final detection result output by the self-attention module and the label to obtain a trained aphid counting model.
[0014] Optionally, the deformable convolutional network includes a scale perception layer, a spatial perception layer, a deformable convolutional layer and a deformable pooling layer connected in sequence; the self-attention module includes an encoding module, a decoding module and a prediction module connected in sequence.
[0015] Optionally, the loss function used in training the aphid counting model is a cross entropy loss function.
[0016] Optionally, before inputting the training data into the deformable convolutional network, the method further includes: preprocessing the training data;
[0017] The specific method for preprocessing the training data is: filtering the training data using a filter.
[0018] The present invention also provides a device for rapid counting of aphids in a field, which is applied to the method as described above, and comprises: a photographing device, a control device and a display device connected in sequence;
[0019] The camera device is used to obtain the image to be detected;
[0020] The control device is used to input the image to be detected into an aphid counting model, and the aphid counting model identifies and directly counts the aphids in the image to obtain a field aphid detection result; the aphid counting model is constructed based on a deformable convolutional network and a self-attention module; the field aphid detection result includes whether aphids exist in the image to be detected and the number of target boxes when aphids exist;
[0021] The display device is used to display the field aphid detection result.
[0022] Optionally, the shooting device is a camera.
[0023] Optionally, the display device is a mobile smart phone or a display.
[0024] According to the specific embodiments provided by the present invention, the present invention discloses the following technical effects:
[0025] The present invention discloses a method and device for quickly counting aphids in a field, the method comprising obtaining an image to be detected; inputting the image to be detected into an aphid counting model, identifying and directly counting aphids in the image through the aphid counting model, and obtaining a field aphid detection result; the aphid counting model is constructed based on a deformable convolutional network and a self-attention module; the field aphid detection result includes whether aphids exist in the image to be detected and the number of target boxes when aphids exist. The present invention can improve the counting efficiency of aphids in a field. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0027] Figure 1 The figure is a schematic diagram of the process of the method for rapid counting of aphids in the field according to the present invention. DETAILED DESCRIPTION
[0028] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0029] The purpose of the invention is to provide a method and a device for quickly counting aphids in a field, which can improve the counting efficiency of aphids in a field.
[0030] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0031] like Figure 1 As shown, the present invention provides a method for quickly counting aphids in a field, comprising:
[0032] Step 100: Acquire an image to be detected.
[0033] Step 200: input the image to be detected into an aphid counting model, and the aphid counting model identifies and directly counts the aphids in the image to obtain a field aphid detection result; the aphid counting model is constructed based on a deformable convolutional network and a self-attention module; the field aphid detection result includes whether aphids exist in the image to be detected and the number of target boxes when aphids exist.
[0034] As a specific implementation, before the image to be detected is input into the aphid counting model, the method further includes: training the aphid counting model, and the specific process is as follows:
[0035] Acquire training data; the training data includes historically collected images of aphids and corresponding labels; the labels include whether aphids exist in the historically collected images of aphids and the number of target frames when aphids exist;
[0036] Constructing a pre-trained model; the pre-trained model includes a deformable convolutional network and a self-attention module connected in sequence;
[0037] The training data is input into the deformable convolutional network, the preliminary detection result output by the deformable convolutional network is used as the input of the self-attention module, and the training is performed with the goal of minimizing the loss between the final detection result output by the self-attention module and the label to obtain a trained aphid counting model. In this embodiment, the loss function used in the training of the aphid counting model is a cross entropy loss function.
[0038] Among them, the deformable convolutional network includes a scale perception layer, a spatial perception layer, a deformable convolution layer and a deformable pooling layer connected in sequence; the self-attention module includes an encoding module, a decoding module and a prediction module connected in sequence.
[0039] As a specific implementation, before the training data is input into the deformable convolutional network, it also includes: preprocessing the training data, and the specific method is: filtering the training data using a filter.
[0040] Based on the above technical solution, the following embodiments are provided.
[0041] Step 100: Data collection. Use a drone, smart phone or professional camera to take high-definition images of crop leaves in the field to obtain a series of field images to be tested. Specifically, it includes:
[0042] The further processing process is: data preprocessing.
[0043] Purpose: Improve image quality, reduce noise interference, and provide a clean data set for model training.
[0044] Method: Use a filter (such as a Gaussian filter) to smooth each training image to remove noise and small impurities in the image. Normalize the image to ensure the consistency of the input data. Mark the location of aphids in the image and generate corresponding labels (including whether aphids exist and the number of target boxes of aphids).
[0045] Step 200: Aphid counting model training.
[0046] Objective: Build and train a deep learning model that can accurately identify and count aphids in the field.
[0047] Process: Build a pre-trained model: Design a deep learning architecture that includes a deformable convolutional network and a self-attention module. The deformable convolutional network part includes a scale-aware layer, a spatial-aware layer, a deformable convolutional layer, and a deformable pooling layer to extract aphid features in the image. The self-attention module part includes an encoding module, a decoding module, and a prediction module to enhance the model's global information perception ability and prediction accuracy.
[0048] Model training: The preprocessed training data (including historical aphid images and corresponding labels) are input into the pre-trained model. The cross entropy loss function is used as the optimization target, and the model parameters are adjusted through the back propagation algorithm to minimize the loss between the final detection result output by the model and the true label. After multiple rounds of iterative training, the model training is completed until the performance of the model on the validation set reaches the preset accuracy threshold.
[0049] Step 300: Rapidly count aphids in the field.
[0050] Objective: To use the trained aphid counting model to quickly count aphids in actual field images.
[0051] Method: The image to be detected is input into the trained aphid counting model. The model automatically identifies aphids in the image and outputs the detection results, including whether aphids are present and the number and location of the target box when aphids are present. The detection results are displayed to the user in a visual form (such as marking the location of aphids and displaying the number) or stored in a database for subsequent analysis.
[0052] Finally, this embodiment has the following beneficial effects:
[0053] Through application tests in actual field environments, the system has demonstrated good aphid identification and counting performance. Compared with traditional manual counting methods, the system not only greatly improves counting efficiency, but also significantly improves counting accuracy and consistency. At the same time, the automation and intelligent features of the system also provide strong support for pest management in modern agriculture.
[0054] In addition, the present invention also provides a device for rapid counting of aphids in a field, which is applied to the method described above, and comprises: a photographing device, a control device and a display device connected in sequence;
[0055] The camera device is used to obtain the image to be detected; the control device is used to input the image to be detected into the aphid counting model, and the aphid counting model identifies and directly counts the aphids in the image to obtain the field aphid detection result; the aphid counting model is constructed based on the deformable convolutional network and the self-attention module; the field aphid detection result includes whether there are aphids in the image to be detected and the number of target boxes when aphids exist; the display device is used to display the field aphid detection result. Among them, the shooting device adopts a camera, and the display device adopts a mobile smart phone or a display.
[0056] Based on the above device structure, the following embodiments are provided.
[0057] Shooting equipment: High-definition cameras are used to capture clear images of crops in the field. The cameras can be mounted on drones, tripods, or handheld devices so that the shooting position and angle can be flexibly adjusted according to actual needs.
[0058] Control device: Built-in high-performance processor and storage unit, responsible for image processing and the operation of aphid counting model. The control device is pre-loaded with an aphid counting model built based on a deformable convolutional network and self-attention module, which can perform real-time analysis and processing of images transmitted by the shooting device.
[0059] Display device: A mobile smart phone or professional display is used as the display interface to display the aphid counting results in the field. The display device receives and displays the processed images and counting results in real time through connection with the control device, including whether aphids exist, the number of aphids, and their locations in the image.
[0060] As a specific implementation step:
[0061] Equipment deployment: Deploy the camera, control and display devices in the preset positions and ways. Ensure that the camera can clearly capture images of crops in the field and that a stable connection is established between the control and display devices.
[0062] Image acquisition: Start the shooting device to capture images of crops in the field. The shooting device transmits the captured images to the control device in real time for processing.
[0063] Image processing and counting: After the control device receives the image, it immediately starts the built-in aphid counting model for processing. The model uses a deformable convolutional network to extract aphid features in the image, and enhances the perception of global information through a self-attention module, ultimately achieving the recognition and counting of aphids in the image.
[0064] Results show: The control device sends the processed counting results (including the presence, number and location of aphids) to the display device for display. Users can intuitively see the distribution of aphids in the field through the screen of a mobile smartphone or the interface of a professional display.
[0065] Data recording and analysis: The control device can also save the counting results in the storage unit for subsequent data recording and analysis. Users can formulate more scientific and reasonable pest management strategies based on the changing trends of historical data.
[0066] Finally, this embodiment has the following beneficial effects:
[0067] The field aphid rapid counting device has shown the characteristics of high efficiency, accuracy and convenience in practical applications. It not only greatly improves the efficiency and accuracy of field aphid monitoring, but also reduces the labor intensity and cost of manual inspections. At the same time, through real-time data display and recording functions, it provides strong data support for agricultural pest management and promotes the intelligent and precise development of modern agriculture.
[0068] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0069] This article uses specific examples to illustrate the principles and implementation methods of the present invention. The above examples are only used to help understand the core idea of the present invention. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting the present invention.
Claims
1. A method for rapid counting of aphids in a field, characterized in that: include: Acquire the image to be detected; The image to be detected is input into an aphid counting model, and the aphid counting model is used to identify and directly count aphids in the image to obtain a field aphid detection result; the aphid counting model is constructed based on a deformable convolutional network and a self-attention module; the field aphid detection result includes whether aphids exist in the image to be detected and the number of target boxes when aphids exist.
2. The method for rapid counting of aphids in the field according to claim 1, characterized in that: Before the image to be detected is input into the aphid counting model, the method further includes: training the aphid counting model; The specific process of training the aphid counting model is as follows: Acquire training data; the training data includes historically collected images of aphids and corresponding labels; the labels include whether aphids exist in the historically collected images of aphids and the number of target frames when aphids exist; Constructing a pre-trained model; the pre-trained model includes a deformable convolutional network and a self-attention module connected in sequence; The training data is input into the deformable convolutional network, the preliminary detection result output by the deformable convolutional network is used as the input of the self-attention module, and training is performed with the goal of minimizing the loss between the final detection result output by the self-attention module and the label to obtain a trained aphid counting model.
3. The method for rapid counting of aphids in the field according to claim 2, characterized in that: The deformable convolutional network includes a scale perception layer, a spatial perception layer, a deformable convolution layer and a deformable pooling layer connected in sequence; the self-attention module includes an encoding module, a decoding module and a prediction module connected in sequence.
4. The method for rapid counting of aphids in the field according to claim 2, characterized in that: The loss function used in training the aphid counting model is a cross entropy loss function.
5. The method for rapid counting of aphids in the field according to claim 2, characterized in that: Before inputting the training data into the deformable convolutional network, the method further includes: preprocessing the training data; The specific method for preprocessing the training data is: filtering the training data using a filter.
6. A device for rapid counting of aphids in a field, applied to the method according to any one of claims 1 to 5, characterized in that: include: The photographing device, the control device and the display device are connected in sequence; The camera device is used to obtain the image to be detected; The control device is used to input the image to be detected into an aphid counting model, and the aphid counting model identifies and directly counts the aphids in the image to obtain a field aphid detection result; the aphid counting model is constructed based on a deformable convolutional network and a self-attention module; the field aphid detection result includes whether aphids exist in the image to be detected and the number of target boxes when aphids exist; The display device is used to display the field aphid detection result.
7. The device for rapid counting of aphids in the field according to claim 6, characterized in that: The shooting device is a camera.
8. The device for rapid counting of aphids in the field according to claim 6, characterized in that: The display device is a mobile smart phone or a display.
Citation Information
Patent Citations
Yellow plate pest depth detection and counting method and system
CN112270681A
Intelligent garden defoliating pest recognition method based on hierarchical deep learning model
CN113627472A
Ceramic tile flaw detection method and system
CN114841987A
Automatic pest counting method based on combination of multi-scale feature fusion network and positioning model
WO2020047738A1
Cited By
High-precision aphid identification and counting method in mobile computing scene
CN122023854A
