Background
Particle size detection is an experimental work that characterizes the particle size characteristics of a particle mass by a particular instrument and method. The grains can be widely applied to daily life and industrial and agricultural production, such as flour, cement, plastics, paper making, rubber, ceramics, medicines and the like. In different fields, different requirements are made on the characteristics of the granules, and the size of the granules is projected by the granularity in all indexes reflecting the characteristics of the granules, so that the granularity distribution is one of the indexes which are most concerned in all application fields. The particle size distribution has an important influence on the use effect of the particles, for example, the particle size distribution is an important part in the classification of coal briquettes and cement grades, so that it is a very important task to objectively and truly reflect the particle size distribution of the particles or powder. The particle size detection based on vision is a new technology, a camera is used for shooting a particle image, the particle size distribution can be rapidly analyzed through image processing, and the particle size detection based on vision has the characteristics of non-contact type, remote measurement and intelligent analysis. However, in the prior art, a conventional digital image method needs to integrate a plurality of image processing algorithms, such as image equalization, Sobel edge detection, threshold segmentation, distance transformation, morphological correction and the like, the flow is complex, a large number of parameters need to be adjusted, and in the actual image analysis process, the edge detection and segmentation of overlapped grains are difficult problems to solve primarily.
Disclosure of Invention
The invention aims to provide a granularity detection analysis method based on a U-Net deep learning network, which is used for obtaining a granularity model of an object to be detected and rapidly completing granularity distribution analysis on a grain block.
In order to achieve the purpose, the invention adopts the following technical scheme: a granularity detection analysis method based on a U-Net deep learning network comprises the following steps: A. collecting a large number of grain block images of the object to be detected; B. preprocessing the grain block image to obtain a standardized image; C. manually calibrating the standardized image, drawing the edge of the grain block to obtain a manually calibrated image, and taking the manually calibrated image as a label image; D. and (4) building a deep learning network based on U-Net, loading the standard image in the step B as an input image and the label image in the step C as an output image into the deep learning network, and starting training to obtain a trained particle size model.
According to the technical scheme, a large number of grain block images of an object to be detected are preprocessed to obtain a standardized image, the edges of the grain blocks are drawn manually according to the standardized image to obtain a label image, then the standardized image and the label image are loaded into a deep learning network based on U-Net as input and output images respectively, a grain size model of the grain blocks of the object to be detected is obtained through training, and then when grain size analysis is carried out on the object to be detected, the shot and processed standardized image is only needed to be input into the grain size model, so that grain size distribution analysis can be rapidly completed on the grain blocks or powder.
Detailed Description
The invention is further described with reference to figure 1:
a granularity detection analysis method based on a U-Net deep learning network comprises the following steps: A. collecting a large number of grain block images of the object to be detected; B. preprocessing the grain block image to obtain a standardized image; C. manually calibrating the standardized image, drawing the edge of the grain block to obtain a manually calibrated image, and taking the manually calibrated image as a label image; D. and (4) building a deep learning network based on U-Net, loading the standard image in the step B as an input image and the label image in the step C as an output image into the deep learning network, and starting training to obtain a trained particle size model. Preprocessing a large number of grain block images of an object to be detected to obtain a standardized image, manually drawing the edges of the grain blocks according to the standardized image to obtain a label image, loading the standardized image and the label image into a deep learning network based on U-Net as input and output images respectively, training to obtain a grain size model of the grain blocks of the object to be detected, and then when carrying out grain size analysis on the object to be detected, only inputting the shot and processed standardized image into the grain size model, so that the grain size distribution analysis of the grain blocks or powder can be rapidly completed.
The step D is followed by the following steps: E. shooting again to obtain a new grain block image, preprocessing the new grain block image to obtain a standardized image, and inputting the standardized image into the granularity model in the step D to perform grain block edge detection; F. e, outputting the granularity edge detection result in the step E for image processing, enhancing the image edge by using morphological operation, and segmenting a granularity block region by using a watershed algorithm; G. and E, carrying out binary image statistics on the particle block regions divided in the step E to obtain statistical parameters such as the radius, the area and the number of the particle blocks, and finally drawing a particle size distribution histogram curve of the particle blocks. After the particle size model in the step D is obtained, in practical application, the edge of the particle can be rapidly detected only by inputting the standardized image of the object to be detected, which is obtained by shooting again, into the particle size model, and the result is subjected to image processing to segment out a particle area, and parameters such as the radius, the area, the number and the like of the particle are counted to obtain an intuitive particle size distribution histogram curve, so that the reference analysis of personnel is facilitated.
The step A comprises the following steps: a1, uniformly spreading the object to be detected on a horizontal plane; a2, determining a shooting position, fixing a camera, and adjusting the direction and the focal length of the camera to enable the grain blocks of the object to be detected to be clearly imaged on the camera; a3, switching the position and the angle of a camera to shoot the object to be detected and collecting a large number of grain block images. Before carrying out the U-Net deep learning network, a large number of stable and clear images of the particle blocks to be detected are obtained.
In the step B, the grain block image is preprocessed as follows: and reducing image noise by using mean filtering, improving image contrast by using adaptive histogram equalization, and finally obtaining a standardized image by using whitening processing.
The step D comprises the following steps: d1, performing small-region random segmentation on the standardized image in the step B and the label image in the step C correspondingly, and training in a deep learning network according to the small-region standardized image and the small-region label image which correspond to each other to obtain a granularity model; d2, after obtaining the granularity model, the deep learning network automatically inputs the standardized image in the step B into the granularity model to obtain a detection image; d3, comparing the label image corresponding to the standardized image in the step B with the detection image, checking whether the similarity reaches 98%, if so, taking the granularity model as the final detection granularity model; and if not, continuing to carry out deep learning network training. In order to facilitate the deep learning network to carry out rapid learning, small-area random segmentation is carried out on the standardized image, for example, the standardized image with 1000 × 1000 pixels and the label image are randomly segmented into a plurality of small-area images with 48 × 48 pixels, then training is carried out, a granularity model is rapidly and accurately obtained, then the granularity model is automatically detected, if the similarity between the detected image and the label image does not reach 98%, the granularity model is proved to be inaccurate in training, and training needs to be carried out continuously.