Drainage pipe defect recognition model training method, drainage pipe defect recognition method

By training the model and combining multiple feature extraction algorithms, the high cost and accuracy reduction of manual identification in drainage pipeline defect recognition is solved, and efficient and accurate defect recognition is achieved.

CN116805416BActive Publication Date: 2025-02-07POWERCHINA HUADONG ENG CORP LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202311050295.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-21
Publication Date
2025-02-07
Estimated Expiration
2043-08-21

AI Technical Summary

Technical Problem

The prior art relies on manual identification in the identification of drainage pipeline defects, which has problems of high cost and reduced recognition accuracy.

Method used

A drain pipe defect recognition model training method is adopted to identify drain pipe defects by obtaining training samples, preprocessing images, extracting image features and training binary classification models. The feature extraction uses the fusion of Hu invariant moment, grayscale symbiosis matrix, Fourier transform and DB wavelet transform algorithm.

Benefits of technology

It realizes efficient and accurate drainage pipeline defect identification, reduces the cost and error of manual identification, and improves recognition accuracy and reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116805416B_ABST
    Figure CN116805416B_ABST
Patent Text Reader

Abstract

The present invention relates to a drainage pipe defect recognition model training method and a drainage pipe defect recognition method. The technical solution of the present invention is a drainage pipe defect recognition model training method, which is characterized by: obtaining a training sample, the training sample has a drainage pipe image and a defect type corresponding to the image, and there are n defect types in the training sample; preprocessing the drainage pipe image, including graying the drainage pipe image; extracting image features corresponding to each defect type from the preprocessed drainage pipe image corresponding to each defect type; training the initial binary classification model based on the image features corresponding to the i-th defect type and the image features corresponding to the j-th defect type among the n defect types, and obtaining defect recognition models for the i-th and j-th defect types, and obtaining defect recognition models in total. The present invention is applicable to the field of image recognition technology.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a drainage pipe defect recognition model training method and a drainage pipe defect recognition method, which are applicable to the field of image recognition technology. Background Art

[0002] The drainage system is one of the important guarantee factors for the healthy operation of the city and the benign cycle of the environment. Its main function is to maintain its own "metabolism" by collecting and transporting sewage, wastewater and rainwater generated in the city. As the service time of the drainage pipes increases, various problems will arise, such as aging of pipe materials, long-term corrosion of pipe walls by sewage, and fluctuations, deformation, ruptures, foreign body insertion, leakage, sediments, etc. in the pipes, or ruptures and depressions caused by road collapse. If the existing drainage pipe problems are not solved in time, it will bring safety hazards to subsequent use.

[0003] The defects of drainage pipes mainly include functional defects and structural defects. The current survey cycle varies depending on the type of pipe defects. According to regulations, functional defects are generally surveyed every 4 to 5 years, while structural defects are generally surveyed every 1 to 2 years.

[0004] The current common method for inspecting drainage pipes is to use CCTV pipe robots to perform endoscopic inspections of the drainage pipes. The camera collects original image materials of the pipe status, and then relies on relevant inspection personnel to visually identify the image materials.

[0005] Although manual identification of pipeline endoscope inspection defects can achieve high accuracy, it requires basic professional level and long-term work experience, and the labor cost is high to give accurate identification. In the process of manual identification, it is impossible for humans to continuously identify pipeline endoscope inspection defects for a long time, and the recognition accuracy of the inspectors will further decrease as time goes by. Summary of the invention

[0006] The technical problem to be solved by the present invention is: in view of the above-mentioned problems, a drainage pipe defect recognition model training method and a drainage pipe defect recognition method are provided.

[0007] The technical solution adopted by the present invention is: a drainage pipe defect recognition model training method, characterized in that:

[0008] Obtain a training sample, the training sample having a drainage pipe image and a defect type corresponding to the image, and there are n defect types in the training sample;

[0009] Preprocessing the drainage pipe image, including grayscale processing of the drainage pipe image;

[0010] Extracting image features corresponding to each defect type from the preprocessed drainage pipe image corresponding to each defect type;

[0011] The initial binary classification model is trained based on the image features corresponding to the i-th defect type and the image features corresponding to the j-th defect type among the n defect types, and a defect recognition model for the i-th and j-th defect types is obtained. A defect recognition model.

[0012] The step of extracting image features corresponding to each defect type from the pre-processed drainage pipe image corresponding to each defect type includes:

[0013] The features of drainage pipe images were extracted using Hu invariant moments, gray-level co-occurrence matrix, Fourier transform and DB wavelet transform algorithms.

[0014] The features extracted by each algorithm are fused to obtain the high-latitude feature vector of the drainage pipe image as the image feature of the drainage pipe image.

[0015] The method of using Hu invariant moment, gray level co-occurrence matrix, Fourier transform and DB wavelet transform algorithm to respectively extract features of the drainage pipe image and using gray level co-occurrence matrix to extract features includes:

[0016] The drainage pipe image is divided into several sub-partitions, and the eigenvalues ​​of the eigenvectors of each sub-partition are obtained through the gray-level co-occurrence matrix;

[0017] Calculate the mean of the global feature vector of the drainage pipe image based on the feature values ​​of each sub-partition feature vector;

[0018] The eigenvalues ​​of each sub-partition feature vector are compared with the mean of the global feature vector. When the error between the two is less than the constant c, the sub-partition feature vector is extracted. Based on the extracted sub-partition feature vector, a composite grayscale co-occurrence feature vector is obtained as the image feature of the drainage pipe image.

[0019] The feature vector is represented by the angular second moment, entropy, contrast and correlation of the gray level co-occurrence matrix.

[0020] The method of using Hu invariant moment, gray level co-occurrence matrix, Fourier transform and DB wavelet transform algorithm to respectively extract features of the drainage pipe image and using Fourier transform to extract features includes:

[0021] 1) Processing the sewer pipe image based on the discrete Fourier transform calculation formula;

[0022] 2) Based on the processing results of the discrete Fourier transform calculation formula, the spectrum diagram of the image is calculated;

[0023] 3) Find the peak position on the address spectrum graph, and obtain the geometric distribution feature vector of the spectrum graph based on the peak position and peak size.

[0024] The method of using Hu invariant moment, gray level co-occurrence matrix, Fourier transform and DB wavelet transform algorithm to respectively extract features of the drainage pipe image and using DB wavelet transform to extract features includes:

[0025] 1) Grayscale preprocessing of the drainage pipe image is performed, focusing on the local texture area with obvious characteristics of the pipe defect image;

[0026] 2) Using average energy Ep and entropy value E S , construct the texture feature parameters of DB wavelet transform;

[0027] 3) Eigenvector and entropy value E based on average energy Ep S The feature vector of DB wavelet is constructed.

[0028] A drainage pipe defect recognition model training device, characterized by comprising:

[0029] Module A is used to obtain training samples, where the training samples include drainage pipe images containing pipe defects and defect types corresponding to the images, and there are n types of defects in the training samples;

[0030] Module B, used for preprocessing the drainage pipe image, including grayscale processing of the drainage pipe image;

[0031] Module C is used to extract image features corresponding to each defect type from the pre-processed drainage pipe image corresponding to each defect type;

[0032] Module D is used to train the initial binary classification model based on the image features corresponding to the i-th defect type and the image features corresponding to the j-th defect type among the n defect types, and obtain defect recognition models for the i-th and j-th defect types, and obtain a total of A defect recognition model.

[0033] A drainage pipe defect identification method, characterized by:

[0034] S1, obtaining a drainage pipe image to be identified;

[0035] S2, preprocessing the drainage pipe image, graying the color image by weighted average method;

[0036] S3, extracting image features from the drainage pipe image to be identified;

[0037] S4, inputting the image features into the image data obtained by the model training method A defect recognition model is obtained Model recognition results;

[0038] S5. Statistics The number of defect types in the recognition results of the models is calculated, and the defect type with the largest number is taken as the defect type of the image to be recognized.

[0039] A drainage pipe defect identification device, characterized by comprising:

[0040] The first module is used to obtain the drainage pipe image to be identified;

[0041] The second module is used to pre-process the drainage pipe image and convert the color image into grayscale by weighted average method;

[0042] The third module is used to extract corresponding image features from the drainage pipe image to be identified;

[0043] The fourth module is used to input the image features obtained by the model training method A defect recognition model is obtained Model recognition results;

[0044] The fifth module is for statistics The number of defect types in the recognition results of the models is calculated, and the defect type with the largest number is taken as the defect type of the image to be recognized.

[0045] A storage medium having a computer program executable by a processor stored thereon, characterized in that: when the computer program is executed, the steps of the training method are implemented;

[0046] Or, the steps of the identification method.

[0047] A drainage pipe defect identification device comprises a memory and a processor, wherein the memory stores a computer program executable by the processor, and is characterized in that the steps of the identification method are implemented when the computer program is executed.

[0048] The beneficial effects of the present invention are as follows: the present invention targets n types of pipeline defects by constructing There are two binary classification models, each of which can distinguish two types of defects. Each defect type participates in the training of n-1 models. The drainage pipe image to be identified is trained by A binary classification model recognizes the output Model recognition results, statistics The number of defect types in the recognition results of the models is used, and the defect type with the largest number is used as the defect type of the image to be recognized. In the present invention, each binary classification model only performs binary classification, which can more efficiently and accurately identify the defect type corresponding to the model, and the final result is based on The model recognition results are determined and the results are more reliable.

[0049] Different from the common use of multivariate classification models to solve multivariate classification problems, the present invention uses The binary classification models are combined to solve the multi-classification problem. Since each binary classification model only classifies two defects, the classification accuracy is higher. And since each defect type participates in the training of n-1 binary classification models, when When a binary classification model is used to classify and identify a certain defect, the n-1 models of the defect type involved in the training will basically identify the accurate type of the defect; Since the binary classification model is not trained based on this defect type, it is difficult to unify the defect results. It is basically impossible for n-1 models to output a certain defect type at the same time. The result statistics of a binary classification model can obtain the accurate type of defect.

[0050] There are many types of pipeline defects, such as leakage, deformation, rupture, etc. The identification of pipeline defect types may be affected by factors such as pipe type, pipe diameter, and the location of defects inside the pipe. When a multivariate classification model is used for training, the training may not be accurate because the pipeline defect images in the training library have different defect types and different pipes, different pipe diameters, different defect locations, etc. There are many influencing factors. However, by training multiple binary classification models at the same time, it is possible to train different defect types in the pipeline under the premise of the same pipe diameter, the same pipe material, and the same defect location, reduce the interference of external factors, and use the voting method to count the votes and then obtain the defect type, which can greatly improve the accuracy of discrimination.

[0051] Based on the problem of low accuracy of CCTV images of drainage pipes in the processes of screening, texture extraction and interpretation, the present invention creatively integrates four feature extraction algorithms, namely Hu invariant moment, gray-level co-occurrence matrix, Fourier transform and DB wavelet transform. In the interpretation process, the image is cut into characteristics such as translation, scaling, proportion and rotation, and texture features such as image division into several sub-partitions, image global domain and local enhancement are extracted. The texture features and spectral features are combined with each other to make the extracted image feature vectors more diversified, and the differences between images of different pipeline defect types are greater. At the same time, the extraction of multiple feature vectors is shifted from the current conventional low dimension to high dimension, which is conducive to improving the accuracy of image recognition.

[0052] The present invention integrates the features extracted by Hu invariant moment, gray level co-occurrence matrix, Fourier transform and DB wavelet transform algorithm as the image features of the CCTV image of the drainage pipe. The integrated image features can increase the distinction between various defects in the pipe, so as to facilitate accurate model recognition and improve the accuracy of model classification and recognition.

[0053] The improved Hu invariant moment in the present invention has the ability to ensure that the feature is invariant to translation, rotation, scale and scaling when the image f(x, y) directly uses the origin moment or the center moment as the feature of the image; the grayscale co-occurrence matrix can identify the image texture feature, which is used to distinguish the important feature basis of the image region. The size of the region, the number of distinguishable grayscale elements and the relationship between these grayscale elements (pixels) are often used to describe the texture region in an image; Fourier transform is the basis of image time domain and frequency domain analysis, which can identify the periodic characteristics of the image, convert the image features to the frequency domain, and construct the image global spectrum feature vector; the DB wavelet transform algorithm has a high texture classification ability, especially focusing on local defect features.

[0054] The present invention studies 14 texture features of the gray-level co-occurrence matrix and screens out 4 features (entropy, contrast, correlation and angular second-order moment), which are not strongly correlated with each other and are more convenient for calculating classification features. At the same time, the traditional gray-level co-occurrence matrix is ​​creatively improved to effectively solve the defect that the feature quantity changes due to image rotation.

[0055] The present invention divides the image into several blocks, focuses on the defect position of the pipeline image, extracts the defect features of the pipeline image more accurately and effectively, and forms several sub-feature vectors; selects the feature vectors within the error range of the feature vector average value to form a composite feature vector, and eliminates all other feature vectors, thereby more efficiently improving the feature extraction accuracy.

[0056] The present invention uses Fourier transform and other methods to extract the features of pipeline defect images in the whole domain, and uses DB wavelet transform to decompose the image in both high-frequency and low-frequency channels, strengthen the extraction of local texture features, and effectively complement the defects of statistical methodology.

[0057] Pipe defect images refer to images taken inside the pipe with defects. Usually, drainage pipes are made of double-walled corrugated pipes, steel pipes, concrete pipes, glass fiber reinforced plastic pipes, etc. There must be differences in the textures inside different pipes. For example, the inner wall of the double-walled corrugated pipe is wavy, the inner wall of the steel pipe is relatively smooth, and the inner wall of the concrete pipe is cement mortar-like. Obviously, the texture features between the inner walls of the pipes of the above different pipes are more obvious. Extracting texture features can make it easier to identify the type of pipeline defects. For example, for the same defect type (rupture), there must be differences between the "rupture" image of the double-walled corrugated pipe and the "rupture" image of the concrete pipe. In order to better distinguish the "rupture" of different pipe types, the present invention uses a grayscale co-occurrence matrix to extract texture features.

[0058] There is generally a certain periodicity (or regularity) in pipeline defects. For example, defects such as "seepage", "rupture" and "corrosion" generally appear continuously at the top of the pipeline; "corrosion" generally appears continuously at the top of concrete pipes and glass fiber reinforced plastic sand-filled pipes. Double-wall corrugated pipes do not appear "corrosion" because they are made of plastic; "misalignment" generally appears at the connection between two sections of the pipeline; "undulation" generally exists in the entire section of the pipeline; "sediment" generally appears at the bottom of the pipeline, etc. At the same time, the location where the defect appears generally does not cover the entire image, but only appears at a certain position inside the pipeline, such as the top or bottom of the inner wall of the pipeline as mentioned above. It is necessary to focus on the local position accurately to effectively extract the local features. Therefore, the Fourier transform algorithm is used to extract the global spectrum feature vectors of images of different defect types, and the DB wavelet transform algorithm is used to extract local texture information, so that the best joint resolution of the image to be processed in the frequency domain and spatial domain, the overall global domain and the local feature information can be obtained, which well meets the needs of extracting texture features.

[0059] When extracting texture feature parameters of a defect image, it is necessary to perform operations such as translation, rotation, scaling, zooming, and translation of image pixels on the image f(x, y). The present invention introduces an improved Hu invariant moment algorithm to eliminate the influence of the above operations. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] Figure 1 Flow chart of the drainage pipe defect identification method in the embodiment.

[0061] Figure 2 Flow chart of the drainage pipe defect recognition model training method in the embodiment.

[0062] Figure 3 4 is a structural block diagram of a drainage pipe defect identification device in an embodiment.

[0063] Figure 4 4 is a structural block diagram of a drainage pipe defect recognition model training device in an embodiment. DETAILED DESCRIPTION

[0064] like Figure 1 As shown, this embodiment is a drainage pipe defect identification method, which specifically includes the following steps:

[0065] S1. Obtain a drainage pipe image to be identified, where the drainage pipe image is a video frame extracted from a video collected by a CCTV pipeline robot and judged to contain defects.

[0066] S2. Preprocess the drainage pipe image and convert the color image into grayscale using a weighted average method.

[0067] In this embodiment, the digital image components are defined as three channel components R, G, and B corresponding to the brightness of red, green, and blue respectively. The brightness range is between 0 and 255, white is the maximum brightness (255, 255, 255), and black is (0, 0, 0).

[0068] The RGB weighted average method is used to grayscale the color image. The calculation formula is as follows:

[0069] , where a, b, c are constants; i, j, k represent the pixels on the x, y, and z axes on the RGB coordinate axes, respectively. Generally, a=0.299, b=0.593, and c=0.108.

[0070] S3. Use Hu invariant moment, gray-level co-occurrence matrix, Fourier transform and DB wavelet transform algorithms to extract image features from the drainage pipe image to be identified, fuse the features extracted by each algorithm, and obtain the high-latitude feature vector of the drainage pipe image, and use the high-latitude feature vector as the image feature of the drainage pipe image.

[0071] In this embodiment, the improved Hu invariant moment is used to extract the features of the preprocessed image, which specifically includes:

[0072] 2D The grayscale of a digital image is Indicates that ( p+q )-order origin moment is: ;in, represents the basis functions of the moment definition; ( p, q =0,1,2…);

[0073] of( p+q )-order central moment express: ;

[0074] image The zero-order matrix represents the sum of the grayscale of the image, and the calculation formula is: ,image Two first-order moments and Used to determine the grayscale center of gravity of the image. The coordinates of the center of gravity of the image are:

[0075] ; ; Center distance = =0;

[0076] image Three second-order moments are used to determine the principal axes of the image, respectively , , Represents the moment of inertia of the image, characteristic value of the moment of inertia , , , the main axis angle Calculate according to the following formula:

[0077] , in the formula is the angle between the principal axis and the coordinate axis .

[0078] image Two third-order central moments , Describes the degree of distortion of the image projection; the distortion coefficients of the image projection on the x and y axes are sk x, sk y , represents the distortion direction of the image to the coordinate axis, and the calculation formula is:

[0079] , ;

[0080] Hu invariant moments have the characteristics of translation invariance, rotation invariance and scale invariance. The expressions of seven invariant moments are M 1 、M 2 、M 3 、M 4 、M 5 、M 6 、M 7 , calculation formula:

[0081] ;

[0082] ;

[0083] ;

[0084] ;

[0085] ;

[0086] ;

[0087] ;

[0088] The Hu invariant moment is improved to increase the scaling invariance, and the following calculation formula is used:

[0089] ; ; ; ; ; ; ; ; ; ;

[0090] Normalize with the zero-order center matrix, get( p+q )-order normalized central moment;

[0091] in: , express of( p+q )-order central moment, the calculation formula is as follows:

[0092] ;

[0093] in, is the centroid coordinate of the image.

[0094] In this embodiment, the features of the image are extracted using an improved gray level co-occurrence matrix from the preprocessed image, specifically including:

[0095] Perform partition processing on the pre-processed drainage pipe image and focus on the block where the defect is located in order to obtain texture features;

[0096] Construct an improved gray-level co-occurrence feature matrix: First, the matrix elements are expressed in The frequency of occurrence of pixel pairs with grayscale values ​​i and j at a certain pixel distance d in the direction ; Generally, four directions are selected, namely 0°, 45°, 90° and 135°;

[0097] The improved gray-level co-occurrence matrix characteristic parameters are respectively expressed as the angular second-order moment S E , Entropy S p , Contrast S d , correlation feature St express.

[0098] Among them, the angular second moment is S E It represents the sum of squares of gray-level co-occurrence matrix element values, and the calculation formula is as follows:

[0099] , S E The value indicates the uniformity of the image grayscale distribution and the coarseness of the texture. S E The smaller the value, the more uniform the grayscale distribution of the image and the finer the texture; S E The larger the value, the opposite is true;

[0100] Entropy S p It is used to reflect the complexity or non-uniformity of the image texture. The calculation formula is as follows:

[0101] , when there is no texture in the image, S p The entropy value is close to zero; when the image is full of fine textures, S p The entropy value is the maximum max; when the image has texture and is not full, Sp The entropy value is between 0 and max;

[0102] Contrast is represented by Sd, which reflects the depth of the texture grooves and the clarity of the image. The calculation formula is as follows:

[0103] , when the contrast S d The larger the value, the deeper the texture grooves of the image and the clearer the image. Sd The smaller it is, the blurrier the image will be.

[0104] Correlation St The calculation formula is as follows:

[0105] ;

[0106] , ;

[0107] , ;

[0108] When the elements of a matrix are uniformly equal, St The larger the value, the greater the difference between the matrix elements. St The smaller the value, the smaller the image StThe value is related to the direction. When there are relatively more textures in a certain direction in the image, that is, St The value is relatively large.

[0109] Calculate the angular second moment S E 、 entropy Sp , Contrast Sd The mean and standard deviation of each type of statistics in the four directions of the correlation feature St are used to measure the final texture feature vector using the mean and standard deviation of each type of statistics.

[0110] The pipeline defect image to be processed is appropriately divided into several sub-partitions, and the conventional gray-level co-occurrence matrix is ​​used to obtain the feature vectors of each sub-partition (steps Ⅱ1 to Ⅱ4 above) to obtain the sub-partition feature vectors. Each sub-partition feature vector is recorded as f ( i , j ),in i =1, 2, …, M ; j =1, 2, …, N , a total of M*N sub-feature vectors.

[0111] The eigenvalues ​​of the eigenvectors of each sub-partition are calculated, and the arithmetic mean value is calculated based on the eigenvalues ​​of the eigenvectors of each sub-partition as the mean value of the global eigenvector of the drainage pipe image.

[0112] The eigenvalues ​​of each sub-partition feature vector are compared with the mean of the global feature vector. When the error between the two is less than the constant c, the sub-partition feature vector is extracted. When the error range is greater than the constant c, the sub-partition feature vector is eliminated. The composite grayscale co-occurrence feature vector is obtained based on the extracted sub-partition feature vector.

[0113] The pipeline defect image may be affected by the angle, light, fog on the shooting lens, lens focus, etc., and the presented image may not be very clear. Some areas may be blurry or the resolution may be unclear. Therefore, it is necessary to divide each sub-area and select the area with a better mean value of the feature vector to extract its feature vector. Even if the feature vector is extracted from the blurry area, the feature vector cannot well reflect the real pipeline defect characteristics. In order to train the support vector machine in the future and improve the recognition accuracy, it is more appropriate to use the composite grayscale co-occurrence feature vector.

[0114] In this embodiment, Fourier transform is used to extract the features of the preprocessed image, which specifically includes:

[0115] The drainage pipe image is processed based on the discrete Fourier transform calculation formula. f ( m,n ) size is M×N , then the discrete Fourier transform calculation formula is as follows:

[0116] ,

[0117] in u =0,1,2,3…M-1, v =0,1,2…N-1, f ( m, n ) represents the first m Line n The pixel grayscale value of the column, variables u and v are frequency variables, m and n are image variables;

[0118] Based on the processing result of the discrete Fourier transform calculation formula, the frequency spectrum of the image is calculated. Represents the spectrum of the image, and the calculation formula is as follows: ,in and They are The real and imaginary parts of

[0119] The peak position on the address spectrum is found, and the geometric distribution feature vector of the spectrum is obtained according to the peak position and peak size.

[0120] P ij The spectrum diagram is i Line j The value of the column, the location of the maximum peak can be found by the following unconstrained optimization formula Solve it and then find the location of M peaks , the corresponding peak value is ,According to the peak position and peak size, the geometric distribution feature vector of the spectrum graph is obtained.

[0121] In this embodiment, DB wavelet transform is used to extract the features of the preprocessed image, which specifically includes:

[0122] Grayscale preprocessing is performed on the drainage pipe image, focusing on the local texture area with obvious characteristics of the pipe defect image;

[0123] Construct the spectrum texture feature parameters of DB wavelet transform and use the average energy E p and entropy value E S , average energy E p The calculation formula is as follows:

[0124] ;

[0125] ;

[0126] ;

[0127] The image pixels have m OK, n The frequency band size is M*N , the coefficients of the sub-band are x, The grayscale of the image is L , feature vector d=3*L+1 dimension;

[0128] The eigenvector of the average energy Ep is ; Entropy value E S The eigenvector of ;Construct DB wavelet feature vector .

[0129] S4. Input the image features obtained in step S3 into the trained defect recognition model to obtain a model recognition result.

[0130] like Figure 2 As shown, the training method of the defect recognition model in this embodiment includes the following steps:

[0131] A large number of training samples are obtained, where the training samples include drainage pipe images containing pipe defects and defect types corresponding to the images.

[0132] Through CCTV pipeline robots and other means to inspect urban underground drainage pipes, the massive amount of pictures taken are collected and screened to select clear images of drainage pipes with different defect types.

[0133] The defects of drainage pipes are mainly divided into functional defects and structural defects. Functional defects mainly include seven categories: sedimentation, residual wall and dam roots, slag, scaling, tree roots, obstacles, and falling off of interface materials; structural defects include nine categories: rupture, deformation, corrosion, misalignment, fluctuation, disconnection, concealed connection of branch pipes, penetration of foreign objects, and leakage.

[0134] The massive amount of drainage pipe images containing defects collected are classified according to the defect type, and the drainage pipe images of the same defect type are placed in the same folder as a training database.

[0135] B. Preprocess the drainage pipe image and convert the color image into grayscale using a weighted average method. The specific method of preprocessing is the same as step S2.

[0136] C. Extracting image features corresponding to each defect type from the pre-processed drainage pipe image corresponding to each defect type. The specific method of feature extraction is the same as step S3.

[0137] D. After extracting image features, any two drainage pipe images with different drainage pipe defect types are combined with the corresponding defect types and input into the initial binary classification model (untrained, support vector machine SVM can be used for binary classification training). A defect recognition model capable of binary classification.

[0138] In this embodiment, all types of pipeline defects are arranged in order, and the initial binary classification model is trained based on the image features corresponding to the i-th defect type in the arrangement and the image features corresponding to the j-th defect type in the arrangement to obtain a defect recognition model for the i-th and j-th defect types, where i=1,2,3...n, j=1,2,3...n, i≠j, and n is the total number of pipeline defect types to be identified.

[0139] In this embodiment, the image features of the drainage pipe image to be identified are respectively input into In a trained defect recognition model capable of binary classification, we obtain Model recognition results.

[0140] S5. Statistics The number of each defect type in the recognition results of the model is calculated, and the defect type with the largest number in the statistics is taken as the defect type of the image to be recognized.

[0141] For example, there are seven types of defects in the pipeline: "deformation", "collapse", "leakage", "rupture", "sediment", "misalignment" and "disconnection". Every two defect types can be diagnosed by an SVM classifier. SVM classifiers, the image to be recognized will be recognized by all 21 SVM classifiers respectively.

[0142] For example, in the recognition results of 21 SVM classifiers, there are 6 votes for deformation, 2 votes for collapse, 1 vote for leakage, 3 votes for rupture, 4 votes for sediment, 4 votes for dislocation, and 1 vote for disconnection. Therefore, the recognition result output is deformation.

[0143] Similarly, in the recognition results of 21 SVM classifiers, there are 3 votes for deformation, 0 votes for collapse, 2 votes for leakage, 5 votes for rupture, 6 votes for sediment, 4 votes for dislocation, and 1 vote for disconnection, so the recognition result output is sediment.

[0144] This embodiment also provides a drainage pipe defect recognition model training device, including: module A, module B, module C and module D.

[0145] like Figure 3As shown, this embodiment also provides a drainage pipe defect recognition device, including first to fifth modules, wherein the first module is used to obtain a drainage pipe image to be recognized; the second module is used to pre-process the drainage pipe image, and grayscale the color image by weighted average method; the third module is used to extract corresponding image features from the drainage pipe image to be recognized; the fourth module is used to input the image features into the training obtained A defect recognition model is obtained model recognition results; the fifth module is used for statistical The number of defect types in the recognition results of the models is calculated, and the defect type with the largest number is taken as the defect type of the image to be recognized.

[0146] like Figure 4 As shown, in this example, module A is used to obtain a large number of training samples, and the training samples have drainage pipe images containing pipeline defects and the defect types corresponding to the images; module B is used to preprocess the drainage pipe images and grayscale the color images by weighted averaging method; module C is used to extract image features corresponding to each defect type from the preprocessed drainage pipe images corresponding to each defect type; module D is used to train the initial binary classification model based on the image features corresponding to the i-th defect type and the image features corresponding to the j-th defect type, and obtain defect recognition models for the i-th and j-th defect types, where i=1,2,3...n, j=1,2,3...n, i≠j, n is the total number of pipeline defect types to be identified, and a total of A defect recognition model.

[0147] This embodiment also provides a storage medium on which a computer program that can be executed by a processor is stored. When the computer program is executed, the steps of the defect recognition model training method in this example are implemented.

[0148] This embodiment also provides a defect recognition model training device, which has a memory and a processor. The memory stores a computer program that can be executed by the processor. When the computer program is executed, the steps of the defect recognition model training method in this example are implemented.

[0149] This embodiment also provides a storage medium on which a computer program that can be executed by a processor is stored. When the computer program is executed, the steps of the drainage pipe defect identification method are implemented.

[0150] This embodiment also provides a drainage pipe defect identification device, which has a memory and a processor. The memory stores a computer program that can be executed by the processor. When the computer program is executed, the steps of the drainage pipe defect identification method in this example are implemented.

Claims

1. A drainage pipe defect recognition model training method, characterized by: Obtain a training sample, the training sample having a drainage pipe image and a defect type corresponding to the image, and there are n defect types in the training sample; Preprocessing the drainage pipe image, including grayscale processing of the drainage pipe image; Extracting image features corresponding to each defect type from the preprocessed drainage pipe image corresponding to each defect type; The initial binary classification model is trained based on the image features corresponding to the i-th defect type and the image features corresponding to the j-th defect type among the n defect types, and a defect recognition model for the i-th and j-th defect types is obtained. A defect recognition model; The step of extracting image features corresponding to each defect type from the pre-processed drainage pipe image corresponding to each defect type includes: The features of drainage pipe images were extracted using Hu invariant moments, gray-level co-occurrence matrix, Fourier transform and DB wavelet transform algorithms. The features extracted by each algorithm are fused to obtain a high-latitude feature vector of the drainage pipe image as the image feature of the drainage pipe image; The method of using Hu invariant moment, gray level co-occurrence matrix, Fourier transform and DB wavelet transform algorithm to respectively extract features of the drainage pipe image and using gray level co-occurrence matrix to extract features includes: The drainage pipe image is divided into several sub-partitions, and the eigenvalues ​​of the eigenvectors of each sub-partition are obtained through the gray-level co-occurrence matrix; Calculate the mean of the global feature vector of the drainage pipe image based on the feature values ​​of each sub-partition feature vector; The eigenvalues ​​of the eigenvectors of each sub-partition are compared with the mean of the global eigenvector. When the error between the two is less than a constant c, the eigenvector of the sub-partition is extracted. Based on the extracted eigenvectors of the sub-partition, a composite grayscale co-occurrence eigenvector is obtained as the image feature of the drainage pipe image. The feature vector is represented by the angular second moment, entropy, contrast and correlation of the gray level co-occurrence matrix; The method of using Hu invariant moment, gray level co-occurrence matrix, Fourier transform and DB wavelet transform algorithm to respectively extract features of the drainage pipe image and using Fourier transform to extract features includes: 1) Processing the sewer pipe image based on the discrete Fourier transform calculation formula; 2) Based on the processing result of the discrete Fourier transform calculation formula, the frequency spectrum of the image is calculated; 3) Find the peak position on the address spectrum graph, and obtain the geometric distribution feature vector of the spectrum graph according to the peak position and peak size; The method of using Hu invariant moment, gray level co-occurrence matrix, Fourier transform and DB wavelet transform algorithm to respectively extract features of the drainage pipe image and using DB wavelet transform to extract features includes: 1) Grayscale preprocessing of the drainage pipe image is performed, focusing on the local texture area with obvious characteristics of the pipe defect image; 2) Using average energy Ep and entropy value E S , construct the texture feature parameters of DB wavelet transform; 3) Eigenvector and entropy value E based on average energy Ep S The feature vector of DB wavelet is constructed.

2. A drainage pipe defect recognition model training device, characterized in that: include: Module A is used to obtain training samples, where the training samples include drainage pipe images containing pipe defects and defect types corresponding to the images, and there are n types of defects in the training samples; Module B, used for preprocessing the drainage pipe image, including grayscale processing of the drainage pipe image; Module C is used to extract image features corresponding to each defect type from the pre-processed drainage pipe image corresponding to each defect type; Module D is used to train the initial binary classification model based on the image features corresponding to the i-th defect type and the image features corresponding to the j-th defect type among the n defect types, and obtain defect recognition models for the i-th and j-th defect types, and obtain a total of A defect recognition model; The step of extracting image features corresponding to each defect type from the pre-processed drainage pipe image corresponding to each defect type includes: The features of drainage pipe images were extracted using Hu invariant moments, gray-level co-occurrence matrix, Fourier transform and DB wavelet transform algorithms. The features extracted by each algorithm are fused to obtain a high-latitude feature vector of the drainage pipe image as the image feature of the drainage pipe image; The method of using Hu invariant moment, gray level co-occurrence matrix, Fourier transform and DB wavelet transform algorithm to respectively extract features of the drainage pipe image and using gray level co-occurrence matrix to extract features includes: The drainage pipe image is divided into several sub-partitions, and the eigenvalues ​​of the eigenvectors of each sub-partition are obtained through the gray-level co-occurrence matrix; Calculate the mean of the global feature vector of the drainage pipe image based on the feature values ​​of each sub-partition feature vector; The eigenvalues ​​of the eigenvectors of each sub-partition are compared with the mean of the global eigenvector. When the error between the two is less than a constant c, the eigenvector of the sub-partition is extracted. Based on the extracted eigenvectors of the sub-partition, a composite grayscale co-occurrence eigenvector is obtained as the image feature of the drainage pipe image. The feature vector is represented by the angular second moment, entropy, contrast and correlation of the gray level co-occurrence matrix; The method of using Hu invariant moment, gray level co-occurrence matrix, Fourier transform and DB wavelet transform algorithm to respectively extract features of the drainage pipe image and using Fourier transform to extract features includes: 1) Processing the sewer pipe image based on the discrete Fourier transform calculation formula; 2) Based on the processing result of the discrete Fourier transform calculation formula, the frequency spectrum of the image is calculated; 3) Find the peak position on the address spectrum graph, and obtain the geometric distribution feature vector of the spectrum graph according to the peak position and peak size; The method of using Hu invariant moment, gray level co-occurrence matrix, Fourier transform and DB wavelet transform algorithm to respectively extract features of the drainage pipe image and using DB wavelet transform to extract features includes: 1) Grayscale preprocessing of the drainage pipe image is performed, focusing on the local texture area with obvious characteristics of the pipe defect image; 2) Using average energy Ep and entropy value E S , construct the texture feature parameters of DB wavelet transform; 3) Eigenvector and entropy value E based on average energy Ep S The feature vector of DB wavelet is constructed.

3. A drainage pipe defect identification method, characterized in that: S1, obtaining a drainage pipe image to be identified; S2, preprocessing the drainage pipe image, including grayscale processing of the drainage pipe image; S3, extracting image features from the drainage pipe image to be identified; S4, inputting the image features into the image data obtained by the model training method according to claim 1 A defect recognition model is obtained Model recognition results; S5. Statistics The number of defect types in the recognition results of the models is calculated, and the defect type with the largest number is taken as the defect type of the image to be recognized.

4. A drainage pipe defect identification device, characterized in that: include: The first module is used to obtain the drainage pipe image to be identified; The second module is used for preprocessing the drainage pipe image, including grayscale processing of the drainage pipe image; The third module is used to extract image features from the drainage pipe image to be identified; The fourth module is used to input the image features obtained by the model training method according to claim 1 A defect recognition model is obtained Model recognition results; The fifth module is for statistics The number of defect types in the recognition results of the models is calculated, and the defect type with the largest number is taken as the defect type of the image to be recognized.

5. A storage medium having stored thereon a computer program executable by a processor, characterized in that: When the computer program is executed, the steps of the training method according to claim 1 are implemented; Or, the steps of the identification method described in claim 3.

6. A drainage pipe defect identification device, comprising a memory and a processor, wherein the memory stores a computer program executable by the processor, characterized in that: When the computer program is executed, the steps of the identification method according to claim 3 are implemented.

Citation Information

Patent Citations

  • Image detection method, device and system and computer readable storage medium

    CN113014908A