CN112288022B - A Grain Insect Recognition Method and Recognition System Based on Feature Fusion of SSD Algorithm - Google Patents
A Grain Insect Recognition Method and Recognition System Based on Feature Fusion of SSD Algorithm Download PDFInfo
- Publication number
- CN112288022B CN112288022B CN202011205968.XA CN202011205968A CN112288022B CN 112288022 B CN112288022 B CN 112288022B CN 202011205968 A CN202011205968 A CN 202011205968A CN 112288022 B CN112288022 B CN 112288022B
- Authority
- CN
- China
- Prior art keywords
- grain
- neural network
- network model
- feature
- output
- 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.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 39
- 241000238631 Hexapoda Species 0.000 title claims abstract description 34
- 230000004927 fusion Effects 0.000 title claims abstract description 31
- 238000003062 neural network model Methods 0.000 claims abstract description 38
- 238000012549 training Methods 0.000 claims description 16
- 238000010586 diagram Methods 0.000 claims description 12
- 235000005824 Zea mays ssp. parviglumis Nutrition 0.000 claims description 6
- 235000002017 Zea mays subsp mays Nutrition 0.000 claims description 6
- 230000004913 activation Effects 0.000 claims description 6
- 238000004590 computer program Methods 0.000 claims description 6
- 235000005822 corn Nutrition 0.000 claims description 6
- 230000006870 function Effects 0.000 claims description 6
- 241000254173 Coleoptera Species 0.000 claims description 5
- 241000254171 Curculionidae Species 0.000 claims description 5
- 241000254113 Tribolium castaneum Species 0.000 claims 3
- 241000595629 Plodia interpunctella Species 0.000 claims 2
- 241000209149 Zea Species 0.000 claims 2
- 241000209020 Cornus Species 0.000 claims 1
- 241000254086 Tribolium <beetle> Species 0.000 claims 1
- 238000001514 detection method Methods 0.000 abstract description 19
- 230000007547 defect Effects 0.000 abstract description 2
- 238000003064 k means clustering Methods 0.000 abstract description 2
- 235000013339 cereals Nutrition 0.000 description 59
- 238000012545 processing Methods 0.000 description 6
- 240000008042 Zea mays Species 0.000 description 4
- 230000008569 process Effects 0.000 description 4
- 238000013135 deep learning Methods 0.000 description 3
- JEIPFZHSYJVQDO-UHFFFAOYSA-N iron(III) oxide Inorganic materials O=[Fe]O[Fe]=O JEIPFZHSYJVQDO-UHFFFAOYSA-N 0.000 description 3
- 238000004519 manufacturing process Methods 0.000 description 3
- 238000012544 monitoring process Methods 0.000 description 3
- 241001397056 Calamobius filum Species 0.000 description 2
- 244000078127 Eleusine coracana Species 0.000 description 2
- 241001426056 Eleusine coracana subsp. coracana Species 0.000 description 2
- 235000000884 Oryzopsis hymenoides Nutrition 0.000 description 2
- 235000007199 Panicum miliaceum Nutrition 0.000 description 2
- 235000007195 Pennisetum typhoides Nutrition 0.000 description 2
- 235000007230 Sorghum bicolor Nutrition 0.000 description 2
- 244000062793 Sorghum vulgare Species 0.000 description 2
- 241000607479 Yersinia pestis Species 0.000 description 2
- 235000013305 food Nutrition 0.000 description 2
- 238000007499 fusion processing Methods 0.000 description 2
- 235000019713 millet Nutrition 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000010606 normalization Methods 0.000 description 2
- 238000005457 optimization Methods 0.000 description 2
- 241000406668 Loxodonta cyclotis Species 0.000 description 1
- 231100000757 Microbial toxin Toxicity 0.000 description 1
- 241000131102 Oryzaephilus Species 0.000 description 1
- 238000013528 artificial neural network Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000013527 convolutional neural network Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000000605 extraction Methods 0.000 description 1
- 230000036541 health Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000004060 metabolic process Effects 0.000 description 1
- 244000005700 microbiome Species 0.000 description 1
- 235000019198 oils Nutrition 0.000 description 1
- 238000007500 overflow downdraw method Methods 0.000 description 1
- 238000011897 real-time detection Methods 0.000 description 1
- 238000011160 research Methods 0.000 description 1
- 238000003860 storage Methods 0.000 description 1
- 238000012360 testing method Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/23—Clustering techniques
- G06F18/232—Non-hierarchical techniques
- G06F18/2321—Non-hierarchical techniques using statistics or function optimisation, e.g. modelling of probability density functions
- G06F18/23213—Non-hierarchical techniques using statistics or function optimisation, e.g. modelling of probability density functions with fixed number of clusters, e.g. K-means clustering
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/21—Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
- G06F18/214—Generating training patterns; Bootstrap methods, e.g. bagging or boosting
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/25—Fusion techniques
- G06F18/253—Fusion techniques of extracted features
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/045—Combinations of networks
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- Evolutionary Computation (AREA)
- Life Sciences & Earth Sciences (AREA)
- Artificial Intelligence (AREA)
- General Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Evolutionary Biology (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Bioinformatics & Computational Biology (AREA)
- Biophysics (AREA)
- Health & Medical Sciences (AREA)
- Biomedical Technology (AREA)
- Probability & Statistics with Applications (AREA)
- Computational Linguistics (AREA)
- General Health & Medical Sciences (AREA)
- Molecular Biology (AREA)
- Computing Systems (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Image Analysis (AREA)
Abstract
本发明涉及一种基于SSD算法的特征融合的粮虫识别方法和识别系统,识别方法包括如下步骤:建立数据集;建立神经网络模型并采用数据集对其进行训练,得到训练后的神经网络模型;采集待识别的粮虫图像,将其输入到训练后的神经网络模型中,检测出其中的粮虫种类和位置。本发明所提供的技术方案,将神经网络模型中的卷积层conv4_3和conv5_3的输出特征图进行融合,删除对小目标检测不利的block11,并且采用K‑means聚类算法得到适合粮虫的先验框,改善原始SSD中默认先验框的缺陷,使之更有利于粮虫的识别和定位,能够解决现有技术中对粮虫识别准确性差的问题。
The invention relates to a grain worm identification method and identification system based on SSD algorithm feature fusion. The identification method comprises the following steps: establishing a data set; establishing a neural network model and using the data set to train it, and obtaining a trained neural network model ; Collect the images of grain worms to be identified, input them into the trained neural network model, and detect the types and locations of grain worms in them. The technical scheme provided by the present invention fuses the output feature maps of the convolutional layers conv4_3 and conv5_3 in the neural network model, deletes the block 11 that is unfavorable for small target detection, and adopts the K-means clustering algorithm to obtain the first suitable for grain insects. It can improve the defect of the default a priori frame in the original SSD and make it more conducive to the identification and positioning of grain worms, which can solve the problem of poor recognition accuracy of grain worms in the prior art.
Description
技术领域technical field
本发明涉及粮虫识别技术领域,具体涉及一种基于SSD算法的特征融合的粮虫识别方法和识别系统。The invention relates to the technical field of grain worm identification, in particular to a grain worm identification method and identification system based on SSD algorithm feature fusion.
背景技术Background technique
粮油食品在其生产、加工、储藏的全过程中,都会受到储粮害虫的侵害。粮虫不仅会食用粮食,造成粮食数量的损失,而且其生活代谢的产物会使粮食发热,加剧粮食微生物的活动,使粮食腐烂变质,并可能诱发微生物毒素的产生。另外,由于害虫的尸体和排泄物在粮食中的存在,也对粮食造成了污染,使粮食的卫生质量下降,危害使用者的健康。Grain, oil and food will be attacked by stored grain pests in the whole process of production, processing and storage. Grain worms will not only eat grain, causing the loss of grain quantity, but also the products of their life metabolism will heat up the grain, aggravate the activity of grain microorganisms, make the grain rot and deteriorate, and may induce the production of microbial toxins. In addition, due to the existence of the corpses and excrement of the pests in the grains, the grains are also polluted, the hygienic quality of the grains is degraded, and the health of the users is endangered.
目前随着计算机技术的发展,粮食行业的信息化要求也越来越高。因为智能仓储技术的引入,在仓储环节中的粮食品质监控也是越来越高效。粮虫检测作为粮食品质监控环节中的重要一环,基于图像处理的粮虫检测已经逐渐成为近些年的研究热点。粮虫图像检测包括传统的数字处理和深度学习图像处理两种方式。根据智能仓储的在线监控要求,粮虫检测的精度和实时性需要进一步的提高。传统的图像处理技术由于精度和实时性问题已经逐渐被淘汰。深度学习图像处理技术中的目标检测算法,不仅可以对检测目标进行精准定位,而且单阶段的目标检测算法,经过不断的优化处理速度已经达到实时的要求。At present, with the development of computer technology, the informatization requirements of the food industry are also getting higher and higher. Because of the introduction of intelligent warehousing technology, grain quality monitoring in warehousing is becoming more and more efficient. As an important part of grain quality monitoring, grain and insect detection based on image processing has gradually become a research hotspot in recent years. Grain and insect image detection includes traditional digital processing and deep learning image processing. According to the online monitoring requirements of intelligent warehousing, the accuracy and real-time performance of grain and insect detection need to be further improved. The traditional image processing technology has been gradually eliminated due to the problems of accuracy and real-time performance. The target detection algorithm in the deep learning image processing technology can not only accurately locate the detection target, but also the single-stage target detection algorithm has achieved real-time requirements after continuous optimization.
单阶段目标检测算法以YOLO(You Only Live Once)和SSD(Single Shot Multi-Box Detector)为代表,以检测速度快而闻名,目前已经应用交通标志检测、无人机目标检测、遥感目标检测、行人视频监控等各个行业中,但是由于粮虫的体积较小,现有技术中的检测方法对其进行识别时,存在识别结果不准确的问题。The single-stage target detection algorithm is represented by YOLO (You Only Live Once) and SSD (Single Shot Multi-Box Detector), which are famous for their fast detection speed. At present, traffic sign detection, UAV target detection, remote sensing target detection, In various industries such as pedestrian video surveillance, however, due to the small size of grain worms, the detection method in the prior art has the problem of inaccurate identification results when identifying them.
发明内容SUMMARY OF THE INVENTION
本发明的目的是提供一种基于SSD算法的特征融合的粮虫识别方法和识别系统,以解决现有技术中对粮虫识别不准确的问题。The purpose of the present invention is to provide a grain worm identification method and identification system based on SSD algorithm feature fusion, so as to solve the problem of inaccurate identification of grain worms in the prior art.
为实现上述目的,本发明采用如下技术方案:To achieve the above object, the present invention adopts the following technical solutions:
一种基于SSD算法的特征融合的粮虫识别方法,包括如下步骤:A grain worm identification method based on feature fusion of SSD algorithm, comprising the following steps:
步骤一:建立数据集;Step 1: Create a dataset;
步骤二:建立神经网络模型,并采用数据集的训练数据对其进行训练,得到训练后的神经网络模型;Step 2: establishing a neural network model, and using the training data of the dataset to train it to obtain a trained neural network model;
步骤三:采集待识别的粮虫图像,将其输入到训练后的神经网络模型中,检测出其中的粮虫种类和位置;Step 3: Collect the images of grain worms to be identified, input them into the trained neural network model, and detect the types and locations of grain worms in them;
所述数据集中的训练数据包括多张粮虫图片,每张图片上只有一种粮虫的图像,每张图片分辨率为640×480;The training data in the data set includes multiple pictures of grain worms, each picture has only one kind of grain worm image, and the resolution of each picture is 640×480;
所述神经网络模型的特征图包括block12、block7、block8、block9和block10,其中block12由卷积层conv4_3和conv5_3输出的特征图通过TOP-DOWN模块融合而成,block7、block8、block9和block10分别为卷积层conv7、conv8_2、conv9_2和conv10_2输出的特征图,各特征图先验框的大小通过K-means算法进行聚类得到。The feature maps of the neural network model include block12, block7, block8, block9 and block10, wherein block12 is formed by the fusion of the feature maps output by the convolutional layers conv4_3 and conv5_3 through the TOP-DOWN module, and block7, block8, block9 and block10 are respectively The feature maps output by the convolutional layers conv7, conv8_2, conv9_2 and conv10_2, and the size of the prior frame of each feature map is obtained by clustering the K-means algorithm.
进一步的,使用TOP-DOWN模块融合卷积层conv4_3和conv5_3输出的特征图方法为:Further, the feature map method of using the TOP-DOWN module to fuse the output of the convolutional layers conv4_3 and conv5_3 is:
对卷积层conv5_3输出的特征图进行一次卷积和两次反卷积,然后接入BN模块;Perform one convolution and two deconvolutions on the feature map output by the convolutional layer conv5_3, and then access the BN module;
对浅层卷积层conv4_3输出特征图进行两次卷积操作,然后接入BN模块;Perform two convolution operations on the output feature map of the shallow convolution layer conv4_3, and then access the BN module;
对卷积层conv5_3输出的特征图和卷积层conv4_3输出特征图进行特征融合,最后经过Relu激活函数输出最终融合后的特征图。Feature fusion is performed on the feature map output by the convolutional layer conv5_3 and the output feature map of the convolutional layer conv4_3, and finally the final fused feature map is output through the Relu activation function.
进一步的,采用点乘的方式对卷积层conv5_3输出的特征图和卷积层conv4_3输出特征图进行特征融合。Further, feature fusion is performed on the feature map output by the convolution layer conv5_3 and the feature map output by the convolution layer conv4_3 by means of point multiplication.
进一步的,通过K-means算法计算各特征图先验框大小的方法包括如下步骤:Further, the method for calculating the size of the prior frame of each feature map by the K-means algorithm includes the following steps:
对数据集图像中的粮虫进行标注,并进行初始化,得到m个聚类中心;Label and initialize the grain worms in the dataset images to obtain m cluster centers;
计算数据集中所有GT与各个聚类中心之间的距离,将与其距离最近的聚类中心作为其索引,将索引相同的特征点作为同一聚类;Calculate the distance between all GTs in the dataset and each cluster center, take the cluster center with the closest distance as its index, and take the feature points with the same index as the same cluster;
当连续两次的聚类结果相同时,判断为聚类结束;When two consecutive clustering results are the same, it is judged that the clustering is over;
将各聚类的最小包围框作为先验框。The minimum bounding box of each cluster is taken as the prior box.
进一步的,所述粮虫包括但不限于玉米象、赤拟谷盗、谷蠹、锈赤扁谷盗和印度谷螟。Further, the grain insects include, but are not limited to, corn weevil, red millet, beetle, rust millet and Indian millet.
一种基于SDD算法的特征融合的粮虫识别系统,包括处理器和存储器,存储器上存储有用于在处理器上执行的计算机程序;所述处理器执行所述计算机程序时,实现基于SDD算法的特征融合的粮虫识别方法,该方法包括如下步骤:A grain insect identification system based on SDD algorithm feature fusion, comprising a processor and a memory, and the memory stores a computer program for execution on the processor; when the processor executes the computer program, the SDD algorithm-based algorithm is realized. A feature fusion method for identifying grains and insects, the method comprises the following steps:
步骤一:建立数据集;Step 1: Create a dataset;
步骤二:建立神经网络模型,并采用数据集的训练数据对其进行训练,得到训练后的神经网络模型;Step 2: establishing a neural network model, and using the training data of the dataset to train it to obtain a trained neural network model;
步骤三:采集待识别的粮虫图像,将其输入到训练后的神经网络模型中,检测出其中的粮虫种类和位置;Step 3: Collect the images of grain worms to be identified, input them into the trained neural network model, and detect the types and locations of grain worms in them;
所述数据集中的训练数据包括多张粮虫图片,每张图片上只有一种粮虫的图像,每张图片分辨率为640×480;The training data in the data set includes multiple pictures of grain worms, each picture has only one kind of grain worm image, and the resolution of each picture is 640×480;
所述神经网络模型的特征图包括block12、block7、block8、block9和block10,其中block12由卷积层conv4_3和conv5_3输出的特征图通过TOP-DOWN模块融合而成,block7、block8、block9和block10分别为卷积层conv7、conv8_2、conv9_2和conv10_2输出的特征图,各特征图先验框的大小通过K-means算法进行聚类得到。The feature maps of the neural network model include block12, block7, block8, block9 and block10, wherein block12 is formed by the fusion of the feature maps output by the convolutional layers conv4_3 and conv5_3 through the TOP-DOWN module, and block7, block8, block9 and block10 are respectively The feature maps output by the convolutional layers conv7, conv8_2, conv9_2 and conv10_2, and the size of the prior frame of each feature map is obtained by clustering the K-means algorithm.
进一步的,使用TOP-DOWN模块融合卷积层conv4_3和conv5_3输出的特征图方法为:Further, the feature map method of using the TOP-DOWN module to fuse the output of the convolutional layers conv4_3 and conv5_3 is:
对卷积层conv5_3输出的特征图进行一次卷积和两次反卷积,然后接入BN模块;Perform one convolution and two deconvolutions on the feature map output by the convolutional layer conv5_3, and then access the BN module;
对浅层卷积层conv4_3输出特征图进行两次卷积操作,然后接入BN模块;Perform two convolution operations on the output feature map of the shallow convolution layer conv4_3, and then access the BN module;
对卷积层conv5_3输出的特征图和卷积层conv4_3输出特征图进行特征融合,最后经过Relu激活函数输出最终融合后的特征图。Feature fusion is performed on the feature map output by the convolutional layer conv5_3 and the output feature map of the convolutional layer conv4_3, and finally the final fused feature map is output through the Relu activation function.
进一步的,采用点乘的方式对卷积层conv5_3输出的特征图和卷积层conv4_3输出特征图进行特征融合。Further, feature fusion is performed on the feature map output by the convolution layer conv5_3 and the feature map output by the convolution layer conv4_3 by means of point multiplication.
进一步的,通过K-means算法计算各特征图先验框大小的方法包括如下步骤:Further, the method for calculating the size of the prior frame of each feature map by the K-means algorithm includes the following steps:
对数据集图像中的粮虫进行标注,并进行初始化,得到m个聚类中心;Label and initialize the grain worms in the dataset images to obtain m cluster centers;
计算数据集中所有GT与各个聚类中心之间的距离,将与其距离最近的聚类中心作为其索引,将索引相同的特征点作为同一聚类;Calculate the distance between all GTs in the dataset and each cluster center, take the cluster center with the closest distance as its index, and take the feature points with the same index as the same cluster;
当连续两次的聚类结果相同时,判断为聚类结束;When two consecutive clustering results are the same, it is judged that the clustering is over;
将各聚类的最小包围框作为先验框。The minimum bounding box of each cluster is taken as the prior box.
进一步的,所述粮虫包括但不限于玉米象、赤拟谷盗、谷蠹、锈赤扁谷盗和印度谷螟。Further, the grain insects include, but are not limited to, corn weevil, red millet, beetle, rust millet and Indian millet.
本发明的有益效果:本发明所提供的技术方案,将神经网络模型中的卷积层conv4_3和conv5_3输出的特征图进行融合,删除对小目标检测不利的block11,并且采用K-means聚类算法得到适合粮虫的先验框,改善原始SSD算法中默认先验框的缺陷,使之更有利于粮虫的识别和定位。因此,本发明所提供的技术方案能够解决现有技术中对粮虫识别准确性差的问题。Beneficial effects of the present invention: The technical solution provided by the present invention fuses the feature maps output by the convolutional layers conv4_3 and conv5_3 in the neural network model, deletes block 11 that is unfavorable for small target detection, and adopts K-means clustering algorithm Obtain a priori frame suitable for grain worms, improve the defects of the default a priori frame in the original SSD algorithm, and make it more conducive to the identification and positioning of grain worms. Therefore, the technical solution provided by the present invention can solve the problem of poor identification accuracy of grain insects in the prior art.
附图说明Description of drawings
图1是本发明方法实施例中基于SSD算法的特征融合的粮虫识别方法的流程图;Fig. 1 is the flow chart of the grain insect identification method based on the feature fusion of SSD algorithm in the method embodiment of the present invention;
图2是本发明方法实施例中神经网络模型的结构示意图;2 is a schematic structural diagram of a neural network model in a method embodiment of the present invention;
图3是本发明方法实施例中浅层特征图和深层特征图融合过程示意图。FIG. 3 is a schematic diagram of a fusion process of a shallow layer feature map and a deep layer feature map in an embodiment of the method of the present invention.
具体实施方式Detailed ways
本发明的目的是提供一种基于SSD算法的特征融合的粮虫识别方法和识别系统,在所建立的神经网络模型中将深度特征层和浅度特征层进行融合,采用K-means算法得到各特征层的先验框,以解决现有技术中对粮虫识别不准确的问题。The purpose of the present invention is to provide a grain worm identification method and identification system based on SSD algorithm feature fusion. The prior frame of the feature layer is used to solve the problem of inaccurate identification of grain insects in the prior art.
方法实施例:Method example:
本实施例提供一种基于SSD算法的特征融合的粮虫识别方法,其流程如图1所示,包括如下步骤:The present embodiment provides a method for identifying grains and insects based on SSD algorithm feature fusion, the process of which is shown in Figure 1 and includes the following steps:
步骤一:建立数据集。Step 1: Create a dataset.
数据集中的训练数据包括多种粮虫图像,粮虫包括但不限于有玉米象、赤拟谷盗、谷蠹、锈赤扁谷盗和印度谷螟。采集图像时,使用活体成虫进行拍摄,由于活体虫子较为活泼,可以保证采集样本的多样性。采集时图片时先拍摄粮虫的视频,然后对其进行截图,完成数据集图片的制作。The training data in the dataset includes images of a variety of grain insects, including but not limited to corn weevil, red grain thief, grain beetle, rust red flat grain thief and Indian grain borer. When collecting images, live adult worms are used for shooting. Since live worms are more active, the diversity of collected samples can be guaranteed. When collecting pictures, first take a video of the grain worm, and then take a screenshot of it to complete the production of the data set picture.
在本实施例的数据集中的训练数据共有1998张图像,每幅图像大小为640×480,每幅图像有3-10只粮虫,且每张图片只有一种粮虫。数据集中1438张图像用于训练神经网络模型,360张图像用于验证神经网络模型,200张用于测试神经网络模型。The training data in the data set of this embodiment has a total of 1998 images, the size of each image is 640×480, each image has 3-10 grain worms, and each picture has only one kind of grain worm. There are 1438 images in the dataset for training the neural network model, 360 images for validating the neural network model, and 200 for testing the neural network model.
步骤二:建立神经网络模型。Step 2: Build a neural network model.
本实施例中所建立的神经网络模型以VGG16网络为特征提取网络,其结构如图2所示,图中的圆形标志即为图2中所示的TOP-DOWN模块,使用该模块将conv4_3和conv5_3的输出的特征图进行融合。The neural network model established in this embodiment uses the VGG16 network as the feature extraction network, and its structure is shown in Figure 2. The circular mark in the figure is the TOP-DOWN module shown in Figure 2. Using this module, the conv4_3 Fusion with the output feature map of conv5_3.
本实施例中的神经网络模型包括block12、block7、block8、block9和block10,其中block12由卷积层conv4_3和conv5_3输出的特征图通过TOP-DOWN模块融合而成,block7、block8、block9和block10分别为卷积层conv7、conv8_2、conv9_2和conv10_2输出的特征图。各特征图先验框的大小通过K-means算法进行聚类得到。The neural network model in this embodiment includes block12, block7, block8, block9 and block10, wherein block12 is formed by fusion of the feature maps output by the convolutional layers conv4_3 and conv5_3 through the TOP-DOWN module, and block7, block8, block9 and block10 are respectively Feature maps output by convolutional layers conv7, conv8_2, conv9_2 and conv10_2. The size of the prior frame of each feature map is obtained by clustering the K-means algorithm.
步骤三:采用数据集中的训练数据对所建立的神经网络模型进行训练,得到训练后的神经网络模型。Step 3: using the training data in the dataset to train the established neural network model to obtain a trained neural network model.
在采用数据集中的训练数据对所建立的神经网络模型进行训练时,以数据集中的训练数据的图像为输入,以图像中粮虫的种类和位置为输出,得到训练后的神经网络模型。When using the training data in the data set to train the established neural network model, the image of the training data in the data set is used as the input, and the type and location of the grain worms in the image are used as the output to obtain the trained neural network model.
步骤四:采集待识别粮虫的图像,将其输入到训练后的神经网络模型中,识别出其中的粮虫种类和数量。Step 4: Collect the image of the grain worm to be identified, input it into the trained neural network model, and identify the type and quantity of the grain worm.
本实施例中使用TOP-DOWN模块将conv4_3输出的浅层特征图和conv5_3输出的深层特征图进行融合,融合过程如图3所示,包括步骤:In this embodiment, the TOP-DOWN module is used to fuse the shallow feature map output by conv4_3 and the deep feature map output by conv5_3. The fusion process is shown in Figure 3, including steps:
步骤1.1:对深层特征图进行一次卷积和两次反卷积,使其尺寸转换为原来的两倍,然后再接入BN模块,其中卷积和反卷积是深度学习中的运算方式;Step 1.1: Perform one convolution and two deconvolutions on the deep feature map to convert its size to twice the original size, and then access the BN module, where convolution and deconvolution are operations in deep learning;
步骤1.2:对浅层特征图进行两次卷积操作,然后接入BN(Batch Normalization,批量标准化)模块;Step 1.2: Perform two convolution operations on the shallow feature map, and then access the BN (Batch Normalization, batch normalization) module;
步骤1.3:对深层特征图和浅层特征图进行特征融合,本实施例中是将浅层特征图和深层特征图在每个通道进行点乘运算的方式将对深层特征图和浅层特征图进行特征融合;Step 1.3: Perform feature fusion on the deep feature map and the shallow feature map. In this embodiment, the deep feature map and the shallow feature map are combined with the shallow feature map and the deep feature map by performing a dot product operation in each channel. perform feature fusion;
步骤1.4:采用Relu激活函数将点乘之后的特征图进行激活,得到最终的融合后的特征图,其中Relu激活函数是卷积神经网络引用非线性的一种操作。Step 1.4: Use the Relu activation function to activate the feature map after point multiplication to obtain the final fused feature map, where the Relu activation function is an operation that uses nonlinearity in the convolutional neural network.
本实施例中在对深层特征图和浅层特征图进行融合的过程中,在进行卷积操作时,卷积核采用的是3×3×C1的卷积核。In this embodiment, in the process of fusing the deep feature map and the shallow feature map, when performing the convolution operation, the convolution kernel is a 3×3×C1 convolution kernel.
本实施例采用K-means算法进行聚类,遍历数据集,确定各特征图先验框的长宽比,使所建立的神经网络模型更容易、准确的对粮虫进行定位。In this embodiment, the K-means algorithm is used for clustering, traversing the data set, and determining the aspect ratio of the prior frame of each feature map, so that the established neural network model can more easily and accurately locate the grain worms.
采用K-means得到先验框的过程包括如下步骤:The process of using K-means to obtain the prior frame includes the following steps:
步骤2.1:对数据集图像中的粮虫进行标注,并进行初始化,得到m个聚类中心,即从所有GT(ground truth,手动标记的边界框)中随机选取m个边界框,m为大于1的正整数;Step 2.1: Label and initialize the grain worms in the dataset image to obtain m cluster centers, that is, randomly select m bounding boxes from all GT (ground truth, manually marked bounding boxes), where m is greater than a positive integer of 1;
步骤2.2:计算数据集中所有GT与各个聚类中心之间的距离,选取距离最小的聚类中心并将其保存其索引;当连续两次聚类结果一致时,判断为聚类结束。Step 2.2: Calculate the distance between all GTs in the data set and each cluster center, select the cluster center with the smallest distance and save its index; when two consecutive clustering results are consistent, it is judged that the clustering is over.
步骤2.3:将同一聚类中心的标注点作为同一类,得到每个类的最小包围框,包围框即为先验框。Step 2.3: Take the labeled points of the same cluster center as the same class, and obtain the minimum bounding box of each class, and the bounding box is the a priori box.
根据聚类结果,每层输出的特征图对应的先验框长宽比如表1所示。According to the clustering results, the length-width ratio of the prior frame corresponding to the feature map output by each layer is shown in Table 1.
表1Table 1
本实施例中采用Precision(精确率)、Recall(召回率)、AP(平均精确度)、以及mAP(平均准确率)和FPS(每秒帧率)来衡量所建立的神经网络模型的优劣。所有指标都是数值取值越大,代表检测性能越好。其中FPS代表检测速度,数值越大,代表检测速度越快。In this embodiment, Precision (Precision), Recall (Recall), AP (Average Precision), mAP (Average Accuracy) and FPS (Frame Rate per Second) are used to measure the pros and cons of the established neural network model . All indicators are that the larger the value, the better the detection performance. The FPS represents the detection speed, and the larger the value, the faster the detection speed.
其中精确率和召回率的计算公式为:The formulas for calculating precision and recall are:
all det ectioons=TP+FPall det ectioons=TP+FP
all ground truthes=FN+TPall ground truths=FN+TP
其中TP为正确划分为正样本的正样本个数(True positive),FP为被错误划分为正样本的负样本个数(False positive),FN为被错误划分为负样本的正样本个数(Falsenegative)。where TP is the number of positive samples that are correctly classified as positive samples (True positive), FP is the number of negative samples that are wrongly classified as positive samples (False positive), and FN is the number of positive samples that are wrongly classified as negative samples ( False negative).
相对于原SSD算法,优化之后的SSD模型,mAP从88.56%提升到96.74%,有了很大的提升。虽然FPS由25降低到21,但仍然能够达到实时检测的要求。优化后的神经网络检测结果的mAP对比如表1所示,优化后的神经网络模型模型对于粮虫的目标检测精度上有了很大的提升。Compared with the original SSD algorithm, the optimized SSD model has a great improvement in mAP from 88.56% to 96.74%. Although the FPS is reduced from 25 to 21, it can still meet the requirements of real-time detection. The mAP comparison of the optimized neural network detection results is shown in Table 1. The optimized neural network model has greatly improved the target detection accuracy of grain worms.
表1Table 1
系统实施例:System example:
本实施例提供一种基于SDD算法的特征融合的粮虫识别系统,包括处理器和存储器,存储器上存储有用于在处理器上执行的计算机程序;所述处理器执行所述计算机程序时,实现如上述方法实施例中所提供的基于SDD算法的特征融合的粮虫识别方法。This embodiment provides a system for identifying grains and insects based on SDD algorithm feature fusion, including a processor and a memory, and the memory stores a computer program for execution on the processor; when the processor executes the computer program, the As provided in the above method embodiments, the method for identifying grain insects based on feature fusion of SDD algorithm is provided.
以上公开的本发明的实施例只是用于帮助阐明本发明的技术方案,并没有尽叙述所有的细节,也不限制该发明仅为所述的具体实施方式。显然,根据本说明书的内容,可作很多的修改和变化。本说明书选取并具体描述这些实施例,是为了更好地解释本发明的原理和实际应用,从而使所属技术领域人员能很好地理解和利用本发明。本发明仅受权利要求书及其全部范围和等效物的限制。The embodiments of the present invention disclosed above are only used to help clarify the technical solutions of the present invention, and do not describe all the details, nor limit the present invention to only the described specific embodiments. Obviously, many modifications and variations are possible in light of the content of this specification. These embodiments are selected and described in this specification in order to better explain the principles and practical applications of the present invention, so that those skilled in the art can well understand and utilize the present invention. The present invention is to be limited only by the claims and their full scope and equivalents.
本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不会使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围。Those of ordinary skill in the art should understand that: they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements will not make the essence of the corresponding technical solutions. It departs from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011205968.XA CN112288022B (en) | 2020-11-02 | 2020-11-02 | A Grain Insect Recognition Method and Recognition System Based on Feature Fusion of SSD Algorithm |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011205968.XA CN112288022B (en) | 2020-11-02 | 2020-11-02 | A Grain Insect Recognition Method and Recognition System Based on Feature Fusion of SSD Algorithm |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112288022A CN112288022A (en) | 2021-01-29 |
CN112288022B true CN112288022B (en) | 2022-09-20 |
Family
ID=74354104
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011205968.XA Active CN112288022B (en) | 2020-11-02 | 2020-11-02 | A Grain Insect Recognition Method and Recognition System Based on Feature Fusion of SSD Algorithm |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112288022B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114067105B (en) * | 2022-01-12 | 2022-04-22 | 安徽高哲信息技术有限公司 | Grain density estimation method, storage medium, and grain density estimation apparatus |
CN116310658B (en) * | 2023-05-17 | 2023-08-01 | 中储粮成都储藏研究院有限公司 | Method for establishing grain storage pest image data set based on spherical camera |
CN116797774A (en) * | 2023-05-24 | 2023-09-22 | 国网江苏省电力有限公司淮安供电分公司 | Substation signboard identification method based on YOLOv5 and CNOCR |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101976350A (en) * | 2010-10-20 | 2011-02-16 | 中国农业大学 | Grain storage pest detection and identification method based on video analytics and system thereof |
CN109886359A (en) * | 2019-03-25 | 2019-06-14 | 西安电子科技大学 | Small target detection method and detection model based on convolutional neural network |
CN110660052A (en) * | 2019-09-23 | 2020-01-07 | 武汉科技大学 | A deep learning-based detection method for surface defects of hot-rolled strip steel |
US10524461B1 (en) * | 2018-09-25 | 2020-01-07 | Jace W. Files | Pest detector to identify a type of pest using machine learning |
CN110766041A (en) * | 2019-09-04 | 2020-02-07 | 江苏大学 | Deep learning-based pest detection method |
CN111091122A (en) * | 2019-11-22 | 2020-05-01 | 国网山西省电力公司大同供电公司 | Training and detecting method and device for multi-scale feature convolutional neural network |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10621725B2 (en) * | 2017-04-12 | 2020-04-14 | Here Global B.V. | Small object detection from a large image |
-
2020
- 2020-11-02 CN CN202011205968.XA patent/CN112288022B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101976350A (en) * | 2010-10-20 | 2011-02-16 | 中国农业大学 | Grain storage pest detection and identification method based on video analytics and system thereof |
US10524461B1 (en) * | 2018-09-25 | 2020-01-07 | Jace W. Files | Pest detector to identify a type of pest using machine learning |
CN109886359A (en) * | 2019-03-25 | 2019-06-14 | 西安电子科技大学 | Small target detection method and detection model based on convolutional neural network |
CN110766041A (en) * | 2019-09-04 | 2020-02-07 | 江苏大学 | Deep learning-based pest detection method |
CN110660052A (en) * | 2019-09-23 | 2020-01-07 | 武汉科技大学 | A deep learning-based detection method for surface defects of hot-rolled strip steel |
CN111091122A (en) * | 2019-11-22 | 2020-05-01 | 国网山西省电力公司大同供电公司 | Training and detecting method and device for multi-scale feature convolutional neural network |
Non-Patent Citations (2)
Title |
---|
"DSSD : Deconvolutional Single Shot Detector";Cheng-Yang Fu 等;《arXiv》;20170123;全文 * |
"基于SSD的粮仓害虫检测研究";邓壮来 等;《计算机工程与应用》;20190905;第56卷(第11期);214-218 * |
Also Published As
Publication number | Publication date |
---|---|
CN112288022A (en) | 2021-01-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112418117B (en) | Small target detection method based on unmanned aerial vehicle image | |
CN107424159B (en) | Image semantic segmentation method based on super-pixel edge and full convolution network | |
CN106683091B (en) | A kind of target classification and attitude detecting method based on depth convolutional neural networks | |
CN112288022B (en) | A Grain Insect Recognition Method and Recognition System Based on Feature Fusion of SSD Algorithm | |
CN108830285B (en) | Target detection method for reinforcement learning based on fast-RCNN | |
CN111310662B (en) | A method and system for flame detection and recognition based on integrated deep network | |
CN107016409A (en) | A kind of image classification method and system based on salient region of image | |
CN110659692A (en) | Pathological image automatic labeling method based on reinforcement learning and deep neural network | |
WO2016066042A1 (en) | Segmentation method for commodity picture and device thereof | |
CN112132818B (en) | Pulmonary nodule detection and clinical analysis method constructed based on graph convolution neural network | |
CN114627052A (en) | Infrared image air leakage and liquid leakage detection method and system based on deep learning | |
CN115471739A (en) | Cross-domain remote sensing scene classification and retrieval method based on self-supervised contrastive learning | |
CN110443125A (en) | A kind of EO-1 hyperion method for detecting abnormal based on the selection of differentiation forest subspace | |
WO2023273572A1 (en) | Feature extraction model construction method and target detection method, and device therefor | |
CN114821102A (en) | Intensive citrus quantity detection method, equipment, storage medium and device | |
CN111931859A (en) | Multi-label image identification method and device | |
CN116524189A (en) | High-resolution remote sensing image semantic segmentation method based on coding and decoding indexing edge characterization | |
CN106874862A (en) | People counting method based on submodule technology and semi-supervised learning | |
CN106023159A (en) | Disease spot image segmentation method and system for greenhouse vegetable leaf | |
CN117593253A (en) | Method, system, storage medium and device for detecting mitosis of mammary gland pathology image | |
CN117496154A (en) | Semantic segmentation method of high-resolution remote sensing images based on probability map representation of edges | |
CN112465821A (en) | Multi-scale pest image detection method based on boundary key point perception | |
Liu et al. | WSRD-Net: A convolutional neural network-based arbitrary-oriented wheat stripe rust detection method | |
Ma et al. | An attention-based progressive fusion network for pixelwise pavement crack detection | |
Yang et al. | Classification of urban interchange patterns using a model combining shape context descriptor and graph convolutional neural network |
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 |