A method for repairing holes in pressure-sensitive paint images

Through the pressure-sensitive paint image hole repair neural network combined with joint loss function and multi-scale feature extraction, it solves the limitations of repairing uneven texture and noise in the existing technology, achieves high-precision and efficient hole repair, and improves image repair. accuracy and reliability.

CN118469814BActive Publication Date: 2024-09-13LOW SPEED AERODYNAMIC INST OF CHINESE AERODYNAMIC RES & DEV CENT +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410940978.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-15
Publication Date
2024-09-13
Estimated Expiration
2044-07-15

AI Technical Summary

Technical Problem

Existing pressure-sensitive paint image hole repair methods have limited repair capabilities when dealing with uneven textures and severe noise, and traditional methods have high computational costs and slow repair speeds, making it difficult to obtain high-precision and accurate pressure data.

Method used

A pressure-sensitive paint image hole repair neural network is used to conduct deep learning training through the encoding and decoding stages combined with a joint loss function. Four-channel input tensors and masked binary images are used for multi-layer encoding and decoding processing, combined with regional convolution and automatic Attention network to extract multi-scale features to achieve high-precision hole repair.

Benefits of technology

It significantly improves the precision and accuracy of hole repair in pressure-sensitive paint images, can handle complex backgrounds and arbitrary mask areas more efficiently, reduces the impact of invalid information, and improves the quality of the repaired image.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118469814B
    Figure CN118469814B
Patent Text Reader

Abstract

The present invention relates to a method for repairing holes in a pressure-sensitive paint image, comprising: obtaining a pressure-sensitive paint image with holes, obtaining a mask binary image, performing mask processing on the pressure-sensitive paint image and the mask binary image to obtain a mask image, performing channel splicing on the mask image and the mask binary image to obtain a four-channel input tensor; using the four-channel input tensor and the mask binary image as inputs of a pressure-sensitive paint image hole repair neural network, and performing hole repair in an encoding stage and a decoding stage to obtain a repaired pressure-sensitive paint image. Compared with the prior art, the repaired method has higher precision and accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of pressure-sensitive coating pressure measurement, and in particular to a method for repairing holes in a pressure-sensitive coating image. Background Art

[0002] PSP (Phase Shifting Profilometry) technology is a non-contact full-field pressure measurement method based on image processing. The pressure-sensitive material is used as a coating to cover the surface of the model. When a laser or ultraviolet LED is used as the excitation light source, the luminescent molecules react with the oxygen in the coating to produce an oxygen quenching reaction. The fluorescence intensity change of the coating on the surface of the model is converted into a pseudo-color image through a CCD (Charge coupled Device) camera, and finally the surface pressure distribution is obtained through computer graphics processing.

[0003] In PSP technology, it is necessary to arrange image markers to carry out image correction and registration, and set pressure measuring holes to install sensors as comparison and reference for optical testing methods. These preset points have black holes due to the lack of pressure-sensitive paint, and the pressure-sensitive paint has fallen off, which affects the integrity of the pressure data. In order to obtain accurate pressure data, the holes in the image need to be repaired. At the same time, in the online calibration, the repaired pressure data needs to be calibrated with the measured pressure value to establish a relationship curve between the light intensity ratio and the pressure. Therefore, hole repair in PSP technology is crucial for obtaining the pressure field on the model surface.

[0004] In the current PSP technology, the repair of pressure-sensitive paint images is still processed using traditional algorithms. These include the FMM (Fast Marching) algorithm, the TV (Total Variation) global variation algorithm, and the Criminisi image repair algorithm. For example, in the current scheme, in the wind tunnel test image repair based on the Otsu and FMM methods, Otsu is used to segment the grayscale texture image for defects, and then the FMM algorithm is used for repair. This method takes a long time through two-stage operations and can only repair small-scale defects. Traditional methods can be mainly summarized into two categories, namely diffusion-based and block-based repair. The diffusion-based method repairs from the missing edge inward by solving high-order partial differential equations, which requires a large number of iterative operations, so the image repair speed is very slow. The block-based method solves this problem by searching for suitable blocks from the background and copying them to the missing area, but the computational cost of sample matching is high and the ability is limited. Summary of the invention

[0005] The technical problem to be solved by the present application is to provide a method for repairing holes in pressure-sensitive paint images, which has the characteristics of improving the repair precision and accuracy.

[0006] In a first aspect, an embodiment provides a method for repairing holes in a pressure-sensitive paint image, comprising:

[0007] Obtain a pressure-sensitive paint image with holes, and obtain a mask binary image;

[0008] Performing mask processing on the pressure-sensitive paint image and the mask binary image to obtain a mask image;

[0009] Concatenating the mask image and the mask binary image by channels to obtain a four-channel input tensor;

[0010] The four-channel input tensor and the mask binary image are used as inputs of a pressure-sensitive paint image hole repair neural network to perform hole repair to obtain a repaired pressure-sensitive paint image, including:

[0011] In the encoding stage, the encoder includes a first encoding processing layer, a plurality of second encoding processing layers, and a plurality of third encoding processing layers which are cascaded in sequence; the four-channel input tensor is used as the input of the encoder, and the mask binary image updated layer by layer and the output of the previous layer are used as the input of each layer in the encoder, and after multi-layer encoding processing, a first feature map containing high-level semantic features is obtained;

[0012] In the decoding stage, the decoder includes a plurality of first decoding processing layers and a second decoding processing layer cascaded in sequence; the first feature map is used as the input of the decoder, the output of the previous layer, the output of the corresponding encoding layer obtained by skip connection and the mask binary map updated layer by layer are used as the input of each layer in the decoder, and the spatial information is restored after multi-layer decoding processing to obtain the pressure-sensitive paint image after hole repair;

[0013] Among them, the pressure-sensitive paint image hole repair neural network is a neural network model obtained by deep learning training combined with a joint loss function.

[0014] The beneficial effects of the present invention are:

[0015] Since the four-channel input tensor and the mask binary image are used as the input of the pressure-sensitive paint image hole repair neural network, the hole repair is performed through the encoding stage and the decoding stage to obtain the repaired pressure-sensitive paint image, so that the repaired pressure-sensitive paint image has higher precision and accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 This is a schematic diagram of a method for repairing holes in a pressure-sensitive paint image according to an embodiment of the present application;

[0017] Figure 2 This is a schematic diagram of a neural network architecture for repairing holes in pressure-sensitive paint images according to an embodiment of the present application;

[0018] Figure 3This is a schematic diagram of a feature extraction network architecture of an embodiment of the present application;

[0019] Figure 4 This is a flow chart of a method for processing input by a feature extraction network according to an embodiment of the present application;

[0020] Figure 5 This is a schematic diagram showing the principle of regional convolution and general convolution in this application;

[0021] Figure 6 It is a flowchart of a method for processing input by regional convolution in an encoder according to an embodiment of the present application;

[0022] Figure 7 It is a schematic diagram of the architecture of regional convolution in an encoder according to an embodiment of the present application;

[0023] Figure 8 It is a flowchart of a method for processing input by regional convolution in a decoder according to an embodiment of the present application;

[0024] Fig. 9 This is a schematic diagram of a pyramid self-attention architecture of an embodiment of the present application;

[0025] Fig.10 This is a flowchart of a method for processing input by a self-attention network according to an embodiment of the present application;

[0026] Fig.11 This is a schematic diagram of the self-attention network architecture of an embodiment of the present application. DETAILED DESCRIPTION

[0027] The present invention is further described in detail below by specific embodiments in conjunction with the accompanying drawings. Wherein similar elements in different embodiments adopt associated similar element numbers. In the following embodiments, many detailed descriptions are for making the present application better understood. However, those skilled in the art can easily recognize that some features can be omitted in different situations, or can be replaced by other elements, materials, methods. In some cases, some operations related to the present application are not shown or described in the specification, this is to avoid the core part of the present application being overwhelmed by too much description, and for those skilled in the art, it is not necessary to describe these related operations in detail, and they can fully understand the related operations according to the description in the specification and the general technical knowledge in the art.

[0028] In addition, the features, operations or characteristics described in the specification can be combined in any appropriate manner to form various implementations. At the same time, the steps or actions in the method description can also be interchanged or adjusted in a manner that is obvious to those skilled in the art. Therefore, the various sequences in the specification and the drawings are only for the purpose of clearly describing a certain embodiment and are not meant to be a required sequence, unless otherwise specified that a certain sequence must be followed.

[0029] The serial numbers assigned to the components in this article, such as "first", "second", etc., are only used to distinguish the objects described and do not have any order or technical meaning.

[0030] To facilitate the description of the inventive concept of the present application, the pressure-sensitive paint image hole repair technology used in the PSP technology is briefly described below.

[0031] The application of deep learning technology in the field of image processing is becoming more and more extensive, especially neural networks, whose powerful feature learning and pattern recognition capabilities can achieve accurate and efficient processing. However, in the field of PSP, the application of deep learning is still insufficient. In the study of pressure-sensitive paint image registration and restoration methods, a restoration method based on deep learning is proposed in the current scheme. This method is a transfer learning based on the HRII-MSNPS algorithm.

[0032] However, the applicant found in the study that the above method is only effective for repairing images with uniform grayscale textures. When there are uneven textures and severe noise, its repair ability has certain limitations. Due to the particularity of pressure-sensitive paint images, the pixels at the pressure measuring holes and marking points fluctuate greatly, and the difference with the pixel values ​​of their neighborhoods is also large, which is in sharp contrast to the relatively gentle change of the pixel values ​​around them. If the standard convolution operation is used to equally sample the two types of areas to derive the missing areas, the light intensity ratio data at the holes such as the pressure measuring holes will be significantly wrong after repair, thereby affecting the overall pressure distribution. Although PConv (Image inpainting for irregular holes using partial convolutions) and GatedConv (Free-form image inpainting with gated convolution) have improved the performance of the image repair model through new convolution methods, they still use the convolution method of fixed sampling windows. When there is invalid information in the sampling area, this problem still exists.

[0033] In addition, due to the particularity of pressure-sensitive paint images, such as texture characteristics, the restoration process mainly relies on its low-level features, which can represent richer details, patterns and textures at different scales. Therefore, in order to capture relevant feature responses at multiple scales, non-local operations can be introduced into the network. The literature also proves that cross-scale self-similarity can bring significant benefits to image restoration. Expanding the search space increases the possibility of finding a better match. A cross-scale focus is also proposed in the current technology, and the most advanced results have been achieved in image super-resolution. However, the applicant also found that the scheme can only capture the correlation of two integer scales and has an additional upsampling process, so it is not suitable for general image restoration.

[0034] In view of this, a method for repairing holes in a pressure-sensitive paint image is provided in a specific embodiment of the present application, which further improves the repair accuracy and can achieve a repair effect with higher accuracy and better reliability.

[0035] The pressure-sensitive paint image hole repair method provided in one embodiment of the present application is provided in Figure 1 ,include:

[0036] Step S10, obtaining a pressure-sensitive paint image with holes, and obtaining a mask binary image.

[0037] In one embodiment, the pressure-sensitive paint image with holes can be represented by I, and the mask binary image can be represented by m.

[0038] Step S20, performing mask processing on the pressure-sensitive paint image and the mask binary image to obtain a mask image.

[0039] In one embodiment, the mask image can be used To indicate that, Represents pixel-by-pixel multiplication.

[0040] Step S30, concatenating the mask image and the mask binary image by channels to obtain a four-channel input tensor.

[0041] Please refer to Figure 2 , © represents channel concatenation, and the mask image and the mask binary image are superimposed to obtain a four-channel input tensor I in .

[0042] Step S40, using the four-channel input tensor and the mask binary image as inputs of a pressure-sensitive paint image hole repair neural network, and performing hole repair to obtain a repaired pressure-sensitive paint image.

[0043] Among them, the pressure-sensitive paint image hole repair neural network is a neural network model obtained by deep learning training combined with a joint loss function.

[0044] In one embodiment, the joint loss function includes:

[0045] ;

[0046] in, represents the joint loss function, Represents the mean absolute error loss function between the predicted value and the true value of the unmasked area, Represents the mean absolute error loss function between the predicted value and the true value of the mask area, represents the total variational loss function, represents the perceptual loss function, represents the style loss function.

[0047] Perceptual loss can be calculated based on the VGG-16 feature extractor and style loss , generating a total variational loss based on the predicted image , obtain the mask area loss based on the true value and predicted image , which is the hole loss, obtains the unmasked area loss based on the true value and the predicted image , which is the effective loss.

[0048] Step S401, in the encoding stage, after performing multi-layer encoding processing, a first feature map containing high-level semantic features is obtained.

[0049] The encoder includes a first encoding processing layer, a plurality of second encoding processing layers, and a plurality of third encoding processing layers that are cascaded in sequence. The four-channel input tensor is used as the input of the encoder, and the mask binary image updated layer by layer and the output of the previous layer are used as the input of each layer in the encoder.

[0050] In one embodiment, please refer to Figure 2 , the first encoding processing layer includes 1 layer, the second encoding processing layer includes 3 layers, and the third encoding processing layer includes 4 layers.

[0051] In the encoder, the input image is processed by general convolution to extract low-level features, the mask is updated synchronously at the output of each layer of the network through maximum pooling, the fine-grained features of the feature map are extracted through the second encoding processing layer, and finally deep features are extracted through the third encoding processing layer.

[0052] Step S402, in the decoding stage, multi-layer decoding processing is performed to restore spatial information and obtain a pressure-sensitive paint image after hole repair.

[0053] The decoder includes a plurality of first decoding processing layers and a second decoding processing layer cascaded in sequence. The first feature map is used as the input of the decoder, and the output of the previous layer, the output of the corresponding encoding layer obtained by skip connection, and the mask binary map updated layer by layer are used as the input of each layer in the decoder.

[0054] Those skilled in the art can understand that the skip connection refers to adding the input data directly to the output of a certain layer of the network. The corresponding encoding layer obtained by the skip connection here refers to the encoding layer symmetrically corresponding to the decoding layer.

[0055] In one embodiment, please refer to Figure 2 , the first decoding processing layer includes 7 layers, and the second decoding processing layer includes 1 layer.

[0056] In one embodiment, the first encoding processing layer includes a general convolutional network, the second encoding processing layer includes a feature extraction network and a self-attention network, and the third encoding processing layer includes a feature extraction network. The first decoding processing layer includes a feature extraction network, and the second decoding processing layer includes a general convolutional network.

[0057] In the decoder, the input of each decoding processing layer is composed of the output features of the corresponding layer of the encoder output of the previous layer, which are concatenated through jump connections, and finally the features are restored to a three-channel color image through general convolution.

[0058] In one embodiment, the method for the first encoding processing layer to process the input includes: performing general convolution processing on the four-channel input tensor to obtain a first general convolution processing feature map, performing maximum pooling update on the mask binary map, and multiplying the first general convolution processing feature map with the updated mask binary map pixel by pixel to obtain a first encoding feature map.

[0059] In one embodiment, the method for the second decoding processing layer to process the input includes: splicing the feature map output by the previous layer and the output of the first layer of the encoder, and masking the spliced ​​features with the mask binary map used in the previous layer, performing general convolution processing on the masked result to obtain a second general convolution processing feature map, performing maximum pooling update on the mask binary map used in the previous layer, and multiplying the updated mask binary map with the second general convolution processing feature map pixel by pixel to obtain a pressure-sensitive paint image after hole repair.

[0060] For the feature extraction network, the feature extraction network of the existing technology can be used. However, the particularity of the pressure-sensitive paint image makes the standard convolution operation limited in processing. The pixels at the pressure holes and landmarks fluctuate greatly, and the difference with their neighboring pixel values ​​is significant. The standard convolution operation samples all areas equally, which will cause the repaired image to have inaccurate light intensity ratio data at the pressure holes and landmarks. In addition, the convolution unit samples the input feature map within a fixed window, which limits the ability to model complex situations in computer vision, especially in the pressure-sensitive paint image repair task with masked areas at arbitrary positions.

[0061] In view of this, this application provides a new feature extraction network that can more intelligently process different areas in the pressure-sensitive paint image, and can adaptively expand the sampling area to avoid using invalid information, thereby more accurately repairing the missing area. At the same time, the feature extraction network has stronger modeling capabilities, can better deal with complex backgrounds and arbitrary mask areas, and achieve higher quality image restoration.

[0062] Please refer to Figure 3 , a feature extraction network provided by an embodiment of the present application includes a partial convolution layer, a regional convolution layer and a dynamic normalization layer. The upper layer output feature map and mask are superimposed as the input of the feature extraction network, and features are extracted through partial convolution and regional convolution. The mask is updated through maximum pooling, and after pixel-by-pixel multiplication, the missing area in the input is updated through this operation, and finally dynamic normalization is performed to obtain the output of this layer.

[0063] Please refer to Figure 4 , the method by which the feature extraction network processes the input includes:

[0064] Step S100, masking the feature map output by the previous layer and the mask binary map used by the previous layer, and performing partial convolution processing on the result after the masking processing to obtain a partial convolution feature map.

[0065] In one embodiment, the masked result is subjected to partial convolution processing to obtain a partial convolution feature map, including:

[0066] Apply general convolution to some of the preset feature map channels in the masked result to extract spatial features and obtain some convolution feature maps.

[0067] Since feature maps have high similarity between different channels, partial convolution is used in the feature extraction network of this application to optimize the cost. Specifically, general convolution is applied to only a part of the input feature map channels for spatial feature extraction, and the remaining channels remain unchanged. Considering that the input and output feature maps have the same number of channels, the floating point number FLOPs calculation of partial convolution can be expressed as:

[0068] ;

[0069] in, h represents the length of the feature map, w represents the width of the feature map, k represents the size of the convolution kernel, c p Represents the number of channels for feature extraction. It can be seen that when c p / c a =1 / 4, the floating point number (that is, the amount of calculation) of the partial convolution is only 1 / 16 of the general convolution. c a Indicates the number of feature channels.

[0070] Step S200, subjecting part of the convolution feature map to regional convolution processing to obtain a regional convolution feature map.

[0071] There are feature extraction networks in the encoder and decoder respectively. Since the regional convolution processing in the feature extraction networks of the encoder and decoder is different, the regional convolution processing method in the encoder feature extraction network and the regional convolution processing method in the decoder are introduced respectively as follows.

[0072] In the feature extraction network of the encoder, the partial convolution feature map and the mask binary map used for the partial convolution processing are taken as input, and the regional convolution feature map is obtained through regional convolution processing.

[0073] For ease of understanding, general convolution and area convolution are explained below.

[0074] Please refer to Figure 5 , The left figure is a general convolution, and the right figure is a regional convolution, where the hollow circles represent valid pixels, the circles filled with diagonal lines represent invalid pixels, and the solid line box represents the sampling area.

[0075] In a general convolution unit, the input features are sampled on a regular grid window S, which defines the receptive field and dilation size of the convolution unit. The sampled data is weighted and summed by the convolution kernel weights to obtain the value of a certain position in the output feature map.

[0076] The application proposes the feature offset introduced by regional convolution. When the sampling area contains known areas (valid areas) and missing areas (invalid areas, such as holes), the offset of the missing area can be calculated to borrow known information to replace the invalid information that may cause errors. Subsequently, by extracting features through general convolution, the known light intensity ratio data in the pressure-sensitive paint image can be fully utilized, and invalid pixel values ​​at holes such as pressure measuring holes can be ignored, thereby significantly improving the accuracy of restoration.

[0077] The offset is learned from the input feature map through an additional convolution layer. This makes the sampling area no longer a fixed general convolution position, but needs to be expanded. The amount of expansion is the offset sampling area. The offset sampling area does not directly correspond to the actual pixel point on the feature map. Therefore, this application uses bilinear interpolation to obtain the offset pixel value to ensure back propagation. Any decimal coordinates can be obtained through bilinear interpolation .

[0078] In view of this, in one embodiment, please refer to Figure 6 and Figure 7 , in the encoder, the method of regional convolution processing includes:

[0079] Step S211, after channel stitching of the partial convolution feature map and the mask binary map used for the partial convolution processing, the overall offset of the channel stitching processing result is calculated to obtain the pixel value of each pixel after the offset, thereby obtaining the feature map after the offset.

[0080] In one embodiment, step S211 includes:

[0081] ;

[0082] in, Represents the pixel value of any pixel after offset. Represents any decimal coordinate, Represents the pixel value of any pixel point t in the splicing results of all channels, represents the pixel coordinate in the x dimension, represents the pixel coordinate in the y dimension, Represents the decimal coordinate of the x dimension, Represents the decimal coordinate of the y dimension; represents the bilinear interpolation kernel, , , .

[0083] Step S212, based on the offset feature map and the mask binary map used for partial convolution processing, a feature map that only retains the offset of the hole area is obtained.

[0084] In one embodiment, step 212 includes:

[0085] ;

[0086] in, Indicates that only the feature map of the hole area offset is retained. represents the feature map after offset, m represents the mask binary map used for partial convolution processing, represents part of the convolutional feature map, Represents pixel-by-pixel multiplication.

[0087] Figure 7 In the formula, ® represents mask region replacement, i.e. 1-m, Indicates pixel-by-pixel addition.

[0088] Step S213, performing general convolution processing on the feature map that only retains the offset of the hole area to extract features to obtain a regional convolution feature map.

[0089] In the extraction network of the decoder, the partial convolution feature map, the output of the corresponding coding layer obtained by skip connection, and the mask binary map used for partial convolution processing are taken as input, and the regional convolution feature map is obtained through regional convolution processing.

[0090] In one embodiment, please refer to Figure 8 , in the encoder, the method of regional convolution processing includes:

[0091] Step S221, after channel stitching of the partial convolution feature map and the mask binary map used for the partial convolution processing, the overall offset of the channel stitching processing result is calculated to obtain the pixel value of each pixel after the offset, thereby obtaining the feature map after the offset.

[0092] For the detailed description of step S221, please refer to the description of step S211.

[0093] Step S222, based on the offset feature map and the mask binary map used for partial convolution processing, obtain a feature map that only retains the offset of the hole area.

[0094] For the detailed description of step S222, please refer to the description of step S212.

[0095] Step S223, concatenating the feature map that only retains the offset of the hole area with the output of the corresponding coding layer to obtain a concatenated feature map.

[0096] Step S224, performing general convolution processing on the concatenated feature map to extract features to obtain a regional convolution feature map.

[0097] In the decoder, The acquisition method is the same as that in the encoder, except that before performing general convolution processing, the feature map that only retains the offset of the hole area is concatenated with the output of the corresponding encoding layer to obtain the concatenated feature map, and then the concatenated feature map is subjected to general convolution processing to extract features to obtain the regional convolution feature map.

[0098] Step S300, the mask binary image used in the previous layer is updated by maximum pooling, and the updated mask binary image is multiplied pixel by pixel with the regional convolution feature map, and the result of the pixel-by-pixel multiplication is dynamically normalized to obtain a feature extraction feature map.

[0099] In one embodiment, in step S300, the result of the pixel-by-pixel multiplication is dynamically normalized to obtain a feature extraction feature map, including: combining the weights corresponding to the BN, IN and LN dynamic learning normalization methods, and normalizing the result of the pixel-by-pixel multiplication by region to obtain a feature extraction feature map.

[0100] By performing normalization operations by region and considering the potential interference of mask distribution on normalization, effective information can be used more reasonably, thereby improving the performance and stability of the model.

[0101] For the attention network, the existing attention network can be used. However, the pressure-sensitive paint image, with its unique texture structure and rich details, places higher requirements on the processing of low-level features. Low-level features can more finely represent the details, patterns and textures of the image at different scales, which is crucial for the repair and restoration of pressure-sensitive paint images. However, the existing attention network mainly focuses on extracting global priors on single-scale features.

[0102] In view of this, a new attention network is proposed in the embodiment of the present application to model the long-range dependencies between features of different sizes, better capture the low-level feature information in the image, and thus improve the performance of pressure-sensitive paint image repair and restoration. Fig. 9 By expanding the original search space from a single feature map to a multi-scale feature pyramid, the correlation between multiple scales is calculated based on blocks, and block-by-block matching allows the network to pay more attention to relevant areas while suppressing irrelevant areas. The fully convolutional pyramid attention is used to accept any input resolution, which is more suitable for image restoration and shows extremely high flexibility and versatility.

[0103] Fig. 9 In , Sa represents bicubic interpolation downsampling. Through bicubic interpolation downsampling, a series of downsampled feature maps of different scales can be obtained.

[0104] In one embodiment, please refer to Fig.10 , the attention network processes the input in the following ways:

[0105] Step S01, the input regional convolution feature map is subjected to multi-layer downsampling to obtain a series of scaled downsampled feature maps, wherein, except for the last layer of downsampling, the output of each downsampling layer is used as the input of the next layer of downsampling.

[0106] In one embodiment, the input region convolution feature map Multi-layer sampling is performed through bicubic interpolation downsampling to obtain a series of scaled downsampled feature maps , F represents the set of downsampled feature maps, F n Represents the downsampled feature map of the nth layer.

[0107] Step S02, based on the self-attention processing, calculate the similarity between the downsampled feature map of each downsampled output layer and the regional convolution feature map to obtain the output of the self-attention. Except for the last layer of self-attention processing, the output of each layer of self-attention processing is used as the input of the next layer of self-attention processing.

[0108] In one embodiment, step S02 includes:

[0109] ;

[0110] in, Represents the correlation between any pixel i in the input regional convolution feature map and all pixels in the downsampled feature map output by any downsampled layer, , F represents the set of downsampled feature maps output by all downsampled layers, z represents the downsampled feature map output by any downsampled layer, j represents any pixel point in z, represents the regional convolution feature map, i represents any pixel in the regional convolution feature map, represents the preset range of the neighborhood, r represents the side length of the neighborhood constraint range, Indicates that any pixel point i is within the preset range of the neighborhood The regional convolution feature map within, Indicates that any pixel point j is within the preset range of the neighborhood Downsampled feature maps within ; represents the similarity function, , , T represents transpose, , , , and Both represent feature conversion functions, , and They represent the learnable weight matrices, Represents the regional convolution feature map For any pixel i in Represents the downsampled feature map z Any pixel in j .

[0111] z Yes Input Mapping at a certain scale, by calculating The correlation between and z can be established at any level. and z The long-distance dependencies between them are used to obtain low-level feature information at different scales. The final output feature is the weighted sum of multi-scale features.

[0112] By adding neighborhood similarity, stronger constraints are imposed on the matching content. The neighborhood is determined by specifies that two features are highly correlated if and only if their neighborhoods are also highly similar. The cross-scale modeling capability is due to feature mappings at different levels. z i (Here z i represents the response at position i on the feature map z) summarizes the information of regions of different sizes, and when they are copied to the original position i, the non-local multi-scale information is fused together to form a new response, which intuitively contains richer and more faithful information than single-scale matching.

[0113] Please refer to Fig.11 The core of the self-attention processing in the embodiment of the present application is to use the basic convolution and deconvolution operations to achieve it. In actual operation, given the feature map , first downsampled to z by bicubic interpolation, and The extracted block r×r in z is matched with the downsampled r×r candidate block in z to obtain the softmax matching score (by using the r×r block in z as the convolution kernel to convolve the input Then, the corresponding image block is extracted from the feature map after the linear transformation of θ, and the softmax matching score calculated previously is deconvolved to generate the final response. The obtained feature map is calculated in the same way as the feature map of the next scale, and finally a feature map with multi-scale responses is generated. It can be noted that the pyramid attention is fully convolutional, so it can accept any input resolution and is more suitable for image restoration, showing extremely high flexibility and versatility. In the figure, and g both represent linear transformations.

[0114] Step S03, taking the output of the last layer of self-attention processing as the output of the attention network.

[0115] The restoration network proposed in this application is specifically designed for the characteristics of pressure-sensitive paint images, and can well extract the texture features of pressure-sensitive paint images. Compared with the ordinary convolution used in other models, the feature extraction network of this application can better avoid the interference of invalid pixels from holes such as pressure measuring holes, and can use more known information to infer missing areas. Therefore, when restoring holes, the boundaries will be smoother and the generated content will be more reasonable. The self-attention convolution proposed in this application can better restore the texture details of pressure-sensitive paint by focusing on the underlying features. In this way, the restoration precision and accuracy are improved.

[0116] In one embodiment of the present application, a computer-readable storage medium is provided, on which a program is stored. The stored program includes a method that can be loaded by a processor and process any of the above embodiments.

[0117] Those skilled in the art will appreciate that all or part of the functions of the various methods in the above-mentioned embodiments can be implemented by hardware or by computer programs. When all or part of the functions in the above-mentioned embodiments are implemented by computer programs, the program can be stored in a computer-readable storage medium, and the storage medium can include: read-only memory, random access memory, disk, optical disk, hard disk, etc., and the program is executed by a computer to implement the above-mentioned functions. For example, the program is stored in the memory of the device, and when the program in the memory is executed by the processor, all or part of the above-mentioned functions can be implemented. In addition, when all or part of the functions in the above-mentioned embodiments are implemented by computer programs, the program can also be stored in a storage medium such as a server, another computer, disk, optical disk, flash disk or mobile hard disk, and can be downloaded or copied and saved in the memory of the local device, or the system of the local device is updated, and when the program in the memory is executed by the processor, all or part of the functions in the above-mentioned embodiments can be implemented.

[0118] The above specific examples are used to illustrate the present invention, which is only used to help understand the present invention and is not intended to limit the present invention. For those skilled in the art, according to the concept of the present invention, some simple deductions, modifications or substitutions can be made.

Claims

1. A method for repairing holes in pressure-sensitive paint images, characterized in that: include: Obtain a pressure-sensitive paint image with holes, and obtain a mask binary image; Performing mask processing on the pressure-sensitive paint image and the mask binary image to obtain a mask image; Concatenating the mask image and the mask binary image by channels to obtain a four-channel input tensor; The four-channel input tensor and the mask binary image are used as inputs of a pressure-sensitive paint image hole repair neural network to perform hole repair to obtain a repaired pressure-sensitive paint image, including: In the encoding stage, the encoder includes a first encoding processing layer, a plurality of second encoding processing layers, and a plurality of third encoding processing layers which are cascaded in sequence; the four-channel input tensor is used as the input of the encoder, and the mask binary image updated layer by layer and the output of the previous layer are used as the input of each layer in the encoder, and after multi-layer encoding processing, a first feature map containing high-level semantic features is obtained; In the decoding stage, the decoder includes a plurality of first decoding processing layers and a second decoding processing layer cascaded in sequence; the first feature map is used as the input of the decoder, the output of the previous layer, the output of the corresponding encoding layer obtained by skip connection and the mask binary map updated layer by layer are used as the input of each layer in the decoder, and the spatial information is restored after multi-layer decoding processing to obtain the pressure-sensitive paint image after hole repair; Wherein, the pressure-sensitive paint image hole repair neural network is a neural network model obtained by deep learning training combined with a joint loss function; The first encoding processing layer includes a general convolutional network, the second encoding processing layer includes a feature extraction network and a self-attention network, and the third encoding processing layer includes a feature extraction network; the first decoding processing layer includes a feature extraction network, and the second decoding processing layer includes a general convolutional network; The feature extraction network includes a partial convolution layer, a regional convolution layer and a dynamic normalization layer; the method for the feature extraction network to process the input includes: The feature map output by the previous layer is masked with the mask binary map used by the previous layer, and the masked result is partially convolved to obtain a partial convolution feature map; In the feature extraction network of the encoder, the partial convolution feature map and the mask binary map used in the partial convolution process are used as inputs, and the regional convolution feature map is obtained through regional convolution process; in the extraction network of the decoder, the partial convolution feature map, the output of the corresponding coding layer obtained by skip connection, and the mask binary map used in the partial convolution process are used as inputs, and the regional convolution feature map is obtained through regional convolution process; The mask binary image used in the previous layer is updated by maximum pooling, and the updated mask binary image is multiplied pixel by pixel with the regional convolution feature map, and the result of the pixel by pixel multiplication is dynamically normalized to obtain a feature extraction feature map; wherein the feature extraction feature map obtained by the third encoding processing layer is used as the first feature map; The method of performing partial convolution processing on the masked result to obtain a partial convolution feature map includes: Apply general convolution to some of the preset feature map channels in the mask processing result to extract spatial features, so as to obtain some convolution feature maps; In the feature extraction network of the encoder, the partial convolution feature map and the mask binary map used for the partial convolution process are used as input, and the regional convolution feature map is obtained by regional convolution process, including: After channel splicing of the partial convolution feature map and the mask binary map used for the partial convolution process, the overall offset of the channel splicing process result is calculated to obtain the pixel value of each pixel after the offset, thereby obtaining the feature map after the offset; Based on the offset feature map and the mask binary map used for partial convolution processing, a feature map that only retains the offset of the hole area is obtained; Performing general convolution processing on the feature map that only retains the offset of the hole area to extract features to obtain a regional convolution feature map; In the extraction network of the decoder, the partial convolution feature map, the output of the corresponding coding layer obtained by the jump connection, and the mask binary map used for the partial convolution processing are used as input, and the regional convolution feature map is obtained by regional convolution processing, including: After channel splicing of the partial convolution feature map and the mask binary map used for the partial convolution process, the overall offset of the channel splicing process result is calculated to obtain the pixel value of each pixel after the offset, thereby obtaining the feature map after the offset; Based on the offset feature map and the mask binary map used for partial convolution processing, a feature map that only retains the offset of the hole area is obtained; The feature map that only retains the offset of the hole area is concatenated with the output of the corresponding coding layer to obtain a concatenated feature map; Performing general convolution processing on the spliced ​​feature map to extract features to obtain a regional convolution feature map; The step of performing a dynamic normalization operation on the pixel-by-pixel multiplication result to obtain a feature extraction feature map includes: Combining the weights corresponding to the BN, IN and LN dynamic learning normalization methods, the pixel-by-pixel multiplication results are normalized by region to obtain a feature extraction feature map; After channel splicing of the partial convolution feature map and the mask binary map used for the partial convolution process, the overall offset of the channel splicing process result is calculated to obtain the pixel value of each pixel after the offset, thereby obtaining the feature map after the offset, including: ; in, Represents the pixel value of any pixel after offset. Represents any decimal coordinate, Represents the pixel value of any pixel point t in the splicing results of all channels, represents the pixel coordinate in the x dimension, represents the pixel coordinate in the y dimension, Represents the decimal coordinate of the x dimension, Represents the decimal coordinate of the y dimension; represents the bilinear interpolation kernel, , , ; Based on the offset feature map and the mask binary map used for partial convolution processing, a feature map that only retains the offset of the hole area is obtained, including: ; in, Indicates that only the feature map of the hole area offset is retained. represents the feature map after offset, m represents the mask binary map used for partial convolution processing, represents part of the convolutional feature map, Represents pixel-by-pixel multiplication.

2. The method for repairing holes in pressure-sensitive paint images according to claim 1, characterized in that: The method for processing the input by the first encoding processing layer includes: performing general convolution processing on the four-channel input tensor to obtain a first general convolution processing feature map, performing maximum pooling update on the mask binary map, and performing pixel-by-pixel multiplication of the first general convolution processing feature map and the updated mask binary map to obtain a first encoding feature map; The method for the second decoding processing layer to process the input includes: splicing the feature map output by the previous layer and the output of the first layer of the encoder, and masking the spliced ​​features with the mask binary map used in the previous layer, performing general convolution processing on the masked result to obtain a second general convolution processing feature map, performing maximum pooling update on the mask binary map used in the previous layer, and multiplying the updated mask binary map by the second general convolution processing feature map pixel by pixel to obtain a pressure-sensitive paint image after hole repair.

3. The method for repairing holes in pressure-sensitive paint images according to claim 1, characterized in that: The method for the attention network to process input includes: The input regional convolution feature map is downsampled in multiple layers to obtain a series of scaled downsampled feature maps; except for the last downsampling layer, the output of each downsampling layer is used as the input of the next downsampling layer; Based on the self-attention processing, the similarity between the downsampled feature map of each downsampled layer output and the regional convolution feature map is calculated to obtain the output of the self-attention; wherein, except for the last layer of self-attention processing, the output of each layer of self-attention processing is used as the input of the next layer of self-attention processing; The output of the last layer of self-attention processing is used as the output of the attention network.

4. The method for repairing holes in pressure-sensitive paint images according to claim 3, characterized in that: The self-attention-based processing calculates the similarity between the downsampled feature map of each downsampled layer output and the regional convolution feature map to obtain the output of the self-attention, including: ; in, Represents the correlation between any pixel i in the input regional convolution feature map and all pixels in the downsampled feature map output by any downsampled layer, , F represents the set of downsampled feature maps output by all downsampled layers, z represents the downsampled feature map output by any downsampled layer, j represents any pixel point in z, represents the regional convolution feature map, i represents any pixel in the regional convolution feature map, represents the preset range of the neighborhood, r represents the side length of the neighborhood constraint range, Indicates that any pixel point i is within the preset range of the neighborhood The regional convolution feature map within, Indicates that any pixel point j is within the preset range of the neighborhood Downsampled feature maps within ; represents the similarity function, , , T represents transpose, , , , and Both represent feature conversion functions, , and They represent the learnable weight matrices, Represents the regional convolution feature map For any pixel i in Represents any pixel j in the downsampled feature map z.

5. The method for repairing holes in pressure-sensitive paint images according to claim 1, characterized in that: The first encoding processing layer includes 1 layer, the second encoding processing layer includes 3 layers, and the third encoding processing layer includes 4 layers; the first decoding processing layer includes 7 layers, and the second decoding processing layer includes 1 layer.

6. The method for repairing holes in pressure-sensitive paint images according to claim 1, characterized in that: The joint loss function includes: ; in, represents the joint loss function, Represents the mean absolute error loss function between the predicted value and the true value of the unmasked area, Represents the mean absolute error loss function between the predicted value and the true value of the mask area, represents the total variational loss function, represents the perceptual loss function, represents the style loss function.