CN109886937B - Insulator defect detection method based on super-pixel segmentation image recognition - Google Patents
Insulator defect detection method based on super-pixel segmentation image recognition Download PDFInfo
- Publication number
- CN109886937B CN109886937B CN201910086179.XA CN201910086179A CN109886937B CN 109886937 B CN109886937 B CN 109886937B CN 201910086179 A CN201910086179 A CN 201910086179A CN 109886937 B CN109886937 B CN 109886937B
- Authority
- CN
- China
- Prior art keywords
- image
- superpixel
- pixel
- super
- insulator
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 239000012212 insulator Substances 0.000 title claims abstract description 84
- 230000007547 defect Effects 0.000 title claims abstract description 49
- 238000001514 detection method Methods 0.000 title claims description 22
- 230000011218 segmentation Effects 0.000 title claims description 13
- 238000012706 support-vector machine Methods 0.000 claims abstract description 27
- 238000012549 training Methods 0.000 claims abstract description 26
- 238000000034 method Methods 0.000 claims abstract description 16
- 238000012360 testing method Methods 0.000 claims abstract description 15
- 238000004364 calculation method Methods 0.000 claims description 16
- 238000010606 normalization Methods 0.000 claims description 15
- 238000012545 processing Methods 0.000 claims description 12
- 238000005315 distribution function Methods 0.000 claims description 8
- 238000012546 transfer Methods 0.000 claims description 8
- 238000005070 sampling Methods 0.000 claims description 6
- 238000002790 cross-validation Methods 0.000 claims description 5
- 238000000605 extraction Methods 0.000 claims 1
- 238000007689 inspection Methods 0.000 abstract description 8
- 238000001914 filtration Methods 0.000 abstract description 6
- 238000004422 calculation algorithm Methods 0.000 abstract description 2
- 238000011161 development Methods 0.000 description 5
- 230000018109 developmental process Effects 0.000 description 5
- 238000005516 engineering process Methods 0.000 description 3
- 230000005540 biological transmission Effects 0.000 description 2
- 239000003086 colorant Substances 0.000 description 2
- 238000003745 diagnosis Methods 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 238000013210 evaluation model Methods 0.000 description 2
- 206010063385 Intellectualisation Diseases 0.000 description 1
- 230000002159 abnormal effect Effects 0.000 description 1
- 238000007635 classification algorithm Methods 0.000 description 1
- 230000002349 favourable effect Effects 0.000 description 1
- 239000000463 material Substances 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000005457 optimization Methods 0.000 description 1
- 238000005375 photometry Methods 0.000 description 1
Images
Landscapes
- Image Analysis (AREA)
Abstract
The invention discloses a method for diagnosing defects of an insulator based on an insulator image, which comprises the following steps of: performing Gaussian low-pass filtering denoising pretreatment on the insulator image to remove noise pixels in the image; carrying out super-pixel clustering of color channel weighting on the denoised image, and dividing the image into certain super-pixels; and dividing the processed images into a training set and a testing set, adding labels, and classifying the images by using a support vector machine algorithm to obtain a prediction result. The method can fully improve the recognition speed of the insulator defects on the premise of not reducing the recognition rate, has certain value on improving the efficiency of power inspection and reducing the cost, and also has certain significance on ensuring the safe operation of a power grid.
Description
Technical Field
The invention relates to the technical field of image recognition, in particular to an insulator defect detection method based on super-pixel segmentation.
Background
With the increasing development of the scale of the power system, the requirements on the safe operation and the power supply reliability of the power line are higher and higher. The power line plays an important role in the power grid, and the safe and stable operation of the power line plays a decisive role in ensuring the integrity of the power grid structure. Insulators are used as important components in overhead transmission lines and are one of the key points of power inspection work, so that the demand of efficient and accurate insulator defect detection methods is increasingly urgent. The traditional insulator defect detection is usually performed by a maintainer who visits the insulator tower by tower along the line, and the method is simple, but has low efficiency, long period, high labor intensity, high cost and high risk. In recent years, inspection methods using image devices are gradually popularized, inspection personnel use tools such as unmanned aerial vehicles to detect line pictures on the ground, but most of insulator defect diagnosis is judged by inspection personnel according to experience, omission or misjudgment still occurs, a large amount of manpower and material resources are consumed, efficiency is not improved, and various problems such as long detection time, poor real-time performance and the like exist.
With the development of power grids towards the direction of intellectualization and the development of power routing inspection towards the direction of automation, image recognition technology is gradually applied to insulator defect detection. The defect detection of the insulator of the power transmission line mainly divides the image into an abnormal type and a normal type, and the prior art has a certain classification effect in a plurality of classification algorithms, but the defect detection or the identification by using a high-resolution insulator original image brings great examination to the calculation speed of processing equipment and has poor real-time performance; or the original image of the insulator is compressed and the low-resolution image is used for identification, which ensures the speed and greatly reduces the identification rate, and the problems prevent the development of the image identification technology and the application in the related fields to a certain extent.
Disclosure of Invention
In order to overcome the defects of the traditional power inspection and the existing insulator defect detection technology, the invention provides the insulator defect detection method based on the super-pixel segmentation image recognition.
In order to realize the scheme, the technical scheme of the invention is as follows:
a super-pixel segmentation image recognition-based insulator defect detection method comprises the following steps:
step 1: collecting n original images of insulators with the same resolution ratio, and performing denoising pretreatment;
step 2: assigning the classification number K according to the complexity of the n insulator image sets to obtain K initial superpixels;
and step 3: distributing K initial superpixel center points on a regular grid spaced by A pixels, wherein the distribution principle is to generate superpixels with equal sizes;
and 4, step 4: adjusting the position of the central point of each initial superpixel to enable the central point to move to the pixel point with the minimum gradient in the neighborhood where the central point is located;
and 5: for each superpixel center point ζiTraversing all pixel points in the range of 2A multiplied by 2A, and carrying out the following operations: if the distance d from a superpixel point to the superpixel center zeta is smaller than the distance d 'from the superpixel point to the original superpixel center zeta' to which the superpixel point originally belongs, the point belongs to the superpixel corresponding to the superpixel center zeta; obtaining a superpixel center zeta after traversingiCluster region S ofiAnd SiNumber of pixels N involvedi;
Step 6: for a clustered region SiRecalculating to obtain the center zeta of each super pixel in each super pixel areai;
And 7: iterating steps 5-6 until the superpixel center zeta of each superpixel areaiConverging or reaching a preset iteration number; re-determining the super pixel center of each super pixel area, and obtaining K updated super pixel areas;
and 8: respectively extracting the characteristics of the updated super pixels on an r channel, a g channel and a b channel of an RGB color space; and normalizing the extracted features to obtain a feature vector X of the insulator imagei;
And step 9: giving corresponding characteristic vector X to each insulator super-pixel according to the defect condition of each insulator super-pixeliAdding tag yiE { -1,1}, where yiThe shape of the insulator of the ith super pixel image is normal, yiIf 1, the insulator of the ith super pixel image has defects, and a sample data set is established
Step 10: dividing layered random sampling of a data set D into k mutually exclusive subsets with the same size;
step 11: subset D of the data set1As a test set, the remaining subset { D }2,D3,…,DnUsing the training set as a training set;
step 12: inputting the training set into a selected support vector machine classifier, selecting a kernel function, determining parameters to be adjusted according to the selected support vector machine classifier and the kernel function, and training by using the training set to obtain a support vector machine classifier model;
step 13: inputting the test set into a trained support vector machine classifier model to obtain a classification result, and predicting the defect condition of the image insulator according to the output of the support vector machine classifier model; evaluating the error rate, precision ratio, recall ratio and the characteristic curve ROC of the testee of the support vector machine model;
step 14: sequentially dividing the data set D into subsets D1Taking one subset out of the test sets as a primary test set and the rest subset as a training set, repeating the steps of 12-13 k-1 times, evaluating the model and performingPerforming parameter setting;
step 15: layering and randomly sampling the data set D again to divide the data set D into k mutually exclusive subsets with the same size, repeating the steps 11-14 for p-1 times, evaluating the model and setting parameters;
step 16: repeating the steps 10-15 to optimize the k-fold cross validation parameters for p times to obtain a trained insulator defect identification model;
and step 17: and inputting the insulator super-pixel image into the trained insulator defect identification model to detect the insulator defect.
As a further improvement of the invention, the denoising pretreatment in the step 1 comprises the following specific steps:
performing discrete Fourier transform on the original image, wherein a two-dimensional discrete Fourier transform formula is as follows:
wherein F (u, v) is a Fourier transform result, namely an image frequency domain function, u and v are frequency components, F (x, y) is an original image, M and N are the width and height of the image, and j is an imaginary unit; calculating a product of a two-dimensional Gaussian low-pass filter transfer function G (u, v) and an image frequency domain function F (u, v), namely a filtered image frequency domain function H (u, v); the transfer function of a two-dimensional gaussian low-pass filter is as follows:
in the formula, delta is a standard deviation, and delta is selected according to the characteristics of the image;
calculating the inverse discrete Fourier transform of the filtered image frequency domain function H (u, v) to obtain a pixel distribution function H (x, y) of the image on a two-dimensional plane; the mode of the pixel distribution function h (x, y) is taken as an output image, namely, the noise pixels existing in the original image are removed.
As a further improvement of the invention, in step 3, grid intervals are set toWhere N is the total number of pixels in the image.
As a further improvement of the present invention, in step 5, a method for calculating a distance d from a superpixel point to a superpixel center ζ is as follows:
taking the coordinate of a pixel point in the RGB color space, carrying out normalization processing on a [0,1] interval, and naming the coordinate as (r, g, b), and carrying out normalization processing on a [0,1] interval on the position coordinate value of the pixel point in the two-dimensional space of the image, and naming the coordinate as (x, y); the calculation formula of the distance l from the super pixel point to the super pixel center in the color space is as follows:
wherein alpha, beta and gamma are weights of R channel, G channel and B channel, (R)1,g1,b1)、(r2,g2,b2) Proceeding [0,1] in RGB color space for superpixel point to superpixel center]Coordinates after normalization processing on the intervals;
the distance s between the super pixel point and the super pixel center in the two-dimensional space is calculated according to the following formula:
in the formula (x)1,y1)、(x2,y2) Performing [0,1] in two-dimensional space of image for superpixel point to superpixel center]Position coordinates after normalization processing on the interval; and carrying out weighted summation on the distances between the color space and the two-dimensional space to obtain the actual distance d from the super pixel point to the super pixel center:
where l is the distance in the color space, s is the distance in the two-dimensional space, and the weights of the distances in the color space and the two-dimensional space are μ and ρ, respectively.
As a further improvement of the present invention, in step 6, its superpixel center ζ is recalculated according to the following formulaiPosition in RGB color space and two-dimensional space:
i.e. taking the average of the position coordinates of all pixels of the area.
As a further improvement of the present invention, in step 8, the super pixel extracting features on r channel, g channel and b channel of RGB color space respectively means the first order origin moment E ζ and the second order origin moment E ζ of each channel of the super pixel image2And third order moment of origin E ζ3The calculation formula is as follows:
wherein ζi=(ri,gi,bi) The value on the RGB channel of the central pixel point of each superpixel block of the superpixel image, the coordinate (x) of the two-dimensional plane in the superpixel blocki,yi) The following were used:
wherein N isjThe number of pixels belonging to the super pixel, SiIs a cluster region, i.e. a region of the superpixel,the sum of the coordinate values of the two-dimensional planes of all the pixels of the super pixel block;
for the first order origin moment E zeta and the second order origin moment E zeta2And third order moment of origin E ζ3The calculation result of (2) is normalized to the (0,1) section, thereby obtaining a feature vector:
as a further development of the invention, in step 12, the kernel function is selected from linear, polynomial, radial basis RBF or sigmoid growth curve.
Compared with the prior art, the invention has the following advantages:
firstly, performing Gaussian low-pass filtering denoising pretreatment on an insulator image to remove noise pixels in the image; carrying out super-pixel clustering of color channel weighting on the denoised image, and dividing the image into certain super-pixels; and dividing the processed images into a training set and a testing set, adding labels, and classifying the images by using a Support Vector Machine (SVM) algorithm. Therefore, the accurate diagnosis of the defect condition of the insulator is realized. According to the method, the idea of division and treatment is adopted, pixel points with similar characteristics are clustered into super pixel regions according to the textures and colors of the images, and then the characteristics of the central point of each region are extracted, so that repeated calculation of a large number of similar pixel points is avoided, the calculated amount is reduced, and the calculation speed is improved. The method introduces the weight in the process of super-pixel clustering, and is favorable for eliminating interference introduced by photometry and white balance deviation of equipment for collecting images by adjusting the weight of red, green and blue colors in calculation; by adjusting the weights of the color space coordinates and the two-dimensional space coordinates in the calculation, the super-pixel region and the actual contour and texture of the object can be accurately coincided to improve the clustering effect. By utilizing the method, the recognition speed of the insulator defects can be fully improved on the premise of not reducing the recognition rate, so that the efficiency of power inspection is improved, the cost is reduced, and the method has very important significance for ensuring the safe operation of a power grid.
Drawings
FIG. 1 is an insulator image after Gaussian low-pass filtering denoising;
FIG. 2 shows that K is 36And iterating the insulator super-pixel image for 10 times.
Detailed Description
The invention will be described in more detail below with reference to insulator defect detection as an example.
The invention provides an insulator defect detection method based on super-pixel segmentation image recognition, which comprises the following steps:
step 1: and acquiring n images of the insulators with the same resolution, and performing Gaussian low-pass filtering denoising pretreatment. Performing discrete Fourier transform on the original image, wherein a two-dimensional discrete Fourier transform formula is as follows:
wherein F (u, v) is a Fourier transform result, namely an image frequency domain function, u and v are frequency components, F (x, y) is an original image, M and N are the width and height of the image, and j is an imaginary number unit. The product of the filter transfer function G (u, v) and the image frequency domain function F (u, v), i.e. the filtered image frequency domain function H (u, v), is calculated. The transfer function of the two-dimensional gaussian low-pass filter applied in this step is as follows:
in the formula, delta is standard deviation, and the appropriate delta is selected according to the characteristics of the image.
And calculating the inverse discrete Fourier transform of the filtered image frequency domain function H (u, v) to obtain a pixel distribution function H (x, y) of the image on a two-dimensional plane. Taking a mode of a pixel distribution function h (x, y) as an output image, namely removing noise pixels existing in an original image;
step 2: assigning a classification number K according to the complexity of the group of n insulator image sets to obtain K initial superpixels;
and step 3: the K initial clustering center points of the superpixels are distributed on a regular grid with intervals of A pixels, the distribution principle is to generate superpixels with approximately equal size, and therefore the grid intervals are set to beWherein N is the total pixel number of the image, i.e. the resolution product thereof;
and 4, step 4: adjusting the position of the initial clustering center point of the superpixel, and moving the center point to the point with the minimum gradient in the 9 points in the 3 multiplied by 3 neighborhood of the center point so as to avoid positioning the center point of the superpixel on the outline boundary of the article and the unfiltered clean noise pixel;
and 5: for each super pixel center ζiThe initial range of the super pixel to which it belongs is a × a, i.e., the area of the unit grid. Traverse points within its 2A × 2A range and do the following: if the distance d from a point to the center ζ of a superpixel is less than the distance d 'from the point to the center ζ' of the superpixel to which the point originally belongs, the point belongs to the superpixel corresponding to the center ζ of the superpixel. Taking the coordinates of the pixel points in the RGB color space and performing [0,1]]The normalization process on the section is named (r, g, b), and the position coordinate value of the point in the two-dimensional space of the image is also subjected to [0,1]]The normalization process on the interval is named (x, y). The calculation formula of the distance l of two points in the color space is as follows:
wherein alpha, beta and gamma are weights of R channel, G channel and B channel, (R)1,g1,b1)、(r2,g2,b2) Performing [0,1] in RGB color space for two pixels]Normalized coordinates over the interval. Alpha, beta and gamma are selected according to the actual situation of the pictureTo eliminate interference introduced by light metering and white balance deviation of the apparatus acquiring the image. The distance s between two points in the two-dimensional space is calculated as follows:
in the formula (x)1,y1)、(x2,y2) For two pixels to perform [0,1] in two-dimensional space of image]Position coordinates after normalization processing on the section. And carrying out weighted summation on the distances between the color space and the two-dimensional space to obtain the actual distance d of the pixel point:
wherein l is the distance between two points in the color space, s is the distance between two points in the two-dimensional space, the weights of the distances in the color space and the two-dimensional space are respectively mu and rho, and the proper weight is selected according to the actual situation to help the superpixel boundary and the actual contour of the object to be accurately coincided. Updating superpixel center zeta after traversaliCluster region S ofiAnd SiNumber of pixels N involvedi;
Step 6: for each superpixel region, recalculating its superpixel center ζ according to the following formulaiPosition in RGB color space and two-dimensional space:
taking the average value of the position coordinates of all pixels in the area;
and 7: iterating steps 5-6 until the superpixel central point zetaiConverging on a fixed value. Or selecting proper iteration times t according to the required identification precision and the calculation capacity of the equipment;
and 8: respectively enabling the super-pixel images obtained in the steps 2-7 to be respectively in an r channel and a g channel of an RGB color spaceExtracting the characteristics on the channel and the channel b, wherein the statistical characteristics in the step are the first order origin moment E zeta and the second order origin moment E zeta of each channel of the super pixel image2And third order moment of origin E ζ3The calculation formula is as follows:
wherein ζi=(ri,gi,bi) The value on the RGB channel of the central pixel point of each superpixel block of the superpixel image, its two-dimensional plane coordinate (x) in the superpixel blocki,yi) The following were used:
wherein N isjIs the number of pixels of the super pixel, SiIs the area of the super-pixel,is the sum of the coordinate values of the two-dimensional planes of all the pixels of the super-pixel block.
Due to the characteristic requirement of the feature vector of the support vector machine, the feature vector can be obtained by normalizing the calculated amount to the (0,1) intervalThen, the feature vector { X corresponding to n insulator images can be obtained1,X2,…,Xn};
And step 9: according to the defect of super pixel image of each insulatorGiven its corresponding feature vector X in case of trappingiAdding tag yiE { -1,1}, where yiThe shape of the insulator of the ith super pixel image is normal, yiIf 1, the insulator of the ith super pixel image has defects, and a sample data set is established
Step 10: a data set D is hierarchically and randomly sampled and divided into k mutually exclusive subsets with the same size, namely D ═ D1∪D2∪…∪Dk,
Step 11: subset D of the data set1As a test set, the remaining subset { D }2,D3,…,DnUsing the training set as a training set;
step 12: inputting the training set into a selected support vector machine classifier, selecting a proper kernel function (linear, polynomial, radial basis RBF, S-shaped growth curve sigmoid), and determining parameters to be adjusted according to the selected support vector machine classifier and the kernel function: the support vector machine classifier model can be obtained after training by utilizing a training set, wherein the parameters include a parameter degree, a parameter coef0, a parameter gamma, a penalty factor cost and the like;
step 13: and inputting the test set into the trained support vector machine model to obtain a classification result, and predicting the defect condition of the image insulator according to the output of the support vector machine. Evaluating the error rate, precision ratio, recall ratio and the characteristic curve ROC of the testee of the support vector machine model;
step 14: sequentially taking each subset of the rest of the data set D as a test set and the rest of the subsets as a training set, repeating the steps of 12-13 k-1 times, evaluating the model and setting parameters;
step 15: the data set D is randomly sampled in a layered mode again and divided into k mutually exclusive subsets with the same size, the steps 11-14 are carried out repeatedly for p-1 times, and the model is evaluated and parameter setting is carried out;
step 16: repeating the steps 10-15 (p times of k-fold cross validation) to perform parameter optimization, so as to obtain a trained insulator defect identification model;
and step 17: and (3) taking an image of the insulator with the same resolution as that of the insulator taken in the step (1). And (3) generating the insulator image subjected to Gaussian low-pass filtering and denoising in the step (1), and generating the insulator super-pixel image in the step (2). Inputting the insulator super-pixel image into the trained model, and outputting the modelThe insulator shape of the super pixel image is normal,the insulator of the super pixel image has a defect.
Examples
The invention discloses an insulator defect detection method based on super-pixel segmentation image recognition, which comprises the following steps:
step 1: 1000 images of the insulator with the resolution of 400 x 200 are collected, and Gaussian low-pass filtering denoising pretreatment is carried out. Performing discrete Fourier transform on the original image, wherein a two-dimensional discrete Fourier transform formula is as follows:
wherein F (u, v) is a Fourier transform result, namely an image frequency domain function, u and v are frequency components, F (x, y) is an original image, M and N are the width and height of the image, and j is an imaginary number unit. Calculating the product of the filter transfer function G (u, v) and the image frequency domain function F (u, v), i.e. the filtered image frequency domain function H (u, v), and selecting the standard deviation δ to be 10, wherein the transfer function of the two-dimensional gaussian low-pass filter is as follows:
and calculating the inverse discrete Fourier transform of the filtered image frequency domain function H (u, v) to obtain a pixel distribution function H (x, y) of the image on a two-dimensional plane. Taking a mode of a pixel distribution function h (x, y) as an output image, namely removing noise pixels existing in an original image; as shown in fig. 1.
Step 2: according to the complexity of the set of 1000 insulator images, the classification number is specified as K to 36(ii) a As shown in fig. 2.
And step 3: 36The initial cluster center points of the individual superpixels are distributed on a regular grid spaced at 110 pixels, the principle of the distribution being that superpixels of approximately equal size are produced, whereby the grid spacing is set toWherein N is the total number of pixels of the image, i.e., the resolution product thereof, i.e., 80000;
and 4, step 4: adjusting the position of the initial clustering center point of the superpixel, and moving the center point to the point with the minimum gradient in the 9 points in the 3 multiplied by 3 neighborhood of the center point so as to avoid positioning the center point of the superpixel on the outline boundary of the article and the unfiltered clean noise pixel;
and 5: for each super pixel center ζiThe initial range of the super pixel to which it belongs is 110 × 110, i.e., the area of the unit grid. Traverse points within its 220 x 220 range and do the following: if the distance d from a point to the center ζ of a superpixel is less than the distance d 'from the point to the center ζ' of the superpixel to which the point originally belongs, the point belongs to the superpixel corresponding to the center ζ of the superpixel. Taking the coordinates of the pixel points in the RGB color space and performing [0,1]]The normalization process on the section is named (r, g, b), and the position coordinate value of the point in the two-dimensional space of the image is also subjected to [0,1]]The normalization process on the interval is named (x, y). The calculation formula of the distance l of two points in the color space is as follows:
wherein alpha, beta and gamma are weights of R channel, G channel and B channel, (R)1,g1,b1)、(r2,g2,b2) Performing [0,1] in RGB color space for two pixels]Normalized coordinates over the interval. Take α ═ β ═ γ ═ 1. The distance s between two points in the two-dimensional space is calculated as follows:
in the formula (x)1,y1)、(x2,y2) For two pixels to perform [0,1] in two-dimensional space of image]Position coordinates after normalization processing on the section. And carrying out weighted summation on the distances between the color space and the two-dimensional space to obtain the actual distance d of the pixel point:
where l is the distance between two points in the color space, s is the distance between two points in the two-dimensional space, and the weights of the distances in the color space and the two-dimensional space are μ and ρ, respectively, where μ is 1 and ρ is 0.8. Updating superpixel center zeta after traversaliCluster region S ofiAnd SiNumber of pixels N involvedi;
Step 6: for each superpixel region, recalculating its superpixel center ζ according to the following formulaiPosition in RGB color space and two-dimensional space:
taking the average value of the position coordinates of all pixels in the area;
and 7: iterating steps 5 and 6 for 10 times;
and 8: respectively extracting the characteristics of the superpixel images obtained in the step 2-7 on an r channel, a g channel and a b channel of an RGB color space, wherein the extracted characteristics in the step are a first-order origin moment E zeta and a second-order origin moment E zeta of each channel of the superpixel imagesMoment of dots E ζ2And third order moment of origin E ζ3The calculation formula is as follows:
wherein ζi=(ri,gi,bi) The value on the RGB channel of the central pixel point of each superpixel block of the superpixel image, its two-dimensional plane coordinate (x) in the superpixel blocki,yi) The following were used:
wherein N isjIs the number of pixels of the super pixel, SiIs the area of the super-pixel,is the sum of the coordinate values of the two-dimensional planes of all the pixels of the super-pixel block.
Due to the characteristic requirement of the feature vector of the support vector machine, the feature vector can be obtained by normalizing the calculated amount to the (0,1) intervalThen 1000 eigenvectors { X corresponding to the insulator image can be obtained1,X2,…,Xn};
And step 9: adding a label y according to the defect condition of each insulator super-pixel imageiE { -1,1}, where yiAbsolute value of the ith super pixel image is expressed as-1Normal limbal morphology, yiIf 1, the insulator of the ith super pixel image has defects, and a sample data set is established
Step 10: hierarchically randomly sampling a data set D into 10 mutually exclusive subsets of equal size, i.e. D ═ D1∪D2∪…∪D10,
Step 11: subset D of the data set1As a test set, the remaining subset { D }2,D3,…,D10Using the training set as a training set;
step 12: inputting the training set into a support vector machine classifier, and selecting a linear kernel function k (x, x)j)=x·xjAdjusting a parameter nu, a parameter p and a penalty factor cost normalized to a (0,1) interval, and obtaining a support vector machine classifier model after training by utilizing a training set;
step 13: and inputting the test set into the trained support vector machine model to obtain a classification result, and predicting the defect condition of the image insulator according to the output of the support vector machine. Evaluating the error rate, precision ratio, recall ratio and the characteristic curve ROC of the testee of the support vector machine model;
step 14: sequentially taking each of the rest subsets of the data set D as a test set, taking the rest subsets as a training set, repeating the steps 12-13 for 9 times, and respectively adjusting the step length to 0.1 for the parameter nu, the parameter p and the penalty factor cost normalized to the (0,1) interval according to the error rate, the precision rate, the recall rate and the receiver operating characteristic curve ROC evaluation model;
step 15: randomly sampling the data set D layer by layer again to divide the data set D into 10 mutually exclusive subsets with the same size, repeating the steps 11-14 for 9 times, and respectively adjusting the step length to 0.1 for the parameter nu, the parameter p and the penalty factor cost normalized to the (0,1) interval according to the error rate, the precision rate, the recall rate and the receiver operating characteristic curve ROC evaluation model;
step 16: repeating the steps 10-15 (10 times of 10-fold cross validation). Table 1 shows the values of the parameters selected in 10-fold cross-validation. Finally, the parameter nu is selected to be 0.6, the parameter p is selected to be 0.1, and the penalty factor cost is selected to be 0.3. Namely, a trained insulator defect identification model is obtained;
TABLE 1
And step 17: and (3) taking an insulator image with the resolution of 400 x 200, and generating a Gaussian low-pass filtered and denoised insulator image through the step 1, namely the insulator image shown in the figure 1. Passing fig. 1 through step 2 yields K-36And iterating the insulator super-pixel image for 10 times to obtain the image shown in the figure 2. Inputting the graph 2 into the trained model, and outputting the modelThe insulator representing the superpixel image has a defect.
The insulator defect detection method based on the super-pixel segmentation image recognition adopts a C + + & opencv computer vision library as a software layer and an Intel core-m 37 y30 as a hardware layer to form an insulator defect detection system.
Note: the "points" and "pixel points" appearing in the above text both refer to pixel points, and the "center point" refers to a center pixel point.
The above description is only a preferred embodiment of the present invention, and is not intended to limit the scope of the present invention, and all equivalent changes and modifications made within the scope of the present invention should be considered as the technical scope of the present invention.
Claims (5)
1. A super-pixel segmentation image recognition-based insulator defect detection method is characterized by comprising the following steps:
step 1: collecting n original images of insulators with the same resolution ratio, and performing denoising pretreatment;
step 2: assigning the classification number K according to the complexity of the n insulator image sets to obtain K initial superpixels;
and step 3: distributing K initial superpixel center points on a regular grid spaced by A pixels, wherein the distribution principle is to generate superpixels with equal sizes;
and 4, step 4: adjusting the position of the central point of each initial superpixel to enable the central point to move to the pixel point with the minimum gradient in the neighborhood where the central point is located;
and 5: for each superpixel center point ζiTraversing all pixel points in the range of 2A multiplied by 2A, and carrying out the following operations: if the distance d from a superpixel point to the superpixel center zeta is smaller than the distance d 'from the superpixel point to the original superpixel center zeta' to which the superpixel point originally belongs, the point belongs to the superpixel corresponding to the superpixel center zeta; obtaining a superpixel center zeta after traversingiCluster region S ofiAnd SiNumber of pixels N involvedi;
Step 6: for a clustered region SiRecalculating to obtain the center zeta of each super pixel in each super pixel areai;
And 7: iterating steps 5-6 until the superpixel center zeta of each superpixel areaiConverging or reaching a preset iteration number; re-determining the super pixel center of each super pixel area, and obtaining K updated super pixel areas;
and 8: respectively extracting the characteristics of the updated super pixels on an r channel, a g channel and a b channel of an RGB color space; and for extracting featuresLine normalization processing is carried out, so that a characteristic vector X of the insulator image is obtainedi;
And step 9: giving corresponding characteristic vector X to each insulator super-pixel according to the defect condition of each insulator super-pixeliAdding tag yiE { -1,1}, where yiThe shape of the insulator of the ith super pixel image is normal, yiIf 1, the insulator of the ith super pixel image has defects, and a sample data set is established
Step 10: dividing layered random sampling of a data set D into k mutually exclusive subsets with the same size;
step 11: subset D of the data set1As a test set, the remaining subset { D }2,D3,···,DnUsing the training set as a training set;
step 12: inputting the training set into a selected support vector machine classifier, selecting a kernel function, determining parameters to be adjusted according to the selected support vector machine classifier and the kernel function, and training by using the training set to obtain a support vector machine classifier model;
step 13: inputting the test set into a trained support vector machine classifier model to obtain a classification result, and predicting the defect condition of the image insulator according to the output of the support vector machine classifier model;
step 14: sequentially dividing the data set D into subsets D1Taking the other subset as a primary test set and the rest subset as a training set, repeating the steps of 12-13 k-1 times, evaluating the model and performing parameter setting;
step 15: layering and randomly sampling the data set D again to divide the data set D into k mutually exclusive subsets with the same size, repeating the steps 11-14 for p-1 times, evaluating the model and setting parameters;
step 16: repeating the steps 10-15 to optimize the k-fold cross validation parameters for p times to obtain a trained insulator defect identification model;
and step 17: inputting the insulator super-pixel image into a trained insulator defect identification model for insulator defect detection;
in step 6, its superpixel center ζ is recalculated according to the following formulaiPosition in RGB color space and two-dimensional space:
taking the average value of the position coordinates of all pixels in the area;
in step 8, the feature extraction of the superpixel on the r channel, the g channel and the b channel of the RGB color space respectively means that the first order origin moment E ζ and the second order origin moment E ζ of each channel of the superpixel image2And third order moment of origin E ζ3The calculation formula is as follows:
wherein ζi=(ri,gi,bi) The value on the RGB channel of the central pixel point of each superpixel block of the superpixel image, the coordinate (x) of the two-dimensional plane in the superpixel blocki,yi) The following were used:
wherein N isjThe number of pixels belonging to the super pixel, SiIs a cluster region, i.e. a region of the superpixel,the sum of the coordinate values of the two-dimensional planes of all the pixels of the super pixel block;
for the first order origin moment E zeta and the second order origin moment E zeta2And third order moment of origin E ζ3The calculation result of (2) is normalized to the (0,1) section, thereby obtaining a feature vector:
2. the insulator defect detection method based on the super-pixel segmentation image recognition as claimed in claim 1, wherein the denoising pretreatment in the step 1 comprises the following specific steps:
performing discrete Fourier transform on the original image, wherein a two-dimensional discrete Fourier transform formula is as follows:
wherein F (u, v) is a Fourier transform result, namely an image frequency domain function, u and v are frequency components, F (x, y) is an original image, M and N are the width and height of the image, and j is an imaginary unit; calculating a product of a two-dimensional Gaussian low-pass filter transfer function G (u, v) and an image frequency domain function F (u, v), namely a filtered image frequency domain function H (u, v); the transfer function of a two-dimensional gaussian low-pass filter is as follows:
in the formula, delta is a standard deviation, and delta is selected according to the characteristics of the image;
calculating the inverse discrete Fourier transform of the filtered image frequency domain function H (u, v) to obtain a pixel distribution function H (x, y) of the image on a two-dimensional plane; the mode of the pixel distribution function h (x, y) is taken as an output image, namely, the noise pixels existing in the original image are removed.
4. The insulator defect detection method based on superpixel segmentation image recognition according to claim 1, wherein in step 5, the distance d from a superpixel point to the center ζ of a superpixel is calculated by the following method:
taking the coordinate of a pixel point in the RGB color space, carrying out normalization processing on a [0,1] interval, and naming the coordinate as (r, g, b), and carrying out normalization processing on a [0,1] interval on the position coordinate value of the pixel point in the two-dimensional space of the image, and naming the coordinate as (x, y); the calculation formula of the distance l from the super pixel point to the super pixel center in the color space is as follows:
wherein alpha, beta and gamma are weights of R channel, G channel and B channel, (R)1,g1,b1)、(r2,g2,b2) Proceeding [0,1] in RGB color space for superpixel point to superpixel center]Coordinates after normalization processing on the intervals;
the distance s between the super pixel point and the super pixel center in the two-dimensional space is calculated according to the following formula:
in the formula (x)1,y1)、(x2,y2) For the super pixel point to the super pixel center in the image twoCarry out [0,1] in dimensional space]Position coordinates after normalization processing on the interval; and carrying out weighted summation on the distances between the color space and the two-dimensional space to obtain the actual distance d from the super pixel point to the super pixel center:
where l is the distance in the color space, s is the distance in the two-dimensional space, and the weights of the distances in the color space and the two-dimensional space are μ and ρ, respectively.
5. The insulator defect detection method based on super-pixel segmentation image recognition is characterized in that in the step 12, the kernel function is selected from linear, polynomial, radial basis RBF or S-shaped growth curve sigmoid.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910086179.XA CN109886937B (en) | 2019-01-29 | 2019-01-29 | Insulator defect detection method based on super-pixel segmentation image recognition |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910086179.XA CN109886937B (en) | 2019-01-29 | 2019-01-29 | Insulator defect detection method based on super-pixel segmentation image recognition |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109886937A CN109886937A (en) | 2019-06-14 |
CN109886937B true CN109886937B (en) | 2021-08-03 |
Family
ID=66927258
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910086179.XA Active CN109886937B (en) | 2019-01-29 | 2019-01-29 | Insulator defect detection method based on super-pixel segmentation image recognition |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109886937B (en) |
Families Citing this family (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111563556B (en) * | 2020-05-11 | 2023-02-07 | 国网陕西省电力公司电力科学研究院 | Transformer substation cabinet equipment abnormity identification method and system based on color gradient weight |
CN112232138B (en) * | 2020-09-25 | 2022-09-23 | 天津大学 | Channel slope damage intelligent identification method based on superpixel characteristics |
CN112991302B (en) * | 2021-03-22 | 2023-04-07 | 华南理工大学 | Flexible IC substrate color-changing defect detection method and device based on super-pixels |
CN113901868B (en) * | 2021-08-25 | 2023-08-04 | 国网四川省电力公司电力科学研究院 | Method and system for safely monitoring power transformation site |
CN114140462B (en) * | 2021-12-10 | 2023-09-08 | 江苏牛犇轴承有限公司 | Bearing wear degree assessment method based on image processing |
CN114211168A (en) * | 2022-02-21 | 2022-03-22 | 江苏天健智能装备制造有限公司 | Method for correcting plane welding seam track based on image subtraction |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103824079A (en) * | 2014-02-08 | 2014-05-28 | 重庆市国土资源和房屋勘测规划院 | Multi-level mode sub block division-based image classification method |
CN106097335A (en) * | 2016-06-08 | 2016-11-09 | 安翰光电技术(武汉)有限公司 | Digestive tract focus image identification system and recognition methods |
CN106934418A (en) * | 2017-03-09 | 2017-07-07 | 国家电网公司 | A kind of insulator infrared diagnostics method based on convolution Recursive Networks |
US9922425B2 (en) * | 2014-12-02 | 2018-03-20 | Canon Kabushiki Kaisha | Video segmentation method |
CN108399430A (en) * | 2018-02-28 | 2018-08-14 | 电子科技大学 | A kind of SAR image Ship Target Detection method based on super-pixel and random forest |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103093470A (en) * | 2013-01-23 | 2013-05-08 | 天津大学 | Rapid multi-modal image synergy segmentation method with unrelated scale feature |
CN104392228B (en) * | 2014-12-19 | 2018-01-26 | 中国人民解放军国防科学技术大学 | Unmanned plane image object class detection method based on conditional random field models |
CN104573719B (en) * | 2014-12-31 | 2017-10-24 | 国家电网公司 | The mountain fire detection method analyzed based on image intelligent |
CN107239777B (en) * | 2017-05-13 | 2021-06-15 | 大连理工大学 | Tableware detection and identification method based on multi-view graph model |
-
2019
- 2019-01-29 CN CN201910086179.XA patent/CN109886937B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103824079A (en) * | 2014-02-08 | 2014-05-28 | 重庆市国土资源和房屋勘测规划院 | Multi-level mode sub block division-based image classification method |
US9922425B2 (en) * | 2014-12-02 | 2018-03-20 | Canon Kabushiki Kaisha | Video segmentation method |
CN106097335A (en) * | 2016-06-08 | 2016-11-09 | 安翰光电技术(武汉)有限公司 | Digestive tract focus image identification system and recognition methods |
CN106934418A (en) * | 2017-03-09 | 2017-07-07 | 国家电网公司 | A kind of insulator infrared diagnostics method based on convolution Recursive Networks |
CN108399430A (en) * | 2018-02-28 | 2018-08-14 | 电子科技大学 | A kind of SAR image Ship Target Detection method based on super-pixel and random forest |
Non-Patent Citations (1)
Title |
---|
"SLIC Superpixels";Radhakrishna Achanta et al;《ResearchGate》;20140630;第1-16页 * |
Also Published As
Publication number | Publication date |
---|---|
CN109886937A (en) | 2019-06-14 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109886937B (en) | Insulator defect detection method based on super-pixel segmentation image recognition | |
CN109118479B (en) | Capsule network-based insulator defect identification and positioning device and method | |
CN112446429B (en) | CGAN (Carrier grade Access network) -based routing inspection image data small sample expansion method | |
CN110322453A (en) | 3D point cloud semantic segmentation method based on position attention and auxiliary network | |
CN109711268B (en) | Face image screening method and device | |
JP2014041476A (en) | Image processing apparatus, image processing method, and program | |
CN111563556B (en) | Transformer substation cabinet equipment abnormity identification method and system based on color gradient weight | |
CN110070545B (en) | Method for automatically extracting urban built-up area by urban texture feature density | |
Liang et al. | Automatic defect detection of texture surface with an efficient texture removal network | |
CN115131325A (en) | Breaker fault operation and maintenance monitoring method and system based on image recognition and analysis | |
CN117911792B (en) | Pin detecting system for voltage reference source chip production | |
CN111242891B (en) | Rail surface defect identification and classification method | |
CN115272303A (en) | Textile fabric defect degree evaluation method, device and system based on Gaussian blur | |
CN112766340A (en) | Depth capsule network image classification method and system based on adaptive spatial mode | |
CN117635615B (en) | Defect detection method and system for realizing punching die based on deep learning | |
CN109241981B (en) | Feature detection method based on sparse coding | |
CN110991463A (en) | Multi-scale guided filtering feature extraction method under guide of super-pixel map | |
CN107292275B (en) | Frequency domain division human face feature recognition method and system | |
CN117475327A (en) | Multi-target detection positioning method and system based on remote sensing image in city | |
CN116958547A (en) | Remote sensing image cloud removal method based on generation countermeasure network | |
Kan et al. | Network models for monitoring high-dimensional image profiles | |
CN113592829B (en) | Deep learning sediment particle identification method and device based on segmentation and recombination | |
CN113222976B (en) | Space-time image texture direction detection method and system based on DCNN and transfer learning | |
CN115471494A (en) | Wo citrus quality inspection method, device, equipment and storage medium based on image processing | |
CN112419407B (en) | Cloud cluster displacement vector calculation method and device based on cloud cluster edge recognition |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |