An electro-imaging image restoration method based on multi-dimensional and multi-scale dilation Transformer
Through the electro-imaging image repair method based on multi-dimensional multi-scale expansion Transformer, the natural repair problem of blank strips in electro-imaging log image repair is solved, and the effective restoration of plate misalignment and layer features is achieved, which improves image quality.
Patent Information
- Application Number
- CN202411651801.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-19
- Publication Date
- 2025-09-02
- Estimated Expiration
- 2044-11-19
AI Technical Summary
The existing electro-image logging image repair method is not natural enough to repair the blank strips, and there is a problem of inability to restore plate misalignment, layer characteristics and plate discontinuity.
The electro-imaging image repair method based on multi-dimensional multi-scale expansion Transformer is adopted. Deep feature maps are extracted through the encoding module, and global context information is modeled using the Transformer main module, and image style feature information is added during the repair process, and the final repair image is generated through the decoding and fusion modules.
The natural repair of blank strips is achieved, the image matrix background processing and the restoration effect of layer features is improved, and the details and style consistency of the repaired image are improved.
Smart Images

Figure CN119559095B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of application of electrical imaging logging data, and in particular to an electrical imaging image restoration method based on a multi-dimensional and multi-scale expansion Transformer. Background Art
[0002] Electrical imaging logging, a key technology in modern geophysical logging, plays a vital role in oil and gas exploration and development due to its ability to provide high-resolution stratigraphic images. Using rotary scanning measurements downhole, a large amount of stratigraphic information is collected along the circumference of the wellbore. Image processing techniques are then used to generate two-dimensional images of the wellbore wall. This technology demonstrates unique advantages in engineering logging applications such as evaluating fracture-cavity reservoirs, low-porosity and low-permeability layers, and complex lithologic reservoirs, as well as in determining mechanical parameters such as formation pressure and geostress. 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 factors can negatively impact the image, such as blank bands, compression and stretching due to stuck electrodes, plate misalignment, bad electrodes, and wellbore wall lamination, severely impacting subsequent evaluation. Therefore, electrical imaging image restoration, a prerequisite for subsequent reservoir evaluation, has become a challenge that must be overcome. However, electrical imaging logging image restoration still faces the following challenges:
[0003] (1) Slow repair speed: The Filtersim algorithm commonly used for electrical imaging image repair at home and abroad is based on multi-point geological statistics and needs to search for 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.
[0004] (2) Poor repair effect for large areas: The Criminisi method is the most classic texture-based image repair method. This algorithm is suitable for images with large damaged areas. During the repair process of electrical imaging images, 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 search for 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 heterogeneity, there is matching uncertainty, which leads to abnormal image repair results.
[0005] (3) Poor restoration of matrix background and reservoir characteristics: Electromagnetic imaging images can be divided into matrix background and geological characteristics based on their importance, which are also important evaluation annotations for electromagnetic image restoration. The Criminisi algorithm simply splices images from other locations and cannot restore the stratigraphic background. Although the Filtersim algorithm restores the matrix background better, it still cannot restore the laminae characteristics. DeepFillV2 has improved in laminae feature restoration compared to Filtersim, but the plate discontinuity problem has not been solved.
[0006] In summary, the existing electrical imaging logging image restoration methods are not natural enough in repairing blank strips, and there are problems such as the inability to restore plate dislocation, lamination features, 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 problems in the existing electrical imaging logging image restoration method that the restoration of blank strips is not natural enough and there is an inability to restore the plate misalignment, lamination characteristics and plate discontinuity.
[0008] To achieve the above objectives, the present invention provides an electrical imaging image restoration method based on a multidimensional and multiscale dilation transformer. The electrical imaging image restoration method based on a multidimensional and multiscale dilation 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, undergo layer-by-layer convolution operations, and extract deep feature maps. At the same time, the above features are updated through masks and then input into the main module of the Transformer.
[0011] S3: The above deep feature maps enter the five Transformer main modules, using the multi-dimensional and multi-scale expansion self-attention mechanism to gradually model the global context information of the image;
[0012] S4: When using the Transformer main module 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, input mask, output image of the first stage and 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] The specific operation process of the multi-dimensional and multi-scale expanded masked self-attention module is 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 weight 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] 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 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 It is the normalized input, and <> indicates the dot product.
[0026] 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.
[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 during the restoration process are to input random noise into a normalization module and generate a style vector after passing through 8 layers of fully connected layers. This vector is used to add image style feature information during 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 modulation module is obtained by fusing w and w′.
[0035] 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 the same shape as x and a value of 0.5 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;
[0036] x′=x*map+map2(1-map)
[0037] In step S6, the second fusion occurs in the fusion module, which splices the output image of the first stage, the original input image, and the mask image together to obtain the x input feature map, and obtains a vector with a value of 0.5 that has the same shape as x. Then, 10% of the elements are randomly discarded to obtain the map vector, and the style vector of the style modulation module is mapped to the 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 present 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 using 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. The method adds image style feature information during the restoration process using a style modulation module, and then decodes the image 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 the final restored image. The above method makes the restoration of blank strips more natural, and both the image matrix background processing and the layer 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 following briefly introduces the drawings required for use in the embodiments or the description of the prior art. 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 any creative work.
[0040] Figure 1 This is the overall structural diagram of the electro-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 diagram of the downsampling 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 This is a comparison chart of the blank strip repair effects of the five algorithms provided by the present invention.
[0045] Figure 6 This is a comparison chart of the five algorithms provided by the present invention for the repair effect of plate misalignment.
[0046] Figure 7 These are comparison pictures before and after repair of other abnormal phenomena provided by the present invention.
[0047] Figure 8 This 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] The following describes embodiments of the present invention in detail, 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 are not to 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, undergo layer-by-layer convolution operations, and extract deep feature maps. At the same time, the above features are updated through masks and then input into the main module of the Transformer.
[0052] S3: The above deep feature maps enter the five Transformer main modules, using the multi-dimensional and multi-scale expansion self-attention mechanism to gradually model the global context information of the image;
[0053] S4: When using the Transformer main module 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, input mask, output image of the first stage and 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 image style feature information in the restoration process during processing, and then 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. Finally, the fusion module is used to fuse the input image, input mask, output image of the first stage and style feature information for the second time to obtain the final restored image. The above method makes the restoration of blank strips more natural, and both the image matrix background processing and the texture feature restoration show good results.
[0057] Furthermore, 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.
[0058] In this embodiment, during 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 has been 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 together 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. They also support mask input and only perform partial convolution on the area supported by the mask, ultimately generating an output feature map of smaller size but with high-dimensional features. Through this process, this technical solution can extract more abstract image features and provide richer contextual 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 the feature splicing 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 values between different network layers to differ too much, thereby causing instability during training. Therefore, this technical solution chooses to fuse multi-layer features through feature splicing, avoiding the cumulative effect and numerical instability problems brought by the residual structure, thereby improving the stability of training and model performance.
[0061] The specific operation process of the multi-dimensional and multi-scale expanded masked self-attention module is 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 weight 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] 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 i QX 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 It is the normalized input, and <> indicates the 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 rule is 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 eventually 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 at 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 a non-saturating adversarial loss to optimize the model architecture and improve the quality and diversity of the 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, the non-saturated adversarial loss can better preserve details and image clarity. In addition, a regularization term is introduced to prevent the discriminator from being overly sensitive to small changes in the input data. Such regularization helps stabilize the GAN training process. 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 adopted, but in practice a relatively low weight coefficient is set. It can be observed that a lower perceptual loss coefficient is easier to optimize during the training process and has a significant effect on improving 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 of the log-likelihood of the discriminator and the negative of the log-likelihood of the true data judged as true and the negative 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 is able to generate high-quality, realistic false data.
[0078] Furthermore, in step S4, the specific steps of using the style modulation module to add image style feature information during the restoration process are as follows: random noise is input into a normalization module, and after passing through 8 fully connected layers, a style vector is generated, which is used to add image style feature information during 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. The final style modulation 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 modulation module is obtained by fusing w and w′.
[0086] Furthermore, 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;
[0087] x′=x*map+map2(1-map)
[0088] In step S6, the second fusion occurs in the fusion module, which splices the output image of the first stage, the original input image, and the mask image together to obtain the x input feature map, and obtains a vector with a value of 0.5 that has the same shape as x. Then, 10% of the elements are randomly discarded to obtain the map vector, and the style vector of the style modulation module is mapped to the 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 its implementation, this two-stage approach not only leverages the Transformer's global perception capabilities but also ensures that the texture and style of the restored image remain consistent with the original through the introduction of a style vector. By gradually integrating contextual information and style features, the entire model effectively improves the quality of complex image restoration.
[0090] Comparative Example 1, comparison of different algorithms:
[0091] This technical solution compared Criminisi, Filtersim, DeepFillV2, LaMa, and our WWDT algorithm. The FID metric was calculated using an InceptionV3 network with a 2048-dimensional vector output, without using a pre-trained model. The results are shown in Table 1. Criminisi ranked last in all parameters, while Filtersim performed well among traditional electro-imaging image restoration algorithms. Among deep learning algorithms, our WWDT ranked first in all parameters. Its FID metric was 2.1, 9.73, 24.48, and 48.64 higher than LaMa, DeepFillV2, Filtersim, and Criminisi, respectively. The average values of the other three metrics were 0.35, 0.58, 1.28, and 1.78 higher than those of 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] Because neural network algorithms can utilize GPUs for massively parallel computing, despite their larger computational workload, they are often faster than traditional algorithms. Several algorithms were used to fill a 10-meter-long well section with electrical imaging logging images. The Criminisi algorithm, due to its slowness, only filled 10 meters. The resulting times are shown in Table 2. As can be seen, the Criminisi algorithm's excessive slowness renders it unsuitable for practical use. The Filtersim algorithm, lacking GPU acceleration, was significantly slower than the neural network algorithms. WWDT was 0.225 seconds faster than LaMa and 0.62 seconds faster than DeepFillV2. Previous well logging interpretation software, such as Techelog, took 11 minutes to fill a 500-meter well section, but our WWDT only took 1 minute, significantly saving time in production.
[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 diagram of a section of FMI electrical imaging logging, with an image coverage rate of about 71% of the wellbore. Figure 5 (b) Figure 5 (c) Figure 5 (d) Figure 5 (e) and Figure 5 (f) The Criminisi algorithm is based on sample blocks to repair images, so there are obvious jagged edges between the plates and blank strips. In addition, the sample selection at the edge of the image is prone to errors; the Filtersim algorithm is better than Criminisi in repairing blank strips with smaller areas, but for large blank strips, there is still an extremely obvious plate discontinuity. DeepFillV2 has a good effect on repairing blank strips with smaller areas, and the range of the plate discontinuity phenomenon for large blank strips is smaller than Filtersim, but the middle part needs to be improved; the LaMa network is better than DeepFillV2 in repairing large blank strips, but there are still plate discontinuities in some places, and its boundary repair effect is relatively fuzzy; and 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 judging, the WWDT (Our) network of this technical solution has the best image filling effect.
[0102] Comparative Example 4: Comparison of plate dislocation repair effects:
[0103] like Figure 6 As shown in (a), when the logging instrument is stuck in the well and the plate is dislocated, the ordinary acceleration correction cannot restore its original geological characteristics. The electrical imaging image can be divided into matrix background and geological characteristics in terms of importance, 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) The Criminisi algorithm simply stitches images from other locations and is powerless to address this plate misalignment phenomenon. The Filtersim algorithm, while performing well on the image matrix background, still fails to restore laminae features. DeepFillV2 improves on laminae feature restoration compared to Filtersim, but the plate discontinuity problem remains. The LaMa network handles the matrix background better than Filtersim and DeepFillV2, but is less effective at handling plate discontinuities. While the WWDT (Our) network of our technical solution still has a small amount of blurred shadows, it demonstrates good results in both image matrix background processing and laminae feature restoration. Overall, the WWDT (Our) network performs best for restoring both the image matrix background and geological features.
[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 discontinuous cracks and slight misalignment, this algorithm can better repair the sinusoidal cracks; Figure 7 As shown in (c), for a certain plate with abnormally bright or dark areas, 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] The above disclosure is only a preferred embodiment of the present invention, and certainly cannot be used to limit the scope of the 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 in accordance with the claims of the present invention are still within the scope of the invention.
Claims
1. An electro-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, undergo layer-by-layer convolution operations, and extract deep feature maps. At the same time, the above features are updated through masks and then input into the main module of the Transformer. S3: The above deep feature maps enter the five Transformer main modules, using the multi-dimensional and multi-scale expansion self-attention mechanism to gradually model the global context information of the image; S4: When using the Transformer main module 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 image 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, input mask, output image of the first stage and image style feature information for the second time to obtain the final repaired image.
2. The method for inpainting an electrical image based on a multi-dimensional and multi-scale dilation transformer according to claim 1, wherein: 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 image based on a multi-dimensional and multi-scale dilation transformer according to claim 2, wherein: The Transformer main module includes four base 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 image based on a multi-dimensional and multi-scale dilation transformer according to claim 3, wherein: The specific operation process of the multi-dimensional and multi-scale expanded mask self-attention module is 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 weight 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 image based on a multi-dimensional and multi-scale dilation transformer according to claim 4, wherein: The operating formula of the multi-dimensional and multi-scale expanded mask self-attention module is: Where, is the linear transformation matrix of query, key and value for different attention heads, where i represents the i-th attention head, Q i , K i is the normalized query and key, V i is the value, X LN It is the normalized input feature map, and <> indicates dot product.
6. The method for inpainting an electrical imaging image based on a multi-dimensional and multi-scale dilation transformer according to claim 5, wherein: 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 image based on a multi-dimensional and multi-scale dilation transformer according to claim 6, wherein: The loss function module is used to calculate the loss function when updating the model weights at 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 image based on a multi-dimensional and multi-scale dilation transformer according to claim 7, wherein: In step S4, the specific steps of using the style modulation module to add image style feature information during the restoration process are as follows: random noise is input into a normalization module, and after passing through 8 fully connected layers, a style vector is generated. This vector is used to add image style feature information during the restoration process.
9. The method for inpainting an electrical image based on a multi-dimensional and multi-scale dilation transformer according to claim 8, wherein: 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, where x is the input feature, so the shape of x is the shape of the input feature, 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 modulation 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 according to claim 9, wherein: In step S5, the first fusion occurs in the third Transformer main module processing stage. Set the input to x, obtain a vector with the same shape as x and a value of 0.5, then randomly discard 10% of the elements to obtain a map vector, and map the style vector of the style modulation module 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, which splices the output image of the first stage, the original input image, and the mask image together to obtain the x input feature map, and obtains a vector with a value of 0.5 that has the same shape as x. Then, 10% of the elements are randomly discarded to obtain the map vector, and the style vector of the style modulation module is mapped to the 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