Unsupervised optical flow estimation method and system based on deformable convolution and self-attention mechanism

By introducing deformable convolution and self-attention mechanisms into optical flow estimation, the problems of blurred optical flow edges and poor processing of occlusion areas are solved, achieving clearer and more accurate optical flow estimation effects.

CN118608573AInactive Publication Date: 2024-09-06NANJING XIAOZHUANG UNIV
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410462088.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-04-17
Publication Date
2024-09-06
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing optical flow estimation methods are not effective when dealing with occlusion areas, and traditional bilinear interpolation results in blurred optical flow edges and large cumulative errors, making it difficult to produce clear optical flow.

Method used

An unsupervised optical flow estimation method using deformable convolution and self-attention mechanism is used to improve pyramid feature extraction capabilities through the feature fusion module. Deformable convolution is used to perform convolution based on feature contours, and a self-attention mechanism is introduced to calculate long-term dependencies. , avoid image contour destruction and achieve clearer optical flow estimation.

Benefits of technology

It improves the clarity and accuracy of optical flow, reduces errors in occlusion areas, and enhances the performance of the optical flow estimation network, especially in optical flow calculations at edges and complex areas.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118608573A
    Figure CN118608573A
Patent Text Reader

Abstract

The invention discloses an unsupervised optical flow estimation method and system based on deformable convolution and a self-attention mechanism. The method comprises the following steps: acquiring two adjacent frames of images; and inputting the two adjacent frames of images into a pre-trained optical flow estimation network to obtain an estimated optical flow. According to the unsupervised optical flow estimation method and system based on the deformable convolution and self-attention mechanism, a brand new optical flow estimation network is provided, so that the problem of edge blurring of the optical flow is solved. Firstly, a feature fusion module is provided, and image features of different scales are fused so as to improve the pyramid feature extraction capability. Then, a deformable up-sampling module is realized, a deformable convolution is used to carry out convolution according to the contour of the feature, a self-attention mechanism is introduced to calculate a long-term dependency relationship in the feature, damage to the contour of an object in the image is avoided, and thus a clearer optical flow is generated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to an unsupervised optical flow estimation method and system based on a deformable convolution and self-attention mechanism, and belongs to the technical field of optical flow estimation. Background Art

[0002] When an object moves, the changes of the object on the imaging plane can be captured by observation devices such as cameras. Optical flow literally refers to the flow of pixels in an image, describing the correlation between pixels of two images. The movement of the camera or the movement of objects in the camera will produce optical flow. Optical flow estimation is a method of calculating the optical flow between two images, which is an important direction of computer vision research. With the development of optical flow estimation technology, optical flow as known information has been increasingly widely used in deep learning, and has played a great role in downstream work such as video interpolation, video filling, and visual odometry.

[0003] Early optical flow estimation relied on assumptions such as brightness invariance and time persistence to perform reasoning and optimize manually defined energy functions to obtain the optical flow field. Brightness invariance means that the brightness of the same object in the previous and next frames is consistent with the change of time, which is the basis of the optical flow method. Time persistence is an indispensable assumption of the optical flow method, that is, the change of time will not be so large that the pixel position will change drastically. The method based on deep learning needs to establish an optical flow data set. Through supervised learning, the information in the input image can be directly inferred to obtain the optical flow. It can be divided into supervised methods and unsupervised methods. The supervised method relies on the true value label of the optical flow to learn the optical flow establishment, and the model can obtain excellent results after training. Such methods require a large number of data sets during the training process, and the performance of the model depends largely on the quality of the data set. However, it is very expensive and difficult to obtain optical flow labels. Most of the current optical flow data sets come from computer simulations or are calculated using radar data.

[0004] Unsupervised methods do not require real optical flow labels to assist in training. The main idea of ​​unsupervised optical flow estimation methods comes from the principles in traditional optical flow estimation methods. The predicted optical flow is used to warp one image to another image, and the photometric difference between the warped image and the target image is minimized to optimize the photometric loss and iterate the network parameters. Such rules are not suitable in occluded areas, and early studies did not deal with occluded areas. Occlusion-aware learning methods remove the calculated occluded areas by using the principle of consistency, and remove the erroneous influence of occluded areas on model training in loss detection.

[0005] The feature pyramid network structure is simple and efficient, and is usually used in network structures such as target detection and semantic segmentation. In both supervised and unsupervised methods, feature pyramids are usually used as the backbone network for optical flow estimation. The idea of ​​the pyramid from coarse to fine is reflected in the feature extraction process. The gradual reduction in the size of each layer of features not only reduces the computational complexity, but also enables the identification of objects of different sizes. However, the high-dimensional top-level features contain more semantic information rather than texture information. Similarly, the pyramid structure uses features to calculate the optical flow in the opposite path from top to bottom. Therefore, when the initial optical flow is established, the lack of detailed features in the features at the top of the pyramid may cause errors in the generation of optical flow. In the process of establishing optical flow, traditional methods usually use simple bilinear interpolation for upsampling, which has fast calculation speed and good effect. However, direct stretching may cause the edge shape in the image to be destroyed, resulting in blurring artifacts that blur the optical flow, and the layer-by-layer transmission leads to accumulated errors in the calculation.

[0006] It can be seen that in order to produce clearer optical flow, an unsupervised optical flow estimation method and system with deformable convolution and self-attention mechanism is urgently needed. Summary of the invention

[0007] The purpose of the present invention is to overcome the deficiencies in the prior art, provide an unsupervised optical flow estimation method and system with a deformable convolution and self-attention mechanism, and propose a new optical flow estimation network to solve the edge blur problem of optical flow. First, a feature fusion module is proposed to fuse image features of different scales to improve the ability of pyramid feature extraction. Then, a deformable upsampling module is implemented, and a deformable convolution is used to perform convolution according to the contour of the feature, and a self-attention mechanism is introduced to calculate the long-term dependency in the feature, so as to avoid the destruction of the contour of the object in the image, thereby producing a clearer optical flow.

[0008] To achieve the above object, the present invention is implemented by adopting the following technical solutions:

[0009] In a first aspect, the present invention provides an unsupervised optical flow estimation method based on a deformable convolution and self-attention mechanism, comprising:

[0010] Get two adjacent frames of images;

[0011] Inputting the two adjacent frames of images into a pre-trained optical flow estimation network to obtain an estimated optical flow;

[0012] Among them, the optical flow estimation network includes a construction module, a feature fusion module, a first calculation module, a second calculation module and an output module; the construction module is used to downsample the pixel points of each frame image respectively to construct an image pyramid; the feature fusion module is used to perform multi-scale feature fusion processing on each layer of the image pyramid to obtain the fusion features of each layer; the first calculation module is used to calculate the first optical flow features of each layer according to the fusion features; the second calculation module is used to process the first optical flow features refined by deformable convolution through a self-attention mechanism to obtain the second optical flow features of each layer; the output module is used to fuse the second optical flow features of each layer to obtain the estimated optical flow.

[0013] Furthermore, each layer of the image pyramid is subjected to multi-scale feature fusion processing to obtain fusion features of each layer, including:

[0014] Obtain a downsampled image of the current layer, and extract a first feature of the downsampled image of the current layer through a first convolution operation;

[0015] The first feature is concatenated with the downsampled image of the current layer and then fused through convolution to obtain the second feature;

[0016] Get the downsampled image of the previous layer and extract the third feature through the first convolution operation;

[0017] The second feature and the third feature are fused to obtain the fused feature of the current layer.

[0018] Furthermore, the method for obtaining the first optical flow feature after the deformable convolution refinement includes:

[0019] According to the first optical flow feature of the current layer, the optical flow residual feature is obtained;

[0020] The optical flow residual features of the current layer are upsampled to obtain the offset corresponding to the feature map, and then fused with the upsampled result of the offset map of the convolution kernel features of the previous layer to obtain the offset map of the current layer;

[0021] The optical flow residual feature is deformably convolved according to the offset map of the current layer to obtain the refined first optical flow feature.

[0022] Furthermore, the method for obtaining the second optical flow feature includes:

[0023] The refined first optical flow features processed by the self-attention mechanism are processed by transposed convolution to obtain intermediate features;

[0024] Perform convolution calculation on the intermediate features to obtain the second optical flow features of the current layer.

[0025] Furthermore, the training method of the optical flow estimation network includes:

[0026] Acquire a training set, wherein the training set includes: two adjacent frames of images and corresponding optical flows;

[0027] Construct loss function;

[0028] Based on the training set and the loss function, the optical flow estimation network is trained to obtain a trained optical flow estimation network;

[0029] Among them, network training includes three stages: a stage using photometric loss and smoothness loss without considering occlusion, a stage using photometric loss and smoothness loss to consider occlusion, and a stage using photometric loss, smoothness loss and self-supervised loss to consider occlusion;

[0030] When considering the photometric loss and smoothness loss, the expression of the loss function is:

[0031] L=λ c L c +λ s L s

[0032] When considering the photometric loss, smoothness loss and self-supervision loss at the same time, the expression of the loss function is:

[0033] L=λ c L c +λ s L s +λ e L e

[0034] Where, L c is the luminosity loss, λ c is the weight coefficient of luminosity loss, L s is the smoothness loss, λ s is the weight coefficient of smoothness loss, L e is the self-supervision loss, λ e is the weight coefficient of the self-supervised loss.

[0035] Furthermore, when considering occlusion, the luminosity loss L c It is expressed as:

[0036]

[0037] in, Indicates I t+1 Using the image reconstructed by optical flow, O represents the predicted occlusion area that can be obtained during the derivation process of the neural network; It is the difference in pixels between the next frame image and the previous frame image after the optical flow mapping is calculated; is the robust loss function;

[0038] When occlusion is not considered, the luminosity loss L c It is expressed as:

[0039] Smoothness loss L s It is expressed as:

[0040] Furthermore, the self-supervision loss L e The methods of obtaining include:

[0041] Transform the input image and transform the optical flow predicted by the original network accordingly to obtain the input data and true value;

[0042] The transformed input image and true value are put into the neural network as labels and true values ​​for re-supervised training to obtain the self-supervised loss L e .

[0043] In a second aspect, the present invention provides an unsupervised optical flow estimation system based on a deformable convolution and self-attention mechanism, characterized in that it includes:

[0044] Acquisition module: used to acquire two adjacent frames of images;

[0045] Estimation module: used for inputting the two adjacent frames of images into a pre-trained optical flow estimation network to obtain an estimated optical flow;

[0046] Among them, the optical flow estimation network includes a construction module, a feature fusion module, a first calculation module, a second calculation module and an output module; the construction module is used to downsample the pixel points of each frame image respectively to construct an image pyramid; the feature fusion module is used to perform multi-scale feature fusion processing on each layer of the image pyramid to obtain the fusion features of each layer; the first calculation module is used to calculate the first optical flow features of each layer according to the fusion features; the second calculation module is used to process the first optical flow features refined by deformable convolution through a self-attention mechanism to obtain the second optical flow features of each layer; the output module is used to fuse the second optical flow features of each layer to obtain the estimated optical flow.

[0047] In a third aspect, the present invention provides a computer device, including a processor and a storage medium;

[0048] The storage medium is used to store instructions;

[0049] The processor is used to operate according to the instructions to execute the steps of the method according to the first aspect.

[0050] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, characterized in that when the program is executed by a processor, the steps of the method described in the first aspect are implemented.

[0051] Compared with the prior art, the present invention has the following beneficial effects:

[0052] The unsupervised optical flow estimation method and system of deformable convolution and self-attention mechanism provided by the present invention propose a new optical flow estimation network to solve the edge blur problem of optical flow. First, a feature fusion module is proposed to fuse image features of different scales to improve the ability of pyramid feature extraction. Then, a deformable upsampling module is implemented, and deformable convolution is used to perform convolution according to the contour of the feature, and a self-attention mechanism is introduced to calculate the long-term dependency in the feature, so as to avoid the destruction of the contour of the object in the image, thereby generating a clearer optical flow. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] Figure 1 It is a flowchart of an unsupervised optical flow estimation method of a deformable convolution and self-attention mechanism in Example 1;

[0054] Figure 2 It is a schematic diagram of the unsupervised optical flow estimation network structure;

[0055] Figure 3 It is the downsampling module diagram;

[0056] Figure 4 It is the optical flow that establishes the network structure;

[0057] Figure 5 It is the structural diagram of the upsampling module;

[0058] Figure 6 It is the output and intermediate process visualization of optical flow on the Sintel training dataset;

[0059] Figure 7 It is the optical flow visualization comparison between the method and ARFlow;

[0060] Figure 8 This is the optical flow visualization of the KITTI 2012 dataset and ARFlow;

[0061] Fig. 9 This is a visualization of the evaluation on the KITTI 2015 test set. DETAILED DESCRIPTION

[0062] The technical solution of the present invention is described in detail below through the accompanying drawings and specific embodiments. It should be understood that the embodiments of the present application and the specific features in the embodiments are detailed descriptions of the technical solution of the present application, rather than limitations on the technical solution of the present application. In the absence of conflict, the embodiments of the present application and the technical features in the embodiments can be combined with each other.

[0063] In this embodiment, the term "and / or" is only a description of the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, in this embodiment, the character " / " generally indicates that the associated objects before and after are in an "or" relationship.

[0064] Embodiment 1:

[0065] Figure 1 This is a flowchart of an unsupervised optical flow estimation method using a deformable convolution and self-attention mechanism in Embodiment 1 of the present invention. The unsupervised optical flow estimation method using a deformable convolution and self-attention mechanism provided in this embodiment can be applied to a terminal and can be executed by an unsupervised optical flow estimation system using a deformable convolution and self-attention mechanism. The device can be implemented by software and / or hardware and can be integrated in a terminal, such as any smart phone, tablet computer or computer device with communication function. Figure 1 The method of this implementation specifically includes the following steps:

[0066] Get two adjacent frames of images;

[0067] Inputting the two adjacent frames of images into a pre-trained optical flow estimation network to obtain an estimated optical flow;

[0068] Among them, the optical flow estimation network includes a construction module, a feature fusion module, a first calculation module, a second calculation module and an output module; the construction module is used to downsample the pixel points of each frame image respectively to construct an image pyramid; the feature fusion module is used to perform multi-scale feature fusion processing on each layer of the image pyramid to obtain the fusion features of each layer; the first calculation module is used to calculate the first optical flow features of each layer according to the fusion features; the second calculation module is used to process the first optical flow features refined by deformable convolution through a self-attention mechanism to obtain the second optical flow features of each layer; the output module is used to fuse the second optical flow features of each layer to obtain the estimated optical flow.

[0069] Furthermore, each layer of the image pyramid is subjected to multi-scale feature fusion processing to obtain fusion features of each layer, including:

[0070] Obtain a downsampled image of the current layer, and extract a first feature of the downsampled image of the current layer through a first convolution operation;

[0071] The first feature is concatenated with the downsampled image of the current layer and then fused through convolution to obtain the second feature;

[0072] Get the downsampled image of the previous layer and extract the third feature through the first convolution operation;

[0073] The second feature and the third feature are fused to obtain the fused feature of the current layer.

[0074] Furthermore, the method for obtaining the first optical flow feature after the deformable convolution refinement includes:

[0075] According to the first optical flow feature of the current layer, the optical flow residual feature is obtained;

[0076] The optical flow residual features of the current layer are upsampled to obtain the offset corresponding to the feature map, and then fused with the upsampled result of the offset map of the convolution kernel features of the previous layer to obtain the offset map of the current layer;

[0077] The optical flow residual feature is deformably convolved according to the offset map of the current layer to obtain the refined first optical flow feature.

[0078] Furthermore, the method for obtaining the second optical flow feature includes:

[0079] The refined first optical flow features processed by the self-attention mechanism are processed by transposed convolution to obtain intermediate features;

[0080] Perform convolution calculation on the intermediate features to obtain the second optical flow features of the current layer.

[0081] Furthermore, during the training process of the optical flow estimation network, the loss function is used to determine whether to stop the training;

[0082] The network training includes three stages: a stage using photometric loss and smoothness loss without considering occlusion, a stage using photometric loss and smoothness loss considering occlusion, and a stage using photometric loss, smoothness loss and self-supervised loss considering occlusion.

[0083] When considering the photometric loss and smoothness loss, the expression of the loss function is:

[0084] L=λ c L c +λ s L s

[0085] When considering the photometric loss, smoothness loss and self-supervision loss at the same time, the expression of the loss function is:

[0086] L=λ c L c +λ s L s +λ e L e

[0087] Where, L c is the luminosity loss, λ c is the weight coefficient of luminosity loss, L s is the smoothness loss, λ s is the weight coefficient of smoothness loss, L e is the self-supervision loss, λ e is the weight coefficient of the self-supervised loss.

[0088] Furthermore, when considering occlusion, the luminosity loss L c It is expressed as:

[0089]

[0090] in, Indicates I t+1 Using the image reconstructed by optical flow, O represents the predicted occlusion area that can be obtained during the derivation process of the neural network; It is the difference in pixels between the next frame image and the previous frame image after the optical flow mapping is calculated; is the robust loss function;

[0091] When occlusion is not considered, the luminosity loss L c It is expressed as:

[0092] Smoothness loss L s It is expressed as:

[0093] Furthermore, the self-supervision loss L e The methods of obtaining include:

[0094] Transform the input image and transform the optical flow predicted by the original network accordingly to obtain the input data and true value;

[0095] The transformed input image and true value are put into the neural network as labels and true values ​​for re-supervised training to obtain the self-supervised loss L e .

[0096] Next, the unsupervised optical flow estimation method of the deformable convolution and self-attention mechanism provided in this embodiment is described with reference to a specific case:

[0097] The task of unsupervised optical flow estimation is: input two three-channel images I t ,I t+1 ∈RH×W×3 Estimate the forward and backward optical flow corresponding to the image. t To I t+1 The optical flow is the forward optical flow V f , from I t+1 To I t The optical flow is the backward optical flow V b ∈R H ×W×2 . Figure 2 The network architecture of the method proposed in this embodiment is described in detail. The method uses a feature pyramid as the basic network for unsupervised optical flow estimation, performs feature extraction from coarse to fine, and establishes and refines the optical flow from fine to coarse. The usual optical flow estimation network structure is divided into three parts: feature extraction, optical flow estimation, and refinement. After the two images are input into the network, multi-scale image features are first obtained through feature extraction, and these features are used to establish and refine the optical flow layer by layer. The obtained optical flow is amplified and passed to the next layer through linear interpolation, and finally the output predicted optical flow is obtained. On this basis, this embodiment adds a multi-input downsampling module to enrich the extracted features in the feature extraction stage. Then, a deformable upsampling module is introduced to refine the optical flow in the pyramid, and the optical flow roughly calculated in the previous layer is refined and interpolated according to the image features and related features, and passed to the next layer. Finally, the network training is supervised using a mixed loss function.

[0098] In an image, different sizes of pixel blocks are formed due to different distances from the camera or the size of the objects themselves. The different sizes of the same object easily make it difficult for the neural network to understand the meaning of the image. After extracting features, the feature pyramid network processes the features on layers of different sizes to take into account targets of different sizes. Extracting features from multi-scale images can better handle objects of different sizes. Therefore, the optical flow pyramid is widely used in the field of optical flow estimation. It can calculate the optical flow layer by layer on features of different scales and transfer them between layers, while processing the flows generated by movements of different sizes.

[0099] In the optical flow pyramid network, the features involved in the calculation all come from the gradual downsampling of the input image features, and then the high-level semantic features are used to establish the optical flow. As the pyramid gets closer to the top layer, the features focus more on abstract semantic information, and some shallow features will be discarded in the pooling layer. Since the establishment of optical flow is a top-down accumulation, errors in the initial optical flow calculation will cause errors to persist in the system, resulting in poor optical flow blurring effect.

[0100] In view of the problem that texture features are gradually lost in the pyramid network structure during the feature extraction process of optical flow estimation. In order to improve the accuracy of unsupervised optical flow estimation, this embodiment proposes a multi-input downsampling feature extraction module (MIFM). The original input image is compressed to different sizes and added to the feature pyramid network to assist in feature extraction. The method first fuses the features originally extracted from the previous layer of the feature pyramid with the features of the scaled input image and then passes them to the next layer of the pyramid. By reducing the complementary information of the features and the features obtained from the downsampled image, it is possible to more comprehensively capture image information at different scales, thereby improving the perception of the image.

[0101] Specific structure such as Figure 3 As shown, for the i-th layer (i=0, 1, 2, 3, 4) of the optical flow pyramid, first, the original input image is downsampled to obtain a downsampled image Then, two 3×3 convolutional layers are used to downsample the image I from this layer i Then, the extracted features and the downsampled image I i The concatenated features are convolved and fused using a 1×1 convolutional layer to obtain the downsampled features. At the same time, the features extracted from the previous layer of the optical flow pyramid are Through two 3×3 convolutional layers, the feature size is consistent with the downsampled feature Finally, fusion The fused features are obtained by combining the downsampled features Then pass it to the next level of the pyramid.

[0102] After extracting the features of the two images, the optical flow estimation module is used to perform a rough calculation of the optical flow between the two images. The general process structure is as follows: Figure 4 As shown in Figure 1. The input of the optical flow network is the features extracted from the two images and the optical flow calculated in the previous layer. The initial optical flow used in the top layer of the pyramid is set to a two-dimensional tensor of all zeros of the same size as the features of the layer, and the remaining layers are interpolations of the predicted optical flow of the upper layer.

[0103] For each layer of the pyramid, first, the optical flow calculated by the previous layer of the pyramid is used to calculate the image I t The extracted feature map makes the image I t The feature image I t+1 Distortion. When calculating the distortion map, bilinear interpolation is used to implement the warping operation and calculate the gradient of the input convolution features and the back propagation flow. Next, these features and image I are used t+1 The cost volume stores It+1 Medium pixel and I t The matching cost of the corresponding pixel association in . It is the correlation matching cost between the distorted features and is calculated as shown in formula (3.1):

[0104]

[0105] In the formula, cv is the abbreviation of cost volume, x1 and x2 represent the features extracted from the two images at this layer, i refers to the number of pyramid layers, T is the transposition operator, and N is the cost volume vector Length, is the column vector of feature x1. By setting the calculation of local correlation, that is, for a total of l levels of pyramid, only the partial cost volume with a limited search range of d pixels needs to be calculated, thereby effectively calculating the complexity of correlation. A pixel movement in the top layer corresponds to a pixel movement in 2 i-1 Therefore, reducing the setting of d will greatly improve the calculation speed of the cost volume.

[0106] After obtaining the cost volume, LeakyReLU is used to activate the features and the number of channels of the correlation matrix between the two images is calculated to be fixed at 81. The correlation matrix is ​​concatenated and compressed to 32 dimensions. The features extracted from this layer of image 1 and the known optical flow are mixed to obtain the first 3×3 convolution input feature in image 4. Six 3×3 convolutions are used to gradually reduce the number of channels of the feature dimensionality reduction. When the feature is reduced to 2 channels, the output is the roughly estimated optical flow of this layer.

[0107] The optical flow obtained by the optical flow estimation module is the result of calculating the correlation between the features of the two images. The optical flow calculated at the top layer of the pyramid needs to be propagated downward. At the same time, the optical flow calculated in this way deviates from the features in the image. The role of the upsampling module in the optical flow estimation method is to refine and interpolate the calculated optical flow according to the image features to adapt it to the use of the lower layer of the pyramid. Traditional methods usually use bilinear interpolation and traditional convolution to complete this step. However, traditional convolution strictly uses features at fixed positions around to calculate output features, while different objects have different shapes and are only related to features at a certain part of the surrounding positions. This may cause flows that do not belong to the same object to be mistakenly entangled, resulting in some unnecessary or irrelevant features that may interfere with the calculation of the output.

[0108] Therefore, this embodiment introduces deformable convolution to adapt to changes in spatial texture. Deformable convolution can change the shape of the convolution kernel through neuron learning. It learns an offset map for each position, and then applies the obtained offset map to the feature map. According to the displacement given by the offset map, the corresponding features at the displacement are selected for resampling for weighting. In this way, the surrounding features that meet the semantics at a certain point are used for convolution calculation. The deformable convolution module learns the offset of each position and applies the generated offset map to the input feature for convolution. The formula is expressed as:

[0109]

[0110] Among them, N(p) represents the neighborhood of position p, whose size is equal to the size of the convolution kernel, p i represents the position in N(p), w i represents the weight of position p in the convolution kernel, x(p) represents the feature of position p in the input feature map x, y(p) is the output feature at position p, Δp i is the position p i That is, the eigenvalue at position p is derived from the weighted sum of the eigenvalues ​​of the corresponding values ​​of the offset map at position p.

[0111] In the optical flow estimation module, in order to reduce the amount of calculation, only the correlation between local pixels is calculated. This is because the movement between most pixels is small, but there may be large offsets, such as when large rotations or high-speed movements occur. In calculating the long-distance interdependence between two points in the feature, previous methods such as RNN or LSTM need to be calculated in order, and the two long-distance points can only be connected after several times and steps of information accumulation. The self-attention mechanism is more likely to capture the long-distance interdependent features in the image. During the calculation process, the connection between any two pixels in the image can be directly connected through a calculation step, which is conducive to the efficient use of features. The deformable upsampling module uses the self-attention mechanism to calculate the relationship between feature correlation and the feature itself to complete the upsampling process.

[0112] Figure 5 (Top) shows the calculation process of the self-attention mechanism. The first step is to create three weight matrices W for the feature X processed by the deformable convolution. Q , W K , W V , initialize three weight matrices. Multiply the weight matrix with the feature X to obtain the query matrix Q X , key matrix K X Sum value matrix V X , the calculation formula is as shown in formula (3.3).

[0113] Q(X)=WQ X,K(X)=W K X,V(X)=W V X.(3.3)

[0114] The second step is to calculate the attention score. For the input feature X, the self-attention mechanism calculates a score for each position. For example, when encoding the feature map at the current position i, the score S ij Determines the focus on the feature map position j. The score of this point depends on the query matrix and the key matrix, which can also be understood as the criticality of the query at this point. The calculation method is to multiply the query matrix and the key matrix, S(X) = Q(X) T K(X). The calculated attention score S needs to be normalized to obtain the normalized energy E, which is calculated according to formula (3.4):

[0115]

[0116] Then, a softmax operation is performed to normalize E(X) so that the attention scores are all positive numbers that sum to one. The value matrix V(X) is multiplied by the softmax E(X) to obtain the output Y of the attention layer.

[0117] Y=softmax(E(X))V(X). (3.5)

[0118] Finally, the output Y of the attention layer is multiplied by a learning factor λ and then added back to the input feature map to obtain the output features of the self-attention mechanism:

[0119] Out=λY+X. (3.6)

[0120] Figure 5 (Below) The framework of the upsampling module (DUM) is summarized. First, the dilated convolution is used for the high-dimensional optical flow features obtained during the optical flow establishment process to obtain the fixed-dimensional optical flow residual features Res of the i-th layer of the optical flow pyramid. i Then, the high-dimensional optical flow feature is used to calculate the offset corresponding to the feature map, and the offset map offsetmap of the convolution kernel feature of the previous layer of the pyramid is used. i+1 The upsampling results are fused to obtain the offset map of the convolution kernel features of this layer as offsetmap i This allows the semantic information of the top layer of the pyramid, that is, the optical flow offset of the previous layer, to be transmitted and circulated between the pyramid layers. i According to the offsetmap of the layer i Perform deformable convolution to obtain further refined optical flow features Among them, H i , Wi , C represent the width, height and number of channels of the feature respectively.

[0121] Then, the self-attention mechanism is used to process the refined optical flow features Refine i , calculate the correlation between local pixels. Different from directly using linear interpolation for upsampling, this embodiment uses transposed convolution to directly amplify the features calculated by the self-attention mechanism and retain the optical flow relationship calculated by the self-attention mechanism. Finally, a 3×3 convolution is used to calculate the optical flow at this scale.

[0122] The loss function is a core issue of unsupervised optical flow. Through the loss function, the method controls the training of model parameters. The method uses three loss functions for mixed supervision and divides the network training into three different stages to distribute and adjust the unsupervised optical flow estimation network. They are the stage of using only photometric loss and smoothness loss without considering occlusion, the stage of using photometric loss and smoothness loss to consider occlusion, and the stage of using photometric loss, smoothness loss and self-supervised loss to consider occlusion. The following is an introduction to the three loss functions.

[0123] (1) Luminosity loss L c

[0124] The photometric consistency assumption is the core rule of motion estimation, which assumes that the pixels in the source image should be similar to the pixels in the target image to which they are registered, which represents the nature of optical flow. Photometric loss is to map pixels to another image using optical flow, and use the photometric value at the pixel point to judge the quality of optical flow. Photometric loss can detect the contours of objects in the image, and can supervise the calculation of the convolution kernel of the deformable convolution. The method uses census loss, and uses optical flow to calculate the Euclidean distance on the census-transformed image to construct the photometric loss L. c , and its calculation method is shown in formula (3.7):

[0125]

[0126] in, Indicates I t+1 Using the image reconstructed by optical flow, O represents the predicted occlusion area that can be obtained during the derivation process of the neural network. It is the difference in pixels between the next frame image and the previous frame image after the optical flow mapping is calculated. is the robust loss function. In the experiment, ε=0.01 and q=0.4 are set. Without considering occlusion, the loss is calculated as That is, it is assumed that there is no occlusion in the image.

[0127] (2) Smoothness loss L s

[0128] Smoothness is a simple and effective assumption for the statistical properties of optical flow. Lighting in nature is generally locally smooth, and the image gradient field is used to correct the smoothness loss to prevent the predicted optical flow values ​​of adjacent pixels from differing too much. The first-order smoothness constraints for calculating the forward and backward optical flows are shown in equation (3.8), minimizing the L1 loss of the first-order gradient of the predicted optical flow:

[0129]

[0130] In order to better supervise the middle part of the network, the method calculates the smoothness loss and photometric loss for the output optical flow of each layer of the pyramid, and accumulates the photometric loss and smoothness loss of each layer as the total photometric loss and smoothness loss to supervise the network training.

[0131] (3) Self-supervision loss L e

[0132] Unlike the above two losses which can be calculated by mathematical formulas, the self-supervised loss refers to using the trained network as a teacher to supervise the network to continue training. The calculation of this loss function includes two steps. First, the input image is transformed and the optical flow predicted by the original network is transformed accordingly to obtain the input data and true value. Then, the transformed input image and true value are put into the neural network as labels and true values ​​for re-supervised training.

[0133] The self-supervised loss is the pixel difference between the newly predicted optical flow and the previously predicted optical flow, and this difference is used to supervise the neural network training. The self-supervised loss only supervises the training on the forward optical flow. Through the self-supervised loss, the data set can be expanded to solve the problem of insufficient optical flow data set, and the model can also be adapted to different environments and objects.

[0134] Combining the above three losses, when only photometric loss and smoothness loss are used, the mixed loss function used by the model is:

[0135] L=λ c L c +λ s L s .(3.9)

[0136] When it is necessary to consider photometric loss, smoothness loss, and self-supervised loss at the same time, the mixed loss function used by the model is:

[0137] L=λ c L c +λ s L s +λ e Le .(3.10)

[0138] After extensive experimental comparison, in three different training stages, the parameters in the loss function are set as follows: c =1,λ s =0.1,λ e =0.1.

[0139] This section first describes the platform environment and network parameter settings for the experiment, then compares the experimental results with the classic supervised and unsupervised optical flow estimation methods on training and test data, and performs a visual comparison of the optical flow. Ablation experiments are then performed on the two new modules proposed in the method to verify their effectiveness.

[0140] The experiment used three datasets for training and evaluation. The Flying Chairs dataset consists of 22,872 image pairs and corresponding optical flows, with an image size of 512×384. The image shows a rendering of a 3D chair on a plane moving against a random background. The MPI-Sintel dataset is divided into two parts, Clean and Final, with 23 different scenes and an image resolution of 1024×436. The KITTI dataset uses two optical flow datasets from 2012 and 2015, with image resolutions of 370×1224, 374×1248, and 376×1241.

[0141] The experiment uses the Flying Chairs dataset to train the model, setting the number of training times to 1,000,000 times, the number of images per iteration to 1, and the learning rate to 0.0001 without considering occlusion, and 0.00001 when considering the occlusion area. The experiment uses the MPI-Sintel and KITTI datasets as the training and evaluation standards, and continues to train on the model parameters obtained by Flying Chairs training, setting the learning rate to 0.00001, the number of images per iteration to 1, and using the test set for training.

[0142] This example uses a five-layer feature pyramid structure. Considering the size of the image, a downsampling feature fusion module is used for the first three layers. The experiment uses a 3090Ti GPU, and the total training time of the model on each data set is 2 days. The parameters of the model are 3.71M.

[0143] After the unsupervised network training is completed, the input image can obtain the forward and backward predicted optical flow and the calculated occlusion area. The KITTI dataset is a dataset in a real environment, and the Sintel dataset is a scene in an animation. Figure 6This is a visualization of the output and intermediate results of the unsupervised optical flow estimation network on the Sintel training set. The four columns are the input image, the forward optical flow prediction value, the difference between the true optical flow value and the predicted value, and the occlusion area calculated by the neural network. The occlusion area in the optical flow is determined by the consistency of the optical flow, and the threshold of the consistency is manually set. The consistency is used to determine whether the forward and backward optical flow are self-consistent, that is, the two pixels between frames can correspond to each other. When the backward optical flow mapping is used on the forward optical flow and returns to the original position, it is considered to have forward and backward consistency. The forward and backward consistency of the optical flow is low in the occluded or fast-moving area, so the method sets the threshold to regard the area with low consistency as the occlusion area that does not conform to the optical flow law. The error of the optical flow is mostly concentrated around the contour of the object, which is also around the predicted occlusion area. In order to better learn the optical flow with more edges, the method regards more areas as non-contour edge areas so that the network participates in the supervision of the optical flow in this area, so that good optical flow can be obtained in this area.

[0144] Figure 7 This is a visual comparison of the details of the method in the Sintel dataset. It can be seen that the optical flow around the object is close to the true value of the optical flow, and has higher clarity and is close to the object outline. This may be due to the deformable upsampling module, which allows the optical flow to have a higher resolution during the pyramid interpolation process.

[0145] This embodiment is compared with classic supervised and unsupervised methods on the MPI-Sintel and KITTI datasets. Table 3.1 shows the quantitative results of the method on the Sintel and KITTI datasets, indicating that the method of this embodiment can estimate the optical flow well, using the endpoint error (EPE) and the proportion of optical flow error areas (ER) as comparison evaluation indicators. The method is performed on the training and test platforms respectively. In the final test environment, the EPE index on the Sintel clean dataset is 4.65, which is 0.11 higher than the 4.73 of the MDFlow-fast method. On the KITTI 2012 dataset, it reaches 1.6, which is 6% higher than the EpiFlow of 1.8. On the KITTI 2015 dataset, the ER reaches 9.04%, which is 10.1% higher than the UFlow method. The effect of the method proposed in this embodiment on the real environment KITTI dataset is close to the test results of the supervised method PWCNet.

[0146] Table 3.1 Comparison of results between the method and existing classical methods

[0147]

[0148] The images on the Sintel final dataset have higher complexity, and the method performs poorly on this dataset. It is observed in the visualization of the test platform that on the Sintel final dataset, the inferred optical flow is too correlated with the image texture information, resulting in large errors, which may be caused by overfitting during the training process of this dataset.

[0149] Figure 8 This is a visual comparison between the unsupervised optical flow estimation method proposed in this embodiment and the ARFlow method on the KITTI 2012 dataset. It can be seen that the optical flow of the edge contour area of ​​the object is clearer in this method. In complex areas, the estimated optical flow can describe smaller objects in it more accurately.

[0150] Fig. 9 This is the visual evaluation result obtained after the method is submitted on the test platform of the KITTI 2015 dataset. They are the input image, the optical flow estimated by this method and the UFlow method, and the difference between the estimated optical flow of the two methods and the true value of the optical flow. Among them, the blue part is the part with less error, and the red part is the part with larger error. It can be seen that in the first column, the method shows more complete changes in the optical flow of the road sign and the grass under the road sign. In the last two columns, the method estimates the optical flow of detailed objects such as vertical road signs and telephone poles on the road more accurately.

[0151] Table 3.2 Comparison results with unsupervised methods on the KITTI 2015 test set

[0152]

[0153] Table 3.2 shows the results on the test platform of the KITTI 2015 dataset. F1 represents the percentage of optical flow outliers, and F1-bg and F1-fg represent the percentage of outliers averaged only on the background area and foreground area. F1-all is the percentage of outliers averaged over all ground truth pixels. The accuracy of the method is higher than that of some unsupervised methods, especially in the background area, which provides high-quality stationary point optical flow for the subsequent odometer calculation.

[0154] In order to verify the impact of different components on network performance, this section conducts an ablation study on the proposed modules, as shown in Table 3.3. The experiment uses the training process mentioned in 3.3.1 Experimental Details. The network proposed in this embodiment is trained in multiple settings that are identical except for the network structure, and is evaluated on five training datasets including simulation environments and real environments: FlyingChairs, Sintel clean, Sintel final, KITTI2012 and 2015. Ablation experiments were conducted on the two components proposed in this embodiment, the multi-input feature extraction downsampling module (MIFM) and the deformable upsampling module (DUM). Among them, the original pyramid feature extraction is used to replace the multi-input feature extraction downsampling module, and the dilated convolution is used to replace the deformable upsampling module.

[0155] Table 3.3 Ablation results of endpoint loss of each module in this method

[0156]

[0157] When trained on each dataset, the MIFM and DUM modules have different degrees of improvement compared to the base network. When MIFM is used alone, the model adds fewer parameters and the training time does not change much. It can achieve significant performance improvements on each dataset, which can prove that the module can effectively improve the accuracy of optical flow estimation on different datasets. The improvement of the model performance by the DUM module alone is not obvious, but when combined with the MIFM module, there is a great improvement, probably because the features contain more texture information, allowing deformable convolution and self-attention mechanisms to play a role. The performance of the complete method is improved by 9% on the Flying Chairs dataset, 14.8% and 12.7% on the Sintel dataset, and 20.2% and 29% on the KITTI dataset. The effectiveness of the proposed module for unsupervised optical flow estimation networks is verified.

[0158] This embodiment proposes an unsupervised optical flow estimation method of deformable convolution and self-attention mechanism to solve the problem of blurred edges of optical flow. First, this embodiment proposes a multi-scale feature extraction module to fuse image features of different scales to improve the ability of pyramid feature extraction. Then, this embodiment implements a deformable upsampling module, uses deformable convolution to perform convolution according to the contour of the feature, introduces a self-attention mechanism to calculate the long-term dependency in the feature, avoids the destruction of the contour of the object in the image, and thus produces a clearer optical flow. It is compared with several classic methods on several major data sets. The experimental results show that both modules improve the performance of optical flow estimation, verifying the effectiveness of the proposed method.

[0159] Embodiment 2:

[0160] An unsupervised optical flow estimation system based on deformable convolution and self-attention mechanism, characterized by comprising:

[0161] Acquisition module: used to acquire two adjacent frames of images;

[0162] Estimation module: used for inputting the two adjacent frames of images into a pre-trained optical flow estimation network to obtain an estimated optical flow;

[0163] Among them, the optical flow estimation network includes a construction module, a feature fusion module, a first calculation module, a second calculation module and an output module; the construction module is used to downsample the pixel points of each frame image respectively to construct an image pyramid; the feature fusion module is used to perform multi-scale feature fusion processing on each layer of the image pyramid to obtain the fusion features of each layer; the first calculation module is used to calculate the first optical flow features of each layer according to the fusion features; the second calculation module is used to process the first optical flow features refined by deformable convolution through a self-attention mechanism to obtain the second optical flow features of each layer; the output module is used to fuse the second optical flow features of each layer to obtain the estimated optical flow.

[0164] The unsupervised optical flow estimation system of deformable convolution and self-attention mechanism provided by an embodiment of the present invention can execute the unsupervised optical flow estimation method of deformable convolution and self-attention mechanism provided by any embodiment of the present invention, and has functional modules and beneficial effects corresponding to the execution method.

[0165] Embodiment three:

[0166] An embodiment of the present invention further provides a computer device, including a processor and a storage medium;

[0167] The storage medium is used to store instructions;

[0168] The processor is used to operate according to the instructions to perform the steps of the following method:

[0169] Get two adjacent frames of images;

[0170] Inputting the two adjacent frames of images into a pre-trained optical flow estimation network to obtain an estimated optical flow;

[0171] Among them, the optical flow estimation network includes a construction module, a feature fusion module, a first calculation module, a second calculation module and an output module; the construction module is used to downsample the pixel points of each frame image respectively to construct an image pyramid; the feature fusion module is used to perform multi-scale feature fusion processing on each layer of the image pyramid to obtain the fusion features of each layer; the first calculation module is used to calculate the first optical flow features of each layer according to the fusion features; the second calculation module is used to process the first optical flow features refined by deformable convolution through a self-attention mechanism to obtain the second optical flow features of each layer; the output module is used to fuse the second optical flow features of each layer to obtain the estimated optical flow.

[0172] For the details of each step in this embodiment, please refer to the first embodiment, which will not be described in detail here. Since this embodiment and the first embodiment adopt the same technical concept, it also has the technical effects described in the first embodiment.

[0173] Embodiment 4:

[0174] The embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, the steps of the following method are implemented:

[0175] Get two adjacent frames of images;

[0176] Inputting the two adjacent frames of images into a pre-trained optical flow estimation network to obtain an estimated optical flow;

[0177] Among them, the optical flow estimation network includes a construction module, a feature fusion module, a first calculation module, a second calculation module and an output module; the construction module is used to downsample the pixel points of each frame image respectively to construct an image pyramid; the feature fusion module is used to perform multi-scale feature fusion processing on each layer of the image pyramid to obtain the fusion features of each layer; the first calculation module is used to calculate the first optical flow features of each layer according to the fusion features; the second calculation module is used to process the first optical flow features refined by deformable convolution through a self-attention mechanism to obtain the second optical flow features of each layer; the output module is used to fuse the second optical flow features of each layer to obtain the estimated optical flow.

[0178] For the details of each step in this embodiment, please refer to the first embodiment, which will not be described in detail here. Since this embodiment and the first embodiment adopt the same technical concept, it also has the technical effects described in the first embodiment.

[0179] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0180] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0181] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0182] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0183] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the technical principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. An unsupervised optical flow estimation method based on deformable convolution and self-attention mechanism, characterized by: include: Get two adjacent frames of images; Inputting the two adjacent frames of images into a pre-trained optical flow estimation network to obtain an estimated optical flow; Wherein, the optical flow estimation network includes a construction module, a feature fusion module, a first calculation module, a second calculation module and an output module; The construction module is used to downsample the pixels of each frame of image to construct an image pyramid; The feature fusion module is used to perform multi-scale feature fusion processing on each layer of the image pyramid to obtain fusion features of each layer; The first calculation module is used to calculate the first optical flow features of each layer according to the fusion features; The second computing module is used to process the first optical flow features refined by the deformable convolution through a self-attention mechanism to obtain the second optical flow features of each layer; The output module is used to fuse the second optical flow features of each layer to obtain an estimated optical flow.

2. The unsupervised optical flow estimation method based on deformable convolution and self-attention mechanism according to claim 1, characterized in that: Each layer of the image pyramid is subjected to multi-scale feature fusion processing to obtain fusion features of each layer, including: Obtain a downsampled image of the current layer, and extract a first feature of the downsampled image of the current layer through a first convolution operation; The first feature is concatenated with the downsampled image of the current layer and then fused through convolution to obtain the second feature; Get the downsampled image of the previous layer and extract the third feature through the first convolution operation; The second feature and the third feature are fused to obtain the fused feature of the current layer.

3. The unsupervised optical flow estimation method based on deformable convolution and self-attention mechanism according to claim 1, characterized in that: The method for obtaining the first optical flow feature after the deformable convolution refinement includes: According to the first optical flow feature of the current layer, the optical flow residual feature is obtained; Get the upsampling result of the offset map of the convolution kernel feature of the previous layer; The optical flow residual features of the current layer are upsampled to obtain the offset corresponding to the feature map, and then fused with the upsampled result of the offset map of the convolution kernel features of the previous layer to obtain the offset map of the current layer; The optical flow residual feature is deformably convolved according to the offset map of the current layer to obtain the refined first optical flow feature.

4. The unsupervised optical flow estimation method of deformable convolution and self-attention mechanism according to claim 3, characterized in that: The method for obtaining the second optical flow feature includes: The refined first optical flow features processed by the self-attention mechanism are processed by transposed convolution to obtain intermediate features; Perform convolution calculation on the intermediate features to obtain the second optical flow features of the current layer.

5. The unsupervised optical flow estimation method of deformable convolution and self-attention mechanism according to claim 1, characterized in that: The training method of the optical flow estimation network comprises: Acquire a training set, wherein the training set includes: two adjacent frames of images and corresponding optical flows; Construct loss function; Based on the training set and the loss function, the optical flow estimation network is trained to obtain a trained optical flow estimation network; Among them, network training includes three stages: a stage using photometric loss and smoothness loss without considering occlusion, a stage using photometric loss and smoothness loss to consider occlusion, and a stage using photometric loss, smoothness loss and self-supervised loss to consider occlusion; When considering the photometric loss and smoothness loss, the expression of the loss function is: L=λ c L c +λ s L s When considering the photometric loss, smoothness loss and self-supervision loss at the same time, the expression of the loss function is: L=λ c L c +λ s L s +λ e L e Where, L c is the luminosity loss, λ c is the weight coefficient of luminosity loss, L s is the smoothness loss, λ s is the weight coefficient of smoothness loss, L e is the self-supervision loss, λ e is the weight coefficient of the self-supervised loss.

6. The unsupervised optical flow estimation method of deformable convolution and self-attention mechanism according to claim 5, characterized in that: When considering occlusion, the luminosity loss L c It is expressed as: in, Indicates I t+1 Using the image reconstructed by optical flow, O represents the predicted occlusion area that can be obtained during the derivation process of the neural network; It is the difference in pixels between the next frame image and the previous frame image after the optical flow mapping is calculated; is the robust loss function; When occlusion is not considered, the luminosity loss L c It is expressed as: Smoothness loss L s It is expressed as:

7. The unsupervised optical flow estimation method of deformable convolution and self-attention mechanism according to claim 6, characterized in that: Self-supervised loss L e The methods of obtaining include: Transform the input image and transform the optical flow predicted by the optical flow estimation network accordingly to obtain the input data and true value; The transformed input image and true value are put into the neural network as labels and true values ​​for re-supervised training to obtain the self-supervised loss L e .

8. An unsupervised optical flow estimation system with deformable convolution and self-attention mechanism, characterized in that: include: Acquisition module: used to acquire two adjacent frames of images; Estimation module: used for inputting the two adjacent frames of images into a pre-trained optical flow estimation network to obtain an estimated optical flow; The optical flow estimation network includes a construction module, a feature fusion module, a first calculation module, a second calculation module and an output module; the construction module is used to downsample the pixel points of each frame image respectively to construct an image pyramid; the feature fusion module is used to perform multi-scale feature fusion processing on each layer of the image pyramid to obtain fusion features of each layer; the first calculation module is used to calculate the first optical flow features of each layer according to the fusion features; the second calculation module is used to process the first optical flow features after the deformable convolution refinement through the self-attention mechanism to obtain the second optical flow features of each layer; The output module is used to fuse the second optical flow features of each layer to obtain an estimated optical flow.

9. A computer device, characterized in that: including processor and storage medium; The storage medium is used to store instructions; The processor is configured to operate according to the instructions to execute the steps of the method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Cited By

  • Optical flow estimation method based on improved FlowNetS

    CN119027462A