A method and system for identifying imperfect grains based on deep learning

Through a multi-view recognition method based on deep learning, using grain grain images obtained from multiple angles and the ResNet classification neural network, the problem of insufficient accuracy and efficiency in the detection of imperfect grain grains in the existing technology is solved, and higher detection accuracy is achieved. and efficiency.

CN112330641BActive Publication Date: 2024-10-29ERYAN(SHANGHAI) TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011239835.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-11-09
Publication Date
2024-10-29
Estimated Expiration
2040-11-09

AI Technical Summary

Technical Problem

Existing imperfect grain detection technology has deficiencies in accuracy and efficiency, and cannot effectively achieve automation and intelligence, resulting in high cost and low efficiency.

Method used

A method based on deep learning is used to obtain images of grain grains from multiple angles, and a pre-trained neural network model is used for identification, and through difference comparison, the result whose sum of confidence levels is higher than the preset threshold is taken as the final identification result. , combined with ResNet classification neural network and opencv library, to realize multi-view image recognition.

Benefits of technology

It improves the accuracy and efficiency of defective grain detection, and has higher fault tolerance compared to single-view recognition, ensuring detection efficiency while improving detection accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112330641B_ABST
    Figure CN112330641B_ABST
Patent Text Reader

Abstract

This invention relates to a method and system for identifying imperfect grains based on deep learning. The method includes: acquiring images of a single grain to be identified from multiple angles and from all angles, resulting in an image set of the grain to be identified; using a pre-trained neural network model to identify each image in the image set, obtaining the identification result of the grain to be identified in each image; and comparing the differences between the identification results of the grain to be identified in all images, taking the identification result whose sum of confidence scores is higher than a preset threshold as the final identification result of the grain to be identified. This invention acquires multiple images of the grain to be identified from multiple angles and from all angles, and uses an open-source ResNet-based classification neural network model to simultaneously identify multiple images from multiple perspectives. This has higher fault tolerance compared to identifying a single image from a single perspective, thus improving detection accuracy while ensuring detection efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of intelligent detection technology, and in particular to a method and system for identifying imperfect grains in grain based on deep learning. Background Art

[0002] With the popularization of industrial automation and intelligence, the detection of imperfect grains in grains also needs to be automated and intelligent, which can greatly save detection costs and improve detection efficiency. The current detection of imperfect grains in grains includes the following:

[0003] Non-intelligent grain imperfect grain detection: simple mechanical structure, no electronic control part, purely manual operation. Although the detection accuracy is high, the labor cost is also very huge, and there are also big problems with the detection efficiency.

[0004] Existing intelligent grain imperfect grain detection: It can basically meet the detection needs of grain imperfect grains, but the detection accuracy and efficiency are not high enough. Summary of the invention

[0005] The technical problem to be solved by the present invention is to provide a method and system for identifying imperfect grains in grain based on deep learning, which can improve detection accuracy while ensuring detection efficiency.

[0006] The technical solution of the present invention to solve the above technical problems is as follows: A method for identifying imperfect grains of grain based on deep learning, comprising the following steps:

[0007] Acquire an image of a grain to be identified from multiple angles in all directions to obtain an image set of the grain to be identified, wherein the image set includes multiple images of the grain to be identified from multiple angles;

[0008] A pre-trained neural network model is used to identify each image in the image set to obtain the recognition result of the grain to be identified in each image; and the recognition results of the grain to be identified in all images are compared for differences, and the recognition result whose sum of confidence levels of the recognition results is higher than a preset threshold is taken as the final recognition result of the grain to be identified.

[0009] Based on the above-mentioned method for identifying imperfect grains based on deep learning, the present invention also provides a system for identifying imperfect grains based on deep learning. A system for identifying imperfect grains based on deep learning includes an image acquisition module and a neural network model recognition module.

[0010] The image acquisition module is used to acquire an image of a grain to be identified from multiple angles in all directions to obtain an image set of the grain to be identified, wherein the image set includes multiple images of the grain to be identified from multiple angles;

[0011] The neural network model recognition module is used to use a pre-trained neural network model to recognize each image in the image set respectively, and obtain the recognition result of the grain to be identified in each image; and perform a difference comparison on the recognition results of the grain to be identified in all images, and take the recognition result whose sum of confidence levels of the recognition results is higher than a preset threshold as the final recognition result of the grain to be identified.

[0012] The beneficial effects of the present invention are as follows: a method and system for identifying imperfect grains based on deep learning are connected to an industrial-grade automatic grain discharging device, an open source OpenCV library is used to comprehensively acquire multiple images of grain grains to be identified that fall from the automatic grain discharging device from multiple angles, and a classification neural network based on Resnet is used to simultaneously identify multiple images from multiple perspectives. Compared with identifying an image from a single perspective, the method has higher fault tolerance performance, so the present invention can improve detection accuracy while ensuring detection efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] Figure 1 This is a flow chart of a method for identifying imperfect grains in grain based on deep learning according to the present invention;

[0014] Figure 2 This is a structural block diagram of a grain imperfect grain recognition system based on deep learning in the present invention. DETAILED DESCRIPTION

[0015] The principles and features of the present invention are described below in conjunction with the accompanying drawings and specific embodiments. The examples given are only used to explain the present invention and are not used to limit the scope of the present invention.

[0016] like Figure 1 As shown, the present invention provides a method for identifying imperfect grains in grains based on deep learning, comprising the following steps: acquiring an image of a grain to be identified from multiple angles in all directions to obtain an image set of the grain to be identified, wherein the image set includes multiple images of the grain to be identified at multiple angles; using a pre-trained neural network model to respectively identify each image in the image set to obtain a recognition result of the grain to be identified in each image; and performing a difference comparison on the recognition results of the grain to be identified in all images, and taking the recognition result whose sum of confidence levels of the recognition results is higher than a preset threshold as the final recognition result of the grain to be identified.

[0017] In the method of the present invention, the specific method for obtaining an image of a grain to be identified from multiple angles in an all-round manner is: using cameras distributed at multiple angles to obtain an image of a grain to be identified in an all-round manner. In this specific embodiment, there are four cameras, the four cameras are in the same horizontal plane, and the four cameras are placed in four different directions respectively, to ensure that the grain to be identified can be photographed 360° without blind spots (the four cameras will also have a large area of ​​overlapping fields of view), and the two adjacent cameras are placed at right angles (the following embodiments are all based on the four cameras set as an example). The image acquisition algorithm uses the open source opencv library, that is, through the opencv program code, the video streams in the four cameras are respectively obtained, and the frame image at the current moment is intercepted as the target image, that is, as the image set of the grain to be identified. Finally, the four cameras will send a captured image to the neural network model every 100ms. After the images taken at four angles are input into the neural network model, four results will appear. Through the difference comparison of these four results, the category with the highest confidence is taken as the final result. For example, the results of the four images are intact grain (92), intact grain (84), intact grain (87), and diseased grain (83). The confidence level is in brackets. Therefore, we believe that this grain should be an intact grain. Therefore, four cameras have better fault tolerance than one camera.

[0018] The present invention realizes intelligent grain imperfect grain detection through a computer. When the program is initialized, a pre-trained neural network model is loaded, and relevant parameter configuration is done, and a thread pool is started (to prepare for the parallelization of the subsequent four image detections). After everything is ready, the industrial-grade grain automatic grain discharging equipment starts to discharge grain. The following is to perform grain imperfect grain detection: First, the program is a real-time fully automatic detection, that is, every moment, the detection program is executed, so we need to know whether there are grain grains in the current picture. If not, no processing is performed, otherwise the subsequent recognition task is performed. Therefore, in the method of the present invention, before obtaining the image of the grain grain to be identified, the following steps are also included: detecting whether the grain grain to be identified exists in the current picture taken by the camera.

[0019] In this specific embodiment, detecting whether the grain to be identified exists in the current picture taken by the camera specifically includes the following steps: obtaining the current picture image taken by the camera, and performing differentiation processing on each pixel point in the current picture image to obtain the differential value of each pixel point; if the differential value of each pixel point in the current picture image is zero, it is determined that the grain to be identified does not exist in the current picture image; otherwise, the pixel information of the pixel points whose differential values ​​are not zero in the current picture image is obtained; the pixel information of all the pixel points whose differential values ​​are not zero in the current picture image is compared with the preset pixel information respectively; if the difference between the pixel information of the pixel point whose differential value is not zero and the preset pixel information is less than a first preset threshold value, it is determined that the pixel point whose differential value is not zero is not an edge point; otherwise, it is determined that the pixel point whose differential value is not zero is an edge point; counting the number of the edge points, and comparing the number of the edge points with a second preset threshold value; if the number of the edge points is less than the second preset threshold value, it is determined that the grain to be identified does not exist in the current picture image; otherwise, it is determined that the grain to be identified exists in the current picture image.

[0020] One thing needs to be explained here. Since the camera has a fixed focus, the farther the object is outside the focal plane, the blurrier the image will be. Therefore, if there are no grains of food in the picture, the entire picture will be black, and there will be no edge information. Otherwise, when the edge information is higher than a predefined threshold, it is considered that food is present.

[0021] In the method of the present invention, after detecting that grains exist in the current picture, the method further includes the following steps: tracking the grains to be identified. In this specific embodiment, the KCF tracking method is used to track the grains to be identified.

[0022] At present, it has been confirmed that the existence of grain has been detected, but at this time, we should not immediately classify and detect the grain grains, but track them first, because classification detection takes a certain amount of time, and after this period of time, the grain may have moved away from its previous position. When the test results come out, we still need to perform relevant operations on it. For example, if a diseased grain is detected, we need to control the mechanical board to shoot it towards the box where the diseased grains are specially stored. At this time, the only thing we need is the specific location of the diseased grain at this moment. For the tracking algorithm, we use the open source KCF, which has extremely high stability and accuracy and is widely used in various industrial fields. Therefore, we directly call the KCF algorithm integrated in the opencv library. According to the edge information detected before, we can calculate the position of the grain in the image, that is, the outermost edge is the largest encirclement of the grain. From this, we can get the position of the grain when it first enters the camera's field of view, and fill in the relevant parameters of the KCF algorithm based on this, and then we can start tracking.

[0023] In the method of the present invention, the neural network is a classification neural network with ResNet as the backbone; each image in the image set is recognized by using a pre-trained neural network model to obtain the recognition result of the grain to be recognized in each image, which specifically includes the following steps: using the neural network model to perform convolution operations, pooling and normalization processing on each image in the image set, and outputting the recognition result of the grain to be recognized in each image; wherein the recognition result includes the weight and confidence of each category to which the grain to be recognized in each image belongs; the recognition result of the grain to be recognized in all images is output; The identification results are compared for differences, and the identification result whose sum of identification result confidences is higher than a preset threshold is taken as the final identification result of the grain to be identified, which specifically includes the following steps: multiplying the weight and confidence of each category of the grain to be identified in each image to obtain the weighted confidence of each category of the grain to be identified in each image; adding the weighted confidences of the same category of the grain to be identified in all images to obtain the sum of the weighted confidences of each category of the grain to be identified; taking the category corresponding to the sum of the weighted confidences higher than the preset threshold as the final identification result of the grain to be identified.

[0024] When the program is running, the thread pool is ready, so we will mobilize four threads to classify and detect four images of grains at the same time. The work content of each thread pool is: input the image as a matrix into the neural network model built by the ResNet network structure model. After a series of convolution operations, pooling, normalization and other operations, the network will output a string of data, which contains the confidence of each category to which the grain represented by the current image belongs. The data is parsed, and the category that is still higher than a certain threshold after the final confidence is weighted is taken as the classification result of the grain. The following example illustrates:

[0025] Here we need to explain the weighted operation in particular: In the process of image detection by the neural network model, each category will generate a weight according to the current image. This weight is a five-dimensional vector (X1, X2, X3, X4, X5), where X1 represents the probability of being intact, X2 represents the probability of being diseased, X3 represents the probability of being damaged (i.e., the weight), X4 represents the probability of being moldy, and X5 represents the probability of being worm-eaten. Initially, the five elements X1, X2, X3, X4, and X5 are all 0.5. The values ​​of these five elements can be reset by executing the following process in sequence: Step 1: If the image P obtained after edge extraction of the current image is subjected to convex hull calculation, if the side length information of the convex hull is consistent with the original The information gap is very large, indicating that the grain is likely to be damaged, so X3 can be set to 0.6 (specifically set according to the edge length information of the convex hull), and the rest remain unchanged, still 0.5 (X1, X2, X4 and X5 remain unchanged); the second step is to count the short edges of the image P. If it is a good grain, its entire edge is relatively complete, and the number of broken and short edge information is very small. If it is moldy or diseased, there will be a lot of edge details. If the edge details are higher than a certain predetermined threshold, X2=0.6, X4=0.6 can be set (specifically set according to the edge details), and the rest remain unchanged (no change does not mean equal to 0.5, because it may meet the judgment of a damaged grain in the first step, that is, this may be a damaged diseased grain).

[0026] Assume that after a certain frame of image is output through the network, the following are obtained: intact grains (23), diseased grains (97), broken grains (95), moldy grains (79), and worm-eaten grains (7). Then the weighted confidence of each category of the grains to be identified is: intact grains: 23*X1=23*0.5=11.5, diseased grains: 97*X2=97*0.6=59.2, broken grains: 95*X3=95*0.6=57, moldy grains: 71*X4=79*0.6=47.4, worm-eaten grains: 7*X5=7*0.5=3.5; assuming that our predetermined threshold is 45, then the final calculation results of two categories exceed this threshold, namely diseased grains (59.2) and broken grains (47.4). Then we believe that the grains in the current frame of image should belong to damaged diseased grains.

[0027] While the four threads are performing classification, detection and calculation, it does not affect the main program's task of tracking the real grains in the physical world, and the target tracking in the first step is still continuing.

[0028] After obtaining the grain images transmitted by the four cameras, a difference comparison is performed (because these images are taken from four different angles, the detected categories may be different from each other). The comparison method is as follows: the category whose sum of confidences is greater than the preset threshold is taken as the classification result.

[0029] For example, in the first image, the weighted confidence that the grain to be identified is intact is A1, the weighted confidence that it is diseased is B1, the weighted confidence that it is damaged is C1, the weighted confidence that it is moldy is D1, and the weighted confidence that it is worm-eaten is E1; in the second image, the weighted confidence that the grain to be identified is intact is A2, the weighted confidence that it is diseased is B2, the weighted confidence that it is damaged is C2, the weighted confidence that it is moldy is D2, and the weighted confidence that it is worm-eaten is E1. 2; in the third image, the weighted confidence that the grain to be identified is intact is A3, the weighted confidence that it is diseased is B3, the weighted confidence that it is broken is C3, the weighted confidence that it is moldy is D3, and the weighted confidence that it is worm-eaten is E3; in the fourth image, the weighted confidence that the grain to be identified is intact is A4, the weighted confidence that it is diseased is B4, the weighted confidence that it is broken is C4, the weighted confidence that it is moldy is D4, and the weighted confidence that it is worm-eaten is E4. Then: the sum of weighted confidences of the grains to be identified as intact grains is A=A1+A2+A3+A4, the sum of weighted confidences of the grains with disease spots is B=B1+B2+B3+B4, the sum of weighted confidences of the grains with damaged grains is C=C1+C2+C3+C4, the sum of weighted confidences of the grains with moldy grains is D=D1+D2+D3+D4, and the sum of weighted confidences of the grains with worm damage is E=E1+E2+E3+E4. Compare A, B, C, D, and E with the preset thresholds respectively, and take the category corresponding to the sum of weighted confidences higher than the preset threshold as the final category; for example, if only A is higher than the preset threshold, the grain to be identified is considered to be intact, if B and C are higher than the preset threshold, the grain to be identified is considered to be diseased and damaged, and so on.

[0030] For example, the sum of the weighted confidences of the corresponding categories of the four images (the above calculation is performed on the pictures taken at four angles and accumulated) is: intact grains (105.3), diseased grains (221.8), broken grains (192.3), moldy grains (83.2), and worm-eaten grains (21.5). Because the threshold of each thread is 45.0, after the four threads are superimposed, the threshold should be 45.0*4=180.0. Therefore, there are two categories that exceed the threshold, namely diseased grains (221.8) and broken grains (192.3). Therefore, in the current physical world, the one that falls from the camera is a damaged diseased grain.

[0031] In the method of the present invention, the specific steps of training the neural network model are: providing a plurality of different categories of original grain grain samples, acquiring images of the original grain grain samples of each category from multiple angles in an all-round manner, and obtaining a plurality of categories of original grain grain sample image sets; based on the TF-Slim library, inputting the plurality of categories of original grain grain sample image sets into the ResNet network model for training, and obtaining the neural network model.

[0032] The neural network backbone uses ResNet50 because it is widely used in industry and its effectiveness and stability have been proven. The images of the original grain samples are obtained from multiple different angles to ensure that the complete details of each grain are collected.

[0033] In the method of the present invention, the method for identifying imperfect grains in grains comprises the following steps: classifying the grains to be identified into corresponding category piles according to the final identification result.

[0034] The grains to be identified have been tracked and processed before. After their categories are identified, they can be photographed into corresponding containers for storage using a mechanical device.

[0035] Based on the above-mentioned method for identifying imperfect grains in grain based on deep learning, the present invention also provides a system for identifying imperfect grains in grain based on deep learning.

[0036] like Figure 2 As shown, a grain imperfect grain recognition system based on deep learning includes an image acquisition module and a neural network model recognition module.

[0037] The image acquisition module is used to acquire an image of a grain to be identified from multiple angles in all directions to obtain an image set of the grain to be identified, wherein the image set includes multiple images of the grain to be identified from multiple angles;

[0038] The neural network model recognition module is used to use a pre-trained neural network model to recognize each image in the image set respectively, and obtain the recognition result of the grain to be identified in each image; and perform a difference comparison on the recognition results of the grain to be identified in all images, and take the recognition result whose sum of confidence levels of the recognition results is higher than a preset threshold as the final recognition result of the grain to be identified.

[0039] The system of the present invention further comprises a sorting module, which is used to sort the grains to be identified into corresponding category piles according to the final identification results of the grains to be identified.

[0040] In this specific embodiment, the image acquisition module uses four cameras in the same horizontal plane, and the four cameras are placed in four different directions to ensure that the grains to be identified can be photographed 360° without blind spots (the four cameras will also have a large area of ​​overlapping fields of view), and the two adjacent cameras are placed at right angles. The neural network model recognition module uses a computer installed with a neural network model software program. The sorting module can specifically use a mechanical board, which is controlled by a computer. The computer sends instructions to notify the mechanical board to perform related operations. Serial communication is used here, and binary instructions are sent through the serial port to notify the mechanical board. After receiving specific instructions, the mechanical board will perform specific actions, such as shooting grains into boxes of corresponding categories.

[0041] The method and system of the present invention are connected to an industrial-grade automatic grain discharging device, and an open source OpenCV library is used to comprehensively acquire multiple images of grain grains to be identified that are discharged from the automatic grain discharging device from multiple angles, and an open source ResNet-based classification neural network model is used to simultaneously identify multiple images of multiple perspectives. Compared with identifying an image of a single perspective, the method and system of the present invention have higher fault tolerance performance, so the present invention can improve detection accuracy while ensuring detection efficiency.

[0042] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for identifying imperfect grains based on deep learning, characterized in that: The method for identifying imperfect grains of grain comprises the following steps: Acquire an image of a grain to be identified from multiple angles in all directions to obtain an image set of the grain to be identified, wherein the image set includes multiple images of the grain to be identified from multiple angles; Using a pre-trained neural network model to identify each image in the image set, respectively, to obtain the recognition result of the grain to be identified in each image; and performing a difference comparison on the recognition results of the grain to be identified in all images, and taking the recognition result whose sum of the confidence of the recognition result is higher than a preset threshold as the final recognition result of the grain to be identified; The specific method of obtaining an image of a grain to be identified from multiple angles in an all-round manner is to use cameras distributed at multiple angles to obtain an image of a grain to be identified in an all-round manner; Before acquiring the image of the grain to be identified, the method further includes the following steps: detecting whether the grain to be identified exists in the current picture taken by the camera; Detecting whether the grain to be identified exists in the current picture taken by the camera specifically includes the following steps: The current screen image captured by the camera is obtained, and each pixel point in the current screen image is differentiated to obtain the differential value of each pixel point; if the differential value of each pixel point in the current screen image is zero, it is determined that the grain to be identified does not exist in the current screen image; otherwise, pixel information of the pixel points in the current screen image whose differential value is not zero is obtained; Compare the pixel information of all pixels whose differential values ​​are not zero in the current screen image with the preset pixel information respectively; if the difference between the pixel information of the pixel whose differential value is not zero and the preset pixel information is less than a first preset threshold, determine that the pixel whose differential value is not zero is not an edge point; otherwise, determine that the pixel whose differential value is not zero is an edge point; Counting the number of edge points, and comparing the number of edge points with a second preset threshold; if the number of edge points is less than the second preset threshold, determining that the grain to be identified does not exist in the current screen image; otherwise, determining that the grain to be identified exists in the current screen image; The neural network is a classification neural network with ResNet as the backbone; each image in the image set is identified by using a pre-trained neural network model to obtain the identification result of the grain to be identified in each image, which specifically includes the following steps: Using the neural network model, each image in the image set is subjected to convolution operation, pooling and normalization processing, and the recognition result of the grain to be identified in each image is output; wherein the recognition result includes the weight and confidence of each category to which the grain to be identified in each image belongs; The recognition results of the grain to be recognized in all images are compared for differences, and the recognition result whose sum of confidence of the recognition result is higher than a preset threshold is taken as the final recognition result of the grain to be recognized, which specifically includes the following steps: The weight and confidence of each category to which the grain to be identified in each image belongs are multiplied to obtain the weighted confidence of each category to which the grain to be identified in each image belongs; The weighted confidences of the same category of the grains to be identified in all images are added together to obtain the sum of the weighted confidences of each category of the grains to be identified; The category corresponding to the sum of the weighted confidences that is higher than a preset threshold is taken as the final recognition result of the grain to be recognized.

2. The method for identifying imperfect grains based on deep learning according to claim 1, characterized in that: After detecting that there are grains in the current image, The method comprises the following steps: tracking and processing the grains to be identified.

3. The method for identifying imperfect grains based on deep learning according to claim 2, characterized in that: The KCF tracking method is used to track the grains to be identified.

4. The method for identifying imperfect grains in grains based on deep learning according to any one of claims 1 to 3, characterized in that: The specific steps of training the neural network model are: Providing a variety of different categories of original grain samples, obtaining images of each category of original grain samples from multiple angles, and obtaining a set of original grain sample images of multiple categories; Based on the TF-Slim library, the original grain sample image sets of multiple categories are input into the ResNet network model for training to obtain the neural network model.

5. The method for identifying imperfect grains in grains based on deep learning according to any one of claims 1 to 3, characterized in that: The method for identifying imperfect grains of grain comprises the following steps: The grains to be identified are classified into corresponding category piles according to the final identification result.

6. A grain imperfect grain recognition system based on deep learning, characterized by: Including image acquisition module and neural network model recognition module, The image acquisition module is used to acquire an image of a grain to be identified from multiple angles in all directions to obtain an image set of the grain to be identified, wherein the image set includes multiple images of the grain to be identified from multiple angles; The neural network model recognition module is used to use the pre-trained neural network model to recognize each image in the image set, and obtain the recognition result of the grain to be recognized in each image; and to compare the recognition results of the grain to be recognized in all images, and take the recognition result whose sum of confidence of the recognition result is higher than a preset threshold as the final recognition result of the grain to be recognized; The specific method of obtaining an image of a grain to be identified from multiple angles in an all-round manner is to use cameras distributed at multiple angles to obtain an image of a grain to be identified in an all-round manner; Before acquiring the image of the grain to be identified, the method further includes the following steps: detecting whether the grain to be identified exists in the current picture taken by the camera; Detecting whether the grain to be identified exists in the current picture taken by the camera specifically includes the following steps: The current screen image captured by the camera is obtained, and each pixel point in the current screen image is differentiated to obtain the differential value of each pixel point; if the differential value of each pixel point in the current screen image is zero, it is determined that the grain to be identified does not exist in the current screen image; otherwise, pixel information of the pixel points in the current screen image whose differential value is not zero is obtained; Compare the pixel information of all pixels whose differential values ​​are not zero in the current screen image with the preset pixel information respectively; if the difference between the pixel information of the pixel whose differential value is not zero and the preset pixel information is less than a first preset threshold, determine that the pixel whose differential value is not zero is not an edge point; otherwise, determine that the pixel whose differential value is not zero is an edge point; Counting the number of edge points, and comparing the number of edge points with a second preset threshold; if the number of edge points is less than the second preset threshold, determining that the grain to be identified does not exist in the current screen image; otherwise, determining that the grain to be identified exists in the current screen image; The neural network is a classification neural network with ResNet as the backbone; each image in the image set is identified by using a pre-trained neural network model to obtain the identification result of the grain to be identified in each image, which specifically includes the following steps: Using the neural network model, each image in the image set is subjected to convolution operation, pooling and normalization processing, and the recognition result of the grain to be identified in each image is output; wherein the recognition result includes the weight and confidence of each category to which the grain to be identified in each image belongs; The recognition results of the grain to be recognized in all images are compared for differences, and the recognition result whose sum of confidence of the recognition result is higher than a preset threshold is taken as the final recognition result of the grain to be recognized, which specifically includes the following steps: The weight and confidence of each category to which the grain to be identified in each image belongs are multiplied to obtain the weighted confidence of each category to which the grain to be identified in each image belongs; The weighted confidences of the same category of the grains to be identified in all images are added together to obtain the sum of the weighted confidences of each category of the grains to be identified; The category corresponding to the sum of the weighted confidences that is higher than a preset threshold is taken as the final recognition result of the grain to be recognized.

Citation Information

Patent Citations

  • A method and a system for establishing a grain imperfect grain image recognition sample library

    CN109711319A

  • Automatic dish settlement and diet health management method based on fine-grained recognition

    CN110059654A