Electric imaging image restoration method based on multi-dimensional multi-scale expansion Transform
Through the electro-imaging image repair method based on multi-dimensional multi-scale expansion Transformer, the problems of unnatural blank band repair, plate misalignment and poor layer feature reduction in electro-imaging well log image repair are solved, and a more natural repair effect and better image quality are achieved.
Patent Information
- Application Number
- CN202411651801.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-19
- Publication Date
- 2025-03-04
- Estimated Expiration
- 2044-11-19
AI Technical Summary
The existing electro-imaging well logging image repair methods are not natural enough to repair blank strips, and there are problems such as plate misalignment, layer characteristics and plate discontinuity.
The electro-imaging image repair method based on multi-dimensional multi-scale expansion Transformer is adopted. The deep feature map is extracted through the encoding module, and the Transformer main module is used to process the multi-dimensional multi-scale expansion self-attention mechanism, and image style feature information is added during the repair process, and the final repair image is generated through the decoding module and the fusion module.
This achieves a more natural repair of blank strips, improves the effect of image matrix background processing and layer feature restoration, solves the problem of plate discontinuity, and significantly improves the details and style consistency of the repaired image.
Smart Images

Figure CN119559095A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of electrical imaging logging data application technology, and in particular to an electrical imaging image restoration method based on a multi-dimensional and multi-scale expansion Transformer. Background Art
[0002] As an important technology in the field of modern geophysical logging, electrical imaging logging technology plays a vital role in oil and gas exploration and development because it can provide high-resolution stratigraphic images. By using rotary scanning measurement in the wellbore, a large amount of stratigraphic information is collected along the circumference of the wellbore, and then a two-dimensional image of the wellbore wall is obtained through image processing technology. It shows its unique advantages in engineering logging problems such as fracture-cavity reservoirs, low-porosity and low-permeability layers, and complex lithology reservoir evaluation, as well as the determination of mechanical parameters such as formation pressure and ground stress. However, the image quality of electrical imaging logging is affected by instrument parameters and status, measurement and preprocessing accuracy, wellbore environment and geological factors. These influencing factors cause negative effects on the image, such as blank strips, compression and stretching when encountering jams, plate dislocation, bad electrodes, and wellbore wall adhesion, which seriously affect the subsequent evaluation. Therefore, electrical imaging image repair has become a difficulty that must be overcome as a prerequisite for subsequent reservoir evaluation. However, electrical imaging logging image repair still faces the following difficulties:
[0003] (1) Slow repair speed: The Filtersim algorithm commonly used in electrical imaging image repair at home and abroad is based on multi-point geological statistics and needs to find the best pattern matching block in the blank area in the entire image area. This global search method is not only time-consuming, but also ignores the local similarities between images. The repair speed is relatively slow, which is not conducive to the actual electrical imaging logging image repair.
[0004] (2) Poor repair effect in large areas: The Criminisi method is the most classic texture-based image repair method. This algorithm is suitable for images with large damaged areas. In the process of electrical imaging image repair, more regularly distributed textures will be generated, but the structure is discontinuous and does not conform to the visual habits of the human eye. The Filtersim algorithm is based on multi-point geological statistics and needs to find the best pattern matching block in the blank area in the entire image area. This global search method is not only time-consuming, but also ignores the local similarity between images. The repair speed is relatively slow, which is not conducive to the actual electrical imaging logging image repair. When repairing large areas and formations with serious non-uniformity, there is matching uncertainty, which leads to abnormal image repair results.
[0005] (3) Poor restoration of matrix background and reservoir characteristics: In terms of importance, electrical imaging images can be divided into matrix background and geological characteristics, which are also important evaluation annotations for electrical imaging image restoration. The Criminisi algorithm simply splices images from other places and cannot restore the formation background; although the Filtersim algorithm restores the image matrix background better, it still cannot restore the laminae characteristics; DeepFillV2 has improved in laminae feature restoration compared to Filtersim, but the plate discontinuity phenomenon has not yet been solved.
[0006] In summary, the existing electrical imaging logging image repair methods are not natural enough for the repair of blank strips, and there are problems such as the inability to restore the plate misalignment, lamination characteristics and plate discontinuity. Summary of the invention
[0007] The purpose of the present invention is to provide an electrical imaging image restoration method based on a multi-dimensional and multi-scale expansion Transformer to solve the problem that the electrical imaging logging image restoration method in the prior art is not natural enough in repairing blank strips and cannot restore the plate misalignment, lamination characteristics and plate discontinuity problems.
[0008] To achieve the above object, the present invention provides an electrical imaging image restoration method based on a multi-dimensional and multi-scale expansion Transformer, and the electrical imaging image restoration method based on a multi-dimensional and multi-scale expansion Transformer comprises the following steps:
[0009] S1: The input image is processed by channel convolution and converted into a feature representation of 192 channels;
[0010] S2: The above features enter the encoding module, and after layer-by-layer convolution operations, the deep feature map is extracted. At the same time, the above features are updated through masks and input into the Transformer main module;
[0011] S3: The above deep feature maps enter the five Transformer main modules, and the global context information of the image is gradually modeled using the multi-dimensional and multi-scale expansion self-attention mechanism;
[0012] S4: When the Transformer main module is used to process the deep feature map, the style modulation module is used to add image style feature information during the restoration process;
[0013] S5: The feature map processed by the Transformer main module is decoded by the decoding module to generate the output image of the first stage. After being processed by the third Transformer main module, the model performs the first fusion to combine the generated style feature information with the image features to enhance the details and style consistency of the restored image.
[0014] S6: Use the fusion module to fuse the input image, the input mask, the output image of the first stage, and the style feature information for the second time to obtain the final repaired image.
[0015] The encoding module consists of three convolutional layers, which are used to gradually downsample the height and width of the image by a factor of two, support mask input, perform partial convolution on the area supported by the mask, and generate an output feature map with high-dimensional features.
[0016] Among them, the Transformer main module includes four basic layers, a multi-dimensional and multi-scale expanded mask self-attention module, a mask update strategy module and a loss function module.
[0017] Among them, the operation process of the multi-dimensional and multi-scale expanded mask self-attention module is specifically as follows:
[0018] Perform layer normalization on the input multi-dimensional feature map to ensure that features of different scales maintain a stable numerical range before attention calculation;
[0019] The feature map is divided into multiple heads based on the channel dimension, and the query vector Q and key-value vector K are constructed respectively. The value vector V is directly obtained from the input feature map;
[0020] The cosine mask self-attention calculation is performed using the standardized Q and K vectors to reduce the computational complexity of traditional dot product attention on large-scale feature maps and introduce masks;
[0021] Use the attention weights to perform weighted summation on the value V vector and concatenate the results calculated by each head;
[0022] The concatenated results are input into the fully connected layer, and the features are further integrated and output through the fully connected layer.
[0023] Among them, the operating formula of the multi-dimensional and multi-scale expanded mask self-attention module is:
[0024] Cos_Mask_Attention(Q i ,K i ,V i ,mask)=softmax(<W i Q X LNi ,W i K X LN >+mask)W i V X
[0025] Where W iQ , W i K , W i V is the linear transformation matrix of query, key and value for different attention heads (i represents the i-th attention head), Q i , K i is the normalized query and key, V i is the value, X LN is the standardized input, and <> indicates a dot product.
[0026] Among them, the mask update strategy module is used to ensure that the model can gradually cover all valid tokens when processing input, so as to capture global information dependencies and ensure the effectiveness and comprehensiveness of the model.
[0027] The loss function module is used to calculate the loss function when updating the model weights in each iteration during the model training process, and then apply it after forward propagation and before backpropagation to adjust the model parameters by minimizing the loss.
[0028] Among them, in step S4, the specific steps of using the style modulation module to add image style feature information in the restoration process are: by inputting random noise into a normalization module and generating it through 8 fully connected layers, the vector is used to add image style feature information in the restoration process.
[0029] The operating formula of the style modulation module is specifically:
[0030] w=ε(n)
[0031] x′=B*x+(1-B)*Resize(w)
[0032] w′=f(x′)
[0033] style=fuse(w,w′)
[0034] Where w is a random style vector generated by random noise through the network, B is a random binary mask of shape x, each value is set to 0 and 1 with a probability of 50%, and the non-random style vector w′ is obtained by the mapping function with x′ as input. The feature expression of the style module is obtained by fusing w and w′.
[0035] Among them, in step S5, the first fusion occurs in the third Transformer main module processing stage, setting the input to be x, obtaining a vector with the same shape as x and a value of 0.5, and then randomly discarding 10% of the elements to obtain a map vector, mapping the style vector of the style modulation module to a shape map2 that matches the size of the feature map of x, and obtaining the fused feature vector x′ according to the following formula;
[0036] x′=x map+map2(1-map)
[0037] In step S6, the second fusion occurs in the fusion module, and the output image of the first stage, the original input image, and the mask image are spliced together to obtain the x input feature map, and a vector with a value of 0.5 that is the same shape as x is obtained. Then, 10% of the elements are randomly discarded to obtain a map vector, and the style vector of the style modulation module is mapped to a shape map2 that matches the size of the x feature map. Finally, the fused feature vector x′ is obtained according to the above formula.
[0038] The invention discloses an electro-imaging image restoration method based on a multi-dimensional and multi-scale expansion transformer. The method extracts the features of an input image through an encoding module to obtain a deep feature map, and processes the deep feature map through a transformer main module, thereby gradually modeling the global context information of the image through a multi-dimensional and multi-scale expansion self-attention mechanism, and uses a style modulation module to add image style feature information in the restoration process during processing, and then decodes it through a decoding module to generate an output image of the first stage. After being processed by a third transformer main module, the model performs a first fusion to combine the generated style feature information with the image features to enhance the details and style consistency of the restored image. Finally, the fusion module performs a second fusion on the input image, the input mask, the output image of the first stage, and the style feature information to obtain a final restored image. The above method makes the restoration of blank strips more natural, and both image matrix background processing and grain feature restoration show good effects. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0040] Figure 1 It is an overall structural diagram of the electrical imaging image restoration method based on the multi-dimensional and multi-scale expansion Transformer provided by the present invention.
[0041] Figure 2 It is a structural schematic diagram of the down-sampling module provided by the present invention.
[0042] Figure 3 It is a structural diagram of the Transformer main module provided by the present invention.
[0043] Figure 4 This is a schematic diagram of mask update provided by the present invention.
[0044] Figure 5 It is a comparison chart of the blank strip repair effects of the five algorithms provided by the present invention.
[0045] Figure 6 It is a comparison chart of the repair effects of the five algorithms provided by the present invention on the plate misalignment.
[0046] Figure 7 It is a comparison diagram before and after repair of other abnormal phenomena provided by the present invention.
[0047] Figure 8 It is the overall technical roadmap of the electrical imaging image restoration method based on the multi-dimensional and multi-scale expansion Transformer provided by the present invention. DETAILED DESCRIPTION
[0048] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present invention, and should not be construed as limiting the present invention.
[0049] See also Figures 1 to 8 The present invention provides an electro-imaging image restoration method based on a multi-dimensional and multi-scale expansion Transformer, comprising the following steps:
[0050] S1: The input image is processed by channel convolution and converted into a feature representation of 192 channels;
[0051] S2: The above features enter the encoding module, and after layer-by-layer convolution operations, the deep feature map is extracted. At the same time, the above features are updated through masks and input into the Transformer main module;
[0052] S3: The above deep feature maps enter the five Transformer main modules, and the global context information of the image is gradually modeled using the multi-dimensional and multi-scale expansion self-attention mechanism;
[0053] S4: When the Transformer main module is used to process the deep feature map, the style modulation module is used to add image style feature information during the restoration process;
[0054] S5: The feature map processed by the Transformer main module is decoded by the decoding module to generate the output image of the first stage. After being processed by the third Transformer main module, the model performs the first fusion to combine the generated style feature information with the image features to enhance the details and style consistency of the restored image.
[0055] S6: Use the fusion module to fuse the input image, the input mask, the output image of the first stage, and the style feature information for the second time to obtain the final repaired image.
[0056] In this embodiment, the features of the input image are extracted by the encoding module to obtain a deep feature map, and the deep feature map is processed by the Transformer main module, so as to gradually model the global context information of the image through the multi-dimensional and multi-scale expansion self-attention mechanism, and the style modulation module is used to add the image style feature information in the restoration process during processing, and then the decoding module is used to decode to generate the output image of the first stage, and after being processed by the third Transformer main module, the model performs the first fusion to combine the generated style feature information with the image features to enhance the details and style consistency of the restored image, and finally the fusion module is used to fuse the input image, the input mask, the output image of the first stage and the style feature information for the second time to obtain the final restored image. The above method makes the restoration of the blank strip more natural, and the image matrix background processing and the restoration of the grain features show good results.
[0057] Furthermore, the encoding module is composed of three convolutional layers, which are used to gradually downsample the height and width of the image by a factor of two, and support mask input, perform partial convolution on the area supported by the mask, and generate an output feature map with high-dimensional features.
[0058] In this embodiment, in the actual training process, the input data will be converted into a tensor form and first enter the downsampling module. Assuming that the input tensor is processed, it can be multiplied by a specific mask value to generate an approximate real image containing missing information. In order to ensure that the model can obtain effective gradients and achieve regularization effects during the training process, the mask is usually processed, its value is subtracted by 0.5, and it is spliced with the original input data as the actual input of the model, such as Figure 2 As shown in the figure, the encoding module consists of three convolutional layers, which are mainly responsible for gradually downsampling the height and width of the image by a factor of two, and support mask input. Only partial convolution is performed on the area supported by the mask, and finally an output feature map with a smaller size but high-dimensional features is generated. Through this process, the technical solution can extract more abstract image features and provide richer context information for subsequent processing.
[0059] Furthermore, the Transformer main module includes four basic layers, a multi-dimensional and multi-scale expanded mask self-attention module, a mask update strategy module and a loss function module.
[0060] In this embodiment, after being processed by the encoding module, the data needs to be further converted into token form so as to serve as the input of the Transformer. At this stage, the input structure of the model consists of four base layers and one convolutional layer, and a feature concatenation method is used to replace the traditional residual learning mechanism, such as Figure 3 As shown in the figure, unlike the traditional Transforme module, the residual structure usually adds the output of each layer directly back to the main branch. As the network depth increases, the value in the main branch will gradually increase. This cumulative effect may cause the activation value differences between different network layers to be too large, thereby causing instability in the training process. Therefore, this technical solution chooses to fuse multiple layers of features through feature splicing, avoiding the cumulative effect and numerical instability problems caused by the residual structure, thereby improving the stability of training and model performance.
[0061] Among them, the operation process of the multi-dimensional and multi-scale expanded mask self-attention module is specifically as follows:
[0062] Perform layer normalization on the input multi-dimensional feature map to ensure that features of different scales maintain a stable numerical range before attention calculation;
[0063] The feature map is divided into multiple heads based on the channel dimension, and the query vector Q and key-value vector K are constructed respectively. The value vector V is directly obtained from the input feature map;
[0064] The cosine mask self-attention calculation is performed using the standardized Q and K vectors to reduce the computational complexity of traditional dot product attention on large-scale feature maps and introduce masks;
[0065] Use the attention weights to perform weighted summation on the value V vector and concatenate the results calculated by each head;
[0066] The concatenated results are input into the fully connected layer, and the features are further integrated and output through the fully connected layer.
[0067] Among them, the operating formula of the multi-dimensional and multi-scale expanded mask self-attention module is:
[0068] Cos_Mask_Attention(Q i ,K i ,V i ,mask)=softmax(<W iQ X LNi ,W i K X LN >+mask)W i V X
[0069] Where W i Q , W i K , W i V is the linear transformation matrix of query, key and value for different attention heads (i represents the i-th attention head), Q i , K i is the normalized query and key, V i is the value, X LN is the standardized input, and <> indicates a dot product.
[0070] Furthermore, the mask update strategy module is used to ensure that the model can gradually cover all valid tokens when processing input, thereby capturing global information dependencies and ensuring the effectiveness and comprehensiveness of the model.
[0071] In this embodiment, the mask is used to indicate whether a token is valid. The mask is determined by the input mask during initialization and is automatically updated according to specific rules during the forward propagation process. The update rules are as follows: as long as one or more tokens in the window are marked as valid before, then after the attention mechanism, all tokens in the window will be updated to be valid. On the contrary, if all tokens in the window were invalid before, they will remain invalid after the attention mechanism. Figure 4 As shown in the figure, from step 1 to step 2, after the calculation of the attention mechanism, all tokens in the upper left window are updated to be valid, while the tokens in other windows remain invalid. With the movement of multiple windows and the gradual effect of attention, the mask will be gradually updated, and finally all tokens will be marked as valid.
[0072] Furthermore, the loss function module is used to calculate the loss function when updating the model weights in each iteration during the model training process, and then apply it after forward propagation and before backpropagation to adjust the model parameters by minimizing the loss.
[0073] In this embodiment, the technical solution introduces non-saturating adversarial loss to optimize the model architecture and improve the quality and diversity of generated images. The reason why this technical solution does not use pixel-level MAE or MSE loss is that such loss functions often cause the generated images to have averaged blur. In contrast, non-saturated adversarial loss can better maintain details and image clarity. In addition, a regularization term is introduced to prevent the discriminator from being too sensitive to small changes in the input data. Such regularization helps stabilize the training process of GAN. By adding this regularization, the decision boundary of the discriminator becomes smoother, thereby reducing the mode collapse problem that may occur when the generator generates false data. Finally, perceptual loss is used, but a relatively low weight coefficient is set in practice. It can be observed that a lower perceptual loss coefficient can be more easily optimized during training and has a greater effect on the texture and perceptual quality of the image.
[0074] Among them, the operating formula of the loss function module is:
[0075] L G = -Ex′[logD(x′)]
[0076] L D =-E x [logD(x)]-E x′ [log(1-D(x′))]
[0077] In the formula, x′ is the fake data generated by the generator, D is the discriminator, and the loss function of the generator is L G It is the negative value of the log-likelihood that the discriminator judges the false data x′ as true, and the loss function of the discriminator L D It is the sum of the negative value of the log-likelihood of the discriminator and the negative value of the log-likelihood of the true data judged as true and the negative value of the log-likelihood of the false data judged as false. These two loss functions together constitute a minimization-maximization game in the training process, in which the generator tries to generate more and more realistic false data, while the discriminator tries to distinguish between real data and false data. In this way, the generator and the discriminator compete with each other and improve together, and finally the generator can generate high-quality and realistic false data.
[0078] Furthermore, in step S4, the specific steps of using the style modulation module to add image style feature information in the restoration process are as follows: random noise is input into a normalization module and generated through 8 fully connected layers. The vector is used to add image style feature information in the restoration process.
[0079] In this embodiment, the style modulation module dynamically adjusts the weight normalization of the convolution layer during the reconstruction process through an additional noise input, thereby manipulating the final output. Specifically, a random latent vector is first mapped to an intermediate latent space. The change factor of this intermediate space is more linear, making the decoupling of features in the latent space more obvious. The mapping process is completed by a neural network containing 8 fully connected layers, the purpose of which is to decouple highly coupled features in the feature space so that different features can change independently in the latent space. In order to further enhance the feature expression ability of the input noise, the non-random style vector needs to be learned from the deepest feature map and random noise, and the final style module is formed by the fusion of the non-random style vector and the random style vector. In this way, fine control of the generation process is achieved to adapt to diverse underground environments and complex geological conditions.
[0080] The operating formula of the style modulation module is specifically:
[0081] w=ε(n)
[0082] x′=B*x+(1-B)*Resize(w)
[0083] w′=f(x′)
[0084] style=fuse(w,w′)
[0085] Where w is a random style vector generated by random noise through the network, B is a random binary mask of shape x, each value is set to 0 and 1 with a probability of 50%, and the non-random style vector w′ is obtained by the mapping function with x′ as input. The feature expression of the style module is obtained by fusing w and w′.
[0086] Further, in step S5, the first fusion occurs in the third Transformer main module processing stage, the input is set to be x, a vector with a value of 0.5 with the same shape as x is obtained, and then 10% of the elements are randomly discarded to obtain a map vector, and the style vector of the style modulation module is mapped to a shape map2 that matches the size of the feature map of x, and the fused feature vector x′ is obtained according to the following formula;
[0087] x′=x map+map2(1-map)
[0088] In step S6, the second fusion occurs in the fusion module, and the output image of the first stage, the original input image, and the mask image are spliced together to obtain the x input feature map, and a vector with a value of 0.5 that is the same shape as x is obtained. Then, 10% of the elements are randomly discarded to obtain a map vector, and the style vector of the style modulation module is mapped to a shape map2 that matches the size of the x feature map. Finally, the fused feature vector x′ is obtained according to the above formula.
[0089] In the implementation, this two-stage processing method not only utilizes the global perception ability of Transformer, but also ensures that the texture and style of the restored image are consistent with the original image through the introduction of style vector. The entire model effectively improves the quality of complex image restoration by gradually integrating context information and style features.
[0090] Comparative Example 1, comparison of different algorithms:
[0091] This technical solution selected Criminisi, Filtersim, DeepFillV2, LaMa and the WWDT algorithm of this technical solution for comparison. The FID index was calculated using the InceptionV3 network with 2048-dimensional vector output, and no pre-training model was used. The results are shown in Table 1. Criminisi's parameters were at the bottom, and Filtersim performed well in the traditional electrical imaging image restoration algorithm. For deep learning algorithms, my WWDT ranked first in all parameters. For the FID index, it was 2.1, 9.73, 24.48, and 48.64 higher than LaMa, DeepFillV2, Filtersim, and Criminisi, respectively. For the mean values of the other three indicators, they were 0.35, 0.58, 1.28, and 1.78 higher than the other four algorithms, respectively.
[0092] Table 1 Comparison of different algorithms
[0093]
[0094] Note: The underlined numbers represent the best results for that metric.
[0095] Comparative Example 2, comparison of blank strip repair time:
[0096] Since the neural network algorithm can use GPU for large-scale parallel computing during calculation, although its calculation amount is large, its speed is often faster than traditional algorithms. Several algorithms were used to fill the electrical imaging logging image of a 10-meter-long well section. The Criminisi algorithm only filled 10 meters due to its slow speed. The time taken is shown in Table 2. It can be seen that the Criminisi algorithm loses its practical value due to its slowness, and the Filtersim algorithm is significantly slower than several neural network algorithms due to the lack of GPU acceleration. WWDT is 0.225 seconds faster than LaMa and 0.62 seconds faster than DeepFillV2. Previous logging interpretation software such as Techelog takes 11 minutes to fill a 500-meter well section, but our WWDT only takes 1 minute, which greatly saves actual production time.
[0097] Table 2 Comparison of filling speed of different algorithms
[0098]
[0099] Note: The underlined numbers represent the best results for that metric.
[0100] Comparative Example 3, comparison of blank strip repair effects:
[0101] The trained network model is used to fill in the electrical imaging logging data, which is then colored using a color code for visual observation. Figure 5 (a) is a dynamic imaging image of a section of FMI electrical imaging logging, with an image coverage rate of about 71%. Figure 5 (b) Figure 5 (c) Figure 5 (d) Figure 5 (e) and Figure 5 (f), Criminisi algorithm is based on sample blocks to repair images, so there are obvious jagged edges between the plates and blank strips. And the sample selection at the edge of the image is prone to errors; Filtersim algorithm is better than Criminisi in repairing blank strips with smaller areas, but for large blank strips, there is still a very obvious plate discontinuity phenomenon. DeepFillV2 has a good repair effect on blank strips with smaller areas, and the range of plate discontinuity phenomenon for large blank strips is smaller than Filtersim, but the middle part needs to be improved; LaMa network has a better repair effect on large blank strips than DeepFillV2, but there are still plate discontinuities in some places, and its boundary repair effect is relatively fuzzy; while the WWDT (Our) network of this technical solution is extremely natural in repairing both small and large blank strips, and the edge repair effect is also excellent. Comprehensively judged, the WWDT (Our) network of this technical solution has the best filling effect on the image.
[0102] Comparative Example 4, comparison of plate misalignment repair effects:
[0103] like Figure 6 As shown in (a), when the logging instrument is stuck in the well and the plate is misaligned, ordinary acceleration correction cannot restore its original geological characteristics. In terms of importance, the electrical imaging image can be divided into matrix background and geological characteristics, which are also important evaluation annotations for electrical imaging image restoration. Figure 6 (b) Figure 6 (c) Figure 6 (d) Figure 6 (e) and Figure 6 (f), Criminisi algorithm simply splices images from other places, and is powerless to solve this kind of plate dislocation phenomenon; although Filtersim algorithm restores the image matrix background better, it still cannot restore the laminae features; DeepFillV2 has improved in laminae feature restoration compared with Filtersim, but the plate discontinuity phenomenon has not been solved; LaMa network handles the matrix background better than Filtersim and DeepFillV2, but the plate discontinuity processing effect is poor; and the WWDT (Our) network of this technical solution still has a small amount of blurred shadows, but it shows good results in both image matrix background processing and laminae feature restoration. Comprehensively judged, WWDT (Our) network has the best effect on image matrix background and geological feature restoration.
[0104] Comparative Example 5, other abnormal phenomena repair demonstration:
[0105] like Figure 7 As shown in (a), when the logging instrument scrapes against the wellbore wall, this algorithm can better restore the lamination characteristics; Figure 7 As shown in (b), for the case of intermittent cracks and slight misalignment, this algorithm can better repair the sinusoidal cracks; Figure 7 As shown in (c), for a certain plate with abnormally high brightness or low darkness, this algorithm repairs the abnormal data and restores the formation characteristics as much as possible, such as Figure 7 As shown in (d), there is a large-scale fault phenomenon in the data. This algorithm restores the data distribution and completes the missing data as much as possible.
[0106] What is disclosed above is only a preferred embodiment of the present invention, and it certainly cannot be used to limit the scope of rights of the present invention. Ordinary technicians in this field can understand that all or part of the processes of the above embodiment and equivalent changes made according to the claims of the present invention still fall within the scope of the invention.
Claims
1. An electrical imaging image restoration method based on a multi-dimensional and multi-scale dilation Transformer, characterized in that: The steps include: S1: The input image is processed by channel convolution and converted into a feature representation of 192 channels; S2: The above features enter the encoding module, and after layer-by-layer convolution operations, the deep feature map is extracted. At the same time, the above features are updated through masks and input into the Transformer main module; S3: The above deep feature maps enter the five Transformer main modules, and the global context information of the image is gradually modeled using the multi-dimensional and multi-scale expansion self-attention mechanism; S4: When the Transformer main module is used to process the deep feature map, the style modulation module is used to add image style feature information during the restoration process; S5: The feature map processed by the Transformer main module is decoded by the decoding module to generate the output image of the first stage. After being processed by the third Transformer main module, the model performs the first fusion to combine the generated style feature information with the image features to enhance the details and style consistency of the restored image. S6: Use the fusion module to fuse the input image, the input mask, the output image of the first stage, and the style feature information for the second time to obtain the final repaired image.
2. The method for electrical imaging image restoration based on multi-dimensional and multi-scale expansion Transformer according to claim 1, characterized in that: The encoding module consists of three convolutional layers, which are used to gradually downsample the height and width of the image by a factor of two, support mask input, perform partial convolution on the area supported by the mask, and generate an output feature map with high-dimensional features.
3. The method for inpainting an electrical imaging image based on a multi-dimensional and multi-scale dilation transformer as claimed in claim 2, characterized in that: The Transformer main module includes four basic layers, a multi-dimensional and multi-scale expanded mask self-attention module, a mask update strategy module and a loss function module.
4. The method for inpainting an electrical imaging image based on a multi-dimensional and multi-scale dilation transformer as claimed in claim 3, characterized in that: The operation process of the multi-dimensional and multi-scale expanded mask self-attention module is specifically as follows: Perform layer normalization on the input multi-dimensional feature map to ensure that features of different scales maintain a stable numerical range before attention calculation; The feature map is divided into multiple heads based on the channel dimension, and the query vector Q and key-value vector K are constructed respectively. The value vector V is directly obtained from the input feature map; The cosine mask self-attention calculation is performed using the standardized Q and K vectors to reduce the computational complexity of traditional dot product attention on large-scale feature maps and introduce masks; Use the attention weights to perform weighted summation on the value V vector and concatenate the results calculated by each head; The concatenated results are input into the fully connected layer, and the features are further integrated and output through the fully connected layer.
5. The method for inpainting an electrical imaging image based on a multi-dimensional and multi-scale dilation transformer as claimed in claim 4, characterized in that: The operating formula of the multi-dimensional and multi-scale expanded mask self-attention module is: In the formula, is the linear transformation matrix of query, key and value for different attention heads (i represents the i-th attention head), Q i , K i is the normalized query and key, V i is the value, X LN is the standardized input, and <> indicates a dot product.
6. The method for inpainting an electrical imaging image based on a multi-dimensional and multi-scale dilation transformer as claimed in claim 5, characterized in that: The mask update strategy module is used to ensure that the model can gradually cover all valid tokens when processing input, thereby capturing global information dependencies and ensuring the effectiveness and comprehensiveness of the model.
7. The method for inpainting an electrical imaging image based on a multi-dimensional and multi-scale dilation transformer as claimed in claim 6, characterized in that: The loss function module is used to calculate the loss function when updating the model weights in each iteration during the model training process, and then apply it after forward propagation and before backpropagation to adjust the model parameters by minimizing the loss.
8. The method for inpainting an electrical imaging image based on a multi-dimensional and multi-scale dilation transformer as claimed in claim 7, characterized in that: In step S4, the specific steps of adding image style feature information in the restoration process using the style modulation module are as follows: random noise is input into a normalization module and generated through 8 fully connected layers. The vector is used to add image style feature information in the restoration process.
9. The method for inpainting an electrical imaging image based on a multi-dimensional and multi-scale dilation transformer as claimed in claim 8, characterized in that: The operating formula of the style modulation module is specifically: w=ε(n) x′=B*x+(1-B)*Resize(w) w′=f(x′) style=fuse(w,w′) Where w is a random style vector generated by random noise through the network, B is a random binary mask of shape x, each value is set to 0 and 1 with a probability of 50%, and the non-random style vector w′ is obtained by the mapping function with x′ as input. The feature expression of the style module is obtained by fusing w and w′.
10. The method for inpainting an electrical imaging image based on a multi-dimensional and multi-scale dilation transformer as claimed in claim 9, characterized in that: In step S5, the first fusion occurs in the third Transformer main module processing stage. The input is set to x, and a vector with a value of 0.5 with the same shape as x is obtained. Then 10% of the elements are randomly discarded to obtain a map vector. The style vector of the style modulation module is mapped to a shape map2 that matches the size of the feature map of x. The fused feature vector x′ is obtained according to the following formula; x′=x map+map2(1-map) In step S6, the second fusion occurs in the fusion module, and the output image of the first stage, the original input image, and the mask image are spliced together to obtain the x input feature map, and a vector with a value of 0.5 that is the same shape as x is obtained. Then, 10% of the elements are randomly discarded to obtain a map vector, and the style vector of the style modulation module is mapped to a shape map2 that matches the size of the x feature map. Finally, the fused feature vector x′ is obtained according to the above formula.
Citation Information
Patent Citations
Double-branch image restoration forgery detection method, system and device and storage medium
CN113744153A
Multi-scale image restoration method, storage medium and terminal
CN115018727A
Image generation method and related equipment
CN115205949A