Pitting detection and residual strength calculation method and system for multi-arm caliper logging data
By converting well logging data into a three-dimensional model and using improved YOLOv8 intelligent image recognition technology, pitting corrosion areas are automatically identified and classified. Combined with stress concentration factor, the remaining strength is calculated, which solves the problems of low detection efficiency and poor accuracy in existing technologies, and realizes efficient and accurate pitting corrosion detection and remaining strength calculation.
Patent Information
- Application Number
- CN202510014362.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-06
- Publication Date
- 2025-11-11
- Estimated Expiration
- 2045-01-06
AI Technical Summary
Existing well logging data analysis methods rely on manual visual inspection and expert systems, resulting in low detection efficiency, strong subjectivity of results, poor consistency, inability to achieve large-scale automated processing, difficulty in accurately identifying pitting corrosion areas and types, and affecting the accuracy of residual strength calculation.
Well logging data is converted into a 3D model, and automated identification and classification are performed using improved YOLOv8 intelligent image recognition technology. Combined with parameters such as stress concentration factor, the remaining strength of pitting corrosion area is calculated. The BBI-YOLOv8 model is used to improve detection efficiency and accuracy.
It enables automated processing of wellbore logging data, improves the efficiency and accuracy of pitting detection, provides more reliable management of tubing corrosion integrity and safety prediction, and can quickly process large amounts of data to meet real-time requirements.
Smart Images

Figure CN119942197B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of oil and gas field engineering technology, and in particular to a method and system for pitting corrosion detection and residual strength calculation of logging data from a multi-arm caliper. Background Technology
[0002] Oil well tubing is often affected by various factors such as geological, engineering, and chemical environments during long-term service, leading to widespread corrosion. Especially in complex environments, the uneven size and distribution of corrosion defects can exacerbate the corrosion rate, causing problems such as perforation, flattening, and cracking of the tubing. This, in turn, affects the structural integrity of the tubing, shortens its service life, and seriously threatens the safety of on-site operations.
[0003] In oil and gas field operations, tubing corrosion is one of the main causes of downhole equipment failure and safety accidents. According to statistics from the Japanese oil refining and petrochemical industries, the corrosion failure rate of completion tubing in sulfur-containing environments is as high as 73.8%, and stress corrosion cracking reaches 41.6%. In my country, the proportion of wells with casing damage is also very serious in some oilfields. For example, in the Shengli Oilfield, out of 22,986 oil, gas, and water wells, 3,300 wells have casing damage, accounting for 14.45% of the total. Therefore, timely and accurate identification of tubing corrosion defects, prediction of remaining strength, and the development of reasonable control measures are crucial for ensuring the safety of oil and gas wells and extending the service life of tubing.
[0004] Currently, corrosion detection and residual strength assessment of oil well tubing primarily rely on caliper logging technology. Caliper logging is a technique that measures the wellbore radius by running a logging instrument and utilizing the contact between the measuring arm and the tubing wall. It provides detailed data on corrosion, deformation, scaling, and other damage to the tubing's inner wall. Multi-arm caliper tools are commonly used caliper logging instruments, offering high-precision measurement capabilities and accurately reflecting the depth of corrosion and the degree of deformation on the tubing's inner wall.
[0005] Existing wellbore logging data analysis methods primarily rely on manual visual inspection, expert judgment, or statistical characteristic-based analysis. Specifically, traditional corrosion detection typically involves manually analyzing the measured wellbore data, manually delineating corrosion zones, and assessing the type and severity of corrosion. This method is not only time-consuming and labor-intensive but also easily influenced by the operator's experience and judgment, leading to subjective and inconsistent results, making it difficult to achieve large-scale, high-efficiency real-time monitoring.
[0006] Furthermore, existing pitting detection technologies largely rely on standards or expert systems for evaluation. This approach has limited data processing capabilities and automation, lacks efficient image processing and deep learning technologies, and struggles to cope with complex pitting morphologies and large-scale data processing needs.
[0007] Limitations of existing technology
[0008] Inefficient and labor-intensive: Traditional methods rely on manual visual inspection and statistical analysis, which are cumbersome and inefficient, and cannot respond to large-scale data demands in real time.
[0009] High subjectivity and poor consistency: Due to the reliance on manual judgment, different operators may have significant differences in the division of corrosion areas and the identification of pitting corrosion types, making it difficult to guarantee the accuracy and consistency of the results.
[0010] Unable to automate large-scale detection: Existing technologies mainly rely on manual processing and expert systems, which cannot achieve automated and large-scale processing of large amounts of well logging data, thus limiting their application in real-time monitoring.
[0011] Limitations of pitting area and type analysis: Traditional methods lack precise means of identifying pitting areas and classifying types, making it difficult to perform fine-grained pitting feature analysis, which affects the accuracy of residual strength calculation. Summary of the Invention
[0012] This invention addresses the shortcomings of existing technologies by providing a method and system for pitting corrosion detection and residual strength calculation using caliper logging data. By converting caliper logging data into a three-dimensional model, and then using intelligent image recognition technology (an improved YOLOv8 model) to automatically identify and classify pitting areas, combined with parameters such as stress concentration factor, the residual strength of the pitting area is accurately calculated. This method automates the processing of caliper logging data, significantly improving the efficiency and accuracy of pitting corrosion detection, and resolving the subjectivity and inefficiency issues of traditional methods. It provides more reliable technical support for the management and safety prediction of tubing corrosion integrity.
[0013] To achieve the above-mentioned objectives, the technical solution adopted by the present invention is as follows:
[0014] A method for pitting corrosion detection and residual strength calculation based on logging data from a multi-arm caliper includes the following steps:
[0015] S1. Convert the logging data from the multi-arm caliper into a three-dimensional model;
[0016] S2. Perform data cleaning on the 3D model and batch projection transformation to obtain a sequence of planar images;
[0017] S3. Classify and label the pitting regions in the planar image sequence according to the pitting type standard;
[0018] S4. Introduce the YOLOv8 intelligent image detection model, add a bottleneck attention module (BAM) to enhance the network's attention to pitting regions, replace the batch normalization function (BN) in the model with the batch channel normalization function (BCN) to improve training performance, and replace the complete intersection-union ratio (CIoU) loss function in the model with the improved bounding box regression method Shape-IoU to improve the detection capability of irregular pitting regions, thus obtaining the improved BBI-YOLOv8 intelligent image detection model;
[0019] S5. The annotated planar image sequence is trained using the improved BBI-YOLOv8 intelligent image detection model to obtain an intelligent pitting detection model.
[0020] S6. Calculate the residual strength of the pitted area based on the pitting type, opening length, average depth, and stress concentration factor (K).
[0021] Furthermore, in S1, the original caliper logging data is mapped to a three-dimensional spatial coordinate system, and a preliminary three-dimensional caliper model is generated.
[0022] Furthermore, data cleaning in S2 includes removing noise, outliers, and measurement errors from the wellbore data, and smoothing the 3D model.
[0023] Furthermore, the pitting areas in S3 are classified into shallow hemispherical, hemispherical, and deep hemispherical according to the morphology of the pitting, and the opening length, depth, and location of each pitting area are marked.
[0024] Furthermore, the stress concentration factor (K) is calculated based on the shape and size characteristics of the pitting area.
[0025] Furthermore, the planar image dataset includes multiple images converted from measurement results of multi-arm caliper logging instruments at different depths and angles in the oil well.
[0026] Furthermore, the calculation of the remaining strength of the pitting region specifically includes:
[0027] Based on the detection results of the pitting corrosion area, including pitting corrosion type, opening length and depth information, the stress concentration factor (K) of each pitting corrosion area is calculated.
[0028] Based on the type and geometric characteristics of pitting corrosion, and combined with existing mechanical models, the residual strength of the pitted area is calculated.
[0029] The remaining strength of the entire tubular string is obtained by statistically analyzing the remaining strength of the pitted area.
[0030] The remaining strength is compared with the original strength of the tubing to assess the degree of corrosion and its safety.
[0031] The calculation results of the remaining strength are provided for tubular corrosion assessment and decision support.
[0032] This invention also discloses an intelligent pitting detection system for realizing pitting detection and residual strength calculation methods for logging data from multi-arm caliper tools, comprising:
[0033] The data conversion module is used to convert logging data from a multi-arm caliper into a three-dimensional model.
[0034] The data processing module is used to clean the data of the 3D model and perform batch projection transformation to obtain a sequence of planar images;
[0035] The classification and annotation module is used to classify and annotate pitting regions in a sequence of planar images according to the pitting type standard.
[0036] The intelligent detection module is used to introduce the YOLOv8 intelligent image detection model, add the bottleneck attention module (BAM), and replace the batch normalization function (BN) with the batch channel normalization function (BCN). The efficiency of pitting detection is improved by using the Shape-IoU bounding box regression method.
[0037] The model training module is used to train the labeled planar image sequence using the improved BBI-YOLOv8 intelligent image detection model;
[0038] The strength calculation module is used to calculate the remaining strength of the pitted area based on the pitting type, opening length, average depth, and stress concentration factor (K).
[0039] Furthermore, the intelligent detection unit also includes a pitting region localization module, which is used to accurately identify pitting regions in the image and improve the robustness of the model in complex backgrounds.
[0040] Compared with the prior art, the advantages of the present invention are as follows:
[0041] 1. This invention utilizes an improved BBI-YOLOv8 intelligent image detection model to quickly and accurately identify and classify pitting areas in well logging data through automated image recognition technology, significantly improving the efficiency of pitting detection.
[0042] 2. This invention reduces the complexity of human operation and subjective errors through automated processing of intelligent models, thereby improving the accuracy and consistency of detection results.
[0043] 3. This invention uses an intelligent detection model to directly extract pitting corrosion area information from well logging data and, combined with parameters such as the stress concentration factor (K), quickly calculates the remaining strength of the tubing string, significantly improving the efficiency of tubing string strength verification. This method can process large amounts of data in a short time, meeting the real-time needs of actual production.
[0044] 4. This invention combines the pitting type, opening length, depth, and stress concentration factor (K) of the pitting area to establish a scientific residual strength calculation model, providing a more accurate assessment basis for the corrosion integrity management of tubing strings, and can provide effective support for the safety control and risk management of oil and gas extraction operations.
[0045] 5. By accurately assessing the remaining strength of the tubing string in real time, this invention can provide a theoretical basis for predicting the safe service life of the tubing string. Using this method, potential corrosion defects and risks in the tubing string can be detected in advance, allowing for the implementation of effective control measures to prevent tubing string failure or sudden accidents.
[0046] 6. This invention converts traditional well logging data into computer-recognizable image data and combines it with advanced deep learning algorithms to achieve intelligent detection of tubing corrosion pitting. This greatly improves the automation level of tubing integrity management and the accuracy of tubing corrosion monitoring, which is of great significance for improving the production efficiency and safety of oil and gas wells. Attached Figure Description
[0047] Figure 1 This is a flowchart of the method for pitting detection and pitting area intensity calculation based on logging data from a multi-arm caliper according to an embodiment of the present invention;
[0048] Figure 2 This is a diagram showing the connection relationships between the various parts of the pitting corrosion detection and pitting corrosion area intensity calculation system according to an embodiment of the present invention;
[0049] Figure 3 This is a schematic diagram of a 40-arm caliper collecting caliper data according to an embodiment of the present invention;
[0050] Figure 4 This is a flowchart illustrating the acquisition of wellbore data using a 40-arm caliper, as described in an embodiment of the present invention.
[0051] Figure 5 This invention relates to a method for NURBS curve interpolation to achieve a three-dimensional imaging image in space.
[0052] Figure 6 This is a top view of the mechanical caliper of the present invention on the cross-section of the wellbore. In the figure, (a) is the top view and (b) is a simplified geometric figure.
[0053] Figure 7 This is an embodiment of the present invention. Figure 6(b) Auxiliary line graph;
[0054] Figure 8 This is a three-dimensional imaging image of the radius data sequence after modification according to an embodiment of the present invention;
[0055] Figure 9 This is a thermal diagram of corrosion depth according to an embodiment of the present invention;
[0056] Figure 10 This is a diagram of the Pytoch framework for YOLOv8;
[0057] Figure 11 This is a flowchart of the CBS (Conv2d-BatchNorm-SiLU) module framework;
[0058] Figure 12 This is a flowchart of the C2f module in an embodiment of the present invention;
[0059] Figure 13 This is a flowchart of the SPPF module according to an embodiment of the present invention;
[0060] Figure 14 This is a simplified model diagram of the residual strength of the oil casing in an embodiment of the present invention;
[0061] Figure 15 This is a diagram of pitting shape according to an embodiment of the present invention. In the diagram, (a) is a deep hemispherical pitting defect, (b) is a shallow hemispherical pitting defect, and (c) is a hemispherical pitting defect.
[0062] Figure 16 This is a classification and annotation diagram of pitting corrosion thermal maps according to embodiments of the present invention;
[0063] Figure 17 This is a diagram of the overall architecture of BBI-YOLOv8 according to an embodiment of the present invention;
[0064] Figure 18 This is a basic structural diagram of the BAM according to an embodiment of the present invention;
[0065] Figure 19 This is a flowchart of the normalization process of the feature image using BCN in an embodiment of the present invention;
[0066] Figure 20 This is a regression diagram of Shape-IoU in an embodiment of the present invention;
[0067] Figure 21 This is a graph showing the variation of stress concentration factor with pitting depth and opening length in an embodiment of the present invention. (a) is a deep hemisphere, (b) is a hemisphere, and (c) is a shallow hemisphere.
[0068] Figure 22 This is a diagram showing the remaining resistance to external extrusion and the remaining resistance to internal pressure in each pitted area of the sample image in the embodiment of the present invention; Detailed Implementation
[0069] To make the objectives, technical solutions, and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings and examples.
[0070] like Figure 1 As shown, this invention provides a method for pitting detection and pitting area intensity calculation of well logging data from a multi-arm caliper, comprising the following steps: S1. Converting well logging data into a three-dimensional model I; S2. Performing data cleaning and batch projection transformation on the three-dimensional model I to obtain a planar image sequence I(n); S3. Classifying and labeling the pitting areas in the planar image sequence I(n) according to the pitting type standard as shallow hemisphere, hemisphere, and deep hemisphere; S4. Introducing the YOLOv8 intelligent image detection model, adding a bottleneck attention module (BAM), replacing the batch normalization function (BN) in the model with a batch channel normalization function (BCN), and replacing the complete intersection-union ratio (CIU) in the model with an improved bounding box regression method Shape-IoU. S5. Use the improved BBI-YOLOv8 intelligent image detection model to train the existing labeled image dataset I(n) to obtain the intelligent pitting detection model; S6. Calculate the residual strength of the pitting region based on the pitting type, opening length, average depth and stress concentration factor K of the pitting region.
[0071] like Figure 2 As shown, the pitting corrosion detection and pitting area intensity calculation system consists of: logging equipment - multi-arm caliper, expert support module, data management module, image generation module, BBI-YOLOv8 intelligent pitting corrosion detection module, and residual intensity calculation module.
[0072] Technical features of each part:
[0073] ① Logging Equipment - Multi-arm Caliper Tool: Measures and statistically analyzes the diameter, remaining wall thickness, well wall defects and deformation locations of the casing and tubing, and interprets the maximum, minimum, and average diameter of the casing and tubing based on the logging data.
[0074] ② Expert Support Module: Expert users receive input data collected by the caliper, set the format and scale of the input data, perform preliminary statistics, interpretation and analysis on the caliper logging data and output it to the data management module; receive the remaining strength calculation results of the casing and tubing, and predict and control the safe service life and critical load of the casing and tubing based on the results.
[0075] ③ Data Management Module: Accepts data input from the Expert Support Module, performs data cleaning and preprocessing, and allocates data according to the module's requirements.
[0076] ④ Image generation module: Organize and collect logging data obtained from field caliper measurements, convert it into an image training set, and label the pitting areas in the images.
[0077] ⑤ BBI-YOLOv8 Intelligent Pitting Detection Module: The YOLOv8 model is improved by inputting the image training set into the model for training, resulting in the BBI-YOLOv8 intelligent pitting detection model that can perform real-time pitting area division and type identification on well logging data.
[0078] ⑥ Residual strength calculation module: The concentrated stress coefficient K is used to approximate different types of pitting corrosion areas. The concentrated stress coefficient of each area is calculated according to the type, and the residual strength of the tubing in the area is further calculated.
[0079] Working principle:
[0080] ① Logging Equipment - Multi-arm Caliper: Multi-arm caliper logging is a logging method for measuring the geometry of an oil wellbore. By lowering the instrument to the bottom of the well, moving the center upwards, and slowly rotating the measuring arm, the radius of the well wall at each location is measured through the contact between the measuring arm and the inner wall. This allows for the identification of damage to the tubing string, such as corrosion, deformation, and scaling. Common multi-arm caliper models include XY calipers, micro calipers, and 8-arm, 18-arm, 38-arm, 40-arm, and 60-arm specifications. Multi-arm calipers offer high measurement accuracy and can measure the corrosion depth at various points on the inner wall of the tubing.
[0081] like Figure 3 As shown, H represents the sequence of measurements taken by the caliper around the well, and r is the distance from the axis of a series of equal arcs to the well wall. All distances form an n×40 matrix that records the caliper information for the entire well section.
[0082] ② Expert Support Module: a. Receives signals transmitted by the caliper and converts them into structured features for transmission to the data management module; b. After receiving data from the remaining strength calculation module, predicts the safe service life and provides risk warnings for the casing and tubing based on the remaining strength and relevant standards, and further provides control schemes that consider the corrosion integrity of the casing and tubing.
[0083] ③ Data Management Module: This module accepts data and feature inputs from the expert support module. Since raw well logging data may contain instrument or human error, failure to address these errors can lead to misjudgments in subsequent modules. Therefore, data cleaning and preprocessing are necessary to reduce model training time and improve prediction accuracy. After cleaning, data is allocated according to module requirements, and this module consistently maintains the integrity of the data.
[0084] ④ Image generation model: Organize and collect logging data obtained from field caliper measurements, convert it into a spatial coordinate sequence, use color linear transformation to reflect radius sequence transformation, establish a three-dimensional model in space based on NURBS curve interpolation, perform data cleaning on the three-dimensional model, and then use projection transformation to generate a series of pitting depth heat maps with equal side lengths and equal vertical depth steps.
[0085] The specific process is as follows:
[0086] like Figure 4 As shown in the table, the data tested this time is the inner wall data of a certain oil pipe obtained by the 40-arm caliper of the Keshen Gas Field in the Tarim Basin. The basic information of the oil pipe is shown in the table.
[0087]
[0088] The robotic arm measures angles in increments of 9° on each horizontal plane and depths in increments of 25.0 mm, obtaining logging data from well depths of 294.5388 m to 1004.0888 m. The resulting radius sequence can be represented by an n x 40 matrix R, where each row represents the well depth measured by the caliper and each column represents the radius distance from the tubing center to the wellbore.
[0089] First, the well logging data is converted into a 3D model. Errors in the original data are found through data visualization. Outlier detection and pose correction are used to clean the data. Finally, the corrected 3D image data is converted into a 2D image training set in batches through projection transformation.
[0090] To map the elements of a matrix to three-dimensional coordinates in spatial coordinates, the following transformation can be performed:
[0091]
[0092] In the formula: R ij Let x be the radius length of the i-th row and j-th column obtained by the caliper, and let x be the element R. ij Lateral displacement in space, (mm), y is element R ij The longitudinal displacement in space is (mm), and z is the vertical depth (m).
[0093] After obtaining the coordinate mapping of all elements in three-dimensional space, 3D imaging is achieved in space using MATLAB and a NURBS curve interpolation method, such as... Figure 5 As shown.
[0094] Figure 5 The image shows the three-dimensional morphology of the inner wall of the oil pipe from 290m to 320m, with colors representing the difference between the measured radius and the theoretical inner diameter, i.e., the corrosion depth (mm). Figure 5 It can be seen that the shape of the inner wall of this area is not accurate in some regions. For example, at a depth of 315m-320m, the inner wall is concave on the left and convex on the right, showing a significant offset. This indicates that the radius data obtained by the wellbore measuring instrument contains errors. Therefore, it is necessary to first correct the erroneous measurement data by performing data cleaning.
[0095] Errors in wellbore measurement can be divided into two categories. One category is systematic errors caused by the inherent accuracy of the mechanical wellbore gauge itself, including insufficient sensor accuracy, product defects, wear and deformation of the robotic arm, etc. These types of data require replacement of the equipment and remeasurement. The other category is random errors caused by human calculation or operation errors, such as the instrument not being centered downhole, the instrument not being perpendicular to the wellbore axis and thus tilting, or human error in recording. These types of errors can be avoided and can be corrected through data analysis, calculation, and cleaning.
[0096] The wellbore measurement focused on a single well section; therefore, the following assumptions can be made regarding any anomalies in the data:
[0097] (1) The caliper itself does not have systematic errors;
[0098] (2) The oil pipe is not deformed;
[0099] (3) There are no deposits or scale points on the inner wall of the oil pipe that would reduce the radius;
[0100] (4) The caliper is always perpendicular to the wellbore axis;
[0101] When studying the variation pattern of a continuous variable, outliers are usually treated as abnormal data. Therefore, the isolated forest algorithm is used to filter out outliers and abnormal data with fluctuation ranges greater than the wall thickness.
[0102] To eliminate the abnormal data generated by condition (4), it is necessary to first confirm whether the current measurement data is centered. If it is not centered, the center offset of the measuring instrument at the current depth needs to be obtained and corrected. Finally, the radius sequence of the current depth is recalculated.
[0103] If the mechanical caliper is offset to the first quadrant at the center, its top view on the wellbore cross-section is shown in Figure 6.
[0104] Figure 6In this model, O' is the instrument center. The initial angle is the A-axis of the measuring arm (Sequence 1), and the arm rotates counter-clockwise. The radii of the four axes are recorded at rotations of 90° (Sequence 11), 180° (Sequence 21), and 270° (Sequence 31). AC and BD are perpendicular to each other. Data measured with this offset will result in AO' and BO' having smaller measured radii than the actual radii, while CO' and DO' will have larger measured radii than the actual radii during reconstruction. To obtain the true center position, the true diameters of AC and BD are first calculated, which simplifies the model as shown above. Figure 6 (b) shows the geometric problem.
[0105] Using the law of sinusoids, the theoretical radii of the inner walls at the four arms AC and BD are obtained:
[0106]
[0107] In the formula: the lengths and angles of each line are easily obtained from the Pythagorean theorem and trigonometric functions.
[0108] To obtain the offset values Δx and Δy between O' and the center O, draw the auxiliary lines shown in Figure 7.
[0109] It is easy to obtain from triangles AOC and BOD:
[0110]
[0111] In the formula: |Δx| and |Δy| are moduli, and their signs are determined by O'A, O'B and r after the quadrant of O' is confirmed. The determination rules are shown in the table.
[0112] Well logging data offset judgment criteria
[0113]
[0114] To recalibrate the radius measurement sequence that is off-center to a centered radius sequence, the planar coordinates of each radius are required. These coordinates are then corrected using offset values Δx and Δy, and finally, a trigonometric transformation is performed to re-derive the radius sequence. The corrected radius r' can be expressed as:
[0115]
[0116] The corrected true radius sequence R' can be obtained by cleaning the data as described above.
[0117] However, for a radius sequence, it is necessary to determine whether the mechanical caliper has deviated from the center by judging the magnitudes of O'A, O'B, and r. Only if the deviation is confirmed will the data cleaning process of condition (4) be executed. However, since the inner wall of the tubing itself has been corroded to varying degrees, the true radius r of the inner wall in the corroded area is no longer equal to the theoretical radius of 62.0 mm. O'A and O'B cannot be compared with r without knowing whether the inner wall has been corroded. Therefore, a threshold of 0.5 mm is set. If and only if the calculated result of r on the horizontal plane is within 62 ± 0.5 mm, it is considered that the inner wall has not been corroded, and the radius sequence of the horizontal plane is corrected. Otherwise, the next radius sequence is selected and the above operation is repeated until the next horizontal plane radius sequence. The final corrected radius data sequence has the following three-dimensional imaging: Figure 8 As shown.
[0118] Note that the original data is a radius sequence measured by a mechanical caliper. If the projection of the radius sequence onto the horizontal plane is directly used as the input image, the image will be distorted due to the projection. In order to accurately reproduce local corrosion and obtain accurate feature information, the tubing string can be cut along the wellbore axis and stretched flat.
[0119] The projection transformation formula is:
[0120]
[0121] In the formula: r is the theoretical inner diameter of the oil pipe (mm).
[0122] The corrosion depth ranges from -11 mm to 0 mm, therefore a linear color change from -11 to 0 is used to represent the corrosion depth. By setting the unit length of the horizontal axis to be equal to the vertical depth, an image that accurately recreates the target shape is generated, producing a series of corrosion depth heatmaps with equal vertical depth steps and an inner diameter circumference of 0.400 m, as shown below. Figure 9 As shown.
[0123] ⑤ BBI-YOLOv8 Intelligent Pitting Detection Module: The pitting detection of the inner wall of the oil pipe is divided into two parts. First, it detects pitting corrosion on the inner wall of the oil pipe. The pitting pattern is divided into different regions, and then the pitting shape in each region is identified. YOLOv8 can identify the type of pitting. Regions are divided and identified, but before that, the original image samples need to be labeled to train the model. Develop rules for classifying pitting areas and types, and develop an improved YOLOv8 model to adapt to these rules and improve identification accuracy. Therefore, this chapter proposes the following improvements:
[0124] This invention proposes a technique for generating images from wellbore logging data and a method for using Convolutional Neural Networks (CNNs) to identify pitting corrosion images and calculate residual strength from wellbore logging data on the inner wall of tubing. The CNN learning is based on the Pytoch framework of YOLOv8, which is as follows... Figure 10 As shown.
[0125] YOLOv8 Overall Structure
[0126] The core modules of this network include:
[0127] (1) CBS (Conv2d-BatchNorm-SiLU) module
[0128] This module consists of three parts: two-dimensional convolution, batch normalization function BatchNorm, and SiLU activation function.
[0129] like Figure 11 As shown, 2D convolution extracts features from the input image; BatchNorm performs batch normalization on the input, and learns the scaling parameter γ and offset parameter β to prevent gradient vanishing or gradient explosion; the activation function SiLU combines the advantages of the sigmoid function and the linear function, and performs a nonlinear transformation on the output.
[0130] (2) C2f module
[0131] like Figure 12 As shown, the input image is first processed by a CBS module, and then the output feature image is split into two halves along dimension c. One half is fed into a BottleNeck module, which consists of two concatenated CBS modules (S=1, K=3). The output of each BottleNeck module is concatenated before the final CBS module to achieve feature fusion.
[0132] (3) SPPF module
[0133] like Figure 13 As shown, the input image is first processed by a CBS module, and then the output feature image is input into three cascaded MaxPooling layers. The output of each BottleNeck layer is concatenated before the final CBS module to achieve feature fusion.
[0134] YOLOv8 extracts features from images through a backbone network, and then uses SPPF, C2f modules, and a neck network to fuse these features across layers. It performs object detection using dual-path prediction and convolutional neural networks, while incorporating cascading and pyramid concepts to accelerate model training efficiency.
[0135] Pitting corrosion detection on the inner wall of oil pipes based on YOLOv8 consists of two parts. First, the corrosion areas are divided into regions, and then the pitting shape type is identified within each region. YOLOv8 can divide and identify pitting areas, but labeling of the original image samples is necessary beforehand to train the model. Therefore, rules for dividing pitting areas and types need to be established, and an improved YOLOv8 model should be developed accordingly to improve recognition accuracy. To this end, this invention proposes the following improvements:
[0136] 1) A pitting shape classification scheme was designed to create image sample labels. The samples were divided into training set, test set and validation set to train the model, and provided a premise for calculating the residual intensity of the pitting region later.
[0137] To evaluate the corrosion integrity of the aforementioned tubing images, pitting defects need to be classified based on the width, height, and depth of the detected area. Although several standards classify the pitting shape of metals and alloys, most are based on visual inspection and lack rigorous numerical specifications. Therefore, a simplified pitting shape classification scheme is proposed that strictly classifies pitting defects according to their lateral opening size (width), longitudinal opening size (height), and pitting depth. The pitting defect shape is approximated as a spherical shape, and a stress concentration factor k is introduced to calculate the remaining strength of the tubing after pitting. The simplified model is as follows: Figure 14 As shown.
[0138] Figure 14 In this context, d is the opening diameter (mm) of the pit after it is approximated as a hemispherical shape, satisfying:
[0139]
[0140] r2 is the radius (mm) of the concentric circle tangent to the outer wall of the oil casing with O as the center, representing the inscribed circle of the pitting corrosion target detection frame. When the width and height of the detection frame are (w,h), r2=min(w,h);
[0141] r1 is the radius of the pitting pit (mm), which satisfies:
[0142] r1 = r2 + rh
[0143] h represents the theoretical wall thickness of the oil casing (mm);
[0144] r is the pitting depth (mm), representing the average depth of all pitted areas in the target pitting detection area:
[0145]
[0146] At this point, the stress σ around the pit is:
[0147]
[0148] In the formula: σ0 is the initial axial stress (MPa); μ is the Poisson's ratio of the oil casing; d is the distance (mm) from any point on the pipe wall to the center of the pitting pit o.
[0149] like Figure 15 As shown, the stress concentration factor is calculated for different pit shapes to determine the residual strength based on different pitting defect types.
[0150] (1) Deep hemispherical pitting defects
[0151] When the width and height of the pitting area are similar and the pitting depth is relatively deep, the morphology of the pitting defect in this area is approximated as a deep hemispherical pitting defect. In this case, the depth of the pitting hemisphere is greater than the radius of the hemisphere. The hemispherical radius, opening diameter, and pitting depth of this morphology satisfy the following relationship:
[0152]
[0153] The stress concentration factor in this region is:
[0154]
[0155] In the formula:
[0156]
[0157] Its pitting shape is as follows Figure 15 As shown in (a);
[0158] (2) Shallow hemispherical pitting defects
[0159] When the width and height of the pitting region are similar and the pitting depth is relatively shallow, the morphology of the pitting defect in this region is approximated as a shallow hemispherical pitting defect. In this case, the depth of the pitting hemisphere is less than the radius of the hemisphere. The pitting radius, opening diameter, and pitting depth of this morphology satisfy the following relationship:
[0160]
[0161] The stress concentration factor in this region is:
[0162]
[0163] In the formula:
[0164]
[0165] Its pitting shape is as follows Figure 15 As shown in (b);
[0166] (3) Hemispherical pitting defects
[0167] When the width and height of the pitting area are similar and the pitting depth is relatively moderate, the shape of the pitting defect in this area is approximated as a hemispherical pitting defect. In this case, the depth of the pitting hemisphere is equal to the radius of the hemisphere.
[0168]
[0169] The stress concentration factor in this region is:
[0170]
[0171] Its pitting shape is as follows Figure 15As shown in (c);
[0172] By combining K with the API standard's resistance to internal pressure and external extrusion, a formula for calculating the residual strength of oil casing considering pitting corrosion is obtained.
[0173] The remaining external extrusion resistance of the oil casing is:
[0174]
[0175] The remaining internal pressure resistance of the oil casing is:
[0176]
[0177] Where: σ y R represents the minimum yield strength of the casing material (MPa); R represents the theoretical outer diameter of the casing (mm).
[0178] Label the previously generated pitting heatmap according to the classification, such as... Figure 16 As shown.
[0179] Figure 16 In the diagram, shallow hemispherical pitting defects are labeled as wide_shallow; hemispherical pitting defects are labeled as ellipse; and deep hemispherical pitting defects are labeled as narrow_depth.
[0180] 2) To address the issues of overlapping and interleaving pitting erosions, a Bottleneck Attention Module (BAM) is introduced. BAM combines the advantages of channel attention and spatial attention, adaptively and selectively enhancing or weakening the feature responses of different channels to improve sensitivity to important information and enhance the detection accuracy of pitting erosion regions.
[0181] 3) The batch normalization function (BN) in the CBS module of the YOLOv8 model was replaced with the batch channel normalization function (BCN). BCN combines the advantages of BN and layer normalization (LN), and simultaneously considers the batch, channel, height, and width of the pitting image, integrating multi-scale feature information to enhance the image feature representation of the pitting region.
[0182] 4) For the problem of numerous and dense small pits on the inner wall of the oil pipe, which are difficult to detect, the improved bounding box regression method Shape-IoU is used to replace the complete intersection-union ratio (CIoU) loss function in the original YOLOv8 model. Shape-IoU considers the shape and size of the edge box in addition to the geometric relationship between the ground truth box and the predicted box, which enhances the edge detection accuracy of the model and thus enhances the localization performance and generalization ability of the model.
[0183] Based on the above three modifications, YOLOv8's ability to focus on spatial dimensions is further enhanced, interference from complex backgrounds, noise, or redundant channels on image features is reduced, sensitivity to boundary shape and size recognition is improved, and model iteration efficiency is accelerated. An improved pitting detection model, BBI-YOLOv8, is proposed, with the overall architecture as follows: Figure 17 As shown.
[0184] First, a Bottleneck Attention Module is introduced into the original Backbone network. This module incorporates both channel attention and spatial attention mechanisms to extract features from pitting images, focusing attention on highly relevant features. This improves the model's ability to focus on key information within pitting regions, thus optimizing detection performance. Next, the batch normalization function BatchNorm in the original CBS module is improved by adding LayerNormalization to obtain Batch channel Normalization, thereby enhancing the model's robustness and enabling it to better perform the tasks of pitting region detection and type recognition. Then, in the Head network, the CIoU bounding box loss function in the region detection module is replaced with the Shape-IoU bounding box loss function. Shape-IoU considers the geometric relationship between the ground truth and predicted boxes while incorporating the shape and size of the bounding box to influence bounding box regression, thereby strengthening the model's ability to capture edge features of pitting regions and making bounding box regression more accurate.
[0185] ①Bottleneck Attention Module
[0186] To enhance the model's ability to focus on the dimensions of pitting regions and reduce misjudgments in region segmentation caused by the stacking and overlapping of pitting regions, this invention proposes the use of a simple and lightweight BAM, which simultaneously introduces channel attention and spatial attention mechanisms, allowing the model to adaptively and selectively enhance or weaken the feature responses of different channels to improve sensitivity to important information.
[0187] Figure 18The image illustrates the basic structure of BAM, where FC stands for Fully Connected Layer. Unlike typical attention mechanisms, BAM integrates the channel attention results M... c (F)∈R C×1×1 Spatial attention result M s (F)∈R 1×H×W Calculate the attention map M(F)∈R C×H×W accomplish:
[0188] M(F) = sigmoid(M c (F)+M s (F))
[0189] The outputs of the two are fused together by multiplication to obtain the final BAM output, which includes adaptive feature adjustments in both channel and spatial aspects.
[0190] The formula for calculating channel attention is:
[0191] M c (F)=BN(MLP 2 (AvgPool(F)))
[0192] In the formula, AvgPool is average pooling, MLP is a multilayer perceptron with one hidden layer, and BN is the batch normalization function.
[0193] The formula for calculating spatial attention is:
[0194]
[0195] In the formula, conv represents the convolution operation, the superscript indicates the size of the convolution filter, and the subscript indicates the convolution order. A convolution kernel of size 1 is used to reduce the number of channels, while a convolution kernel of size 3 is used to aggregate contextual information through a larger receptive field.
[0196] ② Batch channel normalization
[0197] The batch normalization function BN in the CBS module does not consider the influence of channels, which may cause the model to lose some features of the image channels. In order to make the model pay more attention to the relationship between different channels and effectively extract feature images, the batch channel normalization function (BCN) is proposed. BCN combines the advantages of BN and LN, and considers the batch, channels, height and width of the pitting image.
[0198] Figure 19The document demonstrates the normalization process of BCN for feature images. N, C, H, and W represent the batch, channel, spatial height, and width dimensions, respectively. BN calculates the mean and variance along the (N, H, W) dimension, while LN calculates the mean and variance along the (C, H, W) dimension. Finally, the normalized outputs are combined according to adaptive parameters to improve the robustness of the model in processing feature images.
[0199] In BCN, BN calculates the mean μ1 and variance σ1 of the input features along the (N,H,W) direction:
[0200]
[0201] Similarly, LN calculates the mean μ2 and variance σ2 of the input features along the (C,H,W) direction.
[0202] Then normalize using (μ1, σ1); (μ2, σ2) respectively:
[0203]
[0204] To combine the normalized outputs, an additional learning parameter ι is introduced, typically ι is 0.9:
[0205]
[0206] Finally, the scaling parameter γ and the offset parameter β are set to obtain the output result:
[0207]
[0208] In complex situations, the BCN function exhibits better robustness compared to other normalization functions such as BN, LN, IN, and GN, enabling it to better accomplish the tasks of pitting region detection and type identification in this study.
[0209] ③ Bounding box regression function
[0210] To further enhance the model's ability to capture edge features of pitting erosion regions, an improved bounding box regression method, Shape-IoU, is proposed to replace the Complete Intersection over Union (CIoU) loss function in the original YOLOv8 model. This method considers the geometric relationship between the ground truth and predicted boxes while incorporating the influence of the inherent properties of the bounding boxes (such as shape and size) on the bounding box regression, thereby making the bounding box regression more accurate.
[0211] like Figure 20 As shown, GT represents the ground truth bounding box boundary, and Anchor represents the predicted bounding box boundary. Weights ww and hh are set for the horizontal and vertical directions.
[0212]
[0213] In the formula: w gt h is the actual frame width. gt is the height of the ground truth bounding box, and scale is the scaling factor, which depends on the size of the dataset and is generally between 0 and 1.5.
[0214] Therefore:
[0215]
[0216] In the formula: The difference between the x-coordinates. y is the difference between the vertical coordinates, and c is the scaling factor, which depends on the ratio of the actual image size to the pixel size.
[0217] Recalculate:
[0218]
[0219] In the formula:
[0220]
[0221] The final bounding box regression loss function is:
[0222] L shape-IoU =1-IoU+distance shape +0.5Ω shape
[0223] Compared to YOLOv8's bounding box regression loss function CIoU, Shape-IoU has stronger edge recognition capabilities and is better at capturing irregular, blurry, and small pitted objects in complex environments, thereby better dynamically optimizing the loss weights of pitted bounding boxes to improve the model's detection performance.
[0224] ⑥ Residual Strength Calculation Module: Based on the basic parameters of the tubing and the residual strength calculation model for pitting types, the distribution diagram of the stress concentration factor K for three pit shapes as a function of pit depth and opening length is obtained. The pitting detection results include information on pit shape, length, width, and depth. Therefore, after the model obtains the pitting target image, the residual strength of the tubing can be further calculated based on the identification results. To this end, the output results of the intelligent pitting detection model are improved so that each region divided by the model can contain complete corrosion information such as the length, width, and depth of the pitting target, and then the residual strength of the tubing in each region is further converted based on the pitting shape.
[0225] like Figure 21 As shown, the stress concentration factor K generally increases with the increase of pit depth and opening length.
[0226] The steps to improve the model's output are as follows:
[0227] (1) Obtain the depth of all corrosion points in the corrosion target detection area, and calculate the average depth of pitting pits as the pitting pit depth r;
[0228] (2) Obtain the center coordinates (x,y) and width and height (w,h) of the corrosion target detection box, and calculate the radius of the circumscribed circle r2 of the approximate hemisphere, the radius of the pitting corrosion r1 and the opening length d. Based on the center and opening radius, draw a circular detection area box in the image and select the corrosion area as the calculation area for the remaining intensity.
[0229] (3) Based on the pitting depth and opening length, select the formula according to the type to calculate the remaining internal pressure resistance and external extrusion resistance of the tubing in this area and mark them in the image.
[0230] Taking the test set as an example, the remaining resistance to external extrusion and the remaining resistance to internal pressure in each pitted area of the sample image were calculated through the above process:
[0231] like Figure 22 As shown, the pink area represents shallow hemispherical pitting defects, the red area represents deep hemispherical pitting defects, the solid circle represents the pit hemisphere, the ring represents the circumcircle of the pit, and the dashed line represents the concentric circumcircle of the pit. It can be seen that the residual strength of deep hemispherical pitting defects is generally less than that of shallow hemispherical pitting defects, and decreases with increasing opening length and pitting depth, which is consistent with actual conditions and can be used as a reference for residual strength calculation.
[0232] Those skilled in the art will recognize that the embodiments described herein are intended to help the reader understand the implementation methods of the present invention, and should be understood that the scope of protection of the present invention is not limited to such specific statements and embodiments. Those skilled in the art can make various other specific modifications and combinations based on the technical teachings disclosed in this invention without departing from the spirit of the invention, and these modifications and combinations are still within the scope of protection of the present invention.
Claims
1. A method for pitting corrosion detection and residual strength calculation based on logging data from a multi-arm caliper, characterized in that, Includes the following steps: S1. Convert the logging data from the multi-arm caliper into a three-dimensional model; S2. Perform data cleaning on the 3D model and batch projection transformation to obtain a sequence of planar images; S3. Classify and label the pitting regions in the planar image sequence according to the pitting type standard; S4. Introduce the YOLOv8 intelligent image detection model, add the bottleneck attention module BAM to enhance the network's attention to pitting regions, replace the batch normalization function BN in the model with the batch channel normalization function BCN to improve training effect, and replace the complete intersection-union ratio CIoU loss function in the model with the improved bounding box regression method Shape-IoU to improve the detection ability of irregular pitting regions, thus obtaining the improved BBI-YOLOv8 intelligent image detection model; S5. The annotated planar image sequence is trained using the improved BBI-YOLOv8 intelligent image detection model to obtain an intelligent pitting detection model. S6. Calculate the residual strength of the pitted area based on the pitting type, opening length, average depth, and stress concentration factor K.
2. The method for pitting corrosion detection and residual strength calculation according to claim 1, characterized in that: In S1, the original caliper logging data is mapped to a three-dimensional spatial coordinate system, and a preliminary three-dimensional caliper model is generated.
3. The method for pitting corrosion detection and residual strength calculation according to claim 1, characterized in that: Data cleaning in S2 includes removing noise, outliers, and measurement errors from wellbore data, and smoothing the 3D model.
4. The method for pitting corrosion detection and residual strength calculation according to claim 1, characterized in that: In S3, pitting areas are classified into shallow hemispherical, hemispherical, and deep hemispherical according to the pitting morphology, and the opening length, depth, and location of each pitting area are marked.
5. The method for pitting corrosion detection and residual strength calculation according to claim 1, characterized in that: The stress concentration factor K is calculated based on the shape and size characteristics of the pitting corrosion region.
6. The method for pitting corrosion detection and residual strength calculation according to claim 1, characterized in that: The planar image sequence comprises multiple images converted from measurement results of a multi-arm caliper logging instrument at different depths and angles in the oil well.
7. The method for pitting corrosion detection and residual strength calculation according to claim 1, characterized in that: The calculation of the residual strength of the pitted area specifically includes: Based on the detection results of the pitting corrosion area, including pitting corrosion type, opening length and depth information, the stress concentration factor K of each pitting corrosion area is calculated; Based on the type and geometric characteristics of pitting corrosion, and combined with existing mechanical models, the residual strength of the pitting corrosion area is calculated. The remaining strength of the entire tubing string is obtained by statistically analyzing the remaining strength of the pitted area. The remaining strength is compared with the original strength of the tubing to assess the degree of corrosion and its safety. The calculation results of the remaining strength are provided for tubular corrosion assessment and decision support.
8. An intelligent pitting corrosion detection system for implementing the pitting corrosion detection and residual strength calculation method according to any one of claims 1 to 7, characterized in that, include: The data conversion module is used to convert logging data from a multi-arm caliper into a three-dimensional model. The data processing module is used to clean the data of the 3D model and perform batch projection transformation to obtain a sequence of planar images; The classification and annotation module is used to classify and annotate pitting regions in a sequence of planar images according to the pitting type standard. The intelligent detection module is used to introduce the YOLOv8 intelligent image detection model, add the bottleneck attention module BAM, and replace the batch normalization function BN with the batch channel normalization function BCN. The efficiency of pitting detection is improved by using the Shape-IoU bounding box regression method. The model training module is used to train the labeled planar image sequence using the improved BBI-YOLOv8 intelligent image detection model; The strength calculation module is used to calculate the remaining strength of the pitted area based on the pitting type, opening length, average depth, and stress concentration factor K.
9. The method for pitting corrosion detection and residual strength calculation according to claim 8, characterized in that: The intelligent detection module also includes a pitting region localization module, which is used to accurately identify pitting regions in the image and improve the robustness of the model in complex backgrounds.
Citation Information
Patent Citations
Improved hull corrosion line detection and identification method based on YOLOv5 algorithm
CN117475281A
Substation equipment defect detection method and system based on improved YOLOv9
CN118469986A