A moving object classification method based on appearance preserving module and 3D convolution

By using the appearance preservation module and three-dimensional convolution method in the video to align adjacent feature maps and enhance the attention mechanism, the problem of temporal information modeling in the classification of moving objects is solved, and the accurate classification and diversity of moving objects in the video are achieved. promote.

CN113111724BActive Publication Date: 2024-08-23ZHEJIANG UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110291565.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-03-18
Publication Date
2024-08-23
Estimated Expiration
2041-03-18

AI Technical Summary

Technical Problem

Classification of moving objects in videos has problems such as occlusion, blur, and elusive motion trajectories, and it is difficult for existing technologies to effectively model temporal information, affecting classification accuracy.

Method used

A method based on appearance preservation module and three-dimensional convolution is used to align adjacent feature maps at the pixel level, and the attention mechanism is enhanced through regularization constraints. It is combined with three-dimensional convolution to model temporal information while maintaining the quality of appearance performance. , to achieve accurate classification of moving objects in videos.

Benefits of technology

It significantly improves the accurate classification of moving objects in videos, enhances the modeling ability of temporal information, and improves the diversity and accuracy of classification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113111724B
    Figure CN113111724B
Patent Text Reader

Abstract

A moving object classification method based on appearance preservation module and three-dimensional convolution includes obtaining continuous frames and labels of a video to be detected and preprocessing; reconstructing adjacent feature maps of each frame using cross-pixel semantic similarity; and finding mismatched areas of the reconstructed map through a comparative attention mechanism to avoid error propagation; using cascaded 1×3×3 spatial domain convolution and 3×1×1 temporal domain convolution to replace traditional 3D convolution and performing residual cascade of the spatial preservation module in a parallel cascade hybrid manner, and extracting features using the obtained residual network; applying regularization constraints to the attention module to maintain diversity; and obtaining a feature vector obtained by performing spatial maximum pooling and temporal average pooling on the obtained feature map and inputting it into a fully connected network to obtain a predicted classification result for the object to be classified. The present invention realizes accurate classification of moving objects in videos.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the technical field of target classification, and specifically relates to a method for classifying moving objects. Background Art

[0002] With the development of deep learning, image classification and moving object classification have received widespread attention. Analyze the semantic information of objects contained in the video, understand their content, and annotate, classify and describe the video. Large-scale video classification is the next key problem that needs to be solved urgently after the image classification problem is solved. The classification of moving objects in the video is a very challenging task compared to the classification of static images, such as occlusion, blur, elusive motion trajectory, and containing additional time information. The network can access not only the appearance information present in a single static image, but also their complex time evolution. At the same time, the classification of moving objects is also more valuable, such as personnel recognition in surveillance, identification and scanning detection of drones, and driving recorders of self-driving cars.

[0003] The main goal of moving object classification is to understand the moving objects contained in the video and determine the specific category of the moving objects. Moving object classification will classify the continuous frames of different objects in the video into single or multiple categories based on the semantic content of the video, such as human behavior and complex events. Moving object classification is not only about understanding each frame of the video, but more importantly, it is necessary to identify a few key targets that can describe the video. Inspired by the human attention mechanism, the application of attention mechanism in moving object classification can model the temporal relationship while maintaining the quality of the video appearance representation. Combined with three-dimensional convolution, the temporal information between frames can be effectively extracted. Summary of the invention

[0004] The present invention aims to overcome the above-mentioned shortcomings of the prior art and provides a moving object classification method based on an appearance preservation module and three-dimensional convolution. The appearance preservation module aligns adjacent feature maps at the pixel level, and uses subsequent three-dimensional convolution to model the temporal information while maintaining the quality of appearance performance. The diversity of the attention mechanism is enhanced through regularization constraints, thereby achieving accurate classification of moving objects in videos.

[0005] In order to achieve the above purpose, the technical solution adopted by this application is:

[0006] A moving object classification method based on appearance preservation module and three-dimensional convolution comprises the following steps:

[0007] Step S1, obtaining continuous video frames to be detected and corresponding labels;

[0008] Step S2, resize all video frames to 256×128 pixels and use horizontal flipping to increase data;

[0009] Step S3, reconstructing adjacent feature maps using pixel semantic similarity;

[0010] Step S4, using contrast attention to align the appearance of the reconstructed adjacent feature maps;

[0011] Step S5, replacing the residual in ResNet-50 with a basic residual unit formed by appearance-preserving convolution combined with three-dimensional convolution;

[0012] Step S6: For each residual unit, add a regularization constraint module to achieve attention diversity;

[0013] Step S7: input the obtained feature vector into the fully connected network to obtain a predicted classification result for the object to be classified.

[0014] Preferably, the step S3 reconstructs adjacent feature maps using pixel semantic similarity, comprising:

[0015] S31. Let the input tensor of the acquired T frames be T×H×W×C, and regard each frame as the central frame of H×W×C, where T represents the number of batch frames, and H, W, and C represent the length, width, and channel dimensions of the input tensor respectively;

[0016] S32. Sample two adjacent frames of each frame, and obtain 2T adjacent feature maps after zero padding;

[0017] S33. In order to save computational overhead, the central feature map C and the adjacent feature map X are transformed to Where r is the dimension reduction coefficient, which is used to reduce the channel dimension of the feature map by r times;

[0018] S34. Calculate the covariance matrix P of the transformed central feature map C' and the adjacent feature map X' as follows:

[0019]

[0020] Among them, I is The identity matrix, l = [1,1,1,1…] T yes dimensional vector.

[0021] S35. Divide the obtained covariance matrix P by the scaling factor And the similarity weight W is obtained through the Softmax activation function;

[0022] S36. Multiply the weight coefficient W back to the original adjacent feature map, and set the size to H×W×C, that is, the initially reconstructed adjacent feature map Y.

[0023] Preferably, the step S4 uses a contrastive attention mechanism to perform appearance alignment on the reconstructed adjacent feature maps, including:

[0024] S41. Map Y and C to a low-dimensional semantic space through semantic mapping, and transform them into Y', C';

[0025] S42. Perform matrix dot multiplication on the low-dimensional feature graph Y', C' to obtain a similarity matrix Q;

[0026] S43. The similarity matrix Q is activated by the sigmoid function to generate an H×W×1 attention mask ContrastiveAttMASK, as follows:

[0027]

[0028] Among them, i represents any spatial position on the feature map, y i is the feature of any spatial position in the reconstructed feature map Y, c i is the central feature map C and y i Features with the same spatial position, sigmoid is the activation function, θ, It is the semantic mapping function implemented by 1×1 convolution;

[0029] S44. Expand the channel dimension of the attention mask ContrastiveAttMASK and perform matrix dot multiplication with the reconstructed adjacent feature map Y to generate a feature map Z which is the reconstructed adjacent feature map after alignment.

[0030] Preferably, the three-dimensional convolution in step S5 is composed of a 1×3×3 spatial domain convolution and a 3×1×1 temporal domain convolution, and a parallel cascade hybrid method is adopted, first passing through the spatial domain convolution, and then the output passes through the appearance preservation module and the temporal domain convolution as a residual cascade. The residual unit composed of the above 3D convolution and appearance preservation module is used to modify the basic residual unit in the ResNet-50 network. Since the stage 1 of ResNet-50 lacks accurate semantic information and the stage 4 lacks accurate spatial information, only the basic residual units in stage 2 and stage 3 are replaced.

[0031] Preferably, step S6 uses regularization constraints to achieve attention diversity as follows:

[0032]

[0033] Where β is the coefficient, λ1(·) and λ2(·) represent the maximum and minimum eigenvalues ​​of the feature matrix respectively, and F is the output feature map converted into matrix form, F∈R C×N ,N=H×W, which is the product of the width and height of the feature map. T is the transpose of F.

[0034] The present application provides a moving object classification method based on an appearance preservation module and three-dimensional convolution. The appearance preservation module reconstructs adjacent feature maps at the pixel level using pixel semantic similarity, uses contrast attention to perform appearance alignment on the reconstructed adjacent feature maps, and uses subsequent three-dimensional convolution to model temporal information while maintaining the quality of appearance performance, thereby significantly improving the accurate classification of moving objects in videos. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 is a flow chart of the present invention;

[0036] Figure 2 A schematic diagram of the present invention for reconstructing adjacent feature maps using pixel semantic similarity;

[0037] Figure 3 A schematic diagram of the present invention using contrastive attention to align the appearance of reconstructed adjacent feature maps;

[0038] Figure 4 A schematic diagram of adding a regularization constraint module to a residual unit according to the present invention. DETAILED DESCRIPTION

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

[0040] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application.

[0041] In one of the embodiments, a method for classifying moving objects based on an appearance preservation module and three-dimensional convolution is provided. The method aligns adjacent feature maps at the pixel level through the appearance preservation module, and uses subsequent three-dimensional convolution to model temporal information while maintaining the quality of appearance performance. The diversity of the attention mechanism is enhanced through regularization constraints, thereby achieving accurate classification results for moving objects in videos.

[0042] Specifically, Figure 1 As shown, the moving object classification method based on appearance preservation module and three-dimensional convolution in this embodiment includes the following steps:

[0043] Step S1: Obtain continuous video frames to be detected and corresponding labels.

[0044] For each moving object video track, 4 frames are randomly sampled with a step of 8 frames to form a video clip. Each batch contains 8 objects and 4 video clips for each object.

[0045] Step S2: resize all video frames to 256×128 pixels and use horizontal flipping to increase the data.

[0046] In order to improve the processing speed and accuracy of data, the acquired data must first be preprocessed, including image denoising, size processing, and data enhancement to enhance the generalization ability of the model.

[0047] Step S3: Reconstruct adjacent feature maps using pixel semantic similarity.

[0048] For each central feature map, the process of reconstructing adjacent feature maps using cross-pixel semantic similarity in this embodiment is as follows:

[0049] S31. Let the input tensor of the acquired T frames be T×H×W×C, and regard each frame as the central frame of H×W×C, where T represents the number of batch frames, and H, W, and C represent the length, width, and channel dimensions of the input tensor respectively;

[0050] S32. Sample two adjacent frames of each frame, and obtain 2T adjacent feature maps after zero padding;

[0051] S33. Save computational overhead and transform the central feature map C and the adjacent feature map X to Where r is the dimension reduction coefficient, which is used to reduce the channel dimension of the feature map by r times;

[0052] S34. Calculate the covariance matrix P of the transformed central feature map C' and the adjacent feature map X' as follows:

[0053]

[0054] Among them, I is The identity matrix, l = [1,1,1,1…] T yes dimensional vector.

[0055] S35. Divide the obtained covariance matrix P by the scaling factor And the similarity weight W is obtained through the Softmax activation function;

[0056] S36. Multiply the weight coefficient W back to the original adjacent feature map, and set the size to H×W×C, that is, the initially reconstructed adjacent feature map Y.

[0057] Step S4: Use the contrastive attention mechanism to align the appearance of the reconstructed adjacent feature maps.

[0058] For the reconstructed preliminary adjacent feature map, it is necessary to ensure that its appearance is aligned with the original central feature map in time. Such an appearance alignment process can be regarded as the feature map registration between two video frames. Contrastive attention can be used to find the mismatching area between the reconstructed feature map and the central feature map. It takes two feature maps as input and applies it to the reconstructed feature map, while spatial attention takes one feature map as input and applies it to itself to avoid error propagation.

[0059] In one embodiment, the process of providing appearance alignment is as follows:

[0060] S41. Map Y and C to a low-dimensional semantic space through semantic mapping, and transform them into Y', C';

[0061] S42. Perform matrix dot multiplication on the low-dimensional feature graph Y', C' to obtain a similarity matrix Q;

[0062] S43. The similarity matrix Q is activated by the sigmoid function to generate an H×W×1 attention mask ContrastiveAttMASK, as follows:

[0063]

[0064] Among them, i represents any spatial position on the feature map, y i is the feature of any spatial position in the reconstructed feature map Y, c i is the central feature map C and y i Features with the same spatial position, sigmoid is the activation function, θ, It is the semantic mapping function implemented by 1×1 convolution;

[0065] S44. Expand the channel dimension of the attention mask ContrastiveAttMASK and perform matrix dot multiplication with the reconstructed adjacent feature map Y to generate a feature map Z which is the reconstructed adjacent feature map after alignment.

[0066] Step S5: Replace the residual in ResNet-50 with the basic residual unit formed by appearance-preserving convolution combined with three-dimensional convolution.

[0067] Since the performance of a simple three-dimensional convolutional network is poor, and a complex three-dimensional convolutional network may be computationally unbearable, in one embodiment, the three-dimensional convolution is composed of a 1×3×3 spatial domain convolution and a 3×1×1 temporal domain convolution, which can effectively reduce the computational load while improving the performance of the network.

[0068] In this example, a parallel cascade hybrid method is used, which first passes through the spatial domain convolution, and then passes the output through the appearance preservation module and the time domain convolution as a residual cascade. The basic residual unit in the ResNet-50 network is modified using the residual unit composed of the above 3D convolution and appearance preservation. Since the ResNet-50 stage 1 lacks accurate semantic information and stage 4 lacks accurate spatial information, only the basic residual units in stage 2 and stage 3 are replaced.

[0069] Step S6: For each residual unit, add a regularization constraint module to achieve attention diversity.

[0070] Since contrastive attention is used for appearance alignment in this embodiment, the attention-based model cannot naturally guarantee low feature correlation. On the contrary, the attention-based model tends to have higher feature correlation because the attention mechanism tends to concentrate features on a more compact subspace. Higher feature correlation will lead to overfitting, and adding regularization constraints can reduce overfitting of attention to local areas.

[0071] Hard orthogonal constraints are usually used to perform regularization constraints to reduce feature correlation, but this relies on singular value decomposition to constrain the solution to the Stiefel manifold, which is effective but computationally expensive. In one embodiment, eigenvalue decomposition is used to perform regularization constraints, and the use of regularization constraints to achieve attention diversity is as follows:

[0072]

[0073] Where β is the coefficient, λ1(·) and λ2(·) represent the maximum and minimum eigenvalues ​​of the feature matrix respectively, and F is the output feature map converted into matrix form, F∈R C×N ,N=H×W, which is the product of the width and height of the feature map, F T is the transpose of F.

[0074] Step S7: input the obtained feature vector into a fully connected network to obtain a predicted classification result for the classification of the moving object in the video.

[0075] After performing spatial maximum pooling and temporal average pooling, a 2048-dimensional feature is generated. Before being input into the classifier, batch normalization is performed for normalization. The last fully connected layer uses the Softmax activation function to output the predicted classification result.

[0076] This embodiment uses cross-pixel semantic similarity to reconstruct adjacent feature maps, and then uses the comparative attention mechanism to find the mismatched areas between the reconstructed feature map and the central feature map, and applies a mask to the reconstructed feature map to avoid error propagation; by using 1×3×3 spatial domain convolution kernel and 3×1×1 temporal domain convolution instead of traditional 3D convolution, the computational load is effectively reduced while improving the performance of the network. The residual cascade is performed by parallel cascade hybrid, and by adding regular constraints, the diversity of the network is improved, and the accuracy of classification is significantly improved.

[0077] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0078] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. A moving object classification method based on appearance preservation module and 3D convolution, Features: The following steps are involved: Step S1, obtaining continuous video frames to be detected and corresponding labels; Step S2, resize all video frames to 256×128 pixels and use horizontal flipping to increase data; Step S3, reconstructing adjacent feature maps using pixel semantic similarity; Step S4, using contrast attention to align the appearance of the reconstructed adjacent feature maps; Step S5, replacing the residual in ResNet-50 with a basic residual unit formed by appearance-preserving convolution combined with three-dimensional convolution; Step S6: For each residual unit, add a regularization constraint module to achieve attention diversity; Step S7: input the obtained feature vector into the fully connected network to obtain a predicted classification result for the object to be classified.

2. The moving object classification method based on appearance preservation module and three-dimensional convolution as claimed in claim 1, Features: The step S3 of reconstructing adjacent feature maps by using pixel semantic similarity includes: Each acquired frame is regarded as the central frame and its corresponding adjacent frames are sampled and zero-filled. The obtained central feature map C and adjacent feature map X are reduced in dimension using a 1×1 semantic mapping function, and the covariance matrix is ​​calculated using the transformed feature map C' and feature map X': Where c is the size of the feature map channel dimension, r is the scaling factor used to scale the channel dimension of the feature map, and I is The identity matrix, l = [1,1,1,1…] T yes dimensional vector; divide P by the scaling factor The similarity weight W is obtained through the Softmax activation function, and the weight coefficient W is multiplied by the original adjacent feature map X to obtain the preliminary reconstructed adjacent feature map Y.

3. The moving object classification method based on appearance preservation module and three-dimensional convolution as claimed in claim 1, Features: The step S4 described in which the contrastive attention mechanism is used to align the appearance of the reconstructed adjacent feature maps includes: The formula for calculating the attention mask is expressed as follows: Among them, i represents any spatial position on the feature map, y i is the feature of any spatial position in the reconstructed feature map Y, c i is the central feature map C and y i Features with the same spatial position, sigmoid is the activation function, θ, The semantic mapping function implemented by 1×1 convolution is used to reduce the feature dimension to a low-dimensional space; the channel dimension of the attention mask is expanded and matrix dot multiplication is performed with the reconstructed feature map Y to obtain the aligned reconstructed feature map Z.

4. The moving object classification method based on appearance preservation module and three-dimensional convolution as claimed in claim 1, Features: Step S5 described in which the basic residual unit formed by the appearance-preserving convolution combined with the three-dimensional convolution replaces the residual in ResNet-50, including using cascaded 1×3×3 spatial domain convolution and 3×1×1 temporal domain convolution to replace the traditional 3D convolution, and performing residual cascading of the space-preserving module in a parallel cascade hybrid manner, and using the obtained residual network to extract features.

5. The moving object classification method based on appearance preservation module and three-dimensional convolution as claimed in claim 1, Features: Adding a regularization constraint module in step S6 to achieve attention diversity specifically includes: The following formula is used instead of singular value decomposition: Where β is the coefficient, λ 1 (·),λ 2 (·) represent the maximum and minimum eigenvalues ​​of the feature matrix respectively; F represents the feature map generated by the attention module in matrix form, F∈R C×N ,N=H×W, which is the product of the width and height of the feature map. H, W, and C represent the length, width, and channel dimensions of the feature map respectively; F T is the transposed matrix of the feature matrix F.