Method for enhancing visual perception of spatial transformation network based on deep learning

The spatial transformation network is improved through data enhancement and transfer learning technology, which solves the problems of low efficiency and poor interpretability in image processing, improves the robustness and adaptability of the model, and is suitable for depth estimation tasks in different scenarios.

CN118537211AActive Publication Date: 2024-08-23QINGHAI NORMAL UNIV
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202410492330.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-04-23
Publication Date
2024-08-23
Estimated Expiration
2044-04-23

AI Technical Summary

Technical Problem

Traditional image processing algorithms are inefficient when processing large-scale data, deep learning models are susceptible to noise and attacks when processing images, and spatial transformation networks perform poorly and cannot be explained when data is scarce and computational complexity is high. It has poor performance and is difficult to meet the personalized needs of different application scenarios.

Method used

Use data enhancement technology to expand training data, combine with transfer learning methods to initialize or fine-tune the spatial transformer, preprocess and transform images through positioning networks, grid generators and samplers, improve the generalization ability and performance of the model, and use dual Linear interpolation fills the transformed image.

Benefits of technology

It improves the model's robustness and generalization ability to geometric transformations, enhances the efficiency and interpretability of image processing, adapts to depth estimation tasks in different scenarios, and improves the precision and accuracy of monocular depth estimation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118537211A
    Figure CN118537211A
Patent Text Reader

Abstract

The invention discloses a visual perception method for enhancing a spatial transformation network based on deep learning, which is used for solving the problems of geometric transformation invariance of image data, generalization ability of a model and the like. Input data may be affected by geometric transformations such as translation, rotation, scaling, and the like, while the neural network may not have robustness for these transformations. Data enhancement can increase the diversity of training data by introducing data samples with different geometric transformations, so that the neural network better adapts to these transformations. In some scenes, a pre-trained model or a feature extractor may have certain universality when solving some tasks. The introduction of learning migration can help the pre-training models or feature extractors, so that the training process of the model is accelerated, and the performance of the model is improved. ESTN is combined with learning migration to utilize existing knowledge and feature representation by migrating parameters of a pre-trained feature extractor or a localized network, so that the requirements of specific tasks can be met more quickly.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing technology, and in particular to a deep learning-based enhanced spatial transformation network visual perception method. Background Art

[0002] As the scale of data continues to increase, traditional image processing algorithms may encounter inefficiencies when processing large-scale data, and more efficient algorithms and technologies are needed to meet this challenge. Multimodal and cross-domain data have different characteristics and distributions. How to effectively process these data and extract useful information is a challenge, and further research is needed on cross-domain and multimodal image processing technologies. Deep learning models may be disturbed by noise, attacks, etc. when processing images. How to improve the robustness and interpretability of the model is an urgent problem to be solved. Different application scenarios have different requirements for image processing algorithms. For example, medical image processing, intelligent transportation and other fields require specific customized algorithms and solutions, so personalized research and development is required for different scenarios. Therefore, it is necessary to strengthen the research on the robustness and interpretability of deep learning models, propose effective anti-attack methods and model interpretation techniques, and improve the stability and understandability of the model. According to the needs of specific scenarios, develop customized image processing technologies and solutions to meet the personalized needs of different industries and fields.

[0003] As a powerful attention mechanism, the spatial transformer network (STN) can dynamically transform the input data spatially and improve the model's perception of the image. The introduction of STN is of great significance in improving the robustness of neural networks to geometric transformations, enhancing the network's perception range, improving the generalization ability of the model, realizing the spatial attention mechanism, and realizing end-to-end training. It brings greater flexibility and effect improvement to the application of neural networks in image processing tasks. However, it also has certain defects. For example, the network generator in STN requires a large amount of training data to learn accurate transformation parameters, otherwise overfitting or unstable learning will occur, which may be a challenge for scenarios with scarce data. And the computational complexity is high, because the network generator in STN needs to perform affine transformation on the input image, which may lead to additional computational complexity, especially when processing large-size images or requiring high-precision transformation, which may affect the performance and efficiency of the model. And the interpretability is poor, it is difficult to explain the transformation process and parameter meaning of the image inside the system, which will limit the interpretability and credibility of the model in some application scenarios.

[0004] Therefore, there is an urgent need for a new method that can improve the above-mentioned defects of STN to explore innovations and challenges in visual perception tasks. Summary of the invention

[0005] In order to solve the problems existing in the prior art, the present invention provides a visual perception method based on deep learning enhanced spatial transformer network (ESTN), which adopts data enhancement technology to expand training data to improve the generalization ability of STN, and combines with the transfer learning method to use existing large-scale data or pre-trained model parameters to initialize or fine-tune the spatial transformer of STN to accelerate the convergence of the model and improve the performance, thereby solving the problems mentioned in the above background technology.

[0006] To achieve the above object, the present invention provides the following technical solution: a method for enhancing spatial transformation network visual perception based on deep learning, comprising the following steps:

[0007] S1. Perform pre-processing on the images in the data set, including normalization and size adjustment;

[0008] S2, constructing an enhanced space transformer ESTN network, wherein the enhanced space transformer ESTN network includes a positioning network, a grid generator and a sampler;

[0009] S3, transformation parameters predicted based on positioning network optimization;

[0010] S4, strengthen edge mapping through network generator;

[0011] S5. Use the sampler to fill the grid, and finally output the transformed image.

[0012] Preferably, in step S1, the following steps are specifically included:

[0013] S11. Normalization: Input the three primary color RGB image and normalize each color channel separately. The RGB image is represented as a three-dimensional matrix, where the first dimension represents the height of the image, the second dimension represents the width of the image, and the third dimension represents the color channel. For an RGB image, its matrix is ​​represented as follows:

[0014]

[0015] Among them, R, B, and G represent the pixel values ​​on the red, green, and blue channels respectively. Each color channel is normalized, and each element in the matrix is ​​normalized in the same way to ensure that the pixel value of the entire image is in the range of [-1,1]. The calculation formula is as follows:

[0016] normalized_pixel-value=(pixel_value / 127.5)-1

[0017] In RGB images, usually the pixel value of each channel ranges from 0 to 255, so the pixel value is divided by 127.5 and then subtracted from 1 to map the pixel value range from [0,255] to [-1,1];

[0018] S12. Size adjustment: unify the image size to 1280x720.

[0019] Preferably, in step S3, the following steps are specifically included:

[0020] S31, input image U: input the pre-processed image U into the positioning network. Each image has corresponding feature information, which is represented by a matrix of a specific size, including pixel feature information of the image;

[0021] S32, perfecting feature information: adding the image to the convolutional neural network in the positioning network for training to obtain complete feature information of the image and perfect the feature information;

[0022] S33, image U is transferred to the positioning network: the input image U is sent to the neural network module of the positioning network, and feature extraction is performed on the input image to extract edge, color, texture, character and depth features of the image;

[0023] S34, random cropping: load the extracted image in the positioning network, obtain the width and height of the image, randomly select the coordinates (x, y) of the upper left corner of a cropping area and randomly obtain the width and height of the cropping area. The formula is as follows:

[0024] I tailor(x,y) =I[(xx left+i ), (yy left+j )]

[0025] I tailor(x,y) It is represented as the coordinates of the cropped sub-image, x and y represent the coordinate positions of the original image, respectively. left+i and left+j It is represented by the coordinates of the upper right corner of the cropping area, i represents the step length of horizontal movement during cropping, and j represents the step length of vertical movement;

[0026] S35, random scaling: The extracted image is randomly rotated by an angle to generate a new image, and then the rotated image is added to the data set. First, the width and height of the image are obtained, and then a random rotation is performed on the image. The image is rotated and saved to obtain a new image. The formula is as follows:

[0027] I rotate(x,y) =I[(x coxθ-y sinθ), (x sinθ+ycoxθ)]

[0028] I rotate(x,y) Represents the rotated image, I (x,y) is the original image, θ represents the rotation angle;

[0029] S36, adjust saturation: adjust the three primary colors of the image to change the saturation of the image. The formula is as follows:

[0030] B = B + (B - (R + G) / 2) * r;

[0031] G = G + (G - (R + B) / 2) * r;

[0032] R = R + (R - (B + G) / 2) * r;

[0033] r represents the adjustment ratio or increment of saturation, ranging from (-1 to 5). r greater than 1 means increasing saturation and r less than 1 means decreasing saturation. The color brightness of the image can be changed by adjusting the r value.

[0034] S37, regression transformation to obtain parameter V: The positioning network processes the input image U through the convolutional neural network, and transforms the input image U through data enhancement technology to obtain the image transformation parameter V; V includes the parameters of cropping and rotation transformation, and the formula is expressed as follows:

[0035]

[0036] Preferably, in step S4, the following steps are specifically included:

[0037] S41, define a grid W: first define a grid W for the image transformation parameter V, the size of the grid depends on the size of the feature map, and each grid represents the coordinates of a pixel point of the output feature map;

[0038] S42, parameter to grid conversion: apply a transformation T(v) to the defined grid W, generate a transformed sampling grid, transform it by affine mapping; a sampling position of the input feature map By translating b vectors and rotating and enlarging and reducing A, the affine mapping is shown in the following formula:

[0039]

[0040] (Xi, Yi) represents the target pixel position on the feature map output after transformation, It is represented as the sampling position on the corresponding input feature map, and A represents the transformation matrix;

[0041] Perform affine mapping transformation on each pixel of the image, and then map the transformed pixel value to the grid;

[0042] S43. Data enhancement technology is used to strengthen pixels: After being calculated through affine mapping and before being mapped to the grid, for pixels at the edge position, the edge information in the image is increased by expanding the pixels around them. First, the image edge is detected, and 0 values ​​are added to the image edge for expansion to improve its mapping effect in the transformation grid.

[0043] Preferably, in step S5, the following steps are specifically included:

[0044] S51. Introduce transfer learning: introduce the feature extractor pre-trained on the convolutional neural network CNN into ESTN, and transfer the knowledge and feature expression learned on CNN to ESTN, so that the sampler can better understand the mapping relationship between the input image and the output image;

[0045] S52, interpolation filling: In the spatial transformation calculation, the image coordinates may be decimals, so they cannot directly correspond to the pixel positions of the target image. Bilinear interpolation is needed to estimate the pixel values ​​at these positions to fill the entire transformation grid and finally output the transformed image.

[0046] Preferably, the bilinear interpolation includes the following three steps:

[0047] a) Find four pixel points around the target location, the coordinates of these four pixel points are the upper left corner, upper right corner, lower left corner and lower right corner;

[0048] b) For each channel at the target location, calculate the weighted average between the four pixels. The weight is determined by the distance between the four pixels at the target location. The closer the distance, the greater the weight of the pixel;

[0049] c) Use the calculated weighted average as the value of the pixel at the target location.

[0050] The beneficial effects of the present invention are as follows: the method of the present invention is used to solve problems such as the geometric transformation invariance of image data and the generalization ability of the model. The input data may be affected by geometric transformations such as translation, rotation, and scaling, and the neural network may not be robust to these transformations. Data enhancement can increase the diversity of training data by introducing data samples with different geometric transformations, so that the neural network can better adapt to these transformations. In some scenarios, pre-trained models or feature extractors may have certain versatility in solving certain tasks. The introduction of learning transfer can accelerate the training process of the model and improve the performance of the model with the help of these pre-trained models or feature extractors. ESTN combined with learning transfer can utilize existing knowledge and feature representations by migrating the parameters of pre-trained feature extractors or localized networks, thereby adapting to the needs of specific tasks more quickly. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] Figure 1 This is a framework diagram of the method for enhancing spatial transformation network visual perception based on deep learning in the present invention;

[0052] Figure 2 This is a flow chart of the method for enhancing spatial transformation network visual perception based on deep learning in the present invention. DETAILED DESCRIPTION

[0053] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0054] The direction of image processing based on deep learning has many advantages, especially when dealing with large-scale data and complex scenes. By accurately reconstructing the three-dimensional model of the real world through deep learning models, a more realistic and immersive virtual experience can be created, or virtual information can be superimposed on the real scene. Deep learning models can automatically learn rich feature representations of three-dimensional scenes without the need to manually design complex feature extractors. This method helps to better capture the local and global features of three-dimensional images. In cultural heritage protection, this method can be used to build accurate digital models to help preserve and restore cultural heritage such as ancient buildings and sculptures. Therefore, for the complex scene representation of cave temples, deep learning is the best result. By using the correlation between similar pixels, an effective model is learned from image data. In general, the development of perception methods based on deep learning has not only enriched our understanding of the real world, but also brought more application possibilities to many industries and fields. Better understanding and simulation of three-dimensional space from a digital perspective is of great value to future scientific and technological development and social progress.

[0055] In view of the defects of STN, the present invention proposes a new visual perception method based on deep learning enhanced spatial transformation network. Figure 1 and Figure 2 , including the following steps:

[0056] S1. Perform pre-processing on the images in the data set, including normalization and resizing, to facilitate subsequent processing.

[0057] The specific steps include:

[0058] S11. Normalization: Input the three primary color RGB image and normalize each color channel separately. The RGB image is represented as a three-dimensional matrix, where the first dimension represents the height of the image (number of rows), the second dimension represents the width of the image (number of columns), and the third dimension represents the color channel (red, green, and blue). For an RGB image, its matrix is ​​represented as follows:

[0059]

[0060] Among them, R, B, and G represent the pixel values ​​on the red, green, and blue channels respectively, and each pixel point is composed of three values. In this representation, each element of the matrix is ​​an array containing three values, corresponding to the pixel values ​​of the RGB channels. The entire matrix represents the pixel values ​​of the entire image. In order to normalize the entire RGB image matrix, each color channel is normalized, and each element in the matrix is ​​normalized in the same way to ensure that the pixel values ​​of the entire image are in the range of [-1,1]. The calculation formula is as follows:

[0061] normalized_pixel-value=(pixel_value / 127.5)-1

[0062] In RGB images, usually the pixel value of each channel ranges from 0 to 255, so the pixel value is divided by 127.5 and then subtracted from 1 to map the pixel value range from [0,255] to [-1,1];

[0063] S12, size adjustment: The input images are of different sizes. In order to learn uniformly, the image size is unified to 1280x720 (720p).

[0064] S2. Construct an enhanced space transformer ESTN network, which includes a positioning network, a grid generator and a sampler. In the original STN space transformer network, data enhancement technology and transfer learning are added to enhance the mapping and learning of image data information. The positioning network is used to predict the parameters of the spatial transformation, the translation, scaling and rotation parameters of the affine transformation. The grid generator generates a sampling grid based on the transformation parameters output by the positioning network for sampling the input image. The sampler samples the input image according to the sampling grid to obtain an output image after spatial transformation.

[0065] S3, based on the transformation parameters predicted by the positioning network optimization. Introducing data enhancement technology to perform various operations such as deformation, rotation, scaling, and translation on the image, effectively enhancing the diversity of training samples and improving the performance of the model.

[0066] The input image U is trained by the neural network layer of the positioning network to obtain the feature representation of the image. Combined with data enhancement technology to help expand the training data set and improve the generalization ability of the model. The present invention adopts random cropping, random scaling, and saturation adjustment data enhancement technology. Random cropping is to randomly crop the original image into sub-images of different sizes and proportions. Cropping can be performed at any position of the image, and the size of the cropped image can be the same as the original image or smaller than the original image. Cropping can also be performed by random horizontal flipping or vertical flipping, which helps the model learn the features of the object at different positions and scales, increasing the diversity of data. Random rotation rotates the image at different angles, and the rotation angle can be randomly selected within a certain range, such as any angle between 0 and 360 degrees. Note that the rotated image may need to be filled or cropped to keep the image size consistent. This helps the model learn the features of rotation invariance. Random scaling is to scale the image at different angles so that the image is presented at different scales. This helps the model learn the robustness to scale changes. The scaling ratio can be randomly selected within a certain range, such as any ratio between 0.8 and 1.2. The scaled image may need to be padded or cropped to keep the image size consistent. Random brightness, contrast, and saturation transformation randomly adjusts the image's brightness, contrast, and saturation parameters to make the image appear under different lighting and color conditions. The magnitude of the transformation can also be randomly selected within a certain range, such as adding or subtracting brightness within a certain range, multiplying by different contrast coefficients, etc. This helps the model learn to be robust to changes in lighting and color. Add noise Add random noise, such as Gaussian noise, to the image. The intensity and type of noise can be controlled to meet the needs of specific tasks. This helps the model learn to be robust to noise.

[0067] The specific steps include:

[0068] S31, input image U: input the pre-processed image U into the positioning network. Each image has corresponding feature information, which is represented by a matrix of a specific size, including pixel feature information of the image;

[0069] S32. Improve feature information: If the image feature information obtained after the preprocessing operation is not perfect, add the image to the convolutional neural network in the positioning network for training to obtain the complete feature information of the image and improve the feature information; if it is not necessary, directly perform data enhancement on the image.

[0070] S33. Image U is passed to the positioning network: The input image U is sent to the neural network module of the positioning network. The positioning network is a small convolutional neural network CNN, which performs feature extraction on the input image, extracts the edge, color, texture, role and depth features of the image, and provides guarantee for subsequent operations.

[0071] S34, random cropping: load the extracted image in the positioning network, obtain the width and height of the image, randomly select the coordinates (x, y) of the upper left corner of a cropping area and randomly obtain the width and height of the cropping area. The formula is expressed as follows:

[0072] I tailor(x,y) =I[(xx left+i ), (yy left+j )]

[0073] I tailor(x,y) It is represented as the coordinates of the cropped sub-image, x and y represent the coordinate positions of the original image, respectively. left+i and left+j It is represented by the coordinates of the upper right corner of the cropping area, i represents the step size of horizontal movement during cropping, and j represents the step size of vertical movement; in this way, a cropped sub-image can be obtained, and then the sub-image can be transferred to subsequent operations to increase the diversity of the image.

[0074] S35, random scaling: The extracted image is randomly rotated by an angle to generate a new image, and then the rotated image is added to the data set. First, the width and height of the image are obtained, and then a random rotation is performed on the image. The image is rotated and saved to obtain a new image. The formula is as follows:

[0075] I rotate(x,y) =I[(x coxθ-y sinθ), (x Sinθ+ycoxθ)]

[0076] I rotate(x,y) Represents the rotated image, I (x,y) is the original image, θ represents the rotation angle;

[0077] S36. Adjust saturation: ESTN uses RGB image sequences in the enhanced spatial variation network. We need to randomly adjust the brightness, contrast and saturation of the image to improve the richness of the dataset. Adjust the three primary colors of the image to transform the saturation of the image. The formula is as follows:

[0078] B = B + (B - (R + G) / 2) * r;

[0079] G = G + (G - (R + B) / 2) * r;

[0080] R = R + (R - (B + G) / 2) * r;

[0081] When adjusting the saturation of an image, a parameter r is usually used. r represents the adjustment ratio or increment of the saturation, and the range is (-1, 5). r greater than 1 means increasing the saturation, and r less than 1 means decreasing the saturation. The higher the saturation, the brighter the color, and the lower the saturation, the duller the color. The color brightness of the image is changed by adjusting the r value; data enhancement technology is used to transform the image U to obtain the feature U * .

[0082] S37, regression transformation to obtain parameter V: The positioning network processes the input image U through the convolutional neural network, and transforms the input image U through data enhancement technology to obtain the image transformation parameter V; V includes the parameters of cropping and rotation transformation for subsequent spatial transformation operations, and the formula is expressed as follows:

[0083]

[0084] By combining these data enhancement techniques, a large number of diverse training samples can be generated, thereby improving the generalization and robustness of the model. During the training process, each sample will be combined with the above series of data enhancement operations, so that the model can be exposed to more data under different transformations during the training process, so as to better adapt to different test scenarios.

[0085] S4. Strengthen edge mapping through network generator. The network generator generates a transformation grid for spatial transformation of the input image, which defines the position of each pixel in the input image after transformation. This step introduces data enhancement technology to strengthen the pixels so that the pixels at the edge position are better mapped in the grid, thereby increasing the performance and robustness of the image model.

[0086] According to the image transformation parameters V learned by the localization network, the network generator generates a transformation grid for spatial transformation of the input image, which defines the position of each pixel in the input image after transformation. This step also combines data enhancement technology to enhance the pixels so that the pixels at the edge position are better mapped in the grid, thereby increasing the performance and robustness of the image model. The transformation network is usually composed of a set of control points, which determine the shape and size of the transformed image. Data enhancement technology can strengthen the mapping relationship of pixels by adjusting the positions of these control points. For example, the position of the control points can be randomly adjusted when generating the transformation network so that the pixels at the edge position can be better mapped. This can increase the sensitivity of the model to the edge position of the image and improve the performance and robustness of the model.

[0087] The specific steps include:

[0088] S41, define a grid W: first define a grid W for the image transformation parameter V, the size of the grid depends on the size of the feature map, and each grid represents the coordinates of a pixel point of the output feature map;

[0089] S42, parameter to grid conversion: Apply a transformation T(v) to the defined grid W to generate a transformed sampling grid, which indicates how to input the image transformation parameter V for sampling to output the feature map. This operation is mainly transformed through affine mapping; a sampling position of an input feature map By translating b vectors and rotating and enlarging and reducing A, the affine mapping is shown in the following formula:

[0090]

[0091] (Xi, Yi) represents the target pixel position on the feature map output after transformation, It is represented by the sampling position on the corresponding input feature map, and A represents the transformation matrix.

[0092] Perform affine mapping transformation on each pixel of the image, and then map the transformed pixel value to the grid;

[0093] S43, data enhancement technology to strengthen pixels: After being calculated by affine mapping, before being mapped to the grid, for the pixels at the edge position, the edge information in the image is increased by expanding the pixels around the edge. First, the image edge is detected, and additional pixel values ​​are added around the image edge. Here, we add 0 values ​​to the image edge for expansion, so as to improve its mapping effect in the transformation grid.

[0094] S5. Fill the grid with a sampler and output the transformed image. Fill the input image according to the transformed grid. The introduction of transfer learning can learn general geometric feature representations from large-scale data sets with the help of pre-trained models or feature extractors. These pre-trained models can be trained on similar tasks or fields, and then migrated to specific ESTN tasks to accelerate the model training process and improve performance.

[0095] A sampler is a tool used to fill the input image according to the transformation grid. The transformation grid defines the position of each pixel in the input image after the transformation, and the sampler uses this position information to sample the pixels at the corresponding positions on the output image to fill the transformed image.

[0096] The specific steps include:

[0097] S51. Introduce transfer learning: Use the feature extractor pre-trained on the convolutional neural network CNN to improve the performance of the sampler in the ESTN task. Introduce the feature extractor pre-trained on the convolutional neural network CNN into ESTN to better understand the input image in ESTN and effectively help the sampler to fill in the transformed image more accurately. Because the CNN pre-trained feature extractor has learned a more effective feature representation, the sampler can better understand the mapping relationship between the input image and the output image, thereby improving the accuracy and performance of filling;

[0098] S52. Interpolation filling: In spatial transformation calculations, image coordinates may be decimals and therefore cannot directly correspond to the pixel positions of the target image. Bilinear interpolation is required to estimate the pixel values ​​at these positions to fill the entire transformation grid. This allows the image to have better generalization capabilities and adapt to different transformations.

[0099] Furthermore, the bilinear interpolation includes the following three steps:

[0100] a) Find four pixel points around the target location, the coordinates of these four pixel points are the upper left corner, upper right corner, lower left corner and lower right corner;

[0101] b) For each channel at the target location, calculate the weighted average between the four pixels. The weight is determined by the distance between the four pixels at the target location. The closer the distance, the greater the weight of the pixel;

[0102] c) Use the calculated weighted average as the value of the pixel at the target location.

[0103] Through bilinear interpolation, the pixel value at the target position can be estimated more accurately, so that the image has better generalization ability and can adapt to different transformations. This is especially important in the Enhanced Spatial Transformer Network (ESTN), because ESTN usually needs to handle a variety of different transformations, and the interpolation method can effectively handle this situation and improve the accuracy and stability of spatial transformation.

[0104] Finally, the transformed image is output. The ESTN enhanced spatial transformer network system is completed. This optimized ESTN description takes into account the application of data enhancement technology, the use of transfer learning, and the necessity of interpolation and filling, so that the ESTN enhanced spatial transformer network can better adapt to various transformations and improve model performance.

[0105] Through these steps, the entire process forms an end-to-end learning framework, which enables the model to automatically learn the mapping relationship between input images and output targets, and continuously optimize network parameters during training to adapt to different task requirements.

[0106] Enhanced Spatial Transformer Network (ESTN) can be used as a separate module or inserted at any position in CNN. Placing ESTN in the input layer of CNN allows the network to transform the input before learning features, thereby achieving geometric transformation, scaling, rotation and other operations on the image, making the input data more in line with the training requirements of the model. In this way, the role of ESTN is mainly to preprocess the input, thereby improving the adaptability and robustness of the model to the input data. Placing ESTN in the middle layer of CNN allows the network to spatially transform the feature map during feature extraction, thereby enhancing the distinguishability and representation of the features. ESTN can deform the feature map through learning, so that the network can better capture the local features and structural information in the image, improving the feature extraction ability and classification performance of the model. Placing ESTN in the output layer of CNN can spatially transform the feature map output by the network, thereby achieving adjustment and optimization of the feature map. In this way, the role of ESTN is mainly to post-process the feature map, further improving the model's representation and classification capabilities for the input data. When we extract image information from the cave temple, in order to make the final displayed model more in line with the image, we need to strictly require the image extraction process. It effectively solves problems such as image deformation and distortion, and provides a more convenient and faster processing method for subsequent depth estimation. Therefore, the addition of ESTN can effectively solve the above problems. It also plays an important role in CNN, effectively solving problems such as image invariance, geometric shape correction, and inattention.

[0107] The present invention has the following effects: it has the ability to enhance the generalization of the model: by enhancing the spatial transformation network to perform geometric transformation on the training data, the diversity of the training data is increased, so that the model can be better generalized to depth estimation tasks in different scenarios, thereby improving the generalization ability of the model.

[0108] Dealing with data shortage and data imbalance: In monocular depth estimation tasks, we often face data shortage and data imbalance. Using the enhanced spatial transformer network can alleviate these problems by expanding the training data set and improving the model's adaptability to different scenarios.

[0109] Improve the model's adaptability to deformed images: Monocular estimation often needs to process images of various angles, scales, and lighting conditions. The geometric transformation operations introduced by the spatial transformation network can make the model better adapt to these deformed images, thereby improving the robustness and stability of the model.

[0110] Improve depth estimation accuracy: The enhanced spatial transformer network can help the model learn more features in different scenarios, thereby improving the precision and accuracy of monocular depth estimation, making the estimated depth map more accurate and reliable.

[0111] Customization of monocular depth estimation tasks: The enhanced spatial transformation network is combined with CNN, and a customized design is carried out according to the characteristics of the monocular depth estimation task, so that the model can better adapt to the needs of the depth estimation task, which is innovative and targeted.

[0112] Although the present invention has been described in detail with reference to the aforementioned embodiments, it is still possible for those skilled in the art to modify the technical solutions described in the aforementioned embodiments, or to make equivalent substitutions for some of the technical features therein. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for enhancing visual perception of spatial transformation networks based on deep learning, characterized in that: The steps include: S1. Perform pre-processing on the images in the data set, including normalization and size adjustment; S2, constructing an enhanced space transformer ESTN network, wherein the enhanced space transformer ESTN network includes a positioning network, a grid generator and a sampler; S3, transformation parameters predicted based on positioning network optimization; S4, strengthen edge mapping through network generator; S5. Use the sampler to fill the grid, and finally output the transformed image.

2. The method for visual perception based on deep learning enhanced spatial transformation network according to claim 1 is characterized in that: In step S1, the following steps are specifically included: S11. Normalization: Input the three primary color RGB image and normalize each color channel separately. The RGB image is represented as a three-dimensional matrix, where the first dimension represents the height of the image, the second dimension represents the width of the image, and the third dimension represents the color channel. For an RGB image, its matrix is ​​represented as follows: Among them, R, B, and G represent the pixel values ​​on the red, green, and blue channels respectively. Each color channel is normalized, and each element in the matrix is ​​normalized in the same way to ensure that the pixel value of the entire image is in the range of [-1,1]. The calculation formula is as follows: normalized_pixel-value=(pixel_value / 127.5)-1 In RGB images, usually the pixel value of each channel ranges from 0 to 255, so the pixel value is divided by 127.5 and then subtracted from 1 to map the pixel value range from [0,255] to [-1,1]; S12. Size adjustment: unify the image size to 1280x720.

3. The method for visual perception based on deep learning enhanced spatial transformation network according to claim 1, characterized in that: In step S3, the following steps are specifically included: S31, input image U: input the pre-processed image U into the positioning network. Each image has corresponding feature information, which is represented by a matrix of a specific size, including pixel feature information of the image; S32, perfecting feature information: adding the image to the convolutional neural network in the positioning network for training to obtain complete feature information of the image and perfect the feature information; S33, image U is transferred to the positioning network: the input image U is sent to the neural network module of the positioning network, and feature extraction is performed on the input image to extract edge, color, texture, character and depth features of the image; S34, random cropping: load the extracted image in the positioning network, obtain the width and height of the image, randomly select the coordinates (x, y) of the upper left corner of a cropping area and randomly obtain the width and height of the cropping area. The formula is as follows: I tailor(x,y) =I[(x-x left+i ),(y-y left+j )] I tailor(x,y) It is represented as the coordinates of the cropped sub-image, x and y represent the coordinate positions of the original image, respectively. left+i and left+j It is represented by the coordinates of the upper right corner of the cropping area, i represents the step length of horizontal movement during cropping, and j represents the step length of vertical movement; S35, random scaling: The extracted image is randomly rotated by an angle to generate a new image, and then the rotated image is added to the data set. First, the width and height of the image are obtained, and then a random rotation is performed on the image. The image is rotated and saved to obtain a new image. The formula is as follows: I rotate(x,y) =I[(xcoxθ-ysinθ),(xsinθ+ycosθ)] I rotate(x,y) Represents the rotated image, I (x,y) is the original image, θ represents the rotation angle; S36, adjust saturation: adjust the three primary colors of the image to change the saturation of the image. The formula is as follows: B = B + (B - (R + G) / 2) * r; G = G + (G - (R + B) / 2) * r; R = R + (R - (B + G) / 2) * r; r represents the adjustment ratio or increment of saturation, ranging from (-1,5). r greater than 1 means increasing saturation and r less than 1 means decreasing saturation. The color brightness of the image can be changed by adjusting the r value. S37, regression transformation to obtain parameter V: The positioning network processes the input image U through the convolutional neural network, and transforms the input image U through data enhancement technology to obtain the image transformation parameter V; V includes the parameters of cropping and rotation transformation, and the formula is expressed as follows:

4. The method for visual perception based on deep learning enhanced spatial transformation network according to claim 1, characterized in that: In step S4, the following steps are specifically included: S41, define a grid W: first define a grid W for the image transformation parameter V, the size of the grid depends on the size of the feature map, and each grid represents the coordinates of a pixel point of the output feature map; S42, parameter to grid conversion: apply a transformation T(v) to the defined grid W, generate a transformed sampling grid, transform it by affine mapping; a sampling position of the input feature map By translating b vectors and rotating and enlarging and reducing A, the affine mapping is shown in the following formula: (Xi, Yi) represents the target pixel position on the feature map output after transformation, It is represented as the sampling position on the corresponding input feature map, and A represents the transformation matrix; Perform affine mapping transformation on each pixel of the image, and then map the transformed pixel value to the grid; S43. Data enhancement technology is used to strengthen pixels: After being calculated through affine mapping and before being mapped to the grid, for pixels at the edge position, the edge information in the image is increased by expanding the pixels around them. First, the image edge is detected, and 0 values ​​are added to the image edge for expansion to improve its mapping effect in the transformation grid.

5. The method for visual perception based on deep learning enhanced spatial transformation network according to claim 1, characterized in that: In step S5, the following steps are specifically included: S51. Introduce transfer learning: introduce the feature extractor pre-trained on the convolutional neural network CNN into ESTN, and transfer the knowledge and feature expression learned on CNN to ESTN, so that the sampler can better understand the mapping relationship between the input image and the output image; S52, interpolation filling: In the spatial transformation calculation, the image coordinates may be decimals, so they cannot directly correspond to the pixel positions of the target image. Bilinear interpolation is needed to estimate the pixel values ​​at these positions to fill the entire transformation grid and finally output the transformed image.

6. The method for visual perception based on deep learning enhanced spatial transformation network according to claim 5 is characterized in that: The bilinear interpolation includes the following three steps: a) Find four pixel points around the target location, the coordinates of these four pixel points are the upper left corner, upper right corner, lower left corner and lower right corner; b) For each channel at the target location, calculate the weighted average between the four pixels. The weight is determined by the distance between the four pixels at the target location. The closer the distance, the greater the weight of the pixel; c) Use the calculated weighted average as the value of the pixel at the target location.

Citation Information

Patent Citations

  • Vehicle door defect image correction method based on improved spatial transformation network STN

    CN116433514A

  • Deep learning-based qualification image classification method and system

    CN117788957A

  • Optical character detection and recognition

    US20240020863A1