Construction of internal defect classification model for steel pipes, identification methods, devices, equipment and media

CN121767699BActive Publication Date: 2026-08-14CHENGDE JIANLONG SPECIAL STEEL
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-11-10
Publication Date
2026-08-14

AI Technical Summary

Technical Problem

[0007]本发明实施方式提供了一种钢管内缺陷分类模型构建、识别方法、装置、设备及介质,用于解决现有技术中对于钢管内表面缺陷难以准确分清其缺陷种类的问题

Benefits of technology

本发明实施方式公开了一种钢管内缺陷分类模型构建方法,其首先获取多个第一灰度图,其中,每个第一灰度图对应一种钢管内表面缺陷,第一灰度图基于广角镜头对钢管内部拍摄的画面获得;然后对每个第一灰度图分别进行坐标系的转换,获得以极值以及极角表示像素位置的第二灰度图;接着对每个第二灰度图进行多项式转换,获得第一特征向量,其中,第一灰度图进行图像缩放、旋转和位移时第一特征向量的每个元素值的变化率小于阈值;最后利用多个第一特征向量以及多个缺陷标识调整分类基础模型,获得钢管内缺陷识别模型,其中,每个第一特征向量对应一个缺陷标识,第一特征向量的缺陷标识基于第一特征向量的来源第一灰度图的缺陷获得。本发明基于灰度图识别缺陷,相比于边缘识别的方式,由于输入的数据维度多、特征保留多,因此识别准确度会更高;本发明通过坐标系转换和多项式提取到与图像旋转、缩放无关的特征向量,基于特征向量识别缺陷,大为减少了因缺陷在图像中的形式带来的识别问题,提高了识别的准确度和可靠性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121767699B_ABST
    Figure CN121767699B_ABST
Patent Text Reader

Abstract

This invention relates to the field of steel pipe internal surface defect identification, and particularly to a steel pipe internal defect classification model construction, identification method, device, equipment, and medium. The method first acquires multiple first grayscale images; then, it transforms the coordinate system of each first grayscale image to obtain a second grayscale image where pixel positions are represented by extreme values ​​and polar angles; next, it performs a polynomial transformation on each second grayscale image to obtain a first feature vector; finally, it adjusts the classification base model using multiple first feature vectors and multiple defect identifiers to obtain a steel pipe internal defect identification model. This invention identifies defects based on grayscale images. Due to the multi-dimensional input data and the retention of more features, the identification accuracy is higher. This invention extracts feature vectors independent of image rotation and scaling through coordinate system transformation and polynomial extraction, greatly reducing identification problems caused by the form of defects in the image, and improving the accuracy and reliability of identification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of steel pipe internal surface defect identification, and particularly to a steel pipe internal defect classification model construction, identification method, device, equipment and medium. Background Technology

[0002] As a core basic material in industrial fields (such as petroleum, chemical, machinery, and construction), the quality of the inner surface of steel pipes directly determines their pressure resistance, sealing performance, and service life. Defects on the inner surface of steel pipes can not only lead to media leakage and equipment corrosion, but also cause safety accidents. Therefore, accurate identification, analysis, and control of defects are crucial.

[0003] Due to the "closed and elongated" structural characteristics of the inner surface of steel pipes, conventional visual inspection is a relatively convenient method. With technological advancements, current manual visual inspection has gradually evolved into artificial intelligence-based inner surface inspection methods.

[0004] The principle of artificial intelligence-based manual inspection methods is to convert the captured image of the inner surface of the steel pipe to grayscale and extract the edge lines of the image. Based on the edge lines, the image is segmented into blocks, and the resulting sub-blocks are fed into an artificial intelligence model, such as an artificial neural network trained on defect recognition, to identify and warn of defects.

[0005] This method greatly improves the efficiency of detecting internal surface defects. However, since the current mainstream technology determines whether there are defects on the inner surface of the steel pipe by using the edge lines of the image, further identifying the type of defect becomes very unreliable. For example, cracks and overlapping defects are both represented by thin stripes at the edge of the image. In other words, the current mainstream technology can only detect defects, but it is difficult to accurately identify the specific type of defect.

[0006] Therefore, it is necessary to develop a method for constructing a classification model of defects inside steel pipes. Summary of the Invention

[0007] The present invention provides a method, apparatus, equipment and medium for constructing and identifying a classification model of defects inside steel pipes, which solves the problem in the prior art that it is difficult to accurately distinguish the types of defects on the inner surface of steel pipes.

[0008] In a first aspect, embodiments of the present invention provide a method for constructing a classification model for internal defects in steel pipes, including: Multiple first grayscale images are obtained, where each first grayscale image corresponds to a type of defect on the inner surface of the steel pipe. The first grayscale images are obtained based on images taken of the inside of the steel pipe using a wide-angle lens. For each first grayscale image, a coordinate system transformation is performed to obtain a second grayscale image in which the pixel position is represented by the extreme values ​​and polar angles; A polynomial transformation is performed on each second grayscale image to obtain a first feature vector, wherein the rate of change of each element value of the first feature vector is less than a threshold when the first grayscale image is scaled, rotated and translated. By adjusting the classification base model using multiple first feature vectors and multiple defect labels, a defect identification model for steel pipes is obtained. Each first feature vector corresponds to a defect label, and the defect label of the first feature vector is obtained based on the defect in the first grayscale image from which the first feature vector originates.

[0009] In one possible implementation, the step of transforming the coordinate system for each first grayscale image to obtain a second grayscale image in which pixel positions are represented by extrema and polar angles includes: For each first grayscale image, perform the following steps: The origin of the first grayscale image is shifted to the center of the image to obtain a shifted grayscale image; The distance from the origin of the translated grayscale image to a corner vertex is taken as the maximum distance; The coordinates of the translated grayscale image are normalized based on the maximum distance to obtain a normalized grayscale image; The coordinates of the normalized grayscale image are transformed from Cartesian coordinates to polar coordinates to obtain a second grayscale image, wherein each pixel in the second grayscale image includes a polar radius, a polar angle, and a grayscale value.

[0010] In one possible implementation, normalizing the coordinates of the translated grayscale image based on the maximum distance to obtain a normalized grayscale image includes: The coordinates of the translated grayscale image are normalized according to the first formula and the maximum distance to obtain a normalized grayscale image, wherein the first formula is:

[0011] In the formula, For normalized grayscale images of pixels Axis coordinates To shift the pixels in the grayscale image Axis coordinates For pixels in a normalized grayscale image Axis coordinates To shift the pixels in the grayscale image Axis coordinates The maximum distance; The step of transforming the coordinates of the normalized grayscale image from Cartesian coordinates to polar coordinates to obtain the second grayscale image includes: The coordinates of the normalized grayscale image are transformed from Cartesian coordinates to polar coordinates according to the second formula to obtain the second grayscale image, wherein the second formula is:

[0012] In the formula, It is an extreme value. Polar angle, For having based on input Axis coordinates and The arctangent function of the axis coordinates outputs the signed angle.

[0013] In one possible implementation, the step of performing a polynomial transformation on each second grayscale image to obtain a first feature vector includes: Obtain a first total order value and a second total order value, wherein the first total order value is greater than the second total order value, and the difference between the absolute values ​​of the first total order value and the second total order value is an even number; Based on the first total order value and the second total order value, a plurality of first polynomials are generated, wherein each first polynomial corresponds to a combination of a first order value and a second order value, and the first polynomial generates a first feature value based on the extrema, polar angle and pixel value; Take out the first polynomials sequentially from the plurality of first polynomials; Substitute the extreme value, polar angle, and pixel value of each pixel in the second grayscale image into the first polynomial to obtain the first feature value; The sum of the plurality of first eigenvalues ​​is obtained; The modulus of the sum of the features is added as an element of the vector to the first feature vector; If the traversal of the plurality of first polynomials is not completed, then proceed to the step of sequentially extracting the first polynomial from the plurality of first polynomials.

[0014] In one possible implementation, generating a plurality of first polynomials based on the first total order value and the second total order value includes: Multiple order value combinations are generated based on the first total order value and the second total order value; For each combination of order values, perform the following steps: Based on the order combination, an extremum polynomial is generated concerning the extremum characteristic, wherein the extremum polynomial is:

[0015] In the formula, For the first order value, For the second order value, It is an extreme value. It is an extreme value characteristic; Based on the order combination, a polar angle polynomial is generated regarding the polar angle characteristic, wherein the polar angle polynomial is:

[0016] In the formula, Polar angle characteristics, It is a natural constant. Polar angle, The imaginary unit, It is a cosine function. It is a sine function; A first polynomial is generated based on the extreme value feature and the polar angle feature, wherein the first polynomial is:

[0017] In the formula, For the first multiple terms, Pi The extreme values ​​in the grayscale image of the polar coordinate system are Polar angle is The pixel value of the pixel.

[0018] In one possible implementation, the step of adjusting the classification base model using multiple first feature vectors and multiple defect identifiers to obtain a defect identification model for steel pipes includes: Obtain a classification base model, wherein the classification base model is constructed based on an artificial neural network model; For each first feature vector, the inner surface defect of the steel pipe corresponding to the source grayscale image of the first feature vector is used as the defect identifier of the first feature vector, and the first feature vector and the defect identifier are constructed as a feature pair; Divide multiple feature pairs into a first group and a second group; The classification base model is trained using multiple features from the first group to obtain a process model; The fitting status of the process model is verified using multiple features from the second group; If the fitting state is overfitted or underfitted, the number of elements in the first feature vector is adjusted, multiple first feature vectors are regenerated, and the process jumps to the step of taking the steel pipe inner surface defect corresponding to the source grayscale image of the first feature vector as the defect identifier of the first feature vector and constructing the first feature vector and the defect identifier as a feature pair for each first feature vector. Otherwise, the process model is used as the defect identification model for the steel pipe.

[0019] Secondly, embodiments of the present invention provide a method for identifying internal defects in steel pipes, including: Obtain a third grayscale image, wherein the third grayscale image contains an image of the defects on the inner surface of the steel pipe; The coordinate system of the third grayscale image is transformed, and a polynomial transformation is performed on the third grayscale image after coordinate system transformation based on the first total order value and the second total order value to obtain the second feature vector. The dimension of the second feature vector is the same as that of the first feature vector. The pixel position of the third grayscale image after coordinate system transformation is represented by the extreme value and the polar angle. The second feature vector is input into the model constructed according to the steel pipe internal defect classification model construction method described in the first aspect or any possible implementation of the first aspect above, to obtain the types of defects on the inner surface of the steel pipe.

[0020] Thirdly, embodiments of the present invention provide a steel pipe internal defect classification model construction device for implementing the steel pipe internal defect classification model construction method as described in the first aspect or any possible implementation thereof, the steel pipe internal defect classification model construction device comprising: The grayscale image acquisition module is used to acquire multiple first grayscale images, each of which corresponds to a type of defect on the inner surface of the steel pipe. The first grayscale images are obtained based on images taken of the inside of the steel pipe by a wide-angle lens. The coordinate system transformation module is used to transform the coordinate system of each first grayscale image to obtain a second grayscale image in which the pixel position is represented by the extreme value and the polar angle. The feature extraction module is used to perform a polynomial transformation on each second grayscale image to obtain a first feature vector, wherein the rate of change of each element value of the first feature vector is less than a threshold when the first grayscale image is scaled, rotated and translated. as well as, The model building module is used to adjust the classification base model using multiple first feature vectors and multiple defect labels to obtain a defect identification model inside the steel pipe. Each first feature vector corresponds to a defect label, and the defect label of the first feature vector is obtained based on the defect in the first grayscale image from which the first feature vector originates.

[0021] Fourthly, embodiments of the present invention provide an electronic device, including a memory and a processor, wherein the memory stores a computer program executable on the processor, and the processor executes the computer program to implement the steps of the method described in the first aspect, any possible implementation of the first aspect, the second aspect, or any possible implementation of the second aspect.

[0022] Fifthly, embodiments of the present invention provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the method described in the first aspect, any possible implementation of the first aspect, the second aspect, or any possible implementation of the second aspect.

[0023] The beneficial effects of the embodiments of the present invention compared with the prior art are as follows: This invention discloses a method for constructing a classification model for internal defects in steel pipes. First, multiple first grayscale images are acquired, each corresponding to a type of internal surface defect in the steel pipe. These first grayscale images are obtained from images captured by a wide-angle lens inside the steel pipe. Then, each first grayscale image undergoes a coordinate system transformation to obtain a second grayscale image where pixel positions are represented by extreme values ​​and polar angles. Next, each second grayscale image undergoes a polynomial transformation to obtain a first feature vector. The rate of change of each element value of the first feature vector is less than a threshold when the first grayscale image is scaled, rotated, or translated. Finally, the classification model is adjusted using multiple first feature vectors and multiple defect identifiers to obtain a steel pipe internal defect identification model. Each first feature vector corresponds to a defect identifier, and the defect identifier of the first feature vector is obtained based on the defect in the first grayscale image from which the first feature vector originates. This invention identifies defects based on grayscale images. Compared to edge recognition, it achieves higher accuracy due to the greater dimensionality of the input data and the preservation of more features. Furthermore, this invention extracts feature vectors independent of image rotation and scaling through coordinate system transformation and polynomial extraction. By identifying defects based on these feature vectors, it significantly reduces recognition problems caused by the form of defects in the image, thereby improving the accuracy and reliability of the identification. Attached Figure Description

[0024] To more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0025] Figure 1 This is a flowchart of the method for constructing a steel pipe internal defect classification model provided by an embodiment of the present invention; Figure 2 This is a schematic diagram of the first feature vector acquisition process provided by an embodiment of the present invention; Figure 3 This is a functional block diagram of the steel pipe internal defect classification model construction device provided in the embodiments of the present invention; Figure 4 This is a functional block diagram of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0026] In the following description, specific details such as particular system structures and techniques are set forth for illustrative purposes and not for limitation, so as to provide a thorough understanding of embodiments of the invention. However, those skilled in the art will understand that the invention can be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, and methods are omitted so as not to obscure the description of the invention with unnecessary detail.

[0027] To make the objectives, technical solutions, and advantages of the present invention clearer, specific embodiments will be described below in conjunction with the accompanying drawings.

[0028] The embodiments of the present invention will be described in detail below. This example is implemented based on the technical solution of the present invention, and provides detailed implementation methods and specific operation processes. However, the protection scope of the present invention is not limited to the following embodiments.

[0029] Figure 1 A flowchart illustrating the method for constructing a steel pipe internal defect classification model according to an embodiment of the present invention.

[0030] like Figure 1 As shown, a flowchart illustrating the implementation of the steel pipe internal defect classification model construction method provided by the embodiments of the present invention is illustrated below: In step 101, multiple first grayscale images are obtained, wherein each first grayscale image corresponds to a type of inner surface defect of the steel pipe, and the first grayscale image is obtained based on the image of the inside of the steel pipe captured by a wide-angle lens.

[0031] For example, as mentioned above, this invention identifies defects on the inner surface of steel pipes based on existing algorithms for detecting defects on the inner surface of steel pipes. However, due to current technological limitations, there is significant uncertainty when using edge lines to identify anomaly types. Therefore, this invention proposes, under existing conditions, to extract the first grayscale image from a post-processed image taken with a wide-angle lens using edge lines. In other words, the extracted first grayscale image is actually a grayscale image containing defects on the inner surface of the steel pipe.

[0032] In this way, the features of the defective area are significantly increased. In other words, the type of defect can be analyzed by combining multiple grayscale pixel values ​​of the defective area with edge analysis.

[0033] In reality, the first grayscale image contains many features of the defect location (large data dimension), the image size is inconsistent, and the size, direction and position of the defect in the image are highly uncertain, so there are certain technical difficulties in determining the type of defect.

[0034] To overcome the above-mentioned defects, this invention proposes to generate a first feature vector based on a first grayscale image. This vector represents the essence of the image content. In other words, when the image is scaled, rotated, and translated, the change of each element of the feature vector and the overall change are very small. This invention attempts to overcome the difficulty of identifying the types of defects caused by image dimension, rotation, scaling, and translation.

[0035] After that, based on the first feature vector of the first grayscale image and the defects of the first grayscale image, a defect recognition model can be constructed, which can achieve a better recognition effect.

[0036] The present invention describes in detail the implementation process of the above concept through the following steps.

[0037] In step 102, each first grayscale image is transformed in coordinate system to obtain a second grayscale image in which the pixel position is represented by the extreme value and polar angle.

[0038] In some implementations, the step of transforming the coordinate system of each first grayscale image to obtain a second grayscale image in which the pixel position is represented by extrema and polar angle includes: For each first grayscale image, perform the following steps: The origin of the first grayscale image is shifted to the center of the image to obtain a shifted grayscale image; The distance from the origin of the translated grayscale image to a corner vertex is taken as the maximum distance; The coordinates of the translated grayscale image are normalized based on the maximum distance to obtain a normalized grayscale image; The coordinates of the normalized grayscale image are transformed from Cartesian coordinates to polar coordinates to obtain a second grayscale image, wherein each pixel in the second grayscale image includes a polar radius, a polar angle, and a grayscale value.

[0039] In some embodiments, normalizing the coordinates of the translated grayscale image based on the maximum distance to obtain a normalized grayscale image includes: The coordinates of the translated grayscale image are normalized according to the first formula and the maximum distance to obtain a normalized grayscale image, wherein the first formula is:

[0040] In the formula, For normalized grayscale images of pixels Axis coordinates To shift the pixels in the grayscale image Axis coordinates For pixels in a normalized grayscale image Axis coordinates To shift the pixels in the grayscale image Axis coordinates The maximum distance; The step of transforming the coordinates of the normalized grayscale image from Cartesian coordinates to polar coordinates to obtain the second grayscale image includes: The coordinates of the normalized grayscale image are transformed from Cartesian coordinates to polar coordinates according to the second formula to obtain the second grayscale image, wherein the second formula is:

[0041] In the formula, It is an extreme value. Polar angle, For having based on input Axis coordinates and The arctangent function of the axis coordinates outputs the signed angle.

[0042] For example, in practice, the present invention constructs a first feature vector by normalizing the image coordinate system and generating rotation-independent feature values.

[0043] Regarding the normalization of the coordinate system, this invention consists of three main steps: first, the coordinate system is translated to the center of the image, which yields a translated grayscale image; second, the coordinate values ​​of the translated coordinate system are normalized to obtain a normalized grayscale image; and third, the coordinates of the first grayscale image are converted from the Cartesian coordinate system to the polar coordinate system so that subsequent steps can generate rotation-independent feature values.

[0044] In obtaining a normalized grayscale image, this invention calculates a maximum distance based on the coordinates of the origin of the grayscale image and the farthest pixel, and then processes the coordinates of each pixel using a first formula to obtain the normalized grayscale image. The first formula is:

[0045] In the formula, For normalized grayscale images of pixels Axis coordinates To shift the pixels in the grayscale image Axis coordinates For pixels in a normalized grayscale image Axis coordinates To shift the pixels in the grayscale image Axis coordinates This represents the maximum distance.

[0046] In terms of converting to polar coordinates, this invention utilizes the second formula:

[0047] In the formula, It is an extreme value. Polar angle, For having based on input Axis coordinates and The arctangent function of the axis coordinates outputs the signed angle.

[0048] It should be noted that, The function implements based on The sign of the axis coordinates and The sign of the axis coordinates generates a signed angle, for example, when The sign of the axial coordinates is negative and negative. When the axis coordinate is positive, output an angle value in the second coordinate interval. The sign of the axial coordinates is negative and negative. If the axis coordinate is negative, output an angle value in the third coordinate interval.

[0049] In step 103, a polynomial transformation is performed on each second grayscale image to obtain a first feature vector, wherein the rate of change of each element value of the first feature vector is less than a threshold when the first grayscale image is scaled, rotated and translated.

[0050] In some implementations, the step of performing a polynomial transformation on each second grayscale image to obtain a first feature vector includes: Obtain a first total order value and a second total order value, wherein the first total order value is greater than the second total order value, and the difference between the absolute values ​​of the first total order value and the second total order value is an even number; Based on the first total order value and the second total order value, a plurality of first polynomials are generated, wherein each first polynomial corresponds to a combination of a first order value and a second order value, and the first polynomial generates a first feature value based on the extrema, polar angle and pixel value; Take out the first polynomials sequentially from the plurality of first polynomials; Substitute the extreme value, polar angle, and pixel value of each pixel in the second grayscale image into the first polynomial to obtain the first feature value; The sum of the plurality of first eigenvalues ​​is obtained; The modulus of the sum of the features is added as an element of the vector to the first feature vector; If the traversal of the plurality of first polynomials is not completed, then proceed to the step of sequentially extracting the first polynomial from the plurality of first polynomials.

[0051] In some implementations, generating a plurality of first polynomials based on the first total order value and the second total order value includes: Multiple order value combinations are generated based on the first total order value and the second total order value; For each combination of order values, perform the following steps: Based on the order combination, an extremum polynomial is generated concerning the extremum characteristic, wherein the extremum polynomial is:

[0052] In the formula, For the first order value, For the second order value, It is an extreme value. It is an extreme value characteristic; Based on the order combination, a polar angle polynomial is generated regarding the polar angle characteristic, wherein the polar angle polynomial is:

[0053] In the formula, Polar angle characteristics, It is a natural constant. Polar angle, The imaginary unit, It is a cosine function. It is a sine function; A first polynomial is generated based on the extreme value feature and the polar angle feature, wherein the first polynomial is:

[0054] In the formula, For the first multiple terms, Pi The extreme values ​​in the grayscale image of the polar coordinate system are Polar angle is The pixel value of the pixel.

[0055] For example, in terms of feature extraction and obtaining the first feature vector, the present invention sets two order values ​​and generates multiple first polynomials based on the combination of the two order values. It should be noted that among the two order values, the first order value is greater than or equal to the second order value, and the difference obtained by subtracting the absolute values ​​of the first order value and the second order value is an even number.

[0056] like Figure 2 As shown, when calculating feature values ​​using polynomial 201, for each polynomial 202, the extreme values, polar angles, and pixel values ​​of each pixel of the grayscale image obtained in the aforementioned steps, the second grayscale image 202, are substituted into polynomial 201 to obtain the output 203 of the polynomial. The sum of multiple outputs 203 is used as the feature (feature sum 204), and the feature sum 204 is added as a vector element to the first feature vector 205.

[0057] After iterating through multiple polynomials, multiple features are obtained, which together form the first feature vector.

[0058] As for polynomial construction, as mentioned earlier, a combination of two order values ​​generates a polynomial. In other words, a polynomial is constructed based on combinations of order values ​​(e.g., 4-2 combinations).

[0059] When constructing polynomials using combinations, extremal polynomials, polar angle polynomials, and the first polynomial are generated respectively. In fact, the first polynomial is the polynomial used to obtain the eigenvalues ​​mentioned above, while the first polynomial is obtained based on the first two polynomials.

[0060] The extremum polynomial is:

[0061] In the formula, For the first order value, For the second order value, It is an extreme value. This is an extreme value characteristic.

[0062] The polar polynomial is:

[0063] In the formula, Polar angle characteristics, It is a natural constant. Polar angle, The imaginary unit, It is a cosine function. It is a sine function.

[0064] The first polynomial is:

[0065] In the formula, For the first multiple terms, Pi The extreme values ​​in the grayscale image of the polar coordinate system are Polar angle is pixel value of the pixel In step 104, the classification base model is adjusted using multiple first feature vectors and multiple defect identifiers to obtain a defect identification model inside the steel pipe. Each first feature vector corresponds to a defect identifier, and the defect identifier of the first feature vector is obtained based on the defect in the first grayscale image from which the first feature vector originates.

[0066] In some implementations, adjusting the classification base model using multiple first feature vectors and multiple defect identifiers to obtain a defect identification model for steel pipes includes: Obtain a classification base model, wherein the classification base model is constructed based on an artificial neural network model; For each first feature vector, the inner surface defect of the steel pipe corresponding to the source grayscale image of the first feature vector is used as the defect identifier of the first feature vector, and the first feature vector and the defect identifier are constructed as a feature pair; Divide multiple feature pairs into a first group and a second group; The classification base model is trained using multiple features from the first group to obtain a process model; The fitting status of the process model is verified using multiple features from the second group; If the fitting state is overfitted or underfitted, the number of elements in the first feature vector is adjusted, multiple first feature vectors are regenerated, and the process jumps to the step of taking the steel pipe inner surface defect corresponding to the source grayscale image of the first feature vector as the defect identifier of the first feature vector and constructing the first feature vector and the defect identifier as a feature pair for each first feature vector. Otherwise, the process model is used as the defect identification model for the steel pipe.

[0067] For example, once the feature vector is obtained, the feature vector and the defect types of the source image of the feature vector can be used to construct a feature pair.

[0068] These feature pairs form the foundation for building the defect identification model. This invention divides them into two parts, used to train the model (artificial neural network model) and to verify the model's fit, respectively. In practice, the model is first trained using the feature pairs from the first part. After training is complete (reaching the set training target or the number of training iterations), the fit is verified using the feature pairs from the other part. If overfitting is found, this invention adjusts the feature pairs by adding elements to the first feature vector. After adjustment, the training and fitting verification steps are repeated. If underfitting is found, the feature pairs are adjusted by deleting elements from the first feature vector. After adjustment, the training and fitting verification steps are repeated.

[0069] Regarding adjusting the number of elements in the first feature vector, this invention uses the control of the first total order value and the second total order value. The combination of the control orders controls the total number of elements in the feature vector.

[0070] When the fitting state is relatively perfect, the model parameters can be fixed and used as a defect identification model for steel pipes.

[0071] The present invention also provides a method for identifying internal defects in steel pipes, comprising: Obtain a third grayscale image, wherein the third grayscale image contains an image of the defects on the inner surface of the steel pipe; The coordinate system of the third grayscale image is transformed, and a polynomial transformation is performed on the third grayscale image after coordinate system transformation based on the first total order value and the second total order value to obtain the second feature vector. The dimension of the second feature vector is the same as that of the first feature vector. The pixel position of the third grayscale image after coordinate system transformation is represented by the extreme value and the polar angle. The second feature vector is input into the model constructed by the aforementioned method for classifying defects inside steel pipes to obtain the types of defects on the inner surface of the steel pipe.

[0072] For example, when applying the recognition model obtained by the aforementioned process, the defective third grayscale image is transformed by the coordinate system transformation process described above, which involves offsetting, normalizing, and transforming the coordinate system of the third grayscale image to obtain a fourth grayscale image. The fourth grayscale image is then transformed into a second feature vector by the polynomial obtained by the aforementioned steps. It should be noted that the number of polynomials is the same as the number of polynomials in the aforementioned steps, and the first total order and the second total order are the same as the first total order and the second total order in the aforementioned steps.

[0073] The second feature vector is input into the model obtained in the previous steps, and the model can then identify the type of defect.

[0074] The present invention discloses a method for constructing a steel pipe internal defect classification model. First, multiple first grayscale images are acquired, each corresponding to a type of internal surface defect in the steel pipe. These first grayscale images are obtained from images captured by a wide-angle lens inside the steel pipe. Then, each first grayscale image undergoes a coordinate system transformation to obtain a second grayscale image where pixel positions are represented by extreme values ​​and polar angles. Next, each second grayscale image undergoes a polynomial transformation to obtain a first feature vector. The rate of change of each element value of the first feature vector is less than a threshold when the first grayscale image is scaled, rotated, or translated. Finally, the classification base model is adjusted using multiple first feature vectors and multiple defect identifiers to obtain a steel pipe internal defect identification model. Each first feature vector corresponds to a defect identifier, and the defect identifier of the first feature vector is obtained based on the defect in the first grayscale image from which the first feature vector originates. This invention identifies defects based on grayscale images. Compared to edge recognition, it achieves higher accuracy due to the greater dimensionality of the input data and the preservation of more features. Furthermore, this invention extracts feature vectors independent of image rotation and scaling through coordinate system transformation and polynomial extraction. By identifying defects based on these feature vectors, it significantly reduces recognition problems caused by the form of defects in the image, thereby improving the accuracy and reliability of the identification.

[0075] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0076] The following are embodiments of the apparatus of the present invention. For details not described in detail, please refer to the corresponding method embodiments described above.

[0077] Figure 3 This is a functional block diagram of the steel pipe internal defect classification model construction device provided in the embodiments of the present invention, with reference to... Figure 3 The device for constructing a classification model for defects inside steel pipes includes: a grayscale image acquisition module 301, a coordinate system transformation module 302, a feature extraction module 303, and a model construction module 304, wherein: The grayscale image acquisition module 301 is used to acquire multiple first grayscale images, wherein each first grayscale image corresponds to a type of inner surface defect of the steel pipe, and the first grayscale image is obtained based on the image of the inside of the steel pipe captured by a wide-angle lens; The coordinate system transformation module 302 is used to transform the coordinate system of each first grayscale image to obtain a second grayscale image in which the pixel position is represented by the extreme value and the polar angle. The feature extraction module 303 is used to perform a polynomial transformation on each second grayscale image to obtain a first feature vector, wherein the rate of change of each element value of the first feature vector is less than a threshold when the first grayscale image is scaled, rotated and translated. The model building module 304 is used to adjust the classification base model using multiple first feature vectors and multiple defect labels to obtain a defect identification model inside the steel pipe. Each first feature vector corresponds to a defect label, and the defect label of the first feature vector is obtained based on the defect in the first grayscale image from which the first feature vector originates.

[0078] Figure 4 This is a functional block diagram of the electronic device provided in an embodiment of the present invention. For example... Figure 4 As shown, the electronic device 4 in this embodiment includes a processor 400 and a memory 401, wherein the memory 401 stores a computer program 402 that can run on the processor 400. When the processor 400 executes the computer program 402, it implements the steps in the above-described methods and embodiments for constructing classification models of internal defects in steel pipes, for example... Figure 1 Steps 101 to 104 are shown.

[0079] For example, the computer program 402 may be divided into one or more modules / units, which are stored in the memory 401 and executed by the processor 400 to complete the present invention.

[0080] The electronic device 4 can be a desktop computer, laptop, handheld computer, cloud server, or other computing device. The electronic device 4 may include, but is not limited to, a processor 400 and a memory 401. Those skilled in the art will understand that... Figure 4This is merely an example of electronic device 4 and does not constitute a limitation on electronic device 4. It may include more or fewer components than shown, or combine certain components, or different components. For example, electronic device 4 may also include input / output devices, network access devices, buses, etc.

[0081] The processor 400 may be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.

[0082] The memory 401 can be an internal storage unit of the electronic device 4, such as a hard disk or memory. The memory 401 can also be an external storage device of the electronic device 4, such as a plug-in hard disk, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card. Furthermore, the memory 401 can include both internal and external storage units of the electronic device 4. The memory 401 is used to store the computer program 402 and other programs and data required by the electronic device 4. The memory 401 can also be used to temporarily store data that has been output or will be output.

[0083] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the aforementioned method embodiments, and will not be repeated here.

[0084] In the above embodiments, the descriptions of each embodiment have their own emphasis. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0085] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0086] In the embodiments provided by this invention, it should be understood that the disclosed devices / electronic devices and methods can be implemented in other ways. For example, the device / electronic device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0087] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment, depending on actual needs.

[0088] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0089] If the integrated module / unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the above-described embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various methods and apparatus embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium, etc.

[0090] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.

Claims

1. A method for constructing a classification model for internal defects in steel pipes, characterized in that, include: Multiple first grayscale images are obtained, where each first grayscale image corresponds to a type of defect on the inner surface of the steel pipe. The first grayscale images are obtained based on images taken of the inside of the steel pipe using a wide-angle lens. For each first grayscale image, a coordinate system transformation is performed to obtain a second grayscale image in which the pixel position is represented by the extreme values ​​and polar angles; A polynomial transformation is performed on each second grayscale image to obtain a first feature vector, wherein the rate of change of each element value of the first feature vector is less than a threshold when the first grayscale image is scaled, rotated and translated. By adjusting the classification base model using multiple first feature vectors and multiple defect labels, a defect identification model for steel pipes is obtained. Each first feature vector corresponds to a defect label, and the defect label of the first feature vector is obtained based on the defect in the first grayscale image from which the first feature vector originates.

2. The method for constructing a classification model for internal defects in steel pipes according to claim 1, characterized in that, The step of transforming the coordinate system of each first grayscale image to obtain a second grayscale image in which the pixel position is represented by extreme values ​​and polar angles includes: For each first grayscale image, perform the following steps: The origin of the first grayscale image is shifted to the center of the image to obtain a shifted grayscale image; The distance from the origin of the translated grayscale image to a corner vertex is taken as the maximum distance; The coordinates of the translated grayscale image are normalized based on the maximum distance to obtain a normalized grayscale image; The coordinates of the normalized grayscale image are transformed from Cartesian coordinates to polar coordinates to obtain a second grayscale image, wherein each pixel in the second grayscale image includes a polar radius, a polar angle, and a grayscale value.

3. The method for constructing a classification model for internal defects in steel pipes according to claim 2, characterized in that, The step of normalizing the coordinates of the translated grayscale image based on the maximum distance to obtain a normalized grayscale image includes: The coordinates of the translated grayscale image are normalized according to the first formula and the maximum distance to obtain a normalized grayscale image, wherein the first formula is: In the formula, For normalized grayscale images of pixels Axis coordinates To shift the pixels in the grayscale image Axis coordinates For pixels in a normalized grayscale image Axis coordinates To shift the pixels in the grayscale image Axis coordinates The maximum distance; The step of transforming the coordinates of the normalized grayscale image from Cartesian coordinates to polar coordinates to obtain the second grayscale image includes: The coordinates of the normalized grayscale image are transformed from Cartesian coordinates to polar coordinates according to the second formula to obtain the second grayscale image, wherein the second formula is: In the formula, It is an extreme value. Polar angle, For having based on input Axis coordinates and The arctangent function of the axis coordinates outputs the signed angle.

4. The method for constructing a classification model for internal defects in steel pipes according to claim 1, characterized in that, The step of performing a polynomial transformation on each second grayscale image to obtain a first feature vector includes: Obtain a first total order value and a second total order value, wherein the first total order value is greater than the second total order value, and the difference between the absolute values ​​of the first total order value and the second total order value is an even number; Based on the first total order value and the second total order value, a plurality of first polynomials are generated, wherein each first polynomial corresponds to a combination of a first order value and a second order value, and the first polynomial generates a first feature value based on the extrema, polar angle and pixel value; Take out the first polynomials sequentially from the plurality of first polynomials; Substitute the extreme value, polar angle, and pixel value of each pixel in the second grayscale image into the first polynomial to obtain the first feature value; The sum of the plurality of first eigenvalues ​​is obtained; The modulus of the sum of the features is added as an element of the vector to the first feature vector; If the traversal of the plurality of first polynomials is not completed, then proceed to the step of sequentially extracting the first polynomial from the plurality of first polynomials.

5. The method for constructing a classification model for internal defects in steel pipes according to claim 4, characterized in that, The step of generating multiple first polynomials based on the first total order value and the second total order value includes: Multiple order value combinations are generated based on the first total order value and the second total order value; For each combination of order values, perform the following steps: Based on the order combination, an extremum polynomial is generated concerning the extremum characteristic, wherein the extremum polynomial is: In the formula, For the first order value, For the second order value, It is an extreme value. It is an extreme value characteristic; Based on the order combination, a polar angle polynomial is generated regarding the polar angle characteristic, wherein the polar angle polynomial is: In the formula, Polar angle characteristics, It is a natural constant. Polar angle, The imaginary unit, It is a cosine function. It is a sine function; A first polynomial is generated based on the extreme value feature and the polar angle feature, wherein the first polynomial is: In the formula, For the first multiple terms, Pi The extreme values ​​in the grayscale image of the polar coordinate system are Polar angle is The pixel value of the pixel.

6. The method for constructing a classification model for internal defects in steel pipes according to any one of claims 1-5, characterized in that, The process of adjusting the classification base model using multiple first feature vectors and multiple defect identifiers to obtain a defect identification model for steel pipes includes: Obtain a classification base model, wherein the classification base model is constructed based on an artificial neural network model; For each first feature vector, the inner surface defect of the steel pipe corresponding to the source grayscale image of the first feature vector is used as the defect identifier of the first feature vector, and the first feature vector and the defect identifier are constructed as a feature pair; Divide multiple feature pairs into a first group and a second group; The classification base model is trained using multiple features from the first group to obtain a process model; The fitting status of the process model is verified using multiple features from the second group; If the fitting state is overfitted or underfitted, the number of elements in the first feature vector is adjusted, multiple first feature vectors are regenerated, and the process jumps to the step of taking the steel pipe inner surface defect corresponding to the source grayscale image of the first feature vector as the defect identifier of the first feature vector and constructing the first feature vector and the defect identifier as a feature pair for each first feature vector. Otherwise, the process model is used as the defect identification model for the steel pipe.

7. A method for identifying internal defects in steel pipes, characterized in that, include: Obtain a third grayscale image, wherein the third grayscale image contains an image of the defects on the inner surface of the steel pipe; The coordinate system of the third grayscale image is transformed, and a polynomial transformation is performed on the third grayscale image after coordinate system transformation based on the first total order value and the second total order value to obtain the second feature vector. The dimension of the second feature vector is the same as that of the first feature vector. The pixel position of the third grayscale image after coordinate system transformation is represented by the extreme value and the polar angle. The second feature vector is input into the model constructed according to the method for constructing a steel pipe internal defect classification model as described in any one of claims 1-6 to obtain the types of defects on the inner surface of the steel pipe.

8. A device for constructing a classification model of internal defects in steel pipes, characterized in that, For implementing the method for constructing a classification model of internal defects in steel pipes as described in any one of claims 1-6, the apparatus for constructing the classification model of internal defects in steel pipes comprises: The grayscale image acquisition module is used to acquire multiple first grayscale images, each of which corresponds to a type of defect on the inner surface of the steel pipe. The first grayscale images are obtained based on images taken of the inside of the steel pipe by a wide-angle lens. The coordinate system transformation module is used to transform the coordinate system of each first grayscale image to obtain a second grayscale image in which the pixel position is represented by the extreme value and the polar angle. The feature extraction module is used to perform a polynomial transformation on each second grayscale image to obtain a first feature vector, wherein the rate of change of each element value of the first feature vector is less than a threshold when the first grayscale image is scaled, rotated and translated. as well as, The model building module is used to adjust the classification base model using multiple first feature vectors and multiple defect labels to obtain a defect identification model inside the steel pipe. Each first feature vector corresponds to a defect label, and the defect label of the first feature vector is obtained based on the defect in the first grayscale image from which the first feature vector originates.

9. An electronic device comprising a memory and a processor, wherein the memory stores a computer program executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method as described in any one of claims 1 to 7 above.

10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1 to 7 above.

Citation Information

Patent Citations

  • Image registration method and defect detection method

    CN114882088A

  • Surface defect identification method and system for stainless steel pipe

    CN118840605A