APP下载

Method for pests detecting in stored grain based on spectral residual saliency edge detection

2019-09-09YoQinYnliWuQifuWngSupingYu

Grain & Oil Science and Technology 2019年2期

Yo Qin*,Ynli Wu,Qifu Wng,Suping Yu

a College of Information Science and Engineering,Henan University of Technology,Zhengzhou 450001,China

b Key Laboratory of Grain Information Processing and Control,Henan University of Technology,Ministry of Education,Zhengzhou 450001,China

c Henan Academy of Science,Applied Physics Institute Co.,Ltd,Zhengzhou 450001,China

d Luoyang Institute of Science and Technology,Department of Computer and Information Engineering,Luoyang 471000,China

Keywords:

Stored grain pests

Saliency detection

Spectral residual(SR)

Edge detection

ABSTRACT

Pests detecting is an important research subject in grain storage field.In the past decades,many edge detection methods have been applied to the edge detection of stored grain pests.Although some of them can realize the stored grain pests detecting,precision and robustness are not good enough.Spectral residual(SR)saliency edge detection defines the logarithmic spectrum of image as novelty part of the image information.The remaining spectrum is converted to the airspace to obtain edge detection results.SR algorithm is completely based on frequency domain processing.It not only can effectively simplify the target detection algorithm,but also can improve the effectiveness of target recognition.The experimental results show that the edge results of stored grain pests detected by SR method are effective and stable.

1.Introduction

Grain is an essential material basis for human survival and development.Studies have shown that the loss of grain from pests is one of the most important factors in the global food crisis.Pests can cause about 5-10% loss of stored grain in developed countries and more than 20%loss of grain in developing countries[1-3].The low accuracy and stability of domestic food situation detection systems to detect pests is a prominent problem in pest detection methods.Normal sampling,embedding,and the food insect sound detection technology can't achieve quantitative detection of pests.Studying effective stored grain pest detection technology,accurately giving the location,quantity and shape of stored grain pests,can provide a scientific basis for the prevention and control of stored grain pests,and it also has important practical application value.

Traditional methods include visual inspection,trapping and screening,and modern methods include acoustic and image processing techniques[4,5].Modern methods have the advantage of capturing pests efficiently and accurately compared to traditional methods[6].We have found that fast-developing image processing techniques can be applied to pest detection [3,7,8].The use of image processing technology to analyze pest image can accurately obtain the number,shape,size and edge information of pests without any damage to the stored cereal products.In the latest work,it becomes the most effective area for the detection of stored grain pests.

2.Edge detection techniques

In image processing,edge detection is at the forefront of machine vision technology.During stored grain pest image processing,the edge contour of pest image has a lot of important information.In order to accurately analyze and identify the species of pest,it is important to perform clear edge detection with the stored grain pest image[3].

There are many classical basic algorithms for edge detection.In 1963,the first edge detection operator-Robert edge operator was proposed by Lawrence Roberts[9].Roberts operator is a two-dimensional gradient operator that is easy to calculate[9].It has higher edge positioning accuracy,but its noise suppression is weak,resulting in easy loss of a portion of the edge.In 1970,Prewitt edge operator was proposed by JMS Prewitt[10].It is a first order differential operator edge detection,a combination of directional difference operation and local average.In 1973,Sobel edge operator[11]was published as a comment in the published footnotes of the monograph.Sobel edge operator is a basic first-order edge detection operator and belongs to the pixel-level edge detection algorithm.In the actual edge detection,it is found that the edge line detected by the Sobel is thicker than the actual edge line[12,13].In 1980,LOG was proposed by David Marr et al.[14].LOG operator uses Gaussian function for images smoothing.In 1986,Canny edge detection operator was developed by John F.Canny.Canny edge detection operator is a multi-level edge detection algorithm.Because of its fixed mask,it can hardly adaptively cope with the varying image signal-to-noise ratio.

3.The principle of spectral residual saliency edge detection method

SR method is proposed by Hou et al.[15]in 2007.SR was originally used to detect conspicuous objects in cluttered visual environment and made a good performance[16].The effective coding hypothesis divides the image information into two parts:the novelty part and the redundant information.Obtaining the novelty part of the image information is the main task of image edge detection.

Method for pests detecting in stored grain based on spectral residual saliency edge detection defines the novelty part R(f)of the image information as the logarithmic spectrum of image.The characteristic singularity of the input image is the spectral residual of an image.The formula for R(f)is as follows.

where L(f)is expressed as the log spectrum of the input image,A(f)is given as priori information of the input image I(i),expressed as the general shape of the log spectrum.A(f)can be obtained by

The invariant factors of natural image statistics and scale invariance are the most widely studied property[15,17,18].In order to indicate the positions of proto-objects,SR method transforms data into spatial domain.This property,also known as thelaw,indicates that the amplitude of the averaged Fourier spectrum of the ensemble of natural images.The amplitude A(f)obeys the following distribute on.

After the orientation averaging,on a log-log scale,the amplitude spectrum of the ensemble of natural images is roughly a straight line.

The study found that the sampling points in a single image are not wellproportioned.In theory,a single image does not have the scale-invariance property[17,19].In the log-log spectrum,the distribution of data points is not balanced,and the data in the high-frequency portion is concentrated and susceptible to noise,while the data in the low-frequency portion is dispersed.Therefore,the log-log spectrum is not favored in the analysis of individual images,even though it is theoretically matured and widely used.The Log spectrum is used in a series of literature related to statistical scene analysis.The formula for log spectrum L(f)is as follows.

The averaged spectrum A(f)can be approximated by convoluting the input image.

The spectral residual contains the novelty part of the input image that function like an image compression.Using Inverse Fourier Transform,an output image is constructed in spatial domain,which is the result of edge detection of stored grain pests.To achieve a better visual effect,a Gaussian filter g(i)(σ=6)is used to smooth the output image.The formula for output image S(i)is as follows.

The remaining spectrum is converted to the airspace to obtain edge detection results.SR algorithm is completely based on frequency domain processing.It has the ability to suppress various noises,and can effectively simplify the target detection algorithm and improve the effectiveness of edge detection.

The process of SR edge detection method is shown in Fig.1.It includes four steps.First of all,read data from the original image.Then,judge whether the reading image is a binary image.If the image is a binary image,then continue to the next step.Otherwise,it performs binary image conversion.Next,use SR method to detect the image edge and get the final result of edge detection.Finally,Gaussian filter is used to smooth the final edge detection image to achieve better effect.

Fig.1.The edge detection process of SR method.

4.Experimental results and analysis

In order to verify the validity of the algorithm in this paper,three images of stored grain pests are chosen as the input image.In experiment,the first input image contains seven rusty grain beetles with a body length of 1.70-2.34 mm,the second image contains two Tribolium castaneum with a body length of 2-4 mm,and the third input image contains five flat grain beetles with a body length of 2.5-3.5 mm.Based on different edge detection operators,the edge detection results and performance parameters for various stored grain pest images are shown.These techniques are compared by using MATLAB.The results for the image of rusty grain beetle are shown in Fig.2,the results for the image of T.castaneum are shown in Fig.3,and the results for the image of flat grain beetle are shown in Fig.4.

Fig.2.Edge detection results of rusty grain beetle.

As shown in Fig.2,the edge detection result of LOG operator is the worst because LOG operator is too sensitive to noise.From Fig.2(b),(c),(d)and(f),we can also know that all of the other traditional edge detection methods can't get better results.The edges are discrete and lack some edge information.Almost all edge information extracted from the edge extracted by the SR method is extracted.A bit fuzzy,but it is continuous.As shown in Fig.3,Canny operator can't detect the number of pests.From Fig.3(b),(c),(d),(e)and(h),the number of pests can be accurately obtained.Like Canny operator,the edge of pests detected by the SR method is also lost,but the edge of pests detected by the SR method is brighter.As shown in Fig.4,Sobel operator loses some edge information of pests.Some of other operators can accurately detect the location and number of pests.The SR method also lost some of the edge information of pests,but it retains the antennae of pests.SR method provides a good method of edge detection.It displays good performances by dealing with three different pest images,and it eliminates noise of image very well.The edge detection results by SR method are stable.

Analyze images from several parameters such as peak signal to noise ratio (PSNR),mean square error (MSE),threshold value and gray-scale value.PSNR is typically used as a measure of quality between the original image and the processed image [20].MSE represents the cumulative squared error between the processed image and the original image,and if its value is lower,the error rate is lower.PSNR and MSE are obtained by Eqs.(9)and(10),respectively.where R represents the maximum fluctuation of the input image data type.M,N are the number of rows and columns in the input image,respectively.

Fig.3.Edge detection results of Tribolium castaneum.

In practice,the noise and illumination condition affect the quality of edge detection[21],it is necessary to get suitable threshold.The choice of threshold of the algorithm has a direct effect on the results of detection.Gray-scale value is used to describe the brightness of specific pixels in an image and it is used to demonstrate the comparison of gray scale image in digital image processing.The value is higher,the pixel is brighter.The following tables compares performance parameters of various edge detection methods in three stored grain pest images.The following tables refer to Table 1,2 and 3.

Fig.4.Edge detection results of flat grain beetle.

Table 1 Table showing the values for rusty grain beetle.

By analyzing the first image which has 7 rusty grain beetles,PSNR value is higher for Log operator and it is lower for Prewitt.PSNR value of SR method is in between.MSE is minimum for Log operator and maximumfor Prewitt operator.Threshold value is higher for Canny operator and lower for SR method.The threshold value of SR method is 0.It means SR method doesn't need filter.The gray-scale value of SR method is the highest.

Table 2 Table showing the values for Tribolium castaneum.

Table 3 Table showing the values for flat grain beetle.

By analyzing the second image which has 2 Tribolium castaneum,PSNR value is higher for SR method.MSE is minimum for SR method.Threshold value is higher for Canny operator and lower for SR method.The gray-scale value of SR method is higher which is 130.0540 and the gray-scale value of Roberts operator is lower which is 126.3687.

By analyzing the third image which has 5 flat grain beetles,PSNR value is higher for Log and it is lower for Prewitt.MSE is minimum for Log operator.Threshold value is lower for SR method.The gray-scale value of SR method is higher which is 93.8643 and the gray-scale value of Prewitt operator is lower which is 88.3463.

Compare three sets of images and consider all parameters such as PSNR,MSE,threshold value,gray-scale value,SR method is an efficacious edge detection method.The edge of pests detected by SR method is higher in brightness and easy to distinguish,and is similar to the image quality of the original image.Besides that,SR method does not need to filter the original image before edge detection,and it is not sensitive to noise.

5.Conclusions

Spectral residual saliency detection can be used as an edge detection method in stored grain pests.Compare with other edge detection operators based on the processed images and some image analyzing parameters such as PSNR,MSE,threshold value and gray-scale value,SR method performs well.It can accurately detect the position of pests,and the edge of pests is bright and conspicuous.It improves the edge detection effect and provides a new method for the detection of stored grain pests.

Declaration of Competing Interest

The authors declare that there are no conflicts of interest.

Acknowledgments

This research is financially supported by National Natural Science Foundation of China(No.61871176);Key Scientific and Technological Project of Science and Technology Department of Henan Province (No.172102210030,182102110099);Key Scientific Research Project Program of Universities of Henan Province(No.18B520025);Open Fund of Key Laboratory of Grain Information Processing and Control(No.KFJJ-2018-102);the project also supported by Collaborative Innovation Center of Grain Storage and Security of Henan Province.


登录APP查看全文