Pedestrian recognition method and device based on multi-core fusion of global features and head-shoulder features

Through the multi-core fusion method of global features and head and shoulder features, the problem of low pedestrian recognition accuracy in fisheye cameras is solved, efficient recognition in a wide field of view is achieved, and the accuracy and reliability of recognition are enhanced.

CN118397659BActive Publication Date: 2024-10-15HUAQIAO UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410828405.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-25
Publication Date
2024-10-15
Estimated Expiration
2044-06-25

AI Technical Summary

Technical Problem

Conventional surveillance cameras have a small viewing angle, and fisheye cameras cause serious image distortion due to their special structure. The characteristics of pedestrians with the same identity vary greatly under different cameras, and the recognition accuracy is low.

Method used

Using a multi-core fusion method based on global features and head and shoulder features, the global features and head and shoulder features of pedestrian images are extracted through a deep learning network, and the multi-core fusion module is used to perform feature fusion, and a loss function is constructed to train the pedestrian recognition model to improve recognition accuracy. sex.

Benefits of technology

It effectively overcomes the influence of image distortion under fisheye cameras, improves the accuracy and reliability of pedestrian recognition, has good generalization performance and multi-view fusion capabilities, and is adaptable to efficient recognition of different complex backgrounds.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118397659B_ABST
    Figure CN118397659B_ABST
Patent Text Reader

Abstract

The present invention discloses a pedestrian recognition method and device based on multi-core fusion of global features and head-shoulder features, which relates to the field of image recognition, including: using a trained pedestrian head-shoulder detection model to perform head-shoulder detection on a pedestrian image to obtain a pedestrian head-shoulder image; in the pedestrian recognition model, the pedestrian image and the pedestrian head-shoulder image are respectively input into a global feature extraction branch and a head-shoulder feature extraction branch to obtain a global feature vector and a head-shoulder feature vector and input them into a multi-core fusion module for fusion to obtain a fused feature vector, and a loss function is constructed according to the global feature vector, the head-shoulder feature vector and the fused feature vector to train the pedestrian recognition model to obtain a trained pedestrian recognition model; the pedestrian image to be recognized and its corresponding pedestrian head-shoulder image are input into the trained pedestrian recognition model to obtain a corresponding fused feature vector, and then pedestrian recognition is performed. The present invention solves the problem of large image feature differences and low accuracy under fisheye cameras.
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, and in particular to a pedestrian recognition method and device based on multi-core fusion of global features and head-shoulder features. Background Art

[0002] As China's urbanization level continues to improve, the public has put forward newer and higher requirements for urban planning and sustainable development. The intelligent upgrade of public video security monitoring systems represented by surveillance cameras has great research and application value. Conventional surveillance cameras have a small viewing angle, which is not conducive to achieving ultra-large viewing angles and all-round monitoring. In large public places, overhead fisheye cameras are usually installed to achieve large-scale, all-round, and no-dead-angle monitoring, which is conducive to improving the monitoring efficiency in large public places and reducing monitoring costs. However, due to the strong distortion and image distortion caused by the special structure of the fisheye camera, the image features of the same pedestrian under different fisheye cameras are very different, making identification extremely difficult and the accuracy is low. Summary of the invention

[0003] The purpose of this application is to propose a pedestrian recognition method and device based on multi-core fusion of global features and head and shoulder features in response to the above-mentioned technical problems.

[0004] In a first aspect, the present invention provides a pedestrian recognition method based on multi-core fusion of global features and head-shoulder features, comprising the following steps:

[0005] Obtaining a pedestrian image to be identified;

[0006] Using the trained pedestrian head and shoulder detection model to perform head and shoulder detection on the pedestrian image, obtaining a pedestrian head and shoulder image;

[0007] Constructing a pedestrian recognition model, which includes a multi-core fusion module and a global feature extraction branch and a head-shoulder feature extraction branch based on a deep learning network. The pedestrian image and the pedestrian head-shoulder image are respectively input into the global feature extraction branch and the head-shoulder feature extraction branch to obtain a global feature vector and a head-shoulder feature vector. The global feature vector and the head-shoulder feature vector are input into the multi-core fusion module for fusion to obtain a fused feature vector. A loss function is constructed according to the global feature vector, the head-shoulder feature vector and the fused feature vector. The pedestrian recognition model is trained based on the loss function to obtain a trained pedestrian recognition model.

[0008] The pedestrian image to be identified and its corresponding pedestrian head and shoulder image are input into the trained pedestrian recognition model to obtain a fused feature vector corresponding to the pedestrian image to be identified, and pedestrian recognition is performed based on the fused feature vector corresponding to the pedestrian image to be identified to obtain a recognition result.

[0009] Preferably, the trained pedestrian head and shoulder detection model includes an SSD network, a YOLO network or a Faster R-CNN network, and the specific process is as follows:

[0010] ;

[0011] Among them, x represents a pedestrian image, HDNet represents the function corresponding to the trained pedestrian head and shoulder detection model, and h represents the head and shoulder image extracted from the pedestrian image x.

[0012] Preferably, the pedestrian image is collected by a fisheye camera, and the deep learning network includes ResNet, DenseNet or ViT.

[0013] Preferably, the global feature extraction branch and the head-shoulder feature extraction branch are both constructed based on ViT, the global feature extraction branch includes a segmentation layer, a flattening layer, an embedding layer, a splicing layer and q Transformer layers connected in sequence; the head-shoulder feature extraction branch includes a segmentation layer, a flattening layer, an embedding layer, a splicing layer and m Transformer layers connected in sequence;

[0014] The pedestrian image and the pedestrian head and shoulder image are input into the segmentation layer and the flattening layer respectively to obtain the pedestrian image sequence block and the pedestrian head and shoulder image sequence block, as shown in the following formula:

[0015] ;

[0016] ;

[0017] Among them, x represents a pedestrian image, h represents a head and shoulder image extracted from the pedestrian image x, Split represents the segmentation operation corresponding to the segmentation layer, and Flatten represents the spatial flattening operation corresponding to the flattening layer. Represents the height and width of each pedestrian image sequence block and pedestrian head and shoulder image sequence block, represents the number of pedestrian image sequence blocks, are the height and width of the pedestrian image, represents the number of blocks in the pedestrian head and shoulder image sequence, are the height and width of the pedestrian head and shoulder image, C represents the number of channels, and x p represents a pedestrian image sequence block, h p Represents a sequence block of pedestrian head and shoulder images;

[0018] The pedestrian image sequence blocks and the pedestrian head and shoulder image sequence blocks are concatenated with the pedestrian category label and input into the embedding layer to map the corresponding one-dimensional sequence tokens. Then, they are respectively passed through q Transformer layers and m Transformer layers to extract the global feature vector and the head and shoulder feature vector, as shown in the following formula:

[0019] ;

[0020] ;

[0021] Among them, Transformer q Represents the function corresponding to q Transformer layers, Transformer m represents the function corresponding to m Transformer layers, Embedding represents the mapping operation corresponding to the embedding layer, CCat represents the channel-by-channel concatenation operation corresponding to the concatenation layer, cls represents the category token, It means that the d-dimensional global feature vector is extracted from the pedestrian image x; It means that the d-dimensional head-shoulder feature vector is extracted from the pedestrian head-shoulder image h; represents a real number, d represents and The characteristic dimension of

[0022] The multi-core fusion module includes a dimension expansion layer, a splicing layer, multiple convolution layers, and a dimension compression layer. The convolution kernel of each convolution layer is , i=1,2,…,k, k represents the number of types of global and head-shoulder single-core fusion features;

[0023] The global feature vector and the head-shoulder feature vector are respectively input into the dimension expansion layer for dimension expansion to obtain the dimension-expanded global feature tensor and the dimension-expanded head-shoulder feature tensor, as shown in the following formula:

[0024] ;

[0025] ;

[0026] Among them, Unsqueeze represents the dimension expansion operation corresponding to the dimension expansion layer, which expands the processed feature vector to A tensor of dimension c, where c represents the number of channels of the tensor, d represents the height of the tensor, and w represents the width of the tensor. Indicates identity; and Represents the global feature tensor after dimension expansion and the head and shoulders feature tensor after dimension expansion;

[0027] The dimensionally expanded global feature tensor and the dimensionally expanded head-shoulder feature tensor are concatenated to obtain a concatenated feature tensor, as shown in the following formula:

[0028] ;

[0029] Among them, CCat represents the channel-by-channel concatenation operation corresponding to the concatenation layer, and u represents the concatenated feature tensor, whose dimension is ;

[0030] Use multiple convolutional layers to perform multi-core fusion on the spliced ​​feature tensors to obtain the global and head-shoulder multi-core fusion feature tensors, as shown in the following formula:

[0031] ;

[0032] ;

[0033] Among them, v i It means that the concatenated feature tensor u is obtained after the convolution kernel. The i-th global and head-shoulder single-core fusion feature tensor obtained by the convolution layer of , Conv represents the convolution operation corresponding to the convolution layer, and the convolution kernel It indicates that from left to right, the number of input channels, the number of output channels, the height of the receptive field, and the width of the receptive field are 2, 1, and 1, z represents the global and head-shoulder multi-core fusion feature tensor, i represents the sequence number of the global and head-shoulder single-core fusion feature tensor;

[0034] The global and head-shoulder multi-core fusion feature tensors are input into the dimension compression layer to obtain the fused feature vector, as shown in the following formula:

[0035] ;

[0036] Among them, Squeeze represents the dimension compression operation corresponding to the dimension compression layer. Represents the fused feature vector.

[0037] Preferably, the loss function is expressed as:

[0038] ;

[0039] in, , and Respectively represent the global eigenvector, head-shoulder eigenvector and fusion eigenvector, represents the overall loss function, , and They represent the loss function for supervising the global feature vector, the loss function for supervising the head and shoulder feature vector, and the loss function for supervising the fusion feature vector, respectively, as shown in the following formula:

[0040] ;

[0041] ;

[0042] ;

[0043] Where n represents the number of pedestrian images, t represents the number of pedestrian categories, , and Represents the global feature vector, head-shoulder feature vector and fusion feature vector corresponding to the b-th pedestrian image; represents the pedestrian category corresponding to the b-th pedestrian image, b represents the pedestrian image sequence number, Indicates comparison Is it equal to y? , , Respectively represent the b-th pedestrian image by , and The posterior probability of belonging to the yth category is calculated using the Softmax function, where y represents the pedestrian category number; It is an indicator function. If the condition in the brackets is true, the corresponding output is 1, otherwise the output is 0;

[0044] The gradient descent method is used to optimize the loss function and obtain the trained pedestrian recognition model.

[0045] Preferably, pedestrian recognition is performed based on the fused feature vector corresponding to the pedestrian image to be recognized to obtain a recognition result, which specifically includes:

[0046] The fused feature vector corresponding to the pedestrian image to be identified and the fused feature vector obtained by the trained pedestrian recognition model are compared for similarity to obtain a comparison result, and based on the comparison result, it is determined whether the pedestrian image to be identified and the pedestrian image with a known identity belong to the same person.

[0047] In a second aspect, the present invention provides a pedestrian recognition device based on multi-core fusion of global features and head-shoulder features, comprising:

[0048] An image acquisition module is configured to acquire an image of a pedestrian to be identified;

[0049] The region detection module is configured to perform head and shoulder detection on the pedestrian image using a trained pedestrian head and shoulder detection model to obtain a pedestrian head and shoulder image;

[0050] The model training module is configured to build a pedestrian recognition model, which includes a multi-core fusion module and a global feature extraction branch and a head-shoulder feature extraction branch based on a deep learning network. The pedestrian image and the pedestrian head-shoulder image are respectively input into the global feature extraction branch and the head-shoulder feature extraction branch to obtain a global feature vector and a head-shoulder feature vector. The global feature vector and the head-shoulder feature vector are input into the multi-core fusion module for fusion to obtain a fused feature vector. A loss function is constructed according to the global feature vector, the head-shoulder feature vector and the fused feature vector. The pedestrian recognition model is trained based on the loss function to obtain a trained pedestrian recognition model.

[0051] The pedestrian recognition module is configured to input the pedestrian image to be recognized and its corresponding pedestrian head and shoulder image into the trained pedestrian recognition model, obtain the fused feature vector corresponding to the pedestrian image to be recognized, perform pedestrian recognition based on the fused feature vector corresponding to the pedestrian image to be recognized, and obtain the recognition result.

[0052] In a third aspect, the present invention provides an electronic device comprising one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any implementation manner in the first aspect.

[0053] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in any implementation manner in the first aspect.

[0054] In a fifth aspect, the present invention provides a computer program product, comprising a computer program, which, when executed by a processor, implements the method described in any implementation manner in the first aspect.

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

[0056] (1) The pedestrian recognition method based on multi-core fusion of global features and head-shoulder features proposed in the present invention enhances the pedestrian recognition accuracy of fisheye images by learning the global features of pedestrian images and the head-shoulder features of pedestrian head-shoulder images and using a multi-core fusion method to fully fuse the two features.

[0057] (2) The pedestrian recognition method based on the multi-core fusion of global features and head-shoulder features proposed in the present invention is optimized specifically for the wide field of view and pedestrian image distortion problems captured by fisheye cameras. It makes full use of the rich information in the pedestrian head and shoulder images. Through feature extraction and fusion strategies, it effectively overcomes the influence of distortion, thereby achieving efficient recognition of pedestrians within a wide field of view and improving recognition reliability.

[0058] (3) The pedestrian recognition method based on the multi-core fusion of global features and head-shoulder features proposed in the present invention has good generalization performance and multi-view fusion capability, and can adapt to different complex backgrounds, thereby maintaining a high recognition accuracy in a variety of environments and enhancing the practicality of the system. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0060] Figure 1 A flowchart of a pedestrian recognition method based on multi-core fusion of global features and head-shoulder features according to an embodiment of the present application;

[0061] Figure 2 A flowchart of a pedestrian recognition method based on multi-core fusion of global features and head-shoulder features according to an embodiment of the present application;

[0062] Figure 3 A schematic diagram of the training process of a pedestrian recognition model constructed based on ViT in a pedestrian recognition method based on multi-core fusion of global features and head-shoulder features according to an embodiment of the present application;

[0063] Figure 4 A schematic diagram of a pedestrian recognition device based on multi-core fusion of global features and head-shoulder features according to an embodiment of the present application;

[0064] Figure 5 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0065] In order to make the purpose, technical scheme and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0066] Figure 1 A pedestrian recognition method based on multi-core fusion of global features and head-shoulder features provided by an embodiment of the present application is shown, comprising the following steps:

[0067] S1, obtaining a pedestrian image to be identified.

[0068] Specifically, the embodiments of the present application collect pedestrian images through a fisheye camera. Under the fisheye camera, the head and shoulders of pedestrians contain richer pedestrian identification information, and the degree of distortion is relatively mild.

[0069] S2, using the trained pedestrian head and shoulder detection model to perform head and shoulder detection on the pedestrian image to obtain a pedestrian head and shoulder image.

[0070] In a specific embodiment, the trained pedestrian head and shoulder detection model includes an SSD network, a YOLO network or a Faster R-CNN network, and the specific process is as follows:

[0071] ;

[0072] Among them, x represents a pedestrian image, HDNet represents the function corresponding to the trained pedestrian head and shoulder detection model, and h represents the head and shoulder image extracted from the pedestrian image x.

[0073] Specifically, the trained pedestrian head and shoulder detection model is used to extract the head and shoulder positions from the entire pedestrian image to obtain the pedestrian head and shoulder image. The trained pedestrian head and shoulder detection model detects the complete pedestrian image, locates the coordinates of the pedestrian's head and shoulder positions, and cuts the head and shoulder image area according to the aspect ratio of the entire pedestrian image to obtain the pedestrian head and shoulder image. The trained pedestrian head and shoulder detection model does not participate in the subsequent training process of the pedestrian recognition model, but is only used to process the pedestrian head and shoulder image. The trained pedestrian head and shoulder detection model can adopt a target detection model, including but not limited to an SSD network, a YOLO network, or a Faster R-CNN network.

[0074] S3, constructing a pedestrian recognition model, which includes a multi-core fusion module and a global feature extraction branch and a head-shoulder feature extraction branch based on a deep learning network. The pedestrian image and the pedestrian head-shoulder image are respectively input into the global feature extraction branch and the head-shoulder feature extraction branch to obtain a global feature vector and a head-shoulder feature vector. The global feature vector and the head-shoulder feature vector are input into the multi-core fusion module for fusion to obtain a fused feature vector. A loss function is constructed according to the global feature vector, the head-shoulder feature vector and the fused feature vector. The pedestrian recognition model is trained based on the loss function to obtain a trained pedestrian recognition model.

[0075] In a specific embodiment, the pedestrian image is collected by a fisheye camera, and the deep learning network includes ResNet, DenseNet or ViT.

[0076] Specifically, refer to Figure 2 , a deep learning network is used to construct a global feature extraction branch and a head-shoulder feature extraction branch. The global feature extraction branch extracts the global feature vector from the entire input pedestrian image. The head-shoulder feature extraction branch extracts the head-shoulder feature vector from the input pedestrian head-shoulder image . Deep learning networks include but are not limited to ResNet, DenseNet or ViT. Reference Figure 3 , the embodiment of the present application takes ViT as an example. In other embodiments, adjustments can be made according to the specific network structure to obtain the global feature extraction branch and the head and shoulder feature extraction branch.

[0077] In a specific embodiment, the global feature extraction branch and the head-shoulder feature extraction branch are both constructed based on ViT, the global feature extraction branch includes a segmentation layer, a flattening layer, an embedding layer, a splicing layer and q Transformer layers connected in sequence; the head-shoulder feature extraction branch includes a segmentation layer, a flattening layer, an embedding layer, a splicing layer and m Transformer layers connected in sequence;

[0078] The pedestrian image and the pedestrian head and shoulder image are input into the segmentation layer and the flattening layer respectively to obtain the pedestrian image sequence block and the pedestrian head and shoulder image sequence block, as shown in the following formula:

[0079] ;

[0080] ;

[0081] Among them, x represents a pedestrian image, h represents a head and shoulder image extracted from the pedestrian image x, Split represents the segmentation operation corresponding to the segmentation layer, and Flatten represents the spatial flattening operation corresponding to the flattening layer. Represents the height and width of each pedestrian image sequence block and pedestrian head and shoulder image sequence block, represents the number of pedestrian image sequence blocks, are the height and width of the pedestrian image, represents the number of blocks in the pedestrian head and shoulder image sequence, are the height and width of the pedestrian head and shoulder image, C represents the number of channels, and x p represents a pedestrian image sequence block, h p Represents a sequence block of pedestrian head and shoulder images;

[0082] The pedestrian image sequence blocks and the pedestrian head and shoulder image sequence blocks are concatenated with the pedestrian category label and input into the embedding layer to map the corresponding one-dimensional sequence tokens. Then, they are respectively passed through q Transformer layers and m Transformer layers to extract the global feature vector and the head and shoulder feature vector, as shown in the following formula:

[0083] ;

[0084] ;

[0085] Among them, Transformer q Represents the function corresponding to q Transformer layers, Transformer m represents the function corresponding to m Transformer layers, Embedding represents the mapping operation corresponding to the embedding layer, CCat represents the channel-by-channel concatenation operation corresponding to the concatenation layer, cls represents the category token, It means that the d-dimensional global feature vector is extracted from the pedestrian image x; It means that the d-dimensional head-shoulder feature vector is extracted from the pedestrian head-shoulder image h; represents a real number, d represents and The characteristic dimension of

[0086] The multi-core fusion module includes a dimension expansion layer, a splicing layer, multiple convolution layers, and a dimension compression layer. The convolution kernel of each convolution layer is , i=1,2,…,k, k represents the number of types of global and head-shoulder single-core fusion features;

[0087] The global feature vector and the head-shoulder feature vector are respectively input into the dimension expansion layer for dimension expansion to obtain the dimension-expanded global feature tensor and the dimension-expanded head-shoulder feature tensor, as shown in the following formula:

[0088] ;

[0089] ;

[0090] Among them, Unsqueeze represents the dimension expansion operation corresponding to the dimension expansion layer, which expands the processed feature vector to A tensor of dimension c, where c represents the number of channels of the tensor, d represents the height of the tensor, and w represents the width of the tensor. Indicates identity; and Represents the global feature tensor after dimension expansion and the head and shoulders feature tensor after dimension expansion;

[0091] The dimensionally expanded global feature tensor and the dimensionally expanded head-shoulder feature tensor are concatenated to obtain a concatenated feature tensor, as shown in the following formula:

[0092] ;

[0093] Among them, CCat represents the channel-by-channel concatenation operation corresponding to the concatenation layer, and u represents the concatenated feature tensor, whose dimension is ;

[0094] Use multiple convolutional layers to perform multi-core fusion on the spliced ​​feature tensors to obtain the global and head-shoulder multi-core fusion feature tensors, as shown in the following formula:

[0095] ;

[0096] ;

[0097] Among them, v i It means that the concatenated feature tensor u is obtained after the convolution kernel. The i-th global and head-shoulder single-core fusion feature tensor obtained by the convolution layer of , Conv represents the convolution operation corresponding to the convolution layer, and the convolution kernel It indicates that from left to right, the number of input channels, the number of output channels, the height of the receptive field, and the width of the receptive field are 2, 1, and 1, z represents the global and head-shoulder multi-core fusion feature tensor, i represents the sequence number of the global and head-shoulder single-core fusion feature tensor;

[0098] The global and head-shoulder multi-core fusion feature tensors are input into the dimension compression layer to obtain the fused feature vector, as shown in the following formula:

[0099] ;

[0100] Among them, Squeeze represents the dimension compression operation corresponding to the dimension compression layer. Represents the fused feature vector.

[0101] Specifically, a global feature extraction branch with q Transformer layers and a head-shoulder feature extraction branch with m Transformer layers are constructed based on the ViT model. Except for the different numbers of Transformer layers, the rest of the structures of the global feature extraction branch and the head-shoulder feature extraction branch are the same. and pedestrian head and shoulders images As the input of the global feature extraction branch and the head and shoulder feature extraction branch, the image is first segmented and flattened into a fixed-size two-dimensional image sequence block through the segmentation layer and the flattening layer. and . Block the 2D image sequence and They are concatenated with the category token (cls) respectively, mapped into a one-dimensional sequence token through the embedding layer, and the global feature extraction branch constructed by q Transformer layers and the head and shoulder feature extraction branch constructed by m Transformer layers are used to extract the global feature vectors of the fisheye pedestrian image respectively. and head and shoulders eigenvector The category token (cls) is an additional learnable parameter vector required by ViT. After passing through all Transformer layers, the category token (cls) can integrate the information of all two-dimensional image sequence blocks, which is global and will be extracted separately as the image feature of ViT for downstream tasks.

[0102] Furthermore, the global feature vector and the head-shoulder feature vector extracted from the global feature extraction branch and the head-shoulder feature extraction branch are fused using a multi-core fusion module. In the multi-core fusion module, the global feature vector and the head-shoulder feature vector are first input into the dimension expansion layer for dimension expansion to help the model learn deeper feature information. In this embodiment, the dimension expansion operation does not change the number of elements, so ; Then, the dimensionally expanded global feature tensor and the head-shoulder feature tensor are concatenated by channel. The dimension of the concatenated feature tensor is . Use multiple convolution layers with multiple convolution kernels to perform multi-core fusion on the spliced ​​feature tensor u to obtain the global and head-shoulder multi-core fusion feature tensors. As the variable i of the size of the convolution kernel changes, multiple different single-core fusion features can be fused. Finally, the global and head-shoulder multi-core fusion feature tensors are dimensionally compressed to obtain the fused feature vector to reduce the model complexity and improve the model generalization ability.

[0103] In a specific embodiment, the loss function is expressed as:

[0104] ;

[0105] in, , and Respectively represent the global eigenvector, head-shoulder eigenvector and fusion eigenvector, represents the overall loss function, , and They represent the loss function for supervising the global feature vector, the loss function for supervising the head and shoulder feature vector, and the loss function for supervising the fusion feature vector, respectively, as shown in the following formula:

[0106] ;

[0107] ;

[0108] ;

[0109] Where n represents the number of pedestrian images, t represents the number of pedestrian categories, , and Represents the global feature vector, head-shoulder feature vector and fusion feature vector corresponding to the b-th pedestrian image; represents the pedestrian category corresponding to the b-th pedestrian image, b represents the pedestrian image sequence number, Indicates comparison Is it equal to y? , , Respectively represent the b-th pedestrian image by , and The posterior probability of belonging to the yth category is calculated using the Softmax function, where y represents the pedestrian category number; It is an indicator function. If the condition in the brackets is true, the corresponding output is 1, otherwise the output is 0;

[0110] The gradient descent method is used to optimize the loss function and obtain the trained pedestrian recognition model.

[0111] Specifically, in the global eigenvector , head and shoulders eigenvector and fusion feature vector The cross entropy loss function is arranged above, and the gradient descent method is used to reduce the loss function By optimizing the global feature vector, head-shoulder feature vector and fusion feature vector, identity-identifying features are obtained for pedestrian recognition.

[0112] S4, inputting the pedestrian image to be identified and its corresponding pedestrian head and shoulder image into the trained pedestrian recognition model, obtaining the fused feature vector corresponding to the pedestrian image to be identified, performing pedestrian recognition based on the fused feature vector corresponding to the pedestrian image to be identified, and obtaining a recognition result.

[0113] In a specific embodiment, pedestrian recognition is performed based on the fused feature vector corresponding to the pedestrian image to be recognized, and a recognition result is obtained, which specifically includes:

[0114] The fused feature vector corresponding to the pedestrian image to be identified and the fused feature vector obtained by the trained pedestrian recognition model are compared for similarity to obtain a comparison result, and based on the comparison result, it is determined whether the pedestrian image to be identified and the pedestrian image with a known identity belong to the same person.

[0115] Specifically, several pedestrian images with known identities and their corresponding pedestrian head and shoulder images are respectively input into the trained pedestrian recognition model to obtain corresponding fused feature vectors, which are collected in the database. The pedestrian image to be identified and its corresponding pedestrian head and shoulder image are input into the trained pedestrian recognition model to obtain the fused feature vector corresponding to the pedestrian image to be identified. The fused feature vector corresponding to the pedestrian image to be identified is used as the query vector, and the similarity is calculated with each fused feature vector in the database. The identity of the pedestrian in the pedestrian image with known identity corresponding to the fused feature vector with the highest similarity compared with it is selected as the identity of the pedestrian in the pedestrian image to be identified.

[0116] The above steps S1-S4 do not necessarily represent the order between the steps, but are represented by step symbols, and the order between the steps can be adjusted.

[0117] Further references Figure 4 As an implementation of the methods shown in the above figures, the present application provides an embodiment of a pedestrian recognition device based on multi-core fusion of global features and head-shoulder features. Figure 1 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.

[0118] The embodiment of the present application provides a pedestrian recognition device based on multi-core fusion of global features and head-shoulder features, including:

[0119] An image acquisition module 1 is configured to acquire an image of a pedestrian to be identified;

[0120] The region detection module 2 is configured to use a trained pedestrian head and shoulder detection model to perform head and shoulder detection on a pedestrian image to obtain a pedestrian head and shoulder image;

[0121] The model training module 3 is configured to build a pedestrian recognition model, which includes a multi-core fusion module and a global feature extraction branch and a head-shoulder feature extraction branch based on a deep learning network. The pedestrian image and the pedestrian head-shoulder image are respectively input into the global feature extraction branch and the head-shoulder feature extraction branch to obtain a global feature vector and a head-shoulder feature vector. The global feature vector and the head-shoulder feature vector are input into the multi-core fusion module for fusion to obtain a fused feature vector. A loss function is constructed according to the global feature vector, the head-shoulder feature vector and the fused feature vector. The pedestrian recognition model is trained based on the loss function to obtain a trained pedestrian recognition model.

[0122] The pedestrian recognition module 4 is configured to input the pedestrian image to be recognized and its corresponding pedestrian head and shoulder image into the trained pedestrian recognition model, obtain the fused feature vector corresponding to the pedestrian image to be recognized, perform pedestrian recognition based on the fused feature vector corresponding to the pedestrian image to be recognized, and obtain the recognition result.

[0123] Figure 5 Schematic diagram of the hardware structure of the electronic device provided by the embodiment of the present invention. Figure 5 As shown, the electronic device of this embodiment includes: a processor 501 and a memory 502; wherein the memory 502 is used to store computer-executable instructions; the processor 501 is used to execute the computer-executable instructions stored in the memory to implement the various steps performed by the electronic device in the above embodiment. For details, please refer to the relevant description in the above method embodiment.

[0124] Optionally, the memory 502 may be independent or integrated with the processor 501 .

[0125] When the memory 502 is independently provided, the electronic device further includes a bus 503 for connecting the memory 502 and the processor 501 .

[0126] An embodiment of the present invention further provides a computer storage medium, in which computer execution instructions are stored. When a processor executes the computer execution instructions, the above method is implemented.

[0127] An embodiment of the present invention further provides a computer program product, including a computer program. When the computer program is executed by a processor, the above method is implemented.

[0128] In the embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules is only a logical function division, and there may be other division methods in actual implementation, such as multiple modules can be combined or integrated into another system, or some features can be ignored or not executed. Another point, the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or modules, which can be electrical, mechanical or other forms.

[0129] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to implement the solution of this embodiment.

[0130] In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, or each module may exist physically separately, or two or more modules may be integrated into one unit. The above-mentioned module-composed unit may be implemented in the form of hardware or in the form of hardware plus software functional units.

[0131] The above-mentioned integrated module implemented in the form of a software function module can be stored in a computer-readable storage medium. The above-mentioned software function module is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform some steps of the methods of various embodiments of the present application.

[0132] It should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the invention may be directly implemented as being executed by a hardware processor, or may be implemented by a combination of hardware and software modules in the processor.

[0133] The memory may include a high-speed RAM memory, and may also include a non-volatile storage NVM, such as at least one disk memory, and may also be a USB flash drive, a mobile hard disk, a read-only memory, a magnetic disk or an optical disk, etc.

[0134] The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of the present application is not limited to only one bus or one type of bus.

[0135] The above storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The storage medium can be any available medium that can be accessed by a general or special purpose computer.

[0136] An exemplary storage medium is coupled to a processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an application specific integrated circuit (ASIC). Of course, the processor and the storage medium can also exist as discrete components in an electronic device or a main control device.

[0137] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.

[0138] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A pedestrian recognition method based on multi-core fusion of global features and head-shoulder features, characterized in that: The following steps are involved: Acquire a pedestrian image to be identified, where the pedestrian image is captured by a fisheye camera; Using the trained pedestrian head and shoulder detection model to perform head and shoulder detection on the pedestrian image, obtaining a pedestrian head and shoulder image; Constructing a pedestrian recognition model, the pedestrian recognition model includes a multi-core fusion module and a global feature extraction branch and a head-shoulder feature extraction branch based on a deep learning network, the deep learning network includes ResNet, DenseNet or ViT, the pedestrian image and the pedestrian head-shoulder image are respectively input into the global feature extraction branch and the head-shoulder feature extraction branch to obtain a global feature vector and a head-shoulder feature vector, the global feature vector and the head-shoulder feature vector are input into the multi-core fusion module for fusion to obtain a fused feature vector, the global feature extraction branch and the head-shoulder feature extraction branch are both constructed based on ViT, the global feature extraction branch includes a segmentation layer, a flattening layer, an embedding layer, a splicing layer and q Transformer layers connected in sequence; the head-shoulder feature extraction branch includes a segmentation layer, a flattening layer, an embedding layer, a splicing layer and m Transformer layers connected in sequence; The pedestrian image and the pedestrian head and shoulder image are input into the segmentation layer and the flattening layer respectively to obtain a pedestrian image sequence block and a pedestrian head and shoulder image sequence block, as shown in the following formula: Wherein, x represents a pedestrian image, h represents a head and shoulder image extracted from the pedestrian image x, Split represents the segmentation operation corresponding to the segmentation layer, Flatten represents the spatial flattening operation corresponding to the flattening layer, P represents the height and width of each pedestrian image sequence block and pedestrian head and shoulder image sequence block, N G =(H G ×W G ) / (P×P) represents the number of pedestrian image sequence blocks, H G ,W G are the height and width of the pedestrian image, N F =(H F ×W F ) / (P×P) represents the number of blocks in the pedestrian head and shoulder image sequence, H F ,W F are the height and width of the pedestrian head and shoulder image, C represents the number of channels, and x p represents a pedestrian image sequence block, h p Represents a sequence block of pedestrian head and shoulder images; The pedestrian image sequence blocks and the pedestrian head and shoulder image sequence blocks are respectively concatenated with the pedestrian category label and input into the embedding layer, and the corresponding one-dimensional sequence tokens are mapped, and then passed through q Transformer layers and m Transformer layers respectively to extract the global feature vector and the head and shoulder feature vector, as shown in the following formula: Among them, Transformer q Represents the function corresponding to q Transformer layers, Transformer m represents the function corresponding to m Transformer layers, Embedding represents the mapping operation corresponding to the embedding layer, CCat represents the channel-by-channel concatenation operation corresponding to the concatenation layer, cls represents the category token, It means extracting the s-dimensional global feature vector from the pedestrian image x; It means that the s-dimensional head-shoulder feature vector is extracted from the pedestrian head-shoulder image h; represents a real number, s represents f Global and f Head The characteristic dimension of The multi-core fusion module includes a dimension expansion layer, a splicing layer, multiple convolution layers and a dimension compression layer. The convolution kernel of each convolution layer is θ 2×1×(2×i-1)×1 , i = 1, 2, …, k, k represents the number of types of global and head-shoulder single-core fusion features; The global feature vector and the head-shoulder feature vector are respectively input into the dimension expansion layer for dimension expansion to obtain a dimensionally expanded global feature tensor and a dimensionally expanded head-shoulder feature tensor, as shown in the following formula: Among them, Unsqueeze represents the dimension expansion operation corresponding to the dimension expansion layer, which expands the processed feature vector into a tensor of c×d×w dimensions, where c represents the number of channels of the tensor, d represents the height of the tensor, w represents the width of the tensor, and ≡ represents constant; g Global and g Head Represents the global feature tensor after dimension expansion and the head and shoulders feature tensor after dimension expansion; The dimensionally expanded global feature tensor and the dimensionally expanded head-shoulder feature tensor are concatenated to obtain a concatenated feature tensor, as shown in the following formula: Among them, CCat represents the channel-by-channel concatenation operation corresponding to the concatenation layer, and u represents the concatenated feature tensor, whose dimension is 2×d×1; The concatenated feature tensor is multi-core fused using multiple convolutional layers to obtain the global and head-shoulder multi-core fused feature tensors, as shown in the following formula: Among them, v i Indicates that the concatenated feature tensor u passes through the convolution kernel θ 2×1×(2×i-1)×1 The i-th global and head-shoulder single-core fusion feature tensor obtained by the convolution layer of , Conv represents the convolution operation corresponding to the convolution layer, and the convolution kernel θ 2×1×(2×i-1)×1 It indicates that from left to right, the number of input channels, the number of output channels, the height of the receptive field, and the width of the receptive field are 2, 1, 2×i-1, and 1, respectively. z represents the global and head-shoulder multi-core fusion feature tensor, and i represents the sequence number of the global and head-shoulder single-core fusion feature tensor. The global and head-shoulder multi-core fusion feature tensors are input into the dimension compression layer to obtain a fusion feature vector, as shown in the following formula: Wherein, Squeeze represents the dimension compression operation corresponding to the dimension compression layer, and f MKernel represents a fused feature vector, constructs a loss function according to the global feature vector, the head-shoulder feature vector and the fused feature vector, trains the pedestrian recognition model based on the loss function, and obtains a trained pedestrian recognition model; The pedestrian image to be identified and its corresponding pedestrian head and shoulder image are input into a trained pedestrian recognition model to obtain a fused feature vector corresponding to the pedestrian image to be identified, and pedestrian recognition is performed based on the fused feature vector corresponding to the pedestrian image to be identified to obtain a recognition result.

2. The pedestrian recognition method based on multi-core fusion of global features and head-shoulder features according to claim 1 is characterized in that: The trained pedestrian head and shoulder detection model includes an SSD network, a YOLO network or a Faster R-CNN network, and the specific process is as follows: h = HDNet(x); Among them, x represents a pedestrian image, HDNet represents the function corresponding to the trained pedestrian head and shoulder detection model, and h represents the head and shoulder image extracted from the pedestrian image x.

3. The pedestrian recognition method based on multi-core fusion of global features and head-shoulder features according to claim 1 is characterized in that: The expression of the loss function is: Loss Joint (f Global ,f Head ,f MKernel ) =Loss Global (f Global )+Loss Head (f Head )+Loss MKernel (f MKernel ); Among them, f Global 、f Head and f MKernel Respectively represent the global feature vector, head and shoulder feature vector and fusion feature vector, Loss Joint Represents the overall loss function, Loss Global 、Loss Head and Loss MKernel They represent the loss function for supervising the global feature vector, the loss function for supervising the head and shoulder feature vector, and the loss function for supervising the fusion feature vector, respectively, as shown in the following formula: Where n represents the number of pedestrian images, t represents the number of pedestrian categories, and represents the global feature vector, head-shoulder feature vector and fusion feature vector corresponding to the b-th pedestrian image; l b represents the pedestrian category corresponding to the b-th pedestrian image, b represents the pedestrian image sequence number, l b ==y means comparison l b Is it equal to y? Respectively represent the b-th pedestrian image by and The posterior probability of belonging to the yth category is calculated using the Softmax function, where y represents the pedestrian category number; s(·) is an indicator function. If the condition in the brackets is true, the corresponding output is 1, otherwise the output is 0; The loss function is optimized using a gradient descent method to obtain a trained pedestrian recognition model.

4. The pedestrian recognition method based on multi-core fusion of global features and head-shoulder features according to claim 1 is characterized in that: The performing pedestrian recognition based on the fused feature vector corresponding to the pedestrian image to be recognized to obtain a recognition result specifically includes: The fused feature vector corresponding to the pedestrian image to be identified and the fused feature vector obtained by the trained pedestrian recognition model are compared for similarity to obtain a comparison result, and based on the comparison result, it is determined whether the pedestrian image to be identified and the pedestrian image with a known identity belong to the same person.

5. A pedestrian recognition device based on multi-core fusion of global features and head-shoulder features, characterized in that: include: An image acquisition module is configured to acquire an image of a pedestrian to be identified, wherein the image of the pedestrian is acquired by a fisheye camera; The region detection module is configured to perform head and shoulder detection on the pedestrian image using a trained pedestrian head and shoulder detection model to obtain a pedestrian head and shoulder image; A model training module is configured to construct a pedestrian recognition model, wherein the pedestrian recognition model includes a multi-core fusion module and a global feature extraction branch and a head-shoulder feature extraction branch based on a deep learning network, wherein the deep learning network includes ResNet, DenseNet or ViT, wherein the pedestrian image and the pedestrian head-shoulder image are respectively input into the global feature extraction branch and the head-shoulder feature extraction branch to obtain a global feature vector and a head-shoulder feature vector, wherein the global feature vector and the head-shoulder feature vector are input into the multi-core fusion module for fusion to obtain a fused feature vector, wherein both the global feature extraction branch and the head-shoulder feature extraction branch are constructed based on ViT, wherein the global feature extraction branch includes a segmentation layer, a flattening layer, an embedding layer, a splicing layer and q Transformer layers connected in sequence; wherein the head-shoulder feature extraction branch includes a segmentation layer, a flattening layer, an embedding layer, a splicing layer and m Transformer layers connected in sequence; The pedestrian image and the pedestrian head and shoulder image are input into the segmentation layer and the flattening layer respectively to obtain a pedestrian image sequence block and a pedestrian head and shoulder image sequence block, as shown in the following formula: Wherein, x represents a pedestrian image, h represents a head and shoulder image extracted from the pedestrian image x, Split represents the segmentation operation corresponding to the segmentation layer, Flatten represents the spatial flattening operation corresponding to the flattening layer, P represents the height and width of each pedestrian image sequence block and pedestrian head and shoulder image sequence block, N G =(H G ×W G ) / (P×P) represents the number of pedestrian image sequence blocks, H G ,W G are the height and width of the pedestrian image, N F =(H F ×W F ) / (P×P) represents the number of blocks in the pedestrian head and shoulder image sequence, H F ,W F are the height and width of the pedestrian head and shoulder image, C represents the number of channels, and x p represents a pedestrian image sequence block, h p Represents a sequence block of pedestrian head and shoulder images; The pedestrian image sequence blocks and the pedestrian head and shoulder image sequence blocks are respectively concatenated with the pedestrian category label and input into the embedding layer, and the corresponding one-dimensional sequence tokens are mapped, and then passed through q Transformer layers and m Transformer layers respectively to extract the global feature vector and the head and shoulder feature vector, as shown in the following formula: Among them, Transformer q Represents the function corresponding to q Transformer layers, Transformer m represents the function corresponding to m Transformer layers, Embedding represents the mapping operation corresponding to the embedding layer, CCat represents the channel-by-channel concatenation operation corresponding to the concatenation layer, cls represents the category token, It means extracting the s-dimensional global feature vector from the pedestrian image x; It means that the s-dimensional head-shoulder feature vector is extracted from the pedestrian head-shoulder image h; represents a real number, s represents f Global and f Head The characteristic dimension of The multi-core fusion module includes a dimension expansion layer, a splicing layer, multiple convolution layers and a dimension compression layer. The convolution kernel of each convolution layer is θ 2×1×(2×i-1)×1 , i = 1, 2, …, k, k represents the number of types of global and head-shoulder single-core fusion features; The global feature vector and the head-shoulder feature vector are respectively input into the dimension expansion layer for dimension expansion to obtain a dimensionally expanded global feature tensor and a dimensionally expanded head-shoulder feature tensor, as shown in the following formula: Among them, Unsqueeze represents the dimension expansion operation corresponding to the dimension expansion layer, which expands the processed feature vector into a tensor of c×d×w dimensions, where c represents the number of channels of the tensor, d represents the height of the tensor, w represents the width of the tensor, and ≡ represents constant; g Global and g Head Represents the global feature tensor after dimension expansion and the head and shoulders feature tensor after dimension expansion; The dimensionally expanded global feature tensor and the dimensionally expanded head-shoulder feature tensor are concatenated to obtain a concatenated feature tensor, as shown in the following formula: Among them, CCat represents the channel-by-channel concatenation operation corresponding to the concatenation layer, and u represents the concatenated feature tensor, whose dimension is 2×d×1; The concatenated feature tensor is multi-core fused using multiple convolutional layers to obtain the global and head-shoulder multi-core fused feature tensors, as shown in the following formula: Among them, v i Indicates that the concatenated feature tensor u passes through the convolution kernel θ 2×1×(2×i-1)×1 The i-th global and head-shoulder single-core fusion feature tensor obtained by the convolution layer of , Conv represents the convolution operation corresponding to the convolution layer, and the convolution kernel θ 2×1×(2×i-1)×1 It indicates that from left to right, the number of input channels, the number of output channels, the height of the receptive field, and the width of the receptive field are 2, 1, 2×i-1, and 1, respectively. z represents the global and head-shoulder multi-core fusion feature tensor, and i represents the sequence number of the global and head-shoulder single-core fusion feature tensor. The global and head-shoulder multi-core fusion feature tensors are input into the dimension compression layer to obtain a fusion feature vector, as shown in the following formula: Wherein, Squeeze represents the dimension compression operation corresponding to the dimension compression layer, and f MKernel represents a fused feature vector, constructs a loss function according to the global feature vector, the head-shoulder feature vector and the fused feature vector, trains the pedestrian recognition model based on the loss function, and obtains a trained pedestrian recognition model; The pedestrian recognition module is configured to input the pedestrian image to be recognized and its corresponding pedestrian head and shoulder image into a trained pedestrian recognition model, obtain a fused feature vector corresponding to the pedestrian image to be recognized, perform pedestrian recognition based on the fused feature vector corresponding to the pedestrian image to be recognized, and obtain a recognition result.

6. An electronic device comprising: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 4.

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

8. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.