Model training method, crack detection method, device, equipment and storage medium
Patent Information
- Application Number
- CN202310694146.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-12
- Publication Date
- 2026-10-09
- Estimated Expiration
- 2043-06-12
AI Technical Summary
但基于成像测井图像,通过人工识别裂缝的方法存在工作量大、误差大、效率慢等缺点,进而导致采油精确度低
[0031] The model training method, fracture detection method, device, equipment, and storage medium provided in this application use a random cosine function that conforms to the characteristics of formation fractures as the model input dataset, realizing sample expansion under small sample size conditions. In addition, in the target detection model, due to the use of fusion factors, the gradient generated by the detection task in the FPN layer can be reduced. By controlling the information transmitted from deep layers to shallow layers, the network is prompted to learn the detection task of each layer equally, which can effectively improve the information fusion efficiency, enhance the target detection model's ability to detect small fractures, and improve the fracture detection efficiency and accuracy. Thus, fractures in electrical imaging logging images can be detected quickly and accurately, thereby improving the oil production accuracy in oil exploration.
Smart Images

Figure CN116935154B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of petroleum exploration and development, and in particular to a model training method, a fracture detection method, an apparatus, equipment, and a storage medium. Background Technology
[0002] As a non-renewable resource, improving oil extraction efficiency and quality is a crucial research topic. Fractured reservoirs have always been a key focus and challenge in oil exploration and development, making fracture detection extremely important during the oil production process.
[0003] In geological exploration, imaging logging images provide the most information about fractures. However, manually identifying fractures based on imaging logging images has drawbacks such as high workload, large errors, and slow efficiency, which in turn leads to low oil production accuracy.
[0004] Therefore, there is an urgent need for an automated solution for rapid and accurate crack detection. Summary of the Invention
[0005] This application provides a model training method, a crack detection method, an apparatus, a device, and a storage medium for rapidly and accurately detecting cracks, thereby improving oil production accuracy.
[0006] Firstly, this application provides a model training method, including:
[0007] Acquire sample images and labeled data of cracks in the sample images, wherein the cracks in the sample images are generated based on cosine curves that conform to the characteristics of formation cracks;
[0008] The sample image is input into the target detection model. Based on the fusion factor between adjacent layers in the Feature Pyramid Network (FPN), crack detection is performed on the sample image to obtain the first crack detection result corresponding to the sample image. The fusion factor is determined by the number of cracks in the sample image learned by each layer in the FPN.
[0009] Based on the detection results of the first crack and the labeled data, the model parameters of the target detection model are adjusted.
[0010] In one possible implementation, the object detection model includes a Path Aggregation Network (PANet), which includes an Functional Feature Network (FPN). The FPN contains a feature fusion structure, wherein the feature fusion is used to upsample the feature maps output from the intermediate layers of the FPN based on a fusion factor and then fuse them with the feature maps output from the adjacent next layer.
[0011] In one possible implementation, the fusion factor is determined in the following way:
[0012] Based on the position and size of the anchor frames in each layer of the FPN, the intersection over union (IOU) ratio between each anchor frame and the cracks in the sample image is determined; for each anchor frame, the anchor frame with the largest IOU with the cracks in the sample image is selected as the positive sample and counted to obtain the number of cracks in the corresponding layer of the sample image.
[0013] The fusion factor between adjacent layers of the FPN is determined based on the number of cracks in each layer of multiple sample images.
[0014] In one possible implementation, the fusion factor satisfies the following formula:
[0015]
[0016] in, and Representing the Pth term of FPN respectively i Layer and P i+1 The number of cracks in the layer, where i is an integer greater than 1.
[0017] In one possible implementation, the sample image is obtained in the following way:
[0018] Obtain a first image dataset, which is an image dataset generated by adjusting the parameters of a cosine curve generated from a crack simulation cosine function, and the cosine curve contains random noise.
[0019] Based on the principle of left addition and right subtraction, the cosine curve is shifted left and right to randomly generate multiple new images, resulting in the second image dataset.
[0020] Based on the standard dataset format of the object detection dataset (Visual Object Classes 2007, or VOC2007 for short), the training dataset is determined according to the XML format labeled dataset corresponding to the second image dataset. This XML format labeled dataset is generated by labeling the second image dataset using the data labeling tool Labelimg.
[0021] In one possible implementation, the second image dataset further includes: images generated by data augmentation of the second image dataset using computer image processing methods, wherein the computer image processing methods include at least one of: mirroring, rotation, scaling, cropping, color dithering, changing light intensity, changing contrast, image reduction, stitching, and fusion.
[0022] Secondly, this application provides a fracture detection method, comprising: acquiring an electrical imaging logging image of the area to be detected; inputting the electrical imaging logging image into a target detection model for fracture detection, and obtaining the fracture detection result of the area to be detected.
[0023] Thirdly, this application provides a model training apparatus, comprising:
[0024] The acquisition module is used to acquire sample images and the labeled data of cracks in the sample images. The cracks in the sample images are generated based on cosine curves that conform to the characteristics of formation cracks.
[0025] The training module is used to input sample images into the target detection model, perform crack detection on the sample images based on the fusion factor between adjacent layers in the FPN, and obtain the first crack detection result corresponding to the sample image. The fusion factor is determined according to the number of cracks in the sample images learned by each layer in the FPN. The module also adjusts the model parameters of the target detection model based on the first crack detection result and the labeled data.
[0026] Fourthly, this application provides an electronic device, including: a processor, and a memory communicatively connected to the processor;
[0027] The memory stores instructions that the computer executes;
[0028] The processor executes computer execution instructions stored in memory to implement the methods described in the first aspect and / or the second aspect.
[0029] Fifthly, this application provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the methods described in the first aspect and / or the second aspect.
[0030] Sixthly, this application provides a computer program product, including a computer program that, when executed, implements the methods described in the first aspect and / or the second aspect.
[0031] The model training method, fracture detection method, device, equipment, and storage medium provided in this application use a random cosine function that conforms to the characteristics of formation fractures as the model input dataset, realizing sample expansion under small sample size conditions. In addition, in the target detection model, due to the use of fusion factors, the gradient generated by the detection task in the FPN layer can be reduced. By controlling the information transmitted from deep layers to shallow layers, the network is prompted to learn the detection task of each layer equally, which can effectively improve the information fusion efficiency, enhance the target detection model's ability to detect small fractures, and improve the fracture detection efficiency and accuracy. Thus, fractures in electrical imaging logging images can be detected quickly and accurately, thereby improving the oil production accuracy in oil exploration. Attached Figure Description
[0032] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0033] Figure 1 A schematic diagram illustrating the application scenario of the model training method provided in the exemplary embodiments of this application;
[0034] Figure 2 A schematic flowchart of a model training method provided for an exemplary embodiment of this application;
[0035] Figure 3 A schematic diagram of a sample image obtained by generating a random cosine function and processing it, provided for an exemplary embodiment of this application;
[0036] Figure 4 A schematic diagram of the FPN structure provided for an exemplary embodiment of this application;
[0037] Figure 5 A partial structural diagram of PANet provided for an exemplary embodiment of this application;
[0038] Figure 6 A schematic diagram of a VOC2007 format dataset provided as an exemplary embodiment of this application;
[0039] Figure 7 A schematic diagram illustrating the model training effect provided for an exemplary embodiment of this application;
[0040] Figure 8 A schematic flowchart of a crack detection method provided as an exemplary embodiment of this application;
[0041] Figure 9 A schematic diagram of the structure of the model training apparatus provided in an exemplary embodiment of this application;
[0042] Figure 10 A schematic diagram of the structure of a crack detection device provided as an exemplary embodiment of this application;
[0043] Figure 11 A schematic diagram of the structure of an electronic device provided as an exemplary embodiment of this application.
[0044] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0045] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0046] It should be noted that the model training method, crack detection method, device, equipment and storage medium provided in this application can be used in the field of oil exploration and development and belong to the scope of imaging logging interpretation; they can also be used in any field other than oil exploration and development technology, such as geological exploration, building crack detection, road crack detection or other related fields. The application field of this application is not limited.
[0047] While traditional manual crack identification methods can identify some crack information based on researchers' extensive experience, they suffer from drawbacks such as high workload and large errors. Relying solely on manual crack identification is not only costly and inefficient, but also susceptible to factors such as researchers' work experience and knowledge background.
[0048] Therefore, there is an urgent need for a solution for intelligent extraction and accurate identification of fractures; in addition, some tiny fractures are often overlooked during manual picking, so accurate identification of tiny fractures is of great importance in order to increase oil production efficiency and improve oil production accuracy.
[0049] In addition, deep learning has made great strides in image classification and object detection in recent years. Therefore, applying it to the field of fracture target detection in imaging logging and guiding the identification of fractured reservoirs is of great significance.
[0050] Figure 1 A schematic diagram illustrating an application scenario of the model training method provided as an exemplary embodiment of this application. For example... Figure 1 As shown, this application scenario includes a first client 11, a server 12, and a second client 13, wherein the number of both the first client 11 and the second client 13 can be at least one. In practical applications, for example, after researchers or other relevant personnel obtain sample images, they process the sample images through the first client 11 and send them to the server 12 for storage, or they generate sample images through the first client 11, process the images, and then send them to the server 12 for storage. When the server 12 detects a model training instruction issued by the user through the second client 13, it executes the model training method provided in this application based on the stored sample images to obtain a trained object detection model, and sends the result of the completed object detection model training to the second client 13, thereby allowing relevant personnel to know that the object detection model has been trained.
[0051] It should be noted that server 12 can also be replaced by a server cluster or other computing devices with a certain computing power. Both the first and second clients can be mobile phones, computers, laptops, or personal digital assistants (PDAs).
[0052] The following is combined with Figure 1 Application scenarios, refer to Figure 2 This document describes a model training method according to exemplary embodiments of this application. It should be noted that the above application scenarios are shown only to facilitate understanding of the spirit and principles of this application, and the embodiments of this application are not limited to... Figure 1 The limitations of the application scenarios shown.
[0053] Figure 2 This is a schematic flowchart of a model training method provided for an exemplary embodiment of this application. Figure 2 As shown, the model training method in this application embodiment includes the following steps:
[0054] Step 201: Obtain the sample image and the labeled data of the cracks in the sample image. The cracks in the sample image are generated based on the cosine curve that conforms to the characteristics of formation cracks.
[0055] In this step, the sample images are generated based on cosine curves that conform to the characteristics of formation fractures. By using the sample images obtained from the cosine curves that conform to the characteristics of formation fractures as training data, sample expansion is achieved under the condition of small sample size.
[0056] For a cosine curve that matches the characteristics of formation fractures, for example, assuming the fracture filling material is a low-resistivity medium, the surrounding rock is a high-resistivity surrounding rock layer, and the wellbore extends along the north, east, south, and west directions, the cosine function simulated based on the fracture is as follows: Generate a cosine curve, where θ is the crack dip angle, n is random noise, and x is the input independent variable. For example, as shown... Figure 3 As shown, Figure 3 In the equation, X corresponds to the input variable x in the crack simulation cosine function, and Y corresponds to the output y in the crack simulation cosine function.
[0057] Optionally, a single sample image may contain multiple cosine curves, i.e. multiple crack patterns.
[0058] In practical applications, multiple sample images can be generated in advance based on the cosine curve. After labeling the cracks in the sample images, the sample images and labeled data are stored in a database. Thus, the electronic device executing the model training method provided in this application, upon detecting a training instruction for training the target detection model, can retrieve the sample images and the labeled crack data from the database, and then train the target detection model. Alternatively, after receiving the sample image generation instruction, the electronic device generates an image dataset based on the crack-simulated cosine function and performs image processing to obtain the sample images and the labeled crack data. That is, sample images are generated in real time, and cracks are labeled on the sample images before training the target detection model.
[0059] Step 202: Input the sample image into the target detection model. Based on the fusion factor between adjacent layers in the FPN, perform crack detection on the sample image to obtain the first crack detection result corresponding to the sample image. The fusion factor is determined according to the number of cracks in the sample image learned by each layer in the FPN.
[0060] In some embodiments, object detection involves not only correctly classifying objects in an image but also locating their specific positions. For example, the object detection model in this application may be a You Only Look Once (YOLO) series model, such as the YOLOv4 model.
[0061] For example, the YOLOv4 model consists of three parts: the backbone, the neck, and the head. The backbone is mainly composed of CSPDarknet53, whose main function is to aggregate and form convolutional neural networks of image features at different fine-grained levels to extract image features from sample images. The neck is mainly composed of Spatial Pyramid Pooling (SPP) and PANet, which is a series of network layers that mix and combine image features and pass the image features to the prediction layer. PANet includes FPN, bottom-up feature fusion layer, adaptive feature pooling layer, prediction head, and fully connected fusion layer of prediction mask. The head continues the detection head of YOLOv3, and its main function is to predict image features, obtain the bounding boxes of objects in the image, and predict the category.
[0062] In some embodiments, the sample image is first input into the YOLOv4 model, and the feature information of the sample image is extracted through the backbone. Then, the fusion factor between adjacent layers in the FPN is determined based on the number of cracks in the sample image learned by each layer in the neck FPN. Based on the fusion factor, crack detection is performed on the sample image to obtain the first crack detection result corresponding to the sample image.
[0063] Step 203: Adjust the model parameters of the target detection model based on the first crack detection results and labeled data.
[0064] In this step, the model parameters of the target detection model are adjusted by comparing the first crack detection result with the labeled data. For example, the loss value of the first crack detection result relative to the labeled data is determined, and then the model parameters of the target detection model are adjusted according to the loss value to achieve the effect of model training.
[0065] It is understandable that the model training process ends similarly to related technologies. It can be considered that the object detection model is trained after the set number of training iterations has been reached, or that the trained object detection model is obtained when the loss value is less than a set threshold.
[0066] In this embodiment, a random cosine function that conforms to the characteristics of formation fractures is used as the model input dataset to achieve sample expansion under small sample size conditions. In addition, in the target detection model, a fusion factor is added between adjacent layers of the FPN. Since the addition of the fusion factor can reduce the gradient generated by the detection task in the FPN layer, by controlling the information transmitted from the deep layer to the shallow layer, the network is prompted to learn the detection task of each layer equally, which can effectively improve the information fusion efficiency, enhance the target detection model's ability to detect micro-fractures, and improve the efficiency and accuracy of fracture detection, including micro-fractures. In this way, fractures in imaging logging images can be detected quickly and accurately, thereby improving the oil production accuracy in oil exploration.
[0067] Based on the above embodiments, in some embodiments, the target detection model includes PANet, PANet includes FPN, the FPN includes a feature fusion structure, the FPN obtains feature maps of each layer of the FPN based on the fusion factor, and the feature fusion structure is used to upsample the feature maps output by the intermediate layers in the FPN and fuse them with the feature maps output by the adjacent next layer based on the fusion factor.
[0068] Figure 4 A schematic diagram of the FPN structure provided for an exemplary embodiment of this application. For example... Figure 4 As shown, FPN includes a bottom-up convolutional structure and a feature fusion structure on the left.
[0069] Correspondingly, C1 represents the input feature map of the lowest layer, C2 represents the input feature map of the second layer, and so on. Since bottom-up is essentially the forward pass of a convolutional network, the size of each layer's feature map is half that of the previous layer. For example, C1 is the first feature map, with its size reduced to half; C2 is the second feature map, with its size reduced to half that of C1, or one-quarter of the original, and so on. Therefore, in the bottom-up process, the size of adjacent layer feature maps is halved, and the number of channels doubles. Because the size of C1 is too large, it consumes a lot of GPU memory during training, so C1 can be omitted in practical applications.
[0070] Four feature maps, labeled C2, C3, C4, and C5, are obtained through a bottom-up convolutional structure. For example, C2 contains more low-level information, while deeper feature maps like C5 contain more semantic information. To combine these four feature maps with different characteristics, a feature fusion structure adds a fusion factor between adjacent layers from top to bottom, ultimately yielding four feature fusion results: P2, P3, P4, and P5. The fusion process expression for feature fusion between adjacent layers is as follows:
[0071]
[0072] Where i represents the i-th layer of FPN, and i is an integer greater than 1 and less than or equal to 5. (C i ) represents the feature map C of the i-th layer. i Perform a 1×1 convolution operation, f up (P i+1 ) represents the feature fusion result P of the (i+1)th layer. i+1 Perform a double upsampling operation. This represents the fusion factor between layer i and layer i+1. Indicates C i and P i+1 The feature fusion result is subjected to a 3×3 convolution operation to obtain the feature fusion result P of the i-th layer. i This operation is used to mitigate the aliasing effect of upsampling, smooth and adjust the details of the feature map so as to fuse it with the feature map of the previous layer; through Weight the feature map of layer i+1 to control the amount of information passed from layer i+1 to layer i.
[0073] It should be noted that since FPN corresponds to four outputs P2, P3, P4, and P5, when i = 5, only C5 needs to be convolved by 1×1 to obtain P5.
[0074] Figure 5A partial structural diagram of PANet provided for an exemplary embodiment of this application. For example... Figure 5 As shown, in Figure 4 Based on the structure shown, a bottom-up information enhancement structure is added. This information enhancement structure downsamples P2-P5 and fuses them with the feature maps output from the adjacent previous layer to obtain feature prediction maps N2-N5.
[0075] Based on the above embodiments, the fusion factor is determined as follows: The Intersection over Union (IOU) between each anchor frame and the cracks in the sample image is determined according to the position and size of the anchor frames in each layer of the FPN; for each anchor frame, the anchor frame with the largest IOU with the cracks in the sample image is selected as a positive sample and counted to obtain the number of cracks in the corresponding layer of the sample image; the fusion factor between adjacent layers of the FPN is determined based on the number of cracks in each layer of the sample image. Here, IOU is a concept used in object detection, which calculates the overlap rate between the anchor frame and the crack marker boxes in the sample image, i.e., the ratio of their intersection to their union. Correspondingly, the anchor frame refers to the predicted bounding box, which typically has multiple anchor frames with different aspect ratios at the same location. Specifically, the number of cracks in each layer of the FPN for each sample image is calculated sequentially to obtain the number of cracks in each layer of the FPN for the sample image, thus determining the fusion factor between adjacent layers of the FPN.
[0076] Furthermore, the above fusion factor satisfies the following formula:
[0077]
[0078] Where, N Pi and N Pi+1 Representing the Pth term of FPN respectively i Layer and P i+1 The number of cracks in the layer, where i is an integer greater than 1. For example, see [reference needed]. Figure 4 or Figure 5 , where i is an integer greater than 1 and less than or equal to 5.
[0079] It is a weighting factor, representing the fusion weight between two layers, and will affect the P-th layer of the FPN. i+1 Number of cracks in the layer Divide by P i Number of cracks in the layer We obtain a ratio to measure the Pth... i+1 Layer and P i The relative number of cracks between layers, when Larger or When it is smaller, it indicates that the Pth i The layer has many cracks or the Pth layer i+1The layer has fewer cracks, and based on the calculation method of the fusion factor mentioned above, a smaller one can be obtained. That is, the fusion weight is relatively small. The purpose of doing this is to set a smaller weight. To reduce P i The gradient generated by the detection task in the middle prompts the network to learn the detection task of each layer equally, thereby improving the detection efficiency of small cracks.
[0080] In some embodiments, the above sample images are obtained in the following ways:
[0081] Obtain the first image dataset, which is an image dataset generated by adjusting the parameters of the cosine curve generated by the crack simulation cosine function. The cosine curve contains random noise.
[0082] Based on the principle of left addition and right subtraction, the cosine curve is shifted left and right to randomly generate multiple new images, resulting in the second image dataset.
[0083] Based on the VOC2007 standard dataset format, the training dataset is determined according to the XML format labeled dataset corresponding to the second image dataset. The XML format labeled dataset is generated by labeling the second image dataset using the data labeling tool Labelimg.
[0084] The simulated crack cosine function was derived. Considering the irregularity of actual cracks, random noise was added to the cosine curve generated based on the simulated crack cosine function, and the parameters of the cosine curve were adjusted, for example, by modifying the thickness, tilt angle, and the quantity and intensity of random noise, to obtain the first image dataset.
[0085] "Left addition, right subtraction" refers to modifying the input variable x value of the cosine curve. When x is added, the cosine curve shifts to the left; when x is subtracted, the cosine curve shifts to the right. Optionally, the electronic device used to execute the model training method provided in the embodiments of this application randomly generates multiple new images by adjusting the x value, and randomly shuffles them with the images in the first image dataset to obtain a second image dataset.
[0086] After expanding the sample using the above method, the cracks in the second image dataset are labeled using a data labeling tool. The labeling box is perfectly aligned with the cosine curve, thus obtaining the sample image and the labeled data of the cracks in the sample image.
[0087] For example, Labelimg is a visual data annotation tool. Using this tool, users can visualize and annotate cracks in a second image dataset, obtaining annotated data in XML format.
[0088] Next, a training dataset was created based on the VOC2007 standard dataset format. Figure 6 A schematic diagram of a VOC2007 format dataset provided for an exemplary embodiment of this application. (See diagram below.) Figure 6 As shown, the data directory contains five folders: Annotations, Images, ImageSets, labels, and samples. The Annotations folder contains XML label files, with each XML file corresponding to a sample image in the Images folder. The Images folder contains the sample images. The ImageSets folder contains the Main folder, which contains the scripts related to function execution. The labels and samples folders contain the data files related to image segmentation.
[0089] The above-mentioned method of obtaining sample images simplifies data acquisition, improves the speed and accuracy of fracture detection, and saves a significant amount of manpower, which is of great importance for the exploration of fractured reservoirs.
[0090] Furthermore, the second image dataset also includes images generated by data augmentation of the second image dataset using computer image processing methods. These computer image processing methods include at least one of mirroring, rotation, scaling, cropping, color dithering, changing illumination intensity, changing contrast, image reduction, stitching, and fusion.
[0091] As an example, the first image dataset contains 1000 sample images. 1000 new images are randomly generated by adjusting the x-value, and these are then randomly shuffled with the 1000 sample images in the first dataset, resulting in 2000 sample images. These 2000 sample images are then randomly subjected to computer image processing methods such as mirroring, rotation, cropping, changing illumination intensity, changing contrast, image reduction, stitching, and fusion to generate 10,000 sample images with diversity.
[0092] Multiple diverse sample images were generated using computer image processing methods to expand the second image dataset, further improving the quality of the sample images and the model's generalization ability.
[0093] Optionally, the second image dataset can be set as the training and validation set in a 9:1 ratio. The YOLO v4 model considering the fusion factor can be trained and tested using the second image dataset. Furthermore, the object detection evaluation metric AP can be used as the standard for detection performance during the testing process. Figure 7 A schematic diagram illustrating the model training effect provided for an exemplary embodiment of this application. Figure 7In the diagram, a crack value of 0.82 indicates that the probability of the target in the box being a crack is 0.82; a crack value of 0.92 indicates that the probability of the target in the box being a crack is 0.92; and a crack value of 0.81 indicates that the probability of the target in the box being a crack is 0.81.
[0094] Figure 8 A schematic flowchart of a crack detection method provided as an exemplary embodiment of this application is shown below. Figure 8 As shown, the crack detection method provided in this application includes:
[0095] Step 801: Obtain electrical imaging logging images of the area to be detected.
[0096] That is, to obtain electrical imaging logging images of the area to be detected in geological exploration work.
[0097] Step 802: Input the electrical imaging logging image into the target detection model to detect fractures and obtain the fracture detection results of the area to be detected.
[0098] This object detection model was trained using any of the model training methods described above.
[0099] In this application embodiment, the target detection model trained by any of the above embodiments can be used for fracture detection, which can improve the speed and accuracy of fracture detection and is of great significance for the exploration of fractured reservoirs.
[0100] The following are embodiments of the apparatus described in this application, which can be used to execute the embodiments of the method described in this application. For details not disclosed in the apparatus embodiments of this application, please refer to the embodiments of the method described in this application.
[0101] Figure 9 This is a schematic diagram of the structure of a model training apparatus provided for an exemplary embodiment of this application. For ease of explanation, only the parts relevant to the embodiments of this application are shown. Figure 9 As shown, the model training device 90 includes: an acquisition module 91 and a training module 92. Wherein:
[0102] The acquisition module 91 is used to acquire sample images and the labeled data of cracks in the sample images, wherein the cracks in the sample images are generated based on cosine curves that conform to the characteristics of formation cracks.
[0103] Training module 92 is used to input sample images into the target detection model, perform crack detection on the sample images based on the fusion factor between adjacent layers in FPN, and obtain the first crack detection result corresponding to the sample image. The fusion factor is determined according to the number of cracks in the sample images learned by each layer in FPN. The training module 92 is also used to adjust the model parameters of the target detection model based on the first crack detection result and the labeled data.
[0104] In one possible implementation, the object detection model includes PANet, which includes FPN. FPN contains a feature fusion structure, which is used to upsample the feature maps output by the intermediate layers in FPN and fuse them with the feature maps output by the adjacent next layer, based on a fusion factor.
[0105] In one possible implementation, the fusion factor is determined as follows: based on the position and size of the anchor frames in each layer of the FPN, the intersection-union ratio (IOU) between each anchor frame and the cracks in the sample image is determined; for each anchor frame, the anchor frame with the largest IOU with the cracks in the sample image is selected as a positive sample and counted to obtain the number of cracks in the corresponding layer of the sample image; based on the number of cracks in each layer of the sample image in the FPN, the fusion factor between adjacent layers of the FPN is determined.
[0106] In one possible implementation, the fusion factor satisfies the following formula: in, and Representing the Pth term of FPN respectively i Layer and P i+1 The number of cracks in the layer, where i is an integer greater than 1.
[0107] In one possible implementation, multiple sample images are obtained as follows: A first image dataset is obtained, which is an image dataset generated by adjusting the parameters of a cosine curve produced by a crack simulation cosine function, the cosine curve containing random noise; the cosine curve is shifted left and right according to the principle of left addition and right subtraction, randomly generating multiple new images to obtain a second image dataset; based on the VOC2007 standard dataset format, a training dataset is determined according to the XML format labeled dataset corresponding to the second image dataset, wherein the XML format labeled dataset is generated by labeling the second image dataset using the data labeling tool Labelimg.
[0108] In one possible implementation, the second image dataset further includes: using computer image processing methods to perform data augmentation on the second image dataset to generate new images, wherein the computer image processing methods include at least one of: mirroring, rotation, scaling, cropping, color dithering, changing light intensity, changing contrast, image reduction, stitching, and fusion.
[0109] Figure 10 A schematic diagram of the crack detection device provided as an exemplary embodiment of this application. Figure 10 As shown, the crack detection device 100 includes:
[0110] The acquisition module 101 is used to acquire electrical imaging logging images of the area to be detected;
[0111] The detection module 102 is used to input electrical imaging logging images into the target detection model for fracture detection, and obtain the fracture detection results of the area to be detected.
[0112] The target detection model was trained using the model training method described above.
[0113] The apparatus provided in this embodiment can be used to execute the technical solution provided in the above-described crack detection method embodiment. Its implementation principle and technical effect are similar, and will not be described again here.
[0114] Figure 11 A schematic diagram of the structure of an electronic device provided as an exemplary embodiment of this application. For example... Figure 11 As shown, the electronic device 110 of this embodiment includes:
[0115] At least one processor 111; and a memory 112 communicatively connected to said at least one processor;
[0116] The memory 112 stores instructions that can be executed by the at least one processor 111, which, when executed by the at least one processor 111, cause the electronic device to perform the method described in any of the above embodiments.
[0117] Alternatively, the memory 112 can be either standalone or integrated with the processor 111.
[0118] The memory 112 may include high-speed random access memory (RAM) and may also include non-volatile memory, such as at least one disk storage device.
[0119] The processor 111 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of this application. Specifically, when implementing the program execution permission processing method described in the foregoing method embodiments, the electronic device may be, for example, a server or other electronic device with processing capabilities.
[0120] Optionally, the electronic device may also include a communication interface 113. In specific implementations, if the communication interface 113, memory 112, and processor 111 are implemented independently, they can be interconnected via a bus to complete communication. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc., but this does not imply that there is only one bus or one type of bus.
[0121] Optionally, in a specific implementation, if the communication interface 113, memory 112, and processor 111 are integrated on a single chip, then the communication interface 113, memory 112, and processor 111 can communicate through an internal interface.
[0122] The implementation principle and technical effects of the electronic device provided in this embodiment can be found in the foregoing embodiments, and will not be repeated here.
[0123] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the method described in any of the foregoing embodiments.
[0124] The aforementioned computer-readable storage media can be implemented from any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read Only Memory (EEPROM), Erasable Programmable Read Only Memory (EPROM), Programmable Read Only Memory (PROM), Read Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The readable storage medium can be any available medium accessible to a general-purpose or special-purpose computer.
[0125] An exemplary readable storage medium is coupled to a processor, enabling the processor to read information from and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can reside in an application-specific integrated circuit (ASIC). Alternatively, the processor and the readable storage medium can exist as discrete components in a program execution permission processing device.
[0126] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the methods described in any of the foregoing embodiments.
[0127] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.
[0128] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.
Claims
1. A model training method, characterized in that, include: Acquire sample images and labeled data of cracks in the sample images, wherein the cracks in the sample images are generated based on cosine curves that conform to the characteristics of formation cracks, and the cracks include micro-cracks; The sample image is input into the target detection model. Based on the fusion factor between adjacent layers in the Feature Pyramid Network (FPN), crack detection is performed on the sample image to obtain the first crack detection result corresponding to the sample image. The target detection model includes a path aggregation network (PANet), which in turn includes a Feature Pyramid Network (FPN). The FPN contains a feature fusion structure, which, based on the fusion factor between adjacent layers in the FPN, upsamples the feature map output from the intermediate layer of the FPN and fuses it with the feature map output from the adjacent next layer. This controls the amount of information transmitted from the (i+1)th layer to the ith layer and reduces the gradient generated by the detection task in the FPN layers. Based on the first crack detection result and the labeled data, adjust the model parameters of the target detection model; The fusion factor is determined in the following way: Based on the position and size of the anchor frames in each layer of the FPN, the intersection-union ratio (IOU) between each anchor frame and the crack in the sample image is determined; wherein the crack is marked by a bounding box, and the bounding box is completely aligned with the cosine curve; For each anchor frame, select the anchor frame with the largest IOU with the crack in the sample image as a positive sample and count it to obtain the number of cracks in the corresponding layer of the sample image; The fusion factor between adjacent layers of the FPN is determined based on the number of cracks in each layer of the sample image.
2. The model training method according to claim 1, characterized in that, The fusion factor satisfies the following formula: in, and Representing the first of the FPNs Layer and first The number of cracks in the layer, where i is an integer greater than 1.
3. The model training method according to claim 1, characterized in that, The sample images were obtained in the following way: Obtain a first image dataset, which is an image dataset generated by adjusting the parameters of the cosine curve generated based on the crack simulation cosine function, and the cosine curve contains random noise; Based on the principle of left addition and right subtraction, the cosine curve is shifted left and right to randomly generate multiple new images, thus obtaining the second image dataset; Based on the VOC2007 standard dataset format, the training dataset is determined according to the second image dataset and the corresponding XML format labeled dataset. The XML format labeled dataset is generated by labeling the second image dataset using the data labeling tool Labelimg.
4. The model training method according to claim 3, characterized in that, The second image dataset further includes: images generated by data augmentation of the second image dataset using computer image processing methods, wherein the computer image processing methods include at least one of: mirroring, rotation, scaling, cropping, color dithering, changing light intensity, changing contrast, image reduction, stitching, and fusion.
5. A crack detection method, characterized in that, include: Acquire electrical imaging logging images of the area to be detected; The electrical imaging logging image is input into the target detection model for fracture detection to obtain the fracture detection result of the area to be detected. The target detection model is trained by the model training method as described in any one of claims 1 to 4.
6. A model training device, characterized in that, include: The acquisition module is used to acquire sample images and labeled data of cracks in the sample images. The cracks in the sample images are generated based on cosine curves that conform to the characteristics of formation cracks, and the cracks include micro-cracks. A training module is used to input the sample image into the target detection model, and perform crack detection on the sample image based on the fusion factor between adjacent layers in the Feature Pyramid Network (FPN) to obtain a first crack detection result corresponding to the sample image. The target detection model includes a path aggregation network (PANet), which in turn includes a feature pyramid network (FPN). The FPN contains a feature fusion structure, which is used to upsample the feature map output from the intermediate layer of the FPN and fuse it with the feature map output from the next adjacent layer, based on the fusion factor between adjacent layers in the FPN. This controls the amount of information transmitted from the (i+1)th layer to the ith layer and reduces the gradient generated by the detection task in the FPN layers. The fusion factor is determined based on the number of cracks in the sample image learned by each layer of the FPN. The module also adjusts the model parameters of the target detection model based on the first crack detection result and the labeled data. The fusion factor is determined in the following way: Based on the position and size of the anchor frames in each layer of the FPN, the intersection-union ratio (IOU) between each anchor frame and the crack in the sample image is determined; wherein the crack is marked by a bounding box, and the bounding box is completely aligned with the cosine curve; For each anchor frame, select the anchor frame with the largest IOU with the crack in the sample image as a positive sample and count it to obtain the number of cracks in the corresponding layer of the sample image; The fusion factor between adjacent layers of the FPN is determined based on the number of cracks in each layer of the sample image.
7. An electronic device, characterized in that, include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the method as described in any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Weak and small target detection method based on FPN fusion factors
CN111950612A
Crack identification method and device, electronic equipment, storage medium and program product
CN116071647A