CN116258711A - Rice leaf roller harmful image detection method based on inclined rectangular frame - Google Patents

Rice leaf roller harmful image detection method based on inclined rectangular frame Download PDF

Info

Publication number
CN116258711A
CN116258711A CN202310274762.XA CN202310274762A CN116258711A CN 116258711 A CN116258711 A CN 116258711A CN 202310274762 A CN202310274762 A CN 202310274762A CN 116258711 A CN116258711 A CN 116258711A
Authority
CN
China
Prior art keywords
rice leaf
image
pest
rectangular frame
inclined rectangular
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.)
Pending
Application number
CN202310274762.XA
Other languages
Chinese (zh)
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 CN202310274762.XA priority Critical patent/CN116258711A/en
Publication of CN116258711A publication Critical patent/CN116258711A/en
Pending legal-status Critical Current

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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • G06T7/62Analysis of geometric attributes of area, perimeter, diameter or volume
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/44Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/764Arrangements for image or video recognition or understanding using pattern recognition or machine learning using classification, e.g. of video objects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/77Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
    • G06V10/774Generating sets of training patterns; Bootstrap methods, e.g. bagging or boosting
    • 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/20212Image combination
    • G06T2207/20221Image fusion; Image merging
    • 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/30181Earth observation
    • G06T2207/30188Vegetation; Agriculture
    • 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
    • Y02A40/00Adaptation technologies in agriculture, forestry, livestock or agroalimentary production
    • Y02A40/10Adaptation technologies in agriculture, forestry, livestock or agroalimentary production in agriculture

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Artificial Intelligence (AREA)
  • Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • Databases & Information Systems (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Software Systems (AREA)
  • Quality & Reliability (AREA)
  • Geometry (AREA)
  • Catching Or Destruction (AREA)

Abstract

The invention relates to a method for detecting harmful images of rice leaf rollers based on an inclined rectangular frame, which solves the problems that the harmful images of the rice leaf rollers in a complex field environment have the phenomena of non-directional growth, various sizes and the like and are difficult to accurately detect compared with the prior art. The invention comprises the following steps: obtaining and preprocessing a harmful image of rice leaf rollers; constructing a rice leaf roller pest detection model; training a rice leaf roller pest detection model; obtaining an image of rice leaf roller pests to be detected; and obtaining the image detection result of the rice leaf roller pest. The invention can realize accurate detection of the rice pest-shaped area in a complex field environment, improve the accuracy of detecting the rice leaf roller pest, and strengthen the visualization capability of detecting the rice leaf roller pest.

Description

Rice leaf roller harmful image detection method based on inclined rectangular frame
Technical Field
The invention relates to the technical field of insect pest image recognition, in particular to a method for detecting a pest-like image of cnaphalocrocis medinalis based on an inclined rectangular frame.
Background
As an insect harmful to agriculture, cnaphalocrocis medinalis is mainly harmful to rice. It can reduce tillering of rice, delay growth period, prevent normal growth of rice and finally reduce yield. Since the pests are hidden in curled leaves, it is difficult to count directly. Therefore, in field investigation, plant protection personnel can only visually record the number of damaged curled blades. However, this method is inefficient and labor intensive. Under the condition of lacking basic plant protection personnel and technical strength, the image detection and identification theory based on the deep learning technology supports automatic monitoring and intelligent investigation of plant diseases and insect pests.
However, the current general target detection algorithm based on deep learning uses a rectangular frame without angles for positioning, and this method may contain a lot of redundant information with low value or easy confusion, so this method cannot meet the detection of harmful situations in practical application requirements.
In particular, the field background is complex, the growth direction of rice plants is random, so that the pest damage symptoms often have the phenomena of inclination, crossing and the like. Therefore, how to detect the pest of cnaphalocrocis medinalis by adopting the inclined frame labeling method and the deep learning technology based on the inclined frame representation has become an urgent technical problem to be solved.
Disclosure of Invention
The invention aims to solve the defect that in the prior art, rice leaf rollers in a complex field environment are harmful, have the phenomena of non-directional growth, various sizes and the like, and are difficult to accurately detect, and provides an inclined rectangular frame-based rice leaf roller harmful image detection method for solving the problems.
In order to achieve the above object, the technical scheme of the present invention is as follows:
a rice leaf roller pest-like image detection method based on an inclined rectangular frame comprises the following steps:
obtaining and preprocessing harmful images of rice leaf rollers: acquiring a rice leaf roller image, setting the image as a harmful image, marking a data set by using inclined rectangular frame marking software ropylelmg, and establishing a harmful training sample set;
constructing a rice leaf roller pest detection model: constructing a rice leaf roller pest detection model based on the inclined rectangular frame;
training of a rice leaf roller pest detection model: training a rice leaf roller pest detection model based on the pest training sample set;
obtaining an image of rice leaf roller pests to be detected: acquiring an image of rice leaf rollers to be detected and preprocessing the image;
obtaining the image detection result of rice leaf roller pests: inputting the image of the rice leaf rollers to be detected into a trained pest-like detection model of the rice leaf rollers to obtain a pest-like image detection result of the rice leaf rollers.
The construction of the rice leaf roller pest detection model comprises the following steps:
the first part of the rice leaf roller pest-shape detection model is a feature extraction module using ResNet-50, the second part is a feature pyramid module using FPN, the third part is a pending inclined rectangular frame acquisition module, and the fourth part is an inclined rectangular detection frame acquisition module;
setting a pending inclined rectangular frame acquisition module:
setting up non-angle rectangular frames at all spatial positions of m layers in the feature pyramid module, wherein the length-width ratio is (0.5, 1, 2), and the areas of non-angle initial rectangular frames of m different layers are (32) 2 ,64 2 ,128 2 ,256 2 ,512 2 );
Acquiring undetermined inclined rectangular frames by using non-angle rectangular frames, selecting undetermined inclined rectangular frames with highest classification probability for each layer, performing maximum value inhibition for nms, and selecting t frames (x p ,y p ,w p ,h p θ) fine tuning by correcting the feature map;
setting an inclined rectangular detection frame acquisition module:
the inclined rectangular detection frame acquisition module comprises an inclined characteristic dimension reduction module and a detection module, wherein the local characteristic dimension reduction corresponding to t undetermined inclined rectangular frames is changed into k x 256, and then the final detection is executed by using 2 full connections;
the t pending-tilting rectangular boxes acquired in the first stage are denoted (x) p ,y p ,w p ,h p θ), corresponding to local features (x) on the feature map acquired by the feature pyramid network f ,y f ,w f ,h f θ), the local features of k x 256 are obtained through the inclined feature dimension reduction module to execute subsequent full connection detection,
Figure BDA0004135798670000031
s is the dimension reduction ratio from the original image to the feature image, and for the (m, n) th feature point in the C (0.ltoreq.c < C) th dimension, the value is:
Figure BDA0004135798670000032
Figure BDA0004135798670000033
wherein 0 is less than or equal to m, n is less than k, l represents the sampling number of single square lattice in k square lattice corresponding to undetermined inclined rectangular frame on the characteristic diagram, F c (R θ (x, y)) means the sampling position (x, y) in a single square by the tilting operationValues in c dimensions.
The training of the rice leaf roller pest detection model comprises the following steps:
inputting the pest-shaped training sample set into a pest-shaped detection model of cnaphalocrocis medinalis;
obtaining feature images of m different layers through a feature extraction module of a rice leaf roller harmful detection model;
inputting the feature graphs of m different layers into a feature pyramid module to obtain m feature graphs fused by different scales;
based on the undetermined inclined rectangular frame acquisition network of the self-adaptive selection training sample mechanism, finding the most suitable ratio threshold value of intersection and union in the initially set non-angle rectangular frame aiming at each harm,
for each harm-like gt, m feature maps fused on different scales respectively acquire N non-angle initial rectangular frames nearest to the harm-like center, m are counted for N, then a ratio set of inclined intersections and union of the m x N non-angle initial rectangular frames and the harm-like gt is calculated, finally a ratio threshold value mean (io us) +std (io us) of the intersection and the union corresponding to the harm-like gt is acquired, a positive sample setting threshold value of each harm-like is obtained in a self-adaption mode according to the statistical characteristics of the data sets, positive samples are guaranteed to exist in each harm-like state during training of the model, negative samples are selected randomly from other non-angle initial rectangular frames, N=256 positive samples are selected by one image by default, and the positive sample ratio is set as 1 by default: 1, a step of;
n training samples are obtained for one image, 256 are defaulted, wherein the number of positive samples is N 1 ,N 1 The positive and negative samples together complete the classification loss L related to the number and specific positions of harmful shapes in the image cls Is used to obtain regression loss L using only positive samples reg As shown in the following formula:
Figure BDA0004135798670000041
p dt acquisition mesh for pending tilting rectangular frameBranch outcome of the classification of the collaterals, p gt Classification labels for samples, p if the sample is a positive sample gt 1, otherwise 0; l (L) cls Using cross entropy loss, L reg Using
Figure BDA0004135798670000042
Losses, including regression losses of center coordinates, long and short sides, and angles,
Figure BDA0004135798670000043
Figure BDA0004135798670000044
Figure BDA0004135798670000045
Figure BDA0004135798670000046
Figure BDA0004135798670000047
Figure BDA0004135798670000048
Figure BDA0004135798670000049
wherein the method comprises the steps of
Figure BDA00041357986700000410
Obtaining a regression branch result of the network for the pending inclined rectangular box, representing a gap between the pending inclined rectangular box and the initial rectangular box without angle, i gt ,i∈{x,y,w,h, θ } is the center coordinate, long and short sides and angle of the marked inclined rectangular frame, ++>
Figure BDA00041357986700000411
Representing the difference between the marked inclined rectangular frame and the initial rectangular frame without angle by minimizing +.>
Figure BDA00041357986700000412
And->
Figure BDA00041357986700000413
The difference between the two is utilized to train a network by using a back propagation algorithm, and the center coordinate (x) of the undetermined inclined rectangular frame is obtained by calculating the network regression branch result and the initial rectangular frame without angles in the test process dt ,y dt ) Long and short edges (w) dt ,h dt ) And tilt angle, angle normalization operation ++>
Figure BDA00041357986700000414
The final result is a pending-tilting rectangular box, denoted (x) dt ,y dt ,w dt ,h dtdt );
Obtaining the regression branch result of the network and the initial rectangular frame without angles through the undetermined inclined rectangular frame, and performing the calculation to obtain the center coordinates, long and short sides and the inclined angle (x) dt ,y dt ,w dt ,h dtdt ) All undetermined inclined rectangular frames obtain local characteristics k x C through inclined characteristic dimension reduction operation, and then 2 full-connection operations are carried out;
the 1024-dimensional feature vector of the final execution detection of the undetermined inclined rectangular frame is obtained, the inclined rectangular detection frame is obtained through the feature vector through 2 full-connection operations respectively, the feature vector comprises classification scores of categories and position information (x, y, w, h, theta) containing inclination angles, and a loss function of an inclined rectangular detection frame obtaining module is identical with that of an undetermined inclined rectangular frame obtaining network.
Advantageous effects
Compared with the prior art, the method for detecting the rice leaf rollers in the harmful state based on the inclined rectangular frame can realize accurate detection of the rice harmful state areas in the complex field environment, improves the accuracy of detecting the rice leaf rollers in the harmful state, and enhances the visualization capability of detecting the rice leaf rollers in the harmful state.
Drawings
FIG. 1 is a process sequence diagram of the present invention;
FIG. 2a is a graph showing the detection effect of the Faster-rcnn detection algorithm of the rectangular frame without angle in the prior art;
FIG. 2b is a graph showing the detection effect by the method of the present invention.
Detailed Description
For a further understanding and appreciation of the structural features and advantages achieved by the present invention, the following description is provided in connection with the accompanying drawings, which are presently preferred embodiments and are incorporated in the accompanying drawings, in which:
as shown in FIG. 1, the method for detecting the harmful image of the cnaphalocrocis medinalis based on the inclined rectangular frame comprises the following steps of:
firstly, obtaining and preprocessing harmful images of rice leaf rollers. And acquiring a rice leaf roller image, setting the image as a harmful image, marking the data set by using inclined rectangular frame marking software ropylelmg, and establishing a harmful training sample set.
Secondly, constructing a rice leaf roller pest detection model: and constructing a rice leaf roller pest detection model based on the inclined rectangular frame. The built model uses an inclined rectangular frame, the obtained detection frame is more concentrated in the area where pests are harmful, the detection frame can be tightly surrounded into a harmful shape under the complex field condition, and meanwhile, the detection result is conveniently checked and corrected.
(1) The method comprises the steps of setting a first part of a rice leaf roller pest-shaped detection model to be a feature extraction module using ResNet-50, a second part of the rice leaf roller pest-shaped detection model to be a feature pyramid module using FPN, a third part of the rice leaf roller pest-shaped detection model to be a pending inclined rectangular frame acquisition module, and a fourth part of the rice leaf roller pest-shaped detection model to be an inclined rectangular detection frame acquisition module. The feature extraction module and the feature pyramid module are traditional modules.
(2) Setting a pending inclined rectangular frame acquisition module:
setting up non-angle rectangular frames at all spatial positions of m layers in the feature pyramid module, wherein the length-width ratio is (0.5, 1, 2), and the areas of non-angle initial rectangular frames of m different layers are (32) 2 ,64 2 ,128 2 ,256 2 ,512 2 );
Acquiring undetermined inclined rectangular frames by using non-angle rectangular frames, selecting undetermined inclined rectangular frames with highest classification probability for each layer, performing maximum value inhibition for nms, and selecting t frames (x p ,y p ,w p ,h p θ) is fine-tuned by correcting the feature map.
(3) Setting an inclined rectangular detection frame acquisition module:
the inclined rectangular detection frame acquisition module comprises an inclined characteristic dimension reduction module and a detection module, wherein the local characteristic dimension reduction corresponding to t undetermined inclined rectangular frames is changed into k x 256, and then the final detection is executed by using 2 full connections;
the t pending-tilting rectangular boxes acquired in the first stage are denoted (x) p ,y p ,w p ,h p θ), corresponding to local features (x) on the feature map acquired by the feature pyramid network f ,y f ,w f ,h f θ), the local features of k x 256 are obtained through the inclined feature dimension reduction module to execute subsequent full connection detection,
Figure BDA0004135798670000061
s is the dimension reduction ratio from the original image to the feature image, and for the (m, n) th feature point in the C (0.ltoreq.c < C) th dimension, the value is:
Figure BDA0004135798670000062
/>
Figure BDA0004135798670000063
wherein 0 is less than or equal to m, n is less than k, l represents the sampling number of single square lattice in k square lattice corresponding to undetermined inclined rectangular frame on the characteristic diagram, F c (R θ (x, y)) represents the value in the c-th dimension of the sampling position (x, y) in a single square after the tilting operation.
Thirdly, training a rice leaf roller pest detection model: and training the rice leaf roller pest detection model based on the pest training sample set. Training the constructed model by using an inclined rectangular frame enables the acquired characteristic map to be concentrated in the pest damage area, and more effective characteristics are extracted for detection.
(1) And (5) inputting the pest-shaped training sample set into a pest-shaped detection model of the cnaphalocrocis medinalis.
(2) And obtaining feature images of m different layers through a feature extraction module of the rice leaf roller harmful detection model.
(3) And inputting the feature graphs of m different layers into a feature pyramid module to obtain m feature graphs fused by different scales.
(4) Based on the undetermined inclined rectangular frame acquisition network of the self-adaptive selection training sample mechanism, finding the most suitable ratio threshold value of intersection and union in the initially set non-angle rectangular frame aiming at each harm,
for each harm-like gt, m feature maps fused on different scales respectively acquire N non-angle initial rectangular frames nearest to the harm-like center, m are counted for N, then a ratio set of inclined intersections and union of the m x N non-angle initial rectangular frames and the harm-like gt is calculated, finally a ratio threshold value mean (io us) +std (io us) of the intersection and the union corresponding to the harm-like gt is acquired, a positive sample setting threshold value of each harm-like is obtained in a self-adaption mode according to the statistical characteristics of the data sets, positive samples are guaranteed to exist in each harm-like state during training of the model, negative samples are selected randomly from other non-angle initial rectangular frames, N=256 positive samples are selected by one image by default, and the positive sample ratio is set as 1 by default: 1, a step of;
n training samples are obtained for one image, 256 are defaulted, wherein the training samples are positiveThe number of samples is N 1 ,N 1 The positive and negative samples together complete the classification loss L related to the number and specific positions of harmful shapes in the image cls Is used to obtain regression loss L using only positive samples reg As shown in the following formula:
Figure BDA0004135798670000071
p dt obtaining the classified branch result of the network for the pending inclined rectangle box, p gt Classification labels for samples, p if the sample is a positive sample gt 1, otherwise 0; l (L) cls Using cross entropy loss, L reg Using
Figure BDA0004135798670000072
Losses, including regression losses of center coordinates, long and short sides, and angles,
Figure BDA0004135798670000073
Figure BDA0004135798670000074
Figure BDA0004135798670000075
Figure BDA0004135798670000081
Figure BDA0004135798670000082
Figure BDA0004135798670000083
/>
Figure BDA0004135798670000084
wherein the method comprises the steps of
Figure BDA0004135798670000085
Obtaining a regression branch result of the network for the pending inclined rectangular box, representing a gap between the pending inclined rectangular box and the initial rectangular box without angle, i gt I epsilon { x, y, w, h, θ } is the center coordinate, long and short sides and angle of the marked inclined rectangular frame, +.>
Figure BDA0004135798670000086
Representing the difference between the marked inclined rectangular frame and the initial rectangular frame without angle by minimizing +.>
Figure BDA0004135798670000087
And->
Figure BDA0004135798670000088
The difference between the two is utilized to train a network by using a back propagation algorithm, and the center coordinate (x) of the undetermined inclined rectangular frame is obtained by calculating the network regression branch result and the initial rectangular frame without angles in the test process dt ,y dt ) Long and short edges (w) dt ,h dt ) And tilt angle, angle normalization operation ++>
Figure BDA0004135798670000089
The final result is a pending-tilting rectangular box, denoted (x) dt ,y dt ,w dt ,h dtdt )。
(5) Obtaining the regression branch result of the network and the initial rectangular frame without angles through the undetermined inclined rectangular frame, and performing the calculation to obtain the center coordinates, long and short sides and the inclined angle (x) dt ,y dt ,w dt ,h dtdt ) All undetermined inclined rectangular frames obtain local characteristics k x C through inclined characteristic dimension reduction operation, and then pass through 2Full connection operation;
the 1024-dimensional feature vector of the final execution detection of the undetermined inclined rectangular frame is obtained, the inclined rectangular detection frame is obtained through the feature vector through 2 full-connection operations respectively, the feature vector comprises classification scores of categories and position information (x, y, w, h, theta) containing inclination angles, and a loss function of an inclined rectangular detection frame obtaining module is identical with that of an undetermined inclined rectangular frame obtaining network.
Fourth, obtaining an image of rice leaf roller pests to be detected: and obtaining an image of the cnaphalocrocis medinalis to be detected and preprocessing the image.
Fifthly, obtaining an image detection result of rice leaf roller pests: inputting the image of the rice leaf rollers to be detected into a trained pest-like detection model of the rice leaf rollers to obtain a pest-like image detection result of the rice leaf rollers.
As shown in fig. 2a and fig. 2b, it can be seen that compared with a general rectangular frame without angles, the inclined rectangular frame of the invention can more accurately position pest damage under natural conditions, especially in places where the damage is dense or crossed, and is convenient for naked eyes to check the detection result of pictures.
The foregoing has shown and described the basic principles, principal 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, and that the above embodiments and descriptions are merely illustrative of the principles of the present invention, and various changes and modifications may be made therein without departing from the spirit and scope of the invention, which is defined by the appended claims. The scope of the invention is defined by the appended claims and equivalents thereof.

Claims (3)

1. The method for detecting the harmful image of the cnaphalocrocis medinalis based on the inclined rectangular frame is characterized by comprising the following steps of:
11 Obtaining and preprocessing harmful images of rice leaf rollers: acquiring a rice leaf roller image, setting the image as a harmful image, marking a data set by using inclined rectangular frame marking software ropylelmg, and establishing a harmful training sample set;
12 Building a rice leaf roller pest detection model: constructing a rice leaf roller pest detection model based on the inclined rectangular frame;
13 Training of rice leaf rollers as pest detection model: training a rice leaf roller pest detection model based on the pest training sample set;
14 Obtaining an image of rice leaf roller pests to be detected: acquiring an image of rice leaf rollers to be detected and preprocessing the image;
15 Obtaining the image detection result of rice leaf roller pests: inputting the image of the rice leaf rollers to be detected into a trained pest-like detection model of the rice leaf rollers to obtain a pest-like image detection result of the rice leaf rollers.
2. The method for detecting the pest-like image of rice leaf rollers based on the inclined rectangular frame as claimed in claim 1, wherein the construction of the pest-like detection model of rice leaf rollers comprises the following steps:
21 Setting a first part of a rice leaf roller pest-shaped detection model as a feature extraction module using ResNet-50, a second part as a feature pyramid module using FPN, a third part as a pending inclined rectangular frame acquisition module and a fourth part as an inclined rectangular detection frame acquisition module;
22 A pending inclined rectangular frame acquisition module) is set:
setting up non-angle rectangular frames at all spatial positions of m layers in the feature pyramid module, wherein the length-width ratio is (0.5, 1, 2), and the areas of non-angle initial rectangular frames of m different layers are (32) 2 ,64 2 ,128 2 ,256 2 ,512 2 );
Acquiring undetermined inclined rectangular frames by using non-angle rectangular frames, selecting undetermined inclined rectangular frames with highest classification probability for each layer, performing maximum value inhibition for nms, and selecting t frames (x p ,y p ,w p ,h p θ) fine tuning by correcting the feature map;
23 A set inclined rectangular detection frame acquisition module:
the inclined rectangular detection frame acquisition module comprises an inclined characteristic dimension reduction module and a detection module, wherein the local characteristic dimension reduction corresponding to t undetermined inclined rectangular frames is changed into k x 256, and then the final detection is executed by using 2 full connections;
the t pending-tilting rectangular boxes acquired in the first stage are denoted (x) p ,y p ,w p ,h p θ), corresponding to local features (x) on the feature map acquired by the feature pyramid network f ,y f ,w f ,h f θ), the local features of k x 256 are obtained through the inclined feature dimension reduction module to execute subsequent full connection detection,
Figure FDA0004135798660000021
s is the dimension reduction ratio from the original image to the feature image, and for the (m, n) th feature point in the C (0.ltoreq.c < C) th dimension, the value is:
Figure FDA0004135798660000022
Figure FDA0004135798660000023
wherein 0 is less than or equal to m, n is less than k, l represents the sampling number of single square lattice in k square lattice corresponding to undetermined inclined rectangular frame on the characteristic diagram, F c (R θ (x, y)) represents the value in the c-th dimension of the sampling position (x, y) in a single square after the tilting operation.
3. The method for detecting the pest-like image of the cnaphalocrocis medinalis based on the inclined rectangular frame as claimed in claim 1, wherein the training of the pest-like detection model of the cnaphalocrocis medinalis comprises the following steps:
31 Inputting the harmful training sample set into a rice leaf roller detection model;
32 The feature extraction module of the harmful detection model of the cnaphalocrocis medinalis to obtain feature graphs of m different layers;
33 Inputting the feature graphs of m different layers into a feature pyramid module to obtain m feature graphs fused by different scales;
34 Based on the undetermined inclined rectangular frame acquisition network of the self-adaptive selection training sample mechanism, finding the most suitable ratio threshold value of intersection and union in the initially set non-angle rectangular frame aiming at each harm,
for each harm-like gt, m feature maps fused on different scales respectively acquire N non-angle initial rectangular frames nearest to the harm-like center, m are counted for N, then a ratio set of inclined intersections and union of the m x N non-angle initial rectangular frames and the harm-like gt is calculated, finally a ratio threshold value mean (io us) +std (io us) of the intersection and the union corresponding to the harm-like gt is acquired, a positive sample setting threshold value of each harm-like is obtained in a self-adaption mode according to the statistical characteristics of the data sets, positive samples are guaranteed to exist in each harm-like state during training of the model, negative samples are selected randomly from other non-angle initial rectangular frames, N=256 positive samples are selected by one image by default, and the positive sample ratio is set as 1 by default: 1, a step of;
n training samples are obtained for one image, 256 are defaulted, wherein the number of positive samples is N 1 ,N 1 The positive and negative samples together complete the classification loss L related to the number and specific positions of harmful shapes in the image cls Is used to obtain regression loss L using only positive samples reg As shown in the following formula:
Figure FDA0004135798660000031
p dt obtaining the classified branch result of the network for the pending inclined rectangle box, p gt Classification labels for samples, p if the sample is a positive sample gt 1, otherwise 0; l (L) cls Using cross entropy loss, L reg Using
Figure FDA0004135798660000032
Losses, including regression losses of center coordinates, long and short sides, and angles,
Figure FDA0004135798660000033
Figure FDA0004135798660000034
Figure FDA0004135798660000035
Figure FDA0004135798660000036
Figure FDA0004135798660000037
Figure FDA0004135798660000038
Figure FDA0004135798660000039
wherein the method comprises the steps of
Figure FDA00041357986600000310
Obtaining a regression branch result of the network for the pending inclined rectangular box, representing a gap between the pending inclined rectangular box and the initial rectangular box without angle, i gt I epsilon { x, y, w, h, θ } is the labeled moment of inclinationCenter coordinates, long and short sides and angle of the frame, +.>
Figure FDA00041357986600000311
Representing the difference between the marked inclined rectangular frame and the initial rectangular frame without angle by minimizing +.>
Figure FDA00041357986600000312
And->
Figure FDA00041357986600000313
The difference between the two is utilized to train a network by using a back propagation algorithm, and the center coordinate (x) of the undetermined inclined rectangular frame is obtained by calculating the network regression branch result and the initial rectangular frame without angles in the test process dt ,y dt ) Long and short edges (w) dt ,h dt ) And tilt angle, angle normalization operation ++>
Figure FDA00041357986600000314
The final result is a pending-tilting rectangular box, denoted (x) dt ,y dt ,w dt ,h dtdt );
35 Obtaining the regression branch result of the network and the initial rectangular frame without angles through the undetermined inclined rectangular frame, and obtaining the center coordinates, long and short sides and the inclined angle (x) of the undetermined inclined rectangular frame by the calculation dt ,y dt ,w dt ,h dtdt ) All undetermined inclined rectangular frames obtain local characteristics k x C through inclined characteristic dimension reduction operation, and then 2 full-connection operations are carried out;
the 1024-dimensional feature vector of the final execution detection of the undetermined inclined rectangular frame is obtained, the inclined rectangular detection frame is obtained through the feature vector through 2 full-connection operations respectively, the feature vector comprises classification scores of categories and position information (x, y, w, h, theta) containing inclination angles, and a loss function of an inclined rectangular detection frame obtaining module is identical with that of an undetermined inclined rectangular frame obtaining network.
CN202310274762.XA 2023-03-16 2023-03-16 Rice leaf roller harmful image detection method based on inclined rectangular frame Pending CN116258711A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310274762.XA CN116258711A (en) 2023-03-16 2023-03-16 Rice leaf roller harmful image detection method based on inclined rectangular frame

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310274762.XA CN116258711A (en) 2023-03-16 2023-03-16 Rice leaf roller harmful image detection method based on inclined rectangular frame

Publications (1)

Publication Number Publication Date
CN116258711A true CN116258711A (en) 2023-06-13

Family

ID=86682556

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310274762.XA Pending CN116258711A (en) 2023-03-16 2023-03-16 Rice leaf roller harmful image detection method based on inclined rectangular frame

Country Status (1)

Country Link
CN (1) CN116258711A (en)

Similar Documents

Publication Publication Date Title
CN108961235B (en) Defective insulator identification method based on YOLOv3 network and particle filter algorithm
Song et al. Kiwifruit detection in field images using Faster R-CNN with VGG16
WO2020177432A1 (en) Multi-tag object detection method and system based on target detection network, and apparatuses
CN109766887B (en) Multi-target detection method based on cascaded hourglass neural network
CN112084869B (en) Compact quadrilateral representation-based building target detection method
CN113076871B (en) Fish shoal automatic detection method based on target shielding compensation
CN109087294A (en) A kind of product defects detection method, system and computer readable storage medium
JP2020123330A (en) Method for acquiring sample image for label acceptance inspection from among auto-labeled images utilized for neural network learning, and sample image acquisition device utilizing the same
CN110796048A (en) Ship target real-time detection method based on deep neural network
CN114973002A (en) Improved YOLOv 5-based ear detection method
CN113312999B (en) High-precision detection method and device for diaphorina citri in natural orchard scene
CN110647802A (en) Remote sensing image ship target detection method based on deep learning
CN116091951A (en) Method and system for extracting boundary line between farmland and tractor-ploughing path
CN116597224A (en) Potato defect detection method based on improved YOLO V8 network model
CN113850136A (en) Yolov5 and BCNN-based vehicle orientation identification method and system
CN116168240A (en) Arbitrary-direction dense ship target detection method based on attention enhancement
CN112164030A (en) Method and device for quickly detecting rice panicle grains, computer equipment and storage medium
CN116363532A (en) Unmanned aerial vehicle image traffic target detection method based on attention mechanism and re-parameterization
Li et al. Insect detection and counting based on YOLOv3 model
CN104484679B (en) Non- standard rifle shooting warhead mark image automatic identifying method
CN115272882A (en) Discrete building detection method and system based on remote sensing image
CN109615610B (en) Medical band-aid flaw detection method based on YOLO v2-tiny
CN111444816A (en) Multi-scale dense pedestrian detection method based on fast RCNN
CN114581307A (en) Multi-image stitching method, system, device and medium for target tracking identification
CN111274986B (en) Dish identification and classification method based on image analysis

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