CN107516311A - A kind of corn breakage rate detection method based on GPU embedded platforms - Google Patents
A kind of corn breakage rate detection method based on GPU embedded platforms Download PDFInfo
- Publication number
- CN107516311A CN107516311A CN201710669925.9A CN201710669925A CN107516311A CN 107516311 A CN107516311 A CN 107516311A CN 201710669925 A CN201710669925 A CN 201710669925A CN 107516311 A CN107516311 A CN 107516311A
- Authority
- CN
- China
- Prior art keywords
- image
- corn
- gpu
- breakage rate
- algorithm
- 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
Links
- 240000008042 Zea mays Species 0.000 title claims abstract description 50
- 235000005824 Zea mays ssp. parviglumis Nutrition 0.000 title claims abstract description 50
- 235000002017 Zea mays subsp mays Nutrition 0.000 title claims abstract description 50
- 235000005822 corn Nutrition 0.000 title claims abstract description 50
- 238000001514 detection method Methods 0.000 title claims abstract description 28
- 238000000034 method Methods 0.000 claims abstract description 47
- 238000004422 calculation algorithm Methods 0.000 claims abstract description 29
- 238000012360 testing method Methods 0.000 claims abstract description 23
- 230000007797 corrosion Effects 0.000 claims abstract description 14
- 238000005260 corrosion Methods 0.000 claims abstract description 14
- 238000012545 processing Methods 0.000 claims abstract description 14
- 230000011218 segmentation Effects 0.000 claims abstract description 13
- 239000000284 extract Substances 0.000 claims abstract description 10
- 238000000638 solvent extraction Methods 0.000 claims abstract description 10
- 238000012549 training Methods 0.000 claims description 8
- 230000000644 propagated effect Effects 0.000 claims description 5
- 238000011282 treatment Methods 0.000 claims description 4
- 230000001133 acceleration Effects 0.000 claims description 3
- 230000005540 biological transmission Effects 0.000 claims description 3
- 230000008859 change Effects 0.000 claims description 3
- 208000003643 Callosities Diseases 0.000 claims description 2
- 206010020649 Hyperkeratosis Diseases 0.000 claims description 2
- HPTJABJPZMULFH-UHFFFAOYSA-N 12-[(Cyclohexylcarbamoyl)amino]dodecanoic acid Chemical compound OC(=O)CCCCCCCCCCCNC(=O)NC1CCCCC1 HPTJABJPZMULFH-UHFFFAOYSA-N 0.000 claims 1
- 238000013135 deep learning Methods 0.000 abstract description 14
- 238000000605 extraction Methods 0.000 abstract description 10
- 238000003709 image segmentation Methods 0.000 abstract description 7
- 230000015654 memory Effects 0.000 description 11
- 235000013339 cereals Nutrition 0.000 description 9
- 238000013527 convolutional neural network Methods 0.000 description 7
- 241000209140 Triticum Species 0.000 description 6
- 235000021307 Triticum Nutrition 0.000 description 6
- 238000013528 artificial neural network Methods 0.000 description 6
- 230000000694 effects Effects 0.000 description 6
- 238000011160 research Methods 0.000 description 6
- 241000196324 Embryophyta Species 0.000 description 4
- 238000004364 calculation method Methods 0.000 description 4
- 230000006870 function Effects 0.000 description 4
- 238000003306 harvesting Methods 0.000 description 3
- 230000008569 process Effects 0.000 description 3
- 241000894007 species Species 0.000 description 3
- 238000004458 analytical method Methods 0.000 description 2
- 239000003518 caustics Substances 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 238000010191 image analysis Methods 0.000 description 2
- 239000002105 nanoparticle Substances 0.000 description 2
- 238000005192 partition Methods 0.000 description 2
- 238000003860 storage Methods 0.000 description 2
- 240000007594 Oryza sativa Species 0.000 description 1
- 235000007164 Oryza sativa Nutrition 0.000 description 1
- 241001632422 Radiola linoides Species 0.000 description 1
- 208000037656 Respiratory Sounds Diseases 0.000 description 1
- 238000012271 agricultural production Methods 0.000 description 1
- 238000013459 approach Methods 0.000 description 1
- 230000006399 behavior Effects 0.000 description 1
- 239000003086 colorant Substances 0.000 description 1
- 238000005520 cutting process Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000004925 denaturation Methods 0.000 description 1
- 230000036425 denaturation Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000018109 developmental process Effects 0.000 description 1
- 230000003628 erosive effect Effects 0.000 description 1
- 238000000227 grinding Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 239000012535 impurity Substances 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 230000000877 morphologic effect Effects 0.000 description 1
- 238000010606 normalization Methods 0.000 description 1
- 239000002245 particle Substances 0.000 description 1
- 238000003908 quality control method Methods 0.000 description 1
- 235000009566 rice Nutrition 0.000 description 1
- 238000000926 separation method Methods 0.000 description 1
- 235000015170 shellfish Nutrition 0.000 description 1
- 238000007619 statistical method Methods 0.000 description 1
- 238000013179 statistical model Methods 0.000 description 1
- 230000001360 synchronised effect Effects 0.000 description 1
- 210000003462 vein Anatomy 0.000 description 1
- XLYOFNOQVPJJNP-UHFFFAOYSA-N water Substances O XLYOFNOQVPJJNP-UHFFFAOYSA-N 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/0002—Inspection of images, e.g. flaw detection
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/20—Image enhancement or restoration using local operators
- G06T5/30—Erosion or dilatation, e.g. thinning
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/194—Segmentation; Edge detection involving foreground-background segmentation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10004—Still image; Photographic image
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10024—Color image
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20081—Training; Learning
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/30—Subject of image; Context of image processing
- G06T2207/30181—Earth observation
- G06T2207/30188—Vegetation; Agriculture
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Quality & Reliability (AREA)
- Image Analysis (AREA)
Abstract
The invention discloses a kind of corn breakage rate detection method based on GPU embedded platforms, this method is divided into three parts:Part I is the generation of disaggregated model;Part II is split for image, and the corn kernel image of adhesion is divided into and extracts single seed image and carries out parallelization processing to partitioning algorithm;Part III is to carry out damage testing to the image after segmentation using disaggregated model and calculate breakage rate.The present invention efficiently solves adhesion corn kernel image segmentation problem using the corrosion of the convex set limit and condition expansion algorithm, the problem of evading manual features extraction using deep learning method simultaneously ensures damage testing accuracy rate, detection algorithm parallelization is handled using GPU embedded platforms, detection algorithm has been reached real-time.
Description
Technical field
The present invention relates to image segmentation, deep learning, the technical field of parallelization, and in particular to one kind is embedded in based on GPU
The corn breakage rate detection method of formula platform.
Background technology
Corn is the maximum crop of China's cultivated area, accounts for the ratio of total output of grain more than 35%, it has also become China's kind
Plant area maximum, the cereal crops of yield highest, yield potential maximum.With the development of science and technology, corn mechanization gathers in
Level is improving year by year, ends 2013, and corn mechanization harvesting ratio alreadys exceed 51.57%.Grain is received for corn machinery
For, the granular condition of receipts can not be detected in time and making corresponding adjustment can cause seed damage rate height, seed to take off not only, with projected object
Shattering waits machine to receive loss and reduce machine to produce effects the consequence of rate more.
As the important component of mechanical harvesting, on-line detecting system can detect in real time receives granular state, according to seed
Breakage adjusts the working condition of machinery in time, so as to preferably carry out quality control.Traditional manual method carries out corn
(rod, grain) damage testing simultaneously makes corresponding adjustment operation, and not only efficiency is low, and workload is big, and easily produces fatigue error, more
Can not be in night work.It is domestic later using the research of machine vision and image detecting technique to agriculture field, but a lot
Person and researcher are that substantial amounts of research work has been done in its technological improvement, have promoted the high speed hair that nondestructive measuring method of the farm product is theoretical
Exhibition.In recent years, the deep learning research based on convolutional neural networks (CNN) is much paid close attention to, and is shown in image recognition
Superior performance.Because deep learning network frame is more complicated, it is necessary to substantial amounts of numerical computations, therefore it is not easily applicable to reality
When property requires in higher industry and agricultural production also rarely have the case of successful application on detection of agricultural products.
On the one hand image detection algorithm needs to overcome many disturbing factors, for example measurand adhesion even stacking, impurity
Covering, ambient lighting change etc. influence;On the other hand, it is also necessary to meet high requirement of the high speed continuous productive process to real-time.With
CUDA (Compute Unified Device Architecture) appearance and the parallel computation frame based on CUDA
It is proposed, carry out parallel computation using GPU to solve the problems, such as the complicated calculations in terms of industry, business and scientific research by more next
More concerns.How acceleration processing is carried out to detection algorithm, so as to ensure that it can be also one in embedded platform real time execution
Individual study hotspot.
In recent years, NVIDIA companies are proposed a series of embedded gpu platforms, including Jetson TK1, TX1 etc., utilize
Parallel computation engine solves the problems, such as the complicated calculations in terms of industry, business and scientific research, and the present invention entered using TK1 platforms
Transplanting and the parallelization processing of row detection algorithm.
Just there is scholar to propose to carry out grinding for quality of agricultural product detection using image processing techniques since the 1970s
Study carefully.Generally, such test problems can be attributed to image classification problem, be specifically divided into based on traditional mode recognition methods and
Image classification method based on deep learning.
Nineteen ninety, I.Zayas et al. by the statistical analysis to corn kernel, is extracted 5 kinds of fundamental forms such as area girth
State parameter, and 7 kinds of statistical parameters have thus been derived, mahalanobis distance discriminant function is then established, Detection accuracy reaches
98.3% (referring to document【1】Converse H,Steele J.Discrimination of whole from broken
corn kernels with image analysis[J].Transactions of the ASAE,1990,33(5):1-
1646.).But its detection is still image, and corn kernel will strictly be put neatly, and the feature of extraction does not have rotation not
Denaturation.2008, Guzman et al. extracted wheat long axis length, minor axis length, area by the research to 5 kinds of wheats
Deng 13 kinds of morphological features, and as input structure artificial neural network (ANN), the kind of wheat is predicted, obtained
More than 90% accuracy rate is (referring to document【2】Guzman J D,Peralta E K.Classification of
Philippine rice grains using machine vision and artificial neural networks
[C]//World conference on agricultural information and IT,Tokyo,Japan.2008:24-
27.).This method principle is simple, but is not easy to implement, because the feature of extraction is excessive, and the reasonability of these features also needs
Just it can determine that by repetition test.2011, Zapotoczny etc. have studied the spring of 11 kinds of different quality grade
With Winter wheat kind, the texture for calculating 7 Color Channels (R, G, B, Y, S, U, V) of wheat seed projected image respectively is special
Sign, and be entered into statistical model, then classified (referring to document【3】Zapotoczny P.Discrimination
of wheat grain varieties using image analysis and neural networks.Part
I.Single kernel texture[J].Journal of Cereal Science,2011,54(1):60-68.).More than
Method is traditional mode identification method, it is necessary to manually extract feature, and classification accuracy also tends to the choosing depending on feature
Take, it is therefore desirable to which repetition test just can determine that final feature.
Because corn kernel is not of uniform size, being influenceed color by moisture also has difference, therefore is entered using features such as size, colors
Row damage testing needs very high Heuristics, and the deep learning method for being taken based on convolutional neural networks (CNN) can be very
Evade manual features On The Choice well.Open general etc. and construct layering convolution deep learning network, construct including convolutional layer, adopt
Plant leaf blade is identified the 8 layer network structures such as sample layer, normalization layer, full articulamentum, for uniform background leaf recognition rate
Reach 90.90% accuracy rate, and use sift operators, BP neural network, the accuracy rate of KNN, SVM method to only have respectively
31.15%th, 83.26%, 75.49%, 88.64% (referring to document【4】Zhang Shuai, Huaihe River Yongjian are based on layering convolution deep learning system
Plant leaf blade Study of recognition [J] the Beijing Forestry University journal of system, 2016,38 (9):108-115.).But in complex background
In the case of, its image partition method used well can not extract blade, cause recognition accuracy to only have
34.3%.Dyrmann etc. is carried out using convolutional neural networks to 10413 pictures in the crops comprising 22 species and weeds
Model training, final classification accuracy are 86.2% (referring to document【5】Dyrmann M,Karstoft H,Midtiby H
S.Plant species classification using deep convolutional neural network[J]
.Biosystems Engineering,2016,151:72-80.).Do not mention the segmentation to image in text, but real feelings
Crops, which often assemble, under condition is sticked together, it is necessary to manual intervention, thus can not accomplish automatic detection.Park etc. is by similar round
Nano-particle set be defined as convex set.First with convex set limit corrosion (UECS) partitioning algorithm extraction seed point, then push away
Break and the profile of adhesion object missing, finally classified according to the profile (referring to document【6】Park C,Huang J Z,Ji
J X,et al.Segmentation,inference and classification of partially overlapping
nanoparticles[J].IEEE transactions on pattern analysis and machine
intelligence,2013,35(3):1-1.).But this method is time-consuming serious, the processing time of a pictures is 72s, therefore
It can not be applied in the actual production strict to time requirement.
The content of the invention
The purpose of the present invention is:For inputting corn kernel image, realize the automatic segmentation of seed and utilize deep learning
Method statistic breakage rate, reach real-time in embedded platform, to improve the automation of corn mechanization harvesting and intelligent water
It is flat.
The technical scheme is that:A kind of corn breakage rate detection method based on GPU embedded platforms, this method point
For three parts:Part I is the generation of disaggregated model;Part II is split for image, by the corn kernel image point of adhesion
It is cut into and extracts single seed image and parallelization processing is carried out to partitioning algorithm;Part III is to dividing using disaggregated model
Image after cutting carries out damage testing and calculates breakage rate.
1) image is gathered, disaggregated model is generated using Caffe platform trainings data
The present invention is finely adjusted (finetune) using GoogLeNet models, the classification of training generation corn damage testing
Model.The step of generation model is:Collection picture and make data set, according to picture making lagged document (damaged with complete),
Network is finely adjusted, is trained using Caffe platforms and ultimately generates disaggregated model.
2) input picture is split, extracts single corn kernel image
For the RGB image of input, first have to switch to gray level image, then generate binary map using Da-Jin algorithm (OTSU)
Picture, recycle the said minuscule hole of closed operation filling bianry image interior of articles and connect approaching object.For the bianry image, adopt
Adhesion object segmentation is opened with convex set limit corrosion (UECS) method, obtains the seed point of each seed.Seed point is positioned at each
The center of corn kernel, therefore the region is expanded again, obtain the image of corn kernel size.
First time-consuming to algorithm to be analyzed before parallelization is carried out to detection algorithm, for the figure of 68 corns be present
Piece, entering test, partitioning portion takes 1.71s, and further test understands that the place of the time-consuming most serious of segmentation is condition expansion,
1.2s is taken altogether.Parallelization of the invention using CPU and GPU Coordination Treatments accelerates optimisation strategy, CPU processing logic judgment, divides
The complicated orders such as branch scheduling;GPU carries out the numerical operation of high intensity.In CUDA optimisation strategies, present invention employs reduce line
Three kinds of journey granularity, parallel stipulations and shared drive methods.
3) damage testing is carried out to input picture using disaggregated model and calculates breakage rate
The acceleration strategy of predicted portions is different from partitioning portion.When being classified using Caffe to a pictures, first have to
Load Image, propagated forward computing, last output category result are then carried out according to disaggregated model.And classify for plurality of pictures
Common practices be exactly using above step carry out circular treatment, be sequentially output classification results.Because every subseries has pair
Network is once reconstructed, therefore time-consuming serious.The optimisation strategy used herein for parallel anticipation (batch prediction),
The picture (such as 40) of fixed qty size is loaded, primary network reconstruct then need to be only carried out and propagated forward can obtain institute
There are the classification results of corresponding picture.Processing of classifying simultaneously thus is carried out using multiple threads, and reduces GPU and cpu data
The delay that transmission belt is come.
The advantages of technical solution of the present invention and good effect
1) adhesion corn kernel image segmentation problem is efficiently solved using the corrosion of the convex set limit and condition expansion algorithm
In image procossing and assorting process, image segmentation is often simultaneously and of crucial importance as a pretreatment operation
A step, outstanding partitioning algorithm can come out detection object and background separation, then carry out graphical analysis again.Adhesion is overlapping
The segmentation of image is always the problem of image segmentation field, for the image partition method such as cell and grain seed typically using recessed
Point matching method, the dividing method based on watershed and corrosion expanding method.Because edge roughness, single thing be present in damaged seed
The characteristics of body color and vein differs greatly, over-segmentation phenomenon, therefore this literary grace can be caused using concave point matching and dividing ridge method
Adhesion corn kernel image is split with corrosion expanding method.
When bianry image edge is irregularly and noise is larger, the effect of limit corrosion is poor, may for an individual
Multiple tiny particles can be produced, cause over-segmentation.For this convex set image, the more preferable convex set limit of robustness can be used
Erosion algorithm is handled.All detect whether the region is still " recessed collection " during each corrosion, when being unsatisfactory for recessed collection bar
Part, the region of adhesion have then been partitioned from, and now the region are stopped corroding, and then start to carry out other recessed collection regions
Corrosion.At the end of corrosion, each individual only has a connected region, the i.e. seed point in the region.
2) the problem of evading manual features extraction using deep learning method simultaneously ensures damage testing accuracy rate
The present invention uses the deep learning method based on convolutional neural networks, and damaged judgement is carried out to corn kernel.Tradition
Artificial Neural Network, it is necessary to expend considerable time and effort carry out feature extraction, take time and effort.Meanwhile for seed
The damaged species of grain is also more complicated, including situations such as defect, fracture, impression, crackle, therefore can not extract to various damaged feelings
The feature that condition is all suitable for.Need just to be able to verify that its accuracy by repetition test for the feature of extraction, it is undue to the experience of people
Rely on the expertise, it is necessary to very high.
Deep learning can automatically extract feature using convolutional network, so as to evade the extraction of manual features, save
Substantial amounts of feature extraction work.What is more important, deep learning illustrate its superior performance in different fields.This
Invention uses deep learning method, corn kernel breakage rate Detection accuracy has been reached more than 92%.
3) detection algorithm parallelization is handled using GPU embedded platforms, detection algorithm has been reached real-time
Due to corn map as seed number is more, extracted although can be split each seed using corrosion expanding method
Come, but it is time-consuming serious, and the processing time of single picture is 1.7s.Using computation capability powerful GPU to partitioning algorithm
Partitioning algorithm required time can be reduced by carrying out parallelization, and final single picture of splitting only needs 0.5s.In sorting phase, adopt
With batch forecast method, 40 pictures are handled simultaneously, substantially increase classification effectiveness.The present invention uses NVIDIA Jetson
TK1 embedded platforms, for the image no more than 40 corn kernels, detection algorithm of the invention is time-consuming to be less than 1.8s.
Brief description of the drawings
Fig. 1 is a kind of corn breakage rate detection method flow chart based on GPU embedded platforms of the present invention;
Fig. 2 is the effect diagram that binaryzation is carried out using Da-Jin algorithm;
Fig. 3 is seed dot image schematic diagram.
Embodiment
Below in conjunction with the accompanying drawings and embodiment further illustrates the present invention.
A kind of corn breakage rate detection method based on GPU embedded platforms of the present invention, execution flow such as Fig. 1 of this method
It is shown:
Step 1):Generate disaggregated model.
Step 2):RGB image is inputted by CCD camera and carries out image segmentation, extracts independent corn kernel image.
Step 3):Classification processing is carried out to the image of step 2) using the Step1 disaggregated models generated.
Step 4):Damaged number and full number are counted according to Step4 classification results and calculate breakage rate.
It is specific as follows:
1st, training network model
The present invention carries out finetune, the disaggregated model of training generation corn damage testing using GoogLeNet models.It is first
First to gather picture and make training set and test set, image is divided into by complete and damaged two according to the virtual condition of corn kernel
Class;Network is finely adjusted, that is, changes GoogLeNet network parameter and the classification of output is changed to 2;Finally utilize Caffe
Platform is trained generation disaggregated model.
2nd, image segmentation is handled with parallelization
For the RGB image of input, first have to switch to gray level image, then generate bianry image, then profit using Da-Jin algorithm
The said minuscule hole of bianry image interior of articles is filled with closed operation and connects approaching object.For the bianry image, using convex set
Limit caustic solution opens adhesion object segmentation.Convex set limit caustic solution is as follows:
1st, " concavity " value of all connected domains is calculated using following formula.
In formula, C represents the concavity value calculated, and l (A) represents string A length, and m represents the number of sunk area, d (A, B) table
Show string A and arc B distance, formula is as follows:
D (A, B)=maxx∈Xminy∈Y||x-y||
When concavity value C is less than 0.5, then the connected domain is " convex set ", is otherwise " recessed collection ".
2nd, for " concavity value " C (V)>T connected domain uses size to carry out continuous corrosion for 3 × 3 circular configuration operator,
Until C (V) stops not less than threshold value t.The robustness of the smaller UECS algorithms of threshold value t is longer, but splits the ability in adhesion region
Stronger, threshold value t is set to 0.2 in this example.
3rd, the connected domain of 2 conditionals of all satisfactions is extracted, saves as the seed point of each individual region, Ran Houcun
Storage is among single image.
Figure below is the effect of convex set limit corrosion.Fig. 2 is the design sketch that binaryzation is carried out using Da-Jin algorithm, and Fig. 2 (a) is former
Image, Fig. 2 (b) are binary images.In Fig. 3, Fig. 3 (a) is final seed dot image.For the ease of observation, Fig. 3 (b) institutes
Be shown as display effect seed point being drawn in artwork, it can be seen that each corn kernel has a single seed point, and
The seed point is located at seed center.
The seed point that the convex set limit corrodes to obtain is located at the center of each corn kernel, therefore the region is carried out again
Expansion, obtains the image of corn kernel size.The maximum area of all seed points is tied as expansion in choosing per pictures
The threshold value p of beam, stop expanding if the area of some seed point is more than p.Due to needing that each seed point is carried out
Expansion, thus it is very time-consuming.Expand, taken as 1.02s for the image for there are 68 seed points, it is therefore desirable to using parallel
Change method reduces time-consuming.After being handled by parallelization, required time only has 0.05s, and speed-up ratio has reached 20 times.Use and
Rowization strategy has at 3 points:It is specifically to introduce to reduce thread granularity, parallel stipulations and shared drive, here:
1st, thread granularity is reduced.Assuming that there is N number of seed point to need to expand, that is, need to handle N images.Due to N
Size typically below 100, so if only opening N number of thread, each single image of thread process, then can not fill
Divide the disposal ability using GPU.For the image that size is m × n, the method that this example uses is to open N × m × n line simultaneously
Journey, using 2D-grid, 2D-block thread structure.Firstly the need of applying for sufficiently large video memory at GPU ends and by all images
Copy on the video memory;According to the exclusive ID of each thread, different internal memories is read, then serially performs respective task;
The result of calculation of video memory is delivered to CPU ends again after being disposed.It the method reduce 0.7s operation time
2nd, parallel stipulations.Parallel stipulations side is used for the function (countNonZero) that seed point area is calculated in algorithm
Method is realized.The serial approach that array summation uses is that all digital loops add up, for this side of the very big array of data volume
Method is very time-consuming.The method that this example uses opens N/2 thread for the array for being N for size, and each thread calculates two numbers
Group unit sum;N/4 thread is recycled to calculate N/2 data sum after all threads are calculated and finished;Finally there was only one
During individual thread, the result of calculation of the thread is final summed result.This method imitates the calculating of countNonZero functions
Rate improves log2 (N) times, reduces 0.18s operation times altogether.
3rd, shared drive.When the data on to video memory carry out accessing operation, these data are typically in global memory
On (global memory), access every time will spend hundreds of clock cycle, it is therefore desirable to reduce these accesses behaviour as far as possible
The time delay of work, shared drive (share memory) are the internal memories on GPU, and its storage cycle only has several clock cycle, each
Thread in individual block can share all shared drives in the block, therefore the use of shared drive be exactly a side well
Method.The method that this example uses is that each block distributes one piece of shared drive, into during the fast thread first by the overall situation
Then the data copy of internal memory carries out thread synchronization, data are copied to shared drive using synchronous function _ _ syncthreads ()
Following operation can be both carried out after shellfish is complete.Directly it can now be calculated with the data in shared drive, so as to significantly
Reduce data time.This method reduces 0.06s operation time altogether.
Template image after being expanded using seed point is individually extracted the corn kernel in original image, and will figure
It is used for the damage testing of next step as being scaled 224 × 224 size dimensions.
3rd, damage testing is carried out to segmentation figure picture
Damage testing is can be carried out using the independent seed image of disaggregated model and extraction.Due to there is substantial amounts of seed to need
Detected, thus it is very time-consuming, used time 75s of classifying is carried out to 68 pictures.The optimisation strategy that this example uses is parallel pre-
Survey (batch prediction), that is, load the picture of fixed qty, then need to only carry out primary network reconstruct and propagated forward
The classification results of all corresponding pictures can be obtained.Processing of classifying simultaneously thus is carried out using multiple threads, and reduces GPU
The delay come with cpu data transmission belt.Limited by embedded platform video memory size, the picture number of single prediction is up to
40, therefore 68 pictures need to only be predicted twice can obtain all classification results, classification effectiveness improves 32 times, point
The class time has reached 2.24s.
4th, breakage rate is counted
According to the classification results of corn kernel, damaged number and full number can be counted, it is easy to breakage rate is calculated,
I.e.:Breakage rate=damaged number/(full number+damaged number).
Claims (4)
- A kind of 1. corn breakage rate detection method based on GPU embedded platforms, it is characterised in that:This method is divided into three portions Point:Part I is the generation of disaggregated model;Part II is split for image, and the corn kernel image of adhesion is divided into and extracts single seed image and to segmentation Algorithm carries out parallelization processing;Part III is to carry out damage testing to the image after segmentation using disaggregated model and calculate breakage rate.
- 2. a kind of corn breakage rate detection method based on GPU embedded platforms according to claim 1, its feature exist In:Part I is that the generation of disaggregated model is specially:1) image is gathered, classification mould is generated using Caffe platform trainings data Type;It is finely adjusted (finetune) using Google's network (GoogLeNet) model, the classification mould of training generation corn damage testing Type;The step of generation model is:Collection picture simultaneously makes data set, according to picture making lagged document (damaged with complete), right Network is finely adjusted, and is trained using Caffe platforms and is ultimately generated disaggregated model.
- 3. a kind of corn breakage rate detection method based on GPU embedded platforms according to claim 1, its feature exist In:Part II is specially:2) input picture is split, extracts single corn kernel image;For the RGB of input Image, first have to switch to gray level image, then generate bianry image using Da-Jin algorithm (OTSU), recycle closed operation filling two-value Said minuscule hole inside image object simultaneously connects approaching object;For the bianry image, using convex set limit corrosion (UECS) side Method opens adhesion object segmentation, obtains the seed point of each seed;Seed point is located at the center of each corn kernel, therefore The region is expanded again, obtains the image of corn kernel size;Will be first before parallelization is carried out to detection algorithm It is time-consuming to algorithm to analyze, for the picture of 68 corns be present, entered test, partitioning portion takes 1.71s, further surveys Examination understands that the place of the time-consuming most serious of segmentation is condition expansion, takes 1.2s altogether;Using the parallel of CPU and GPU Coordination Treatments Change and accelerate optimisation strategy, the complicated order such as CPU processing logic judgment, branch's scheduling;GPU carries out the numerical operation of high intensity; In CUDA optimisation strategies, employ and reduce three kinds of thread granularity, parallel stipulations and shared drive methods.
- 4. a kind of corn breakage rate detection method based on GPU embedded platforms according to claim 1, its feature exist In:Part III is specially:3) damage testing is carried out to input picture using disaggregated model and calculates breakage rate;Predicted portions Acceleration strategy is different from partitioning portion;When classifying to a pictures using Caffe, first have to Load Image, then basis Disaggregated model carries out propagated forward computing, last output category result;And the common practices for plurality of pictures classification is exactly profit Circular treatment is carried out with above step, is sequentially output classification results;Network is once reconstructed because every subseries has, Therefore it is time-consuming serious;The optimisation strategy used loads fixed qty size for parallel anticipation (batch prediction) Picture, then need to only carry out primary network reconstruct and propagated forward can obtain the classification results of all corresponding pictures;Thus Processing of classifying simultaneously is carried out using multiple threads, and reduces the delay that GPU comes with cpu data transmission belt.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710669925.9A CN107516311A (en) | 2017-08-08 | 2017-08-08 | A kind of corn breakage rate detection method based on GPU embedded platforms |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710669925.9A CN107516311A (en) | 2017-08-08 | 2017-08-08 | A kind of corn breakage rate detection method based on GPU embedded platforms |
Publications (1)
Publication Number | Publication Date |
---|---|
CN107516311A true CN107516311A (en) | 2017-12-26 |
Family
ID=60722847
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710669925.9A Pending CN107516311A (en) | 2017-08-08 | 2017-08-08 | A kind of corn breakage rate detection method based on GPU embedded platforms |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107516311A (en) |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107993244A (en) * | 2017-12-27 | 2018-05-04 | 合肥市雅视智能科技有限公司 | A kind of corn automatic testing method |
CN108230307A (en) * | 2017-12-29 | 2018-06-29 | 浙江大学 | A kind of corn broken kernel detection method based on profile centroid distance and neural network |
CN108416790A (en) * | 2018-01-31 | 2018-08-17 | 湖北工业大学 | A kind of detection method for workpiece breakage rate |
CN109522185A (en) * | 2018-11-19 | 2019-03-26 | 江苏镭博智能科技有限公司 | A kind of method that model segmentation improves arithmetic speed |
CN109961441A (en) * | 2019-03-19 | 2019-07-02 | 广东省农业科学院水稻研究所 | Hybrid rice seed splits the efficient measuring method of clever rate |
CN110060233A (en) * | 2019-03-20 | 2019-07-26 | 中国农业机械化科学研究院 | A kind of corn ear damage testing method |
CN111986192A (en) * | 2020-08-31 | 2020-11-24 | 华中科技大学 | Machine vision-based mushroom damage detection method |
CN112348744A (en) * | 2020-11-24 | 2021-02-09 | 电子科技大学 | Data enhancement method based on thumbnail |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103268492A (en) * | 2013-04-19 | 2013-08-28 | 北京农业信息技术研究中心 | Corn grain type identification method |
CN103514459A (en) * | 2013-10-11 | 2014-01-15 | 中国科学院合肥物质科学研究院 | Method and system for identifying crop diseases and pests based on Android mobile phone platform |
CN103700123A (en) * | 2013-12-19 | 2014-04-02 | 北京国药恒瑞美联信息技术有限公司 | Method and device for reconstructing GPU (Graphic Processing Unit) accelerating X-ray image based on CUDA (Compute Unified Device Architecture) |
CN105631482A (en) * | 2016-03-03 | 2016-06-01 | 中国民航大学 | Convolutional neural network model-based dangerous object image classification method |
CN106296644A (en) * | 2015-06-10 | 2017-01-04 | 浙江托普云农科技股份有限公司 | Method is analyzed in a kind of corn kernel species test based on image procossing |
-
2017
- 2017-08-08 CN CN201710669925.9A patent/CN107516311A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103268492A (en) * | 2013-04-19 | 2013-08-28 | 北京农业信息技术研究中心 | Corn grain type identification method |
CN103514459A (en) * | 2013-10-11 | 2014-01-15 | 中国科学院合肥物质科学研究院 | Method and system for identifying crop diseases and pests based on Android mobile phone platform |
CN103700123A (en) * | 2013-12-19 | 2014-04-02 | 北京国药恒瑞美联信息技术有限公司 | Method and device for reconstructing GPU (Graphic Processing Unit) accelerating X-ray image based on CUDA (Compute Unified Device Architecture) |
CN106296644A (en) * | 2015-06-10 | 2017-01-04 | 浙江托普云农科技股份有限公司 | Method is analyzed in a kind of corn kernel species test based on image procossing |
CN105631482A (en) * | 2016-03-03 | 2016-06-01 | 中国民航大学 | Convolutional neural network model-based dangerous object image classification method |
Non-Patent Citations (6)
Title |
---|
CHIWOO PARK 等: "Segmentation, Inference, and Classification of Partially Overlapping Nanoparticles", 《IEEE TRANSACTIONS ON PATTERN ANALYSIS AND MACHINE INTELLIGENCE》 * |
K.LIAO 等: "Corn Kernel Breakage Classification by Machine Vision Using a Neural Network Classifier", 《AMERICAN SOCIETY OF AGRICULTURAL AND BIOLOGICAL ENGINEERS》 * |
MIN ZHAO 等: "The corn seed image segmentation and measurement of the geometrical features based on image analysis", 《APPLIED MECHANICS AND MATERIALS》 * |
SRDJAN SLADOJEVIC 等: "Deep Neural Networks Based Recognition of Plant Diseases by Leaf Image Classification", 《COMPUTATIONAL INTELLIGENCE AND NEUROSCIENCE》 * |
张玉荣 等: "基于外观特征识别玉米不完善粒检测方法", 《河南工业大学学报(自然科学版)》 * |
魏英姿 等: "玉米籽粒完整性识别的深度学习方法", 《沈阳理工大学学报》 * |
Cited By (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107993244A (en) * | 2017-12-27 | 2018-05-04 | 合肥市雅视智能科技有限公司 | A kind of corn automatic testing method |
CN107993244B (en) * | 2017-12-27 | 2020-09-11 | 合肥市雅视智能科技有限公司 | Automatic corn detection method |
CN108230307A (en) * | 2017-12-29 | 2018-06-29 | 浙江大学 | A kind of corn broken kernel detection method based on profile centroid distance and neural network |
CN108416790A (en) * | 2018-01-31 | 2018-08-17 | 湖北工业大学 | A kind of detection method for workpiece breakage rate |
CN108416790B (en) * | 2018-01-31 | 2021-08-17 | 湖北工业大学 | Method for detecting breakage rate of workpiece |
CN109522185A (en) * | 2018-11-19 | 2019-03-26 | 江苏镭博智能科技有限公司 | A kind of method that model segmentation improves arithmetic speed |
CN109961441A (en) * | 2019-03-19 | 2019-07-02 | 广东省农业科学院水稻研究所 | Hybrid rice seed splits the efficient measuring method of clever rate |
CN110060233A (en) * | 2019-03-20 | 2019-07-26 | 中国农业机械化科学研究院 | A kind of corn ear damage testing method |
CN111986192A (en) * | 2020-08-31 | 2020-11-24 | 华中科技大学 | Machine vision-based mushroom damage detection method |
CN111986192B (en) * | 2020-08-31 | 2022-05-27 | 华中科技大学 | Machine vision-based mushroom damage detection method |
CN112348744A (en) * | 2020-11-24 | 2021-02-09 | 电子科技大学 | Data enhancement method based on thumbnail |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107516311A (en) | A kind of corn breakage rate detection method based on GPU embedded platforms | |
Tian et al. | Apple detection during different growth stages in orchards using the improved YOLO-V3 model | |
Parvathi et al. | Detection of maturity stages of coconuts in complex background using Faster R-CNN model | |
Li et al. | Automatic organ-level point cloud segmentation of maize shoots by integrating high-throughput data acquisition and deep learning | |
Bresilla et al. | Single-shot convolution neural networks for real-time fruit detection within the tree | |
He et al. | Defect detection of hot rolled steels with a new object detection framework called classification priority network | |
Li et al. | PlantNet: A dual-function point cloud segmentation network for multiple plant species | |
CN110363253A (en) | A kind of Surfaces of Hot Rolled Strip defect classification method based on convolutional neural networks | |
CN107169956A (en) | Yarn dyed fabric defect detection method based on convolutional neural networks | |
CN108830326A (en) | A kind of automatic division method and device of MRI image | |
CN105654136B (en) | A kind of extensive remote sensing image Motion parameters method based on deep learning | |
Saranya et al. | Deep learning techniques in tomato plant–a review | |
Raj et al. | Fruit Classification Comparison Based on CNN and YOLO | |
Ferrer-Ferrer et al. | Simultaneous fruit detection and size estimation using multitask deep neural networks | |
Zhang et al. | Multi-phenotypic parameters extraction and biomass estimation for lettuce based on point clouds | |
Yumang et al. | Detection of Anthracnose on Mango Tree Leaf Using Convolutional Neural Network | |
Ma et al. | Using an improved lightweight YOLOv8 model for real-time detection of multi-stage apple fruit in complex orchard environments | |
CN116563714A (en) | Method and system for automatically distinguishing growth stage of rice | |
CN114972292A (en) | Banana growing period identification method and system based on deep learning | |
Yadav et al. | Crop disease prediction and solution | |
CN110210510B (en) | Defective shrimp rapid identification method based on deep convolutional neural network | |
Kong et al. | Detection model based on improved faster-RCNN in apple orchard environment | |
CN116012571A (en) | Corn kernel breaking rate real-time detection method integrating attention mechanism | |
Zhang et al. | A hierarchical growth method for extracting 3D phenotypic trait of apple tree branch in edge computing | |
Dan | Research progress of crop disease image recognition |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20171226 |