CN113487576A - Insect pest image detection method based on channel attention mechanism - Google Patents

Insect pest image detection method based on channel attention mechanism Download PDF

Info

Publication number
CN113487576A
CN113487576A CN202110796527.XA CN202110796527A CN113487576A CN 113487576 A CN113487576 A CN 113487576A CN 202110796527 A CN202110796527 A CN 202110796527A CN 113487576 A CN113487576 A CN 113487576A
Authority
CN
China
Prior art keywords
pest
image detection
pest image
channel
feature
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110796527.XA
Other languages
Chinese (zh)
Other versions
CN113487576B (en
Inventor
王儒敬
董士风
李�瑞
张洁
焦林
刘康
滕越
刘海云
王晓栋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hefei Institutes of Physical Science of CAS
Original Assignee
Hefei Institutes of Physical Science of CAS
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hefei Institutes of Physical Science of CAS filed Critical Hefei Institutes of Physical Science of CAS
Priority to CN202110796527.XA priority Critical patent/CN113487576B/en
Publication of CN113487576A publication Critical patent/CN113487576A/en
Application granted granted Critical
Publication of CN113487576B publication Critical patent/CN113487576B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0012Biomedical image inspection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • G06F18/2415Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on parametric or probabilistic models, e.g. based on likelihood ratio or false acceptance rate versus a false rejection rate
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/047Probabilistic or stochastic networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/048Activation functions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20016Hierarchical, coarse-to-fine, multiscale or multiresolution image processing; Pyramid transform
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20081Training; Learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20084Artificial neural networks [ANN]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30004Biomedical image processing
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02ATECHNOLOGIES FOR ADAPTATION TO CLIMATE CHANGE
    • Y02A50/00TECHNOLOGIES FOR ADAPTATION TO CLIMATE CHANGE in human health protection, e.g. against extreme weather
    • Y02A50/30Against vector-borne diseases, e.g. mosquito-borne, fly-borne, tick-borne or waterborne diseases whose impact is exacerbated by climate change

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Mathematical Physics (AREA)
  • Computing Systems (AREA)
  • Software Systems (AREA)
  • Molecular Biology (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Evolutionary Biology (AREA)
  • Probability & Statistics with Applications (AREA)
  • Medical Informatics (AREA)
  • Nuclear Medicine, Radiotherapy & Molecular Imaging (AREA)
  • Radiology & Medical Imaging (AREA)
  • Quality & Reliability (AREA)
  • Image Analysis (AREA)
  • Catching Or Destruction (AREA)

Abstract

The invention relates to a pest image detection method based on a channel attention mechanism, which solves the defects of low pest detection accuracy and low detection speed compared with the prior art. The invention comprises the following steps: collecting insect pest images and establishing insect pest data sets; constructing a pest image detection model based on a channel attention mechanism; training a pest image detection model; acquiring an image of the insect pest to be detected; and obtaining a pest image detection result. According to the invention, a basic neural network with richer characteristics can be extracted through a multi-scale prediction structure, and the characteristics of multiple scales are fused for detection, so that the detection precision can be improved on the premise of not deepening the network depth; according to the invention, through a channel volume space attention mechanism and through screening of channel characteristics, information reserved during characteristic fusion is more beneficial to reduction of training loss and accuracy of positioning and classification, and simultaneously, the trade-off of performance and detection speed can be balanced through dimension reduction in a certain proportion.

Description

Insect pest image detection method based on channel attention mechanism
Technical Field
The invention relates to the technical field of insect pest image identification, in particular to an insect pest image detection method based on a channel attention mechanism.
Background
At present, the severity of pest occurrence is mainly judged by the pest number per unit area in China, and if the pest occurrence is judged only by field research and judgment of agricultural experts, time and labor are wasted, and the efficiency is low. The method has great practical significance for providing information for agricultural experts to assist insect situation judgment by counting and classifying the pests in the image based on pest image detection, and is also an important subject in the field of agricultural image research.
Traditional methods based on machine learning require manual design methods to extract pest characteristics, which are not adaptively adjusted and optimized according to feedback. In recent years, detection algorithms based on deep learning have been applied deeply. The method based on dense frame sampling represented by the SSD algorithm treats the detection problem as a regression problem, and easily confuses the foreground region and the background region. The method represented by the Faster R-CNN algorithm based on the region-of-interest recommendation box determines the regions where objects possibly exist in the region-of-interest, and greatly improves the accuracy of subsequent classification. Insect pest image detection is performed by using a deep learning target detection method based on a general scene, and the method is difficult to adapt to the problems of small insect pest size, high similarity, low detection accuracy and low detection speed.
Disclosure of Invention
The invention aims to solve the defects of low insect pest detection accuracy and low detection speed in the prior art, and provides an insect pest image detection method based on a channel attention mechanism to solve the problems.
In order to achieve the purpose, the technical scheme of the invention is as follows:
a pest image detection method based on a channel attention mechanism comprises the following steps:
11) insect pest images are collected and insect pest data sets are established: acquiring a pest image, preprocessing and marking the pest image, and establishing a pest data set;
12) constructing a pest image detection model based on a channel attention mechanism: constructing a pest image detection model, wherein the pest image detection model comprises a multi-scale characteristic pyramid prediction structure and a channel product space attention mechanism structure used for fusion of characteristic layers;
13) training a pest image detection model: training a pest image detection model by using a pest data set through a random gradient descent algorithm;
14) acquiring an image of the insect pest to be detected: acquiring a pest image to be detected, and preprocessing the pest image;
15) obtaining a pest image detection result: and inputting the preprocessed image of the pest to be detected into the trained pest image detection model, and outputting a detection result (c), x, y, w and h, namely the category and the frame position of each pest in the image, by the pest image detection model.
The method for constructing the insect pest image detection model based on the channel attention mechanism comprises the following steps:
21) taking the multi-scale characteristic pyramid prediction structure as a first layer of a pest image detection model, and constructing the multi-scale characteristic pyramid prediction structure:
211) setting insect pest image input into deep convolution neural network to obtain characteristic graphs with down-sampling sizes of 1/4, 1/8, 1/16 and 1/32 times of original images, wherein C is respectivelyi,i∈(2,3,4,5);
212) The 4 characteristic maps C are comparediPerforming feature weighted fusion according to the following mode to obtain a multi-scale feature pyramid prediction structure:
c5 obtaining P5 through convolution with convolution kernel and step length both being 1, and obtaining a characteristic diagram P6 with the size being equal to 1/64 times of the original image through downsampling;
carrying out bilinear interpolation upsampling on the P5 to obtain a feature map C4 with the resolution of the output feature map being 1/16 times, and carrying out feature weighted fusion on the P5 and the C4 to obtain P4;
carrying out bilinear interpolation upsampling on the P4 to obtain a feature map C3 with the resolution of the output feature map being 1/8 times, and carrying out feature weighted fusion on the P4 and the C3 to obtain P3;
carrying out bilinear interpolation upsampling on the P3 to obtain a feature map C2 with the resolution of the output feature map being 1/4 times, and carrying out feature weighted fusion on the P3 and the C2 to obtain P2;
obtained PiI belongs to (2,3,4,5,6) to form a multi-scale feature pyramid;
22) taking the channel product space attention mechanism structure as a second layer of the insect pest image detection model aiming at the multi-scale feature pyramid PiAnd i belongs to (2,3,4,5,6) to construct a channel product space attention mechanism structure after feature layer fusion:
221) for each layer of feature map P on the feature pyramid2、P3、P4、P5、P6Performing global adaptive maximum pooling and global adaptive average pooling to generate context descriptions of two different spaces to obtain global feature information and average feature information, and respectively outputting
Figure BDA0003163005420000031
The characteristic diagram contains the following mathematical expressions of information:
Figure BDA0003163005420000032
wherein ,
Figure BDA0003163005420000033
is a feature diagram F with height H, width W and channel number Cc(i, j) generating, i, j representing coordinates of pixel points on the feature map;
222) respectively aiming at two characteristic graphs
Figure BDA0003163005420000034
The number of channels was reduced to 1/8 times by the attention module based on channel compression, and the results were recorded separately
Figure BDA0003163005420000035
Figure BDA0003163005420000036
223) For two characteristic graphs
Figure BDA0003163005420000037
After the number of channels is amplified by 8 times by using a ReLU nonlinear activation function and an attention module based on channel amplification, the obtained results are respectively recorded as
Figure BDA0003163005420000038
Figure BDA0003163005420000039
224) Will be provided with
Figure BDA00031630054200000310
Figure BDA00031630054200000311
Combining the characteristics of the two channels to obtain characteristics of the two channels, and using a Sigmoid activation function to adaptively model information on the characteristic diagram;
225) and finally, performing Hadamard product on the original characteristic diagram and the characteristic diagram after the adaptive learning modeling to realize the effect of channel characteristic recalibration.
The training of the insect pest image detection model comprises the following steps:
31) inputting the pest data set into a pest image detection model;
32) setting momentum to be 0.9, weight attenuation to be 0.00004, neuron inactivation rate to be 0.5, basic learning rate to be 0.001, training 12 rounds of epochs in a stochastic gradient descent optimization algorithm,
wherein the classification function is a cross entropy loss function, and the mathematical expression is as follows:
Figure BDA00031630054200000312
wherein C represents the number of categories, yiIndicating that if the category is the same as the label category, then take 1, otherwise take 0, piRepresenting the probability of a prediction sample belonging to i;
the bounding box regression function is an L1 norm loss function, and the expression is as follows:
Figure BDA0003163005420000041
wherein G represents the true labeling box, R represents the regression box, and x, y, w, h therein are defined as follows:
x=(x*-xr)/wr
y=(y*-yr)/hr
w=log(w*/wr)
h=log(h*/hr)
x* and y*Is the coordinate of the center point of the label box, w*,h*Width and height of the label box, xr,yr,wr and hrIs the value of the corresponding prediction box.
Advantageous effects
Compared with the traditional single-scale prediction structure, the insect pest image detection method based on the channel attention mechanism can extract a basic neural network with richer characteristics and fuse the characteristics of multiple scales for detection through the multi-scale prediction structure, and can improve the detection precision on the premise of not deepening the network depth; according to the invention, through a channel volume space attention mechanism and through screening of channel characteristics, information reserved during characteristic fusion is more beneficial to reduction of training loss and accuracy of positioning and classification, and simultaneously, the trade-off of performance and detection speed can be balanced through dimension reduction in a certain proportion.
Drawings
FIG. 1 is a sequence diagram of the method of the present invention;
FIG. 2 is a schematic diagram of a multi-scale feature pyramid prediction structure according to the present invention;
FIG. 3 is a schematic diagram of the channel volume spatial attention mechanism for feature layer fusion according to the present invention;
fig. 4 is a diagram showing the effect of the detection result of detecting the insect pest image by using the present invention.
Detailed Description
So that the manner in which the above recited features of the present invention can be understood and readily understood, a more particular description of the invention, briefly summarized above, may be had by reference to embodiments, some of which are illustrated in the appended drawings, wherein:
as shown in FIG. 1, the pest image detection method based on the channel attention mechanism comprises the following steps:
the method comprises the following steps of firstly, collecting insect pest images and establishing an insect pest data set: and acquiring insect pest images, preprocessing and marking the insect pest images, and establishing an insect pest data set. Acquiring a pest image for preprocessing and marking, wherein the preprocessing comprises image size unification, and the data cleaning comprises screening out low-quality images, such as images without pests and overexposed images; and then, labeling a single pest on the pest image by using image labeling software Labelme, correspondingly generating a label file in an xml format for each image, and establishing a pest data set by using the pest image and the corresponding label file together.
Secondly, as shown in fig. 2, constructing a pest image detection model based on a channel attention mechanism: and constructing a pest image detection model, wherein the pest image detection model comprises a multi-scale characteristic pyramid prediction structure and a channel volume space attention mechanism structure used for fusion of characteristic layers. The multi-scale feature pyramid prediction structure integrates features of multiple scales for detection, and detection precision can be improved on the premise of not deepening network depth. The channel product space attention mechanism module has the function of improving the characterization capability of important features by modeling the dependency among the channels of the feature map, and the network can selectively strengthen the features containing important information and inhibit the features with irrelevant or weaker correlation.
The method comprises the following specific steps:
(1) the multi-scale characteristic pyramid prediction structure is used as a first layer of a pest image detection model, and the multi-scale characteristic pyramid prediction structure is a method for detecting by using a deep basic neural network capable of extracting more abundant characteristics and fusing characteristics of multiple scales. Constructing a multi-scale characteristic pyramid prediction structure:
A1) setting insect pest image input into deep convolution neural network to obtain characteristic graphs with down-sampling sizes of 1/4, 1/8, 1/16 and 1/32 times of original images, wherein C is respectivelyi,i∈(2,3,4,5);
A2) The 4 characteristic maps C are comparediPerforming feature weighted fusion according to the following mode to obtain a multi-scale feature pyramid prediction structure:
c5 obtaining P5 through convolution with convolution kernel and step length both being 1, and obtaining a characteristic diagram P6 with the size being equal to 1/64 times of the original image through downsampling;
carrying out bilinear interpolation upsampling on the P5 to obtain a feature map C4 with the resolution of the output feature map being 1/16 times, and carrying out feature weighted fusion on the P5 and the C4 to obtain P4;
carrying out bilinear interpolation upsampling on the P4 to obtain a feature map C3 with the resolution of the output feature map being 1/8 times, and carrying out feature weighted fusion on the P4 and the C3 to obtain P3;
carrying out bilinear interpolation upsampling on the P3 to obtain a feature map C2 with the resolution of the output feature map being 1/4 times, and carrying out feature weighted fusion on the P3 and the C2 to obtain P2;
obtained PiI ∈ (2,3,4,5,6) constitutes a multi-scale feature pyramid.
(2) The detail information of the image is inevitably lost in the up-sampling process of acquiring the high-level semantic information of the image, and particularly, the small objects occupy less pixels in the image and are easily lost in the process of multiple down-sampling. However, these detailed information and small objects may exist in the channels of the low-level feature map. The invention builds the multi-scale characteristic pyramid PiAnd the channel product space attention mechanism structure after feature layer fusion is respectively used on i ∈ (2,3,4,5,6), as shown in FIG. 3.
Taking the channel product space attention mechanism structure as a second layer of the insect pest image detection model aiming at the multi-scale feature pyramid PiAnd i belongs to (2,3,4,5,6) to construct a channel product space attention mechanism structure after feature layer fusion:
B1) for each layer of feature map P on the feature pyramid2、、P3、P4、P5、P6Performing global adaptive maximum pooling and global adaptive average pooling to generate context descriptions of two different spaces to obtain global feature information and average feature information, and respectively outputting
Figure BDA0003163005420000061
The characteristic diagram contains the following mathematical expressions of information:
Figure BDA0003163005420000062
wherein ,
Figure BDA0003163005420000063
is a feature diagram F with height H, width W and channel number Cc(i, j) generating, i, j representing coordinates of pixel points on the feature map;
B2) respectively aiming at two characteristic graphs
Figure BDA0003163005420000064
The number of channels was reduced to 1/8 times by the attention module based on channel compression, and the results were recorded separately
Figure BDA0003163005420000065
Figure BDA0003163005420000066
B3) For two characteristic graphs
Figure BDA0003163005420000067
After the number of channels is amplified by 8 times by using a ReLU nonlinear activation function and an attention module based on channel amplification, the obtained results are respectively recorded as
Figure BDA0003163005420000068
Figure BDA0003163005420000069
B4) Will be provided with
Figure BDA00031630054200000610
Figure BDA00031630054200000611
Combining the characteristics of the two channels to obtain characteristics of the two channels, and using a Sigmoid activation function to adaptively model information on the characteristic diagram;
B5) and finally, performing Hadamard product on the original characteristic diagram and the characteristic diagram after the adaptive learning modeling to realize the effect of channel characteristic recalibration.
The channel space attention module has the function of improving the characterization capability of important features by adaptively modeling the dependency among the channels of the feature map, and the network can selectively strengthen the features containing important information and inhibit the features with irrelevant or weaker correlation.
Thirdly, training a pest image detection model: and training the insect pest image detection model by using an insect pest data set through a random gradient descent algorithm. In practical application, the operating system which can be used is an ubuntu18.04 version, a Pytorch 1.6.0 deep learning framework, a CUDA11.0 version, a 24GB memory, and a device environment training model with a video card being NVIDIA RTX 2080Ti and NVIDIA geforce driver 450.102 version. The method comprises the following specific steps:
(1) inputting the pest data set into a pest image detection model;
(2) set in the stochastic gradient descent optimization algorithm with momentum set to 0.9, weight attenuation set to 0.00004, neuron deactivation rate set to 0.5, base learning rate set to 0.001, training for 12 rounds (epoch),
wherein the classification function is a cross entropy loss function, and the mathematical expression is as follows:
Figure BDA0003163005420000071
wherein C represents the number of categories, yiIndicating that if the category is the same as the label category, then take 1, otherwise take 0, piRepresenting the probability of a prediction sample belonging to i;
the bounding box regression function is an L1 norm loss function, and the expression is as follows:
Figure BDA0003163005420000072
wherein G represents the true labeling box, R represents the regression box, and x, y, w, h therein are defined as follows:
x=(x*-xr)/wr
y=(y*-yr)/hr
w=log(w*/wr)
h=log(h*/hr)
x* and y*Is the coordinate of the center point of the label box, w*,h*Width and height of the label box, xr,yr,wr and hrIs the value of the corresponding prediction box.
Fourthly, acquiring an image of the insect pest to be detected: and acquiring an insect pest image to be detected, and preprocessing the insect pest image.
Fifthly, obtaining a pest image detection result: and inputting the preprocessed image of the pest to be detected into the trained pest image detection model, and outputting a detection result (c), x, y, w and h, namely the category and the frame position of each pest in the image, by the pest image detection model.
As shown in fig. 4, fig. 4 is a diagram illustrating the effect of the detection result of detecting the insect pest image according to the present invention. As can be seen from fig. 4, the detection method proposed by the present invention can still perform well despite the large number and density of pests in the pest image. The method provided by the invention is integrated into a module CRFPN, and can be used for a one-stage detection method, such as RetinaNet; it can also be used in two-stage detection methods, such as Faster R-CNN. Table 1 shows the results of comparison of the different detection methods (unit:%), and as shown in Table 1, the average accuracy of the present invention is superior to that of the other comparison methods. The method of the invention uses CRFPN module and some data enhancement strategies such as random cutting, mirror image and the like on the basis of Faster R-CNN. Table 2 shows the detection accuracy (unit:%) of different detection methods for each type of pest, and as shown in Table 2, the average accuracy of the present invention is superior to that of other comparative methods except for the 26 th type of pest. Particularly, for 1,12 and 15 types of pests with poor detection precision, the invention can still obtain the detection precision of 24.6 percent, 32.4 percent and 48.0 percent, which are much improved compared with the comparison method. The method has a better improvement effect on pests which are difficult to detect, and further has a stronger detection effect compared with other methods.
TABLE 1 comparison of the results of the present invention and various tests (unit:%)
Figure BDA0003163005420000081
TABLE 2 comparison table of pest detection accuracy for each type according to the present invention and different detection methods (unit:%)
Figure BDA0003163005420000082
Figure BDA0003163005420000091
The foregoing shows and describes the general principles, essential features, and advantages of the invention. It will be understood by those skilled in the art that the present invention is not limited to the embodiments described above, which are merely illustrative of the principles of the invention, but that various changes and modifications may be made without departing from the spirit and scope of the invention, which fall within the scope of the invention as claimed. The scope of the invention is defined by the appended claims and equivalents thereof.

Claims (3)

1. A pest image detection method based on a channel attention mechanism is characterized by comprising the following steps:
11) insect pest images are collected and insect pest data sets are established: acquiring a pest image, preprocessing and marking the pest image, and establishing a pest data set;
12) constructing a pest image detection model based on a channel attention mechanism: constructing a pest image detection model, wherein the pest image detection model comprises a multi-scale characteristic pyramid prediction structure and a channel product space attention mechanism structure used for fusion of characteristic layers;
13) training a pest image detection model: training a pest image detection model by using a pest data set through a random gradient descent algorithm;
14) acquiring an image of the insect pest to be detected: acquiring a pest image to be detected, and preprocessing the pest image;
15) obtaining a pest image detection result: and inputting the preprocessed image of the pest to be detected into the trained pest image detection model, and outputting a detection result (c), x, y, w and h, namely the category and the frame position of each pest in the image, by the pest image detection model.
2. A pest image detection method based on a channel attention mechanism according to claim 1, wherein the building of a pest image detection model based on a channel attention mechanism comprises the following steps:
21) taking the multi-scale characteristic pyramid prediction structure as a first layer of a pest image detection model, and constructing the multi-scale characteristic pyramid prediction structure:
211) setting insect pest image input into deep convolution neural network to obtain characteristic graphs with down-sampling sizes of 1/4, 1/8, 1/16 and 1/32 times of original images, wherein C is respectivelyi,i∈(2,3,4,5);
212) The 4 characteristic maps C are comparediPerforming feature weighted fusion according to the following mode to obtain a multi-scale feature pyramid prediction structure:
c5 obtaining P5 through convolution with convolution kernel and step length both being 1, and obtaining a characteristic diagram P6 with the size being equal to 1/64 times of the original image through downsampling;
carrying out bilinear interpolation upsampling on the P5 to obtain a feature map C4 with the resolution of the output feature map being 1/16 times, and carrying out feature weighted fusion on the P5 and the C4 to obtain P4;
carrying out bilinear interpolation upsampling on the P4 to obtain a feature map C3 with the resolution of the output feature map being 1/8 times, and carrying out feature weighted fusion on the P4 and the C3 to obtain P3;
carrying out bilinear interpolation upsampling on the P3 to obtain a feature map C2 with the resolution of the output feature map being 1/4 times, and carrying out feature weighted fusion on the P3 and the C2 to obtain P2;
obtained PiI belongs to (2,3,4,5,6) to form a multi-scale feature pyramid;
22) taking the channel product space attention mechanism structure as a second layer of the insect pest image detection model aiming at the multi-scale feature pyramid PiAnd i belongs to (2,3,4,5,6) to construct a channel product space attention mechanism structure after feature layer fusion:
221) for each layer of feature map P on the feature pyramid2、P3、P4、P5 P6Performing global adaptive max pooling and global adaptive average pooling on an upper layer results in two different spatial upper layersAs described below, to obtain global feature information and average feature information, which are respectively output
Figure FDA0003163005410000021
The characteristic diagram contains the following mathematical expressions of information:
Figure FDA0003163005410000022
wherein ,
Figure FDA0003163005410000023
is a feature diagram F with height H, width W and channel number Cc(i, j) generating, i, j representing coordinates of pixel points on the feature map;
222) respectively aiming at two characteristic graphs
Figure FDA0003163005410000024
The number of channels was reduced to 1/8 times by the attention module based on channel compression, and the results were recorded separately
Figure FDA0003163005410000025
223) For two characteristic graphs
Figure FDA0003163005410000026
Figure FDA0003163005410000027
After the number of channels is amplified by 8 times by using a ReLU nonlinear activation function and an attention module based on channel amplification, the obtained results are respectively recorded as
Figure FDA0003163005410000028
224) Will be provided with
Figure FDA0003163005410000029
Combining the characteristics of the two channels to obtain characteristics of the two channels, and using a Sigmoid activation function to adaptively model information on the characteristic diagram;
225) and finally, performing Hadamard product on the original characteristic diagram and the characteristic diagram after the adaptive learning modeling to realize the effect of channel characteristic recalibration.
3. A pest image detection method based on a channel attention mechanism according to claim 1, wherein the training of the pest image detection model comprises the following steps:
31) inputting the pest data set into a pest image detection model;
32) setting momentum to be 0.9, weight attenuation to be 0.00004, neuron inactivation rate to be 0.5, basic learning rate to be 0.001, training 12 rounds of epochs in a stochastic gradient descent optimization algorithm,
wherein the classification function is a cross entropy loss function, and the mathematical expression is as follows:
Figure FDA0003163005410000031
wherein C represents the number of categories, yiIndicating that if the category is the same as the label category, then take 1, otherwise take 0, piRepresenting the probability of a prediction sample belonging to i;
the bounding box regression function is an L1 norm loss function, and the expression is as follows:
Figure FDA0003163005410000032
wherein G represents the true labeling box, R represents the regression box, and x, y, w, h therein are defined as follows:
x=(x*-xr)/wr
y=(y*-yr)/hr
w=log(w*/wr)
h=log(h*/hr)
x* and y*Is the coordinate of the center point of the label box, w*,h*Width and height of the label box, xr,yr,wr and hrIs the value of the corresponding prediction box.
CN202110796527.XA 2021-07-14 2021-07-14 Insect pest image detection method based on channel attention mechanism Active CN113487576B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110796527.XA CN113487576B (en) 2021-07-14 2021-07-14 Insect pest image detection method based on channel attention mechanism

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110796527.XA CN113487576B (en) 2021-07-14 2021-07-14 Insect pest image detection method based on channel attention mechanism

Publications (2)

Publication Number Publication Date
CN113487576A true CN113487576A (en) 2021-10-08
CN113487576B CN113487576B (en) 2023-08-22

Family

ID=77939528

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110796527.XA Active CN113487576B (en) 2021-07-14 2021-07-14 Insect pest image detection method based on channel attention mechanism

Country Status (1)

Country Link
CN (1) CN113487576B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114155560A (en) * 2022-02-08 2022-03-08 成都考拉悠然科技有限公司 Light weight method of high-resolution human body posture estimation model based on space dimension reduction
CN115359370A (en) * 2022-10-21 2022-11-18 哈尔滨工业大学(深圳)(哈尔滨工业大学深圳科技创新研究院) Remote sensing image cloud detection method and device, computer device and storage medium
CN116883741A (en) * 2023-07-12 2023-10-13 北京市农林科学院 Small sample insect pest detection method based on pyramid attention mechanism
CN117235672A (en) * 2023-11-14 2023-12-15 北京市科学技术研究院 Comprehensive pipe gallery fault diagnosis method and device based on multi-source data

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190294970A1 (en) * 2018-03-23 2019-09-26 The Governing Council Of The University Of Toronto Systems and methods for polygon object annotation and a method of training an object annotation system
CN112508936A (en) * 2020-12-22 2021-03-16 中国科学院空天信息创新研究院 Remote sensing image change detection method based on deep learning
CN112733614A (en) * 2020-12-22 2021-04-30 中国科学院合肥物质科学研究院 Pest image detection method with similar size enhanced identification
CN112836646A (en) * 2021-02-05 2021-05-25 华南理工大学 Video pedestrian re-identification method based on channel attention mechanism and application

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190294970A1 (en) * 2018-03-23 2019-09-26 The Governing Council Of The University Of Toronto Systems and methods for polygon object annotation and a method of training an object annotation system
CN112508936A (en) * 2020-12-22 2021-03-16 中国科学院空天信息创新研究院 Remote sensing image change detection method based on deep learning
CN112733614A (en) * 2020-12-22 2021-04-30 中国科学院合肥物质科学研究院 Pest image detection method with similar size enhanced identification
CN112836646A (en) * 2021-02-05 2021-05-25 华南理工大学 Video pedestrian re-identification method based on channel attention mechanism and application

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
高丹;陈建英;谢盈;: "A-PSPNet:一种融合注意力机制的PSPNet图像语义分割模型", 中国电子科学研究院学报, no. 06 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114155560A (en) * 2022-02-08 2022-03-08 成都考拉悠然科技有限公司 Light weight method of high-resolution human body posture estimation model based on space dimension reduction
CN115359370A (en) * 2022-10-21 2022-11-18 哈尔滨工业大学(深圳)(哈尔滨工业大学深圳科技创新研究院) Remote sensing image cloud detection method and device, computer device and storage medium
CN116883741A (en) * 2023-07-12 2023-10-13 北京市农林科学院 Small sample insect pest detection method based on pyramid attention mechanism
CN117235672A (en) * 2023-11-14 2023-12-15 北京市科学技术研究院 Comprehensive pipe gallery fault diagnosis method and device based on multi-source data
CN117235672B (en) * 2023-11-14 2024-03-08 北京市科学技术研究院 Comprehensive pipe gallery fault diagnosis method and device based on multi-source data

Also Published As

Publication number Publication date
CN113487576B (en) 2023-08-22

Similar Documents

Publication Publication Date Title
CN113487576B (en) Insect pest image detection method based on channel attention mechanism
CN112949673B (en) Feature fusion target detection and identification method based on global attention
CN108460356B (en) Face image automatic processing system based on monitoring system
CN111462126A (en) Semantic image segmentation method and system based on edge enhancement
CN111291809B (en) Processing device, method and storage medium
CN111461083A (en) Rapid vehicle detection method based on deep learning
CN109558811B (en) Motion recognition method based on motion foreground attention and unsupervised key frame extraction
US20230334632A1 (en) Image recognition method and device, and computer-readable storage medium
CN107767416B (en) Method for identifying pedestrian orientation in low-resolution image
CN104700100A (en) Feature extraction method for high spatial resolution remote sensing big data
CN112580458B (en) Facial expression recognition method, device, equipment and storage medium
CN107451565A (en) A kind of semi-supervised small sample deep learning image model classifying identification method
CN112884033B (en) Household garbage classification detection method based on convolutional neural network
WO2023030182A1 (en) Image generation method and apparatus
CN111353544A (en) Improved Mixed Pooling-Yolov 3-based target detection method
CN111178121A (en) Pest image positioning and identifying method based on spatial feature and depth feature enhancement technology
CN112308087B (en) Integrated imaging identification method based on dynamic vision sensor
CN112580480A (en) Hyperspectral remote sensing image classification method and device
CN114005085A (en) Dense crowd distribution detection and counting method in video
CN114092819B (en) Image classification method and device
CN116758609A (en) Lightweight face recognition method based on feature model improvement
CN116363535A (en) Ship detection method in unmanned aerial vehicle aerial image based on convolutional neural network
CN114519383A (en) Image target detection method and system
CN108764233B (en) Scene character recognition method based on continuous convolution activation
CN113505640A (en) Small-scale pedestrian detection method based on multi-scale feature fusion

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant