A pedestrian detection method, device and terminal device based on multi-spatial relationship perception

By using a multi-spatial relationship sensing module to fuse global and local information in pedestrian detection, the problem of insufficient feature extraction and high resource consumption in the existing technology is solved, and the accuracy of pedestrian detection and the learning ability of the model are improved.

CN114332919BActive Publication Date: 2024-10-29南京行者易智能交通科技有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111510823.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-11
Publication Date
2024-10-29
Estimated Expiration
2041-12-11

AI Technical Summary

Technical Problem

Existing pedestrian detection technology is difficult to effectively combine global and local information in complex environments, resulting in insufficient feature extraction and high consumption of model training and deployment resources.

Method used

A pedestrian detection method based on multi-spatial relationship perception is adopted. Through the YOLOX detection framework and Focus module, combined with branches of different receptive fields, the multi-spatial relationship perception module is used to fuse global and local information, generate a multi-spatial relationship perception feature map, and add it to the detection head Decoupling classification and regression.

Benefits of technology

It improves the feature recognition and accuracy of pedestrian detection, reduces resource consumption, and enhances the learning ability and generalization ability of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114332919B_ABST
    Figure CN114332919B_ABST
Patent Text Reader

Abstract

The present invention discloses a pedestrian detection method, device and terminal device based on multi-spatial relationship perception, the method comprises step 1, collecting pedestrian image data set, adjusting to a fixed size for model training; step 2, using the detection framework of YOLOX, inputting the image into the framework model, and first performing data enhancement on the image; step 3, inputting the data-enhanced image into the Focus module, slicing the image according to odd and even, obtaining 4 images, and then splicing them along the channel direction; step 4, inputting the spliced ​​image into the backbone network of the YOLOX detection framework, and connecting the backbone network with three branches; step 5, each branch comprises 2 parts, a multi-spatial relationship perception module and a detection head, and the multi-spatial relationship perception module effectively fuses global information and local information by combining the relationship between features in different spatial dimensions, and obtains a multi-spatial relationship perception feature map. The method not only focuses on global information, but also extracts local information, and effectively fuses the two, thereby obtaining more recognizable feature information and improving pedestrian detection performance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image recognition research, in particular to a pedestrian detection method, a device and a terminal device based on multi-spatial relationship perception. Background Art

[0002] With the continuous development of smart city construction, many new artificial intelligence technologies are applied to smart transportation, smart government affairs, smart factories, etc., and each application is inseparable from the masses and serves people. Therefore, pedestrian detection is the premise of many application technologies. However, real scenes are often more complicated, such as dense crowds causing overlapping bodies, or being blocked by objects, strong changes in lighting, and blurred images caused by severe weather factors (rainy and snowy weather, etc.). These real situations increase the difficulty of pedestrian detection. For this reason, there is an urgent need for a pedestrian detection technology that can mine deeper and more discriminative features in the pedestrian area of ​​the image, which is sufficient to characterize pedestrians in various environments.

[0003] In the process of implementing the present invention, the inventors found that there are at least the following problems in the prior art: currently popular pedestrian detection technologies are mostly based on convolutional neural networks (CNNs), and most CNN pedestrian detection models use limited receptive fields, and it is difficult to combine global information to learn rich structural patterns, such as using CNN to detect and segment pedestrians to obtain final location information; for example, using CNN combined with feature fusion for pedestrian detection; although some methods take into account different receptive fields, they do not combine global and local information well; in addition, there are some methods that enhance the learning ability of the model by stacking network depth, and this model is very resource-intensive both in training and deployment. Summary of the invention

[0004] In order to overcome the shortcomings of the prior art, the present invention provides a pedestrian detection method, device and terminal device based on multi-spatial relationship perception. The method not only focuses on global information, but also extracts local information and effectively integrates the two, thereby obtaining more recognizable feature information and improving pedestrian detection performance. The technical solution is as follows:

[0005] The present invention provides a pedestrian detection method based on multi-spatial relationship perception, the method comprising the following steps:

[0006] Step 1: Collect a pedestrian image dataset and adjust it to a fixed size for model training.

[0007] Step 2: Use the YOLOX detection framework to input the image into the framework model and perform data enhancement on the image first.

[0008] Step 3: Input the data-enhanced image into the Focus module, slice the image according to odd and even numbers to obtain 4 images, and then splice them along the channel direction.

[0009] Step 4: Input the spliced ​​image into the backbone network of the YOLOX detection framework. The backbone network is connected to three branches, which correspond to different receptive fields. The three receptive fields can cover targets of different sizes.

[0010] In step 5, each branch consists of two parts, a multi-spatial relationship perception module and a detection head. The multi-spatial relationship perception module effectively fuses global information and local information by combining the relationship between features in different spatial dimensions to obtain a multi-spatial relationship perception feature map.

[0011] The workflow of the multi-spatial relationship perception module is as follows:

[0012] The feature map X input to the multi-spatial relationship perception module has a dimension of H×W×C, where H is the height, W is the width, and C is the number of channels;

[0013] (1) Construct a relational feature graph in H×W space;

[0014] In the H×W space range, the feature map X is decomposed into H×W feature vectors of length C. The feature vector x i Mapped to the feature vector x j The relationship information is expressed as r i,j Indicates that the calculation method is as follows:

[0015]

[0016] in, and φ H×W are two embedding functions, each consisting of a 1×1 convolutional layer, a BatchNormalization layer, and a ReLU activation layer. Correspondingly, the feature vector x j Mapped to the feature vector Jx i The relationship information is r j,i =f H×W (x j , x i ), then (r i,j , r j,i ) describes the eigenvector x i and x j For a unidirectional relationship, the relationship information between all eigenvectors is calculated and stacked to obtain an affinity matrix The number of matrix channels is H×W, so the bidirectional relationship can obtain two different affinity matrices M1 and M2 to deeply mine the local information of the features.

[0017] The original global structural information is retained. Specifically, after performing a 1×1 convolution on the original feature map X, a global average pooling operation is performed in the channel direction to obtain a global structural feature map F. The global structural feature graph F is connected in series with the two affinity matrices to obtain a feature matrix Y, the formula is as follows:

[0018]

[0019] pool represents global average pooling, θ H×W and They are composed of a 1×1 convolution layer, a BatchNormalization layer, and a ReLU activation layer. and φ H×W , the number of their output activation nodes is different; the feature matrix Y is convolved by 1×1 to fuse all the global and local information contained in the feature matrix, thereby obtaining a relational feature graph belonging to the slice×W space.

[0020] (2) construct a relationship feature map in the channel space C;

[0021] Similarly, in the channel space, the feature map X is decomposed into C feature vectors of length H×W. The feature vector x a Mapped to the feature vector x b Relationship information a,b for:

[0022]

[0023] in Yang C Functions and and φ H×W The same as step 5(1) is used to obtain the affinity matrix. That is, the bidirectional relationship can obtain two different affinity matrices M′ 1 and M′ 2 .

[0024] After performing a 1×1 convolution on the original feature map X, global average pooling is performed in the H×W dimension to obtain the structural feature map The structural feature graph is concatenated with the two affinity matrices to obtain the feature matrix Y′, which is calculated as follows:

[0025] Y′=[pool(θ C (X)), θ C (M′ 1 ), θ C (M′2 )].

[0026] θ C and Function and θ H×W and The only difference is the output dimension. The feature matrix Y′ is convolved by 1×1 to fuse all the global and local information contained in the feature matrix, thereby obtaining a relational feature map belonging to the channel space C.

[0027] Multiply the relationship feature map of H×W space and channel space C to obtain a multi-space relationship perception feature map.

[0028] Step 6: Put the multi-spatial relationship perception feature map into the detection head. YOLOX decouples classification and coordinate positioning. First, a 1×1 convolution is used to reduce the dimension of the channel, followed by two lightweight branches for classification and regression respectively.

[0029] Preferably, step 2 data enhancement includes random horizontal flipping of the image, color jittering, multi-scale enhancement and mosaic coordinate enhancement methods.

[0030] Preferably, the receptive fields corresponding to the three branches in step 4 are downsampled by 8 times, 16 times, and 32 times, respectively.

[0031] Preferably, during the training phase, the classification loss function uses cross entropy, the regression loss function uses GIOU loss, and the L1 norm is used to impose a penalty on the acquired position information.

[0032] Compared with the prior art, one of the above technical solutions has the following beneficial effects: through the multi-spatial relationship perception module, the relationship between features in different spatial dimensions is deeply mined, focusing on global information, extracting local information, and effectively integrating the two, establishing a connection between the feature information of different spaces and the relationship information between features, so that the features learned by the model are more recognizable and discriminative, thereby obtaining more recognizable feature information and improving the accuracy of pedestrian detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] Figure 1 A flow chart of a multi-spatial relationship perception module provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0034] In order to illustrate the technical solution and working principle of the present invention, the following will further describe the embodiments of the present invention in detail with reference to the accompanying drawings. All the above optional technical solutions can be combined in any way to form optional embodiments of the present invention, which will not be described one by one here.

[0035] The terms "step 1", "step 2", "step 3" and the like in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the terms used in this way can be interchanged where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those described herein.

[0036] In the first aspect, the present disclosure provides a method for pedestrian detection based on multi-spatial relationship perception, the method comprising the following steps:

[0037] Step 1: Collect a pedestrian image dataset and adjust it to a fixed size for model training.

[0038] Step 2, using the YOLOX detection framework, this framework has a simple structure, does not require manual anchor frame setting, and is easy to train and deploy. Input the image into the framework model, first perform data enhancement on the image. Preferably, step 2 data enhancement includes random horizontal flipping of the image, color jittering, multi-scale enhancement, and mosaic coordinate enhancement methods, etc., to expand the scale of the training set and improve the generalization ability of the model.

[0039] Step 3: Input the data-enhanced image into the Focus module, slice the image according to odd and even numbers, obtain 4 images, and then splice them along the channel direction. The Focus module performs downsampling without increasing the amount of calculation and retains more complete image information.

[0040] Step 4: Input the spliced ​​image into the backbone network of the YOLOX detection framework. The backbone network is connected to three branches, which correspond to different receptive fields, and the three receptive fields can cover targets of different sizes. Preferably, the receptive fields corresponding to the three branches in step 4 are 8 times, 16 times, and 32 times of downsampling.

[0041] In step 5, each branch consists of two parts, a multi-spatial relationship perception module and a detection head. The multi-spatial relationship perception module effectively fuses global information and local information by combining the relationship between features in different spatial dimensions to obtain a multi-spatial relationship perception feature map.

[0042] Attached Figure 1 This is a workflow diagram of a multi-spatial relationship perception module. Combined with this diagram, the workflow of the multi-spatial relationship perception module is as follows:

[0043] The feature map X input to the multi-spatial relationship perception module has a dimension of H×W×C, where H is the height, W is the width, and C is the number of channels;

[0044] (1) Construct a relational feature graph in H×W space;

[0045] In the H×W space range, the feature map X is decomposed into H×W feature vectors of length C. The feature vector x i Mapped to the feature vector x j The relationship information is expressed as r i,j Indicates that the calculation method is as follows:

[0046]

[0047] in, and φ H×W are two embedding functions, each consisting of a 1×1 convolutional layer, a BatchNormalization layer, and a ReLU activation layer. Correspondingly, the feature vector x j Mapped to the feature vector x i The relationship information is r j,i =f H×W (x j , x i ), then (r i,j , r j,i ) describes the eigenvector x i and x j For a unidirectional relationship, the relationship information between all eigenvectors is calculated and stacked to obtain an affinity matrix The number of matrix channels is H×W, so the bidirectional relationship can obtain two different affinity matrices M 1 and M 2 , deeply mine the local information of features.

[0048] In order to simultaneously develop the global information of the features, it is necessary to preserve the original global structural information. Specifically, after performing a 1×1 convolution on the original feature map X, a global average pooling operation is performed in the channel direction to obtain a global structural feature map F. The global structural feature graph F is connected in series with the two affinity matrices to obtain a feature matrix Y, the formula is as follows:

[0049] Y=[pool(θ H×W (X)), θ H×W (M 1 ), θ H×W (M 2 )].

[0050] pool represents global average pooling, θ H×W and θ H×W They are composed of a 1×1 convolution layer, a BatchNormalization layer, and a ReLU activation layer. and φ H×W, the number of their output activation nodes is different; the feature matrix Y is convolved with 1×1 to fuse all the global and local information contained in the feature matrix, thereby obtaining a relational feature map belonging to the H×W space.

[0051] (2) construct a relationship feature map in the channel space C;

[0052] Similarly, in the channel space, the feature map X is decomposed into C feature vectors of length H×W. The feature vector x a Mapped to the feature vector x b Relationship information a,b for:

[0053]

[0054] in and φ C Functions and and φ H×W The same as step 5(1) is used to obtain the affinity matrix. That is, the bidirectional relationship can obtain two different affinity matrices M′ 1 and M′ 2 ;

[0055] Different from the structural feature map F obtained in step 5, in this step, after performing 1×1 convolution on the original feature map X, global average pooling is performed in the H×W dimension to obtain the structural feature map The structural feature graph is concatenated with the two affinity matrices to obtain the feature matrix Y′, which is calculated as follows:

[0056]

[0057] θ C and Function and θ H×W and The only difference is the output dimension. The feature matrix Y′ is convolved by 1×1 to fuse all the global and local information contained in the feature matrix, thereby obtaining a relational feature map belonging to the channel space C.

[0058] The relationship feature map of H×W space and channel space C is dot-multiplied to obtain a multi-space relationship-aware feature map. This relationship-aware feature map contains the global and local information of features in different spatial dimensions and fully integrates them, thereby improving the effectiveness and discrimination ability of the features.

[0059] Step 6: Put the multi-spatial relationship perception feature map into the detection head. Different from the traditional YOLO series detection heads that couple classification and coordinate positioning together for training, YOLOX decouples classification and coordinate positioning. It first reduces the dimension of the channel through a 1×1 convolution, and then connects two lightweight branches to perform classification and regression respectively, which can effectively improve the model convergence speed.

[0060] Preferably, during the training phase, the classification loss function uses cross entropy, the regression loss function uses GIOU loss, and the L1 norm is used to impose a penalty on the acquired position information.

[0061] In the second aspect, an embodiment of the present disclosure provides a pedestrian detection device based on multi-spatial relationship perception. Based on the same technical concept, the device can implement or execute a pedestrian detection method based on multi-spatial relationship perception in any one of all possible implementation methods.

[0062] Preferably, the device comprises a data acquisition unit, a first data processing unit, a second data processing unit, and a result acquisition unit;

[0063] The data acquisition unit is used to perform step 1 of a pedestrian detection method based on multi-spatial relationship perception in any one of all possible implementation modes;

[0064] The first data processing unit is used to execute steps 2 and 3 of a pedestrian detection method based on multi-spatial relationship perception in any one of all possible implementation modes;

[0065] The second data processing unit is used to execute steps 4 and 5 of a pedestrian detection method based on multi-spatial relationship perception in any one of all possible implementation modes;

[0066] The result acquisition unit is used to execute step 6 of a pedestrian detection method based on multi-spatial relationship perception described in any one of all possible implementation methods.

[0067] It should be noted that the pedestrian detection device based on multi-spatial relationship perception provided in the above embodiment only uses the division of the above-mentioned functional modules as an example when executing a pedestrian detection method based on multi-spatial relationship perception. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the pedestrian detection device based on multi-spatial relationship perception provided in the above embodiment and the pedestrian detection method based on multi-spatial relationship perception belong to the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.

[0068] In a third aspect, an embodiment of the present disclosure provides a terminal device, which includes a pedestrian detection device based on multi-spatial relationship perception as described in any one of all possible implementation methods.

[0069] The present invention is described above by way of example in conjunction with the accompanying drawings. Obviously, the specific implementation of the present invention is not limited to the above-mentioned method. All non-substantial improvements made by adopting the method concept and technical solution of the present invention; or directly applying the above-mentioned concept and technical solution of the present invention to other occasions without improvement or equivalent replacement, are within the protection scope of the present invention.

Claims

1. A pedestrian detection method based on multi-spatial relationship perception, characterized in that: The method comprises the following steps: Step 1: Collect a pedestrian image dataset and adjust it to a fixed size for model training; Step 2: Use the YOLOX detection framework to input the image into the framework model and perform data enhancement on the image first; Step 3: Input the data-enhanced image into the Focus module, slice the image according to odd and even numbers to obtain 4 images, and then splice them along the channel direction; Step 4: Input the spliced ​​image into the backbone network of the YOLOX detection framework. The backbone network is connected to three branches, which correspond to different receptive fields. The three receptive fields can cover targets of different sizes. Step 5: Each branch consists of two parts: a multi-spatial relationship perception module and a detection head. The multi-spatial relationship perception module combines the relationship between features in different spatial dimensions to effectively fuse global information and local information to obtain a multi-spatial relationship perception feature map. The workflow of the multi-spatial relationship perception module is as follows: The feature map X input to the multi-spatial relationship perception module has a dimension of H×W×C, where H is the height, W is the width, and C is the number of channels; (1) Construct a relational feature graph in H×W space; In the H×W space range, the feature map X is decomposed into H×W feature vectors of length C. The feature vector x i Mapped to the feature vector x j The relationship information is expressed as r i,j Indicates that the calculation method is as follows: in, and φ H×w are two embedding functions, each consisting of a 1×1 convolutional layer, a BatchNormalization layer, and a ReLU activation layer; correspondingly, the feature vector x j Mapped to the feature vector x i The relationship information is r j,i =f H×W (x j , x i ), then (r i,j , r j,i ) describes the eigenvector x i and x j For a unidirectional relationship, the relationship information between all eigenvectors is calculated and stacked to obtain an affinity matrix The number of matrix channels is H×W, so the bidirectional relationship can obtain two different affinity matrices M1 and M2 to deeply mine the local information of the features; The original global structure information is retained. Specifically, after performing a 1×1 convolution on the original feature map X, a global average pooling operation is performed in the channel direction to obtain a global structure feature map The global structural feature graph F is connected in series with the two affinity matrices to obtain a feature matrix Y, the formula is as follows: pool represents global average pooling, θ H×W and They are composed of a 1×1 convolution layer, a BatchNormalization layer, and a ReLU activation layer. and φ H×W , the number of their output activation nodes is different; the feature matrix Y is convolved by 1×1 to fuse all the global and local information contained in the feature matrix, thereby obtaining a relational feature graph belonging to the H×W space; (2) construct a relationship feature map in the channel space C; Similarly, in the channel space, the feature map X is decomposed into C feature vectors of length H×W. The feature vector x a Mapped to the feature vector x b Relationship information a,b for: in and φ C Functions and and φ H×W The same as step 5(1) is used to obtain the affinity matrix. That is, the bidirectional relationship can obtain two different affinity matrices M′1 and M′2; After performing a 1×1 convolution on the original feature map X, global average pooling is performed in the H×W dimension to obtain the structural feature map The structural feature graph is connected in series with the two affinity matrices to obtain the feature matrix Y′, which is calculated as follows: θ C and Function and θ H×W and The same, only the output dimension is different; the feature matrix Y′ is convolved by 1×1 to fuse all the global and local information contained in the feature matrix, so as to obtain the relationship feature map belonging to the channel space C; Multiply the relationship feature map of H×W space and channel space C to obtain a multi-space relationship perception feature map; Step 6: Put the multi-spatial relationship perception feature map into the detection head. YOLOX decouples classification and coordinate positioning. First, it reduces the dimension of the channel through a 1×1 convolution, and then connects two lightweight branches to perform classification and regression respectively.

2. The pedestrian detection method based on multi-spatial relationship perception according to claim 1, characterized in that: Step 2 data enhancement includes random horizontal flipping of images, color jittering, multi-scale enhancement, and mosaic coordinate enhancement methods.

3. The pedestrian detection method based on multi-spatial relationship perception according to claim 1, characterized in that: The receptive fields of the three branches in step 4 are downsampled by 8 times, 16 times, and 32 times, respectively.

4. A pedestrian detection method based on multi-spatial relationship perception according to any one of claims 1 to 3, characterized in that: During the training phase, the classification loss function uses cross entropy, the regression loss function uses GIOU loss, and the L1 norm is used to penalize the acquired position information.

5. A pedestrian detection device based on multi-spatial relationship perception, characterized in that: The device can implement a pedestrian detection method based on multi-spatial relationship perception as described in any one of claims 1-4.

6. The pedestrian detection device based on multi-spatial relationship perception according to claim 5, characterized in that: The device comprises a data acquisition unit, a first data processing unit, a second data processing unit, and a result acquisition unit; The data acquisition unit is used to perform step 1 of the pedestrian detection method based on multi-spatial relationship perception according to any one of claims 1 to 4; The first data processing unit is used to execute steps 2 and 3 of the pedestrian detection method based on multi-spatial relationship perception according to any one of claims 1 to 4; The second data processing unit is used to execute steps 4 and 5 of the pedestrian detection method based on multi-spatial relationship perception according to any one of claims 1 to 4; The result acquisition unit is used to execute step 6 of the pedestrian detection method based on multi-spatial relationship perception described in any one of claims 1-4.

7. A terminal device, characterized in that: The terminal device includes a pedestrian detection device based on multi-spatial relationship perception as described in any one of claims 5 or 6.

Citation Information

Patent Citations

  • Channel and space fusion perception-based deep learning target detection method

    CN110796239A

  • Rapid pollen particle detection algorithm based on dual self-attention module

    CN111369543A