Pedestrian attribute identification method based on mask prior

By adopting a mask prior method in pedestrian attribute recognition, using the prior knowledge provided by 2D pose estimation and mask image modeling, the problem of poor generalization ability caused by the lack of prior knowledge and model complexity in the existing methods is solved, and pedestrian attribute recognition with higher accuracy and generalization performance is achieved.

CN119810867APending Publication Date: 2025-04-11CHINA TELECOM CLOUD TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411719307.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-27
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

The existing pedestrian attribute recognition methods lack prior knowledge-guided learning, which leads to the lack of targetedness in the model when identifying pedestrian attributes, and the model design is complex and the generalization ability is poor.

Method used

The mask prior is used to extract the human body structure through 2D pose estimation, and the mask prior obtained by mask image modeling provides the model with semantic rich pedestrian body structure information. This method does not require additional construction of expert models or massive data sets, and pedestrian attribute recognition is only required for simple network structure.

Benefits of technology

It improves the accuracy and generalization performance of pedestrian attribute recognition, enhances the model's specific learning ability to the human body, and reduces the complexity of the model structure.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119810867A_ABST
    Figure CN119810867A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of computer vision, and discloses a pedestrian attribute recognition method based on mask prior, which comprises the following steps: acquiring a video image and a pedestrian attribute data set; based on the pedestrian attribute data set, extracting a 2D human body posture of a pedestrian containing a preset type of human body structure attribute, and combining the preset type of human body structure attribute according to the video image to construct pedestrian structure priori based on mask image modeling; after a training data set and a verification data set are constructed based on pedestrian structure prior, a pedestrian attribute model is obtained by combining visual model training; in the same feature space, aligning the pedestrian attribute model and the structural features representing the same human body part in the video image; and identifying pedestrian attributes of the video image based on the pedestrian attribute model. According to the method, the ability of guiding learning by priori knowledge is enhanced through pedestrian structure priori, so that the precision and accuracy of pedestrian attribute recognition are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer vision technology, and in particular to a method for pedestrian attribute recognition based on mask prior. Background Art

[0002] Pedestrian Attribute Recognition (PAR) based on computer vision plays an important role in the field of video surveillance. The main purpose of PAR is to be able to deeply explore the attributes of the target person when given an image of a person, so as to describe and understand his or her characteristics in detail. These features include but are not limited to gender, age, hair color, clothing style, etc. Compared with low-level features such as Histogram of Oriented Gradient (HOG), Scale-invariant feature transform (SIFT), Local Binary Patterns (LBP) or deep features, human attributes are regarded as higher-level semantic information.

[0003] In practical applications, pedestrian attribute recognition can be widely used in security monitoring, intelligent transportation, face recognition and other fields. For example, in the field of security monitoring, by identifying pedestrian attributes, it is possible to automatically track and alarm specific personnel; in the field of intelligent transportation, by identifying pedestrian attributes, it is possible to analyze and predict pedestrian behavior, thereby improving traffic safety; in the field of face recognition, by identifying pedestrian attributes, it is possible to achieve a more accurate match of facial information, thereby improving the accuracy of face recognition.

[0004] Pedestrian attribute recognition mainly includes traditional methods and methods based on deep learning:

[0005] 1) Traditional pedestrian attribute recognition methods: Traditional methods usually focus on developing robust feature representations from the perspective of hand-crafted features, classifiers, or attribute relationships, including models such as HOG, SIFT, Support Vector Machine (SVM), and Conditional Random Field (CRF). However, since pedestrian images in surveillance videos are susceptible to motion blur and have low resolution, the performance of these traditional algorithms is far inferior to the requirements of practical applications.

[0006] 2) Pedestrian attribute recognition methods based on deep learning: In recent years, deep learning has achieved impressive results due to its automatic feature extraction using multi-layer nonlinear transformations, especially in computer vision, speech recognition and natural language processing. Based on these breakthroughs, and in order to solve the problems of traditional methods, people have also proposed pedestrian attribute recognition methods based on deep learning, including: DeepMAR, WPAL, VeSPA, HPNet, HCMoCo and other algorithms. Compared with traditional methods, these deep learning algorithms have improved the accuracy of pedestrian attribute recognition to a certain extent, but these algorithms all use specially designed network structures and conduct training on a large number of modalities and data sets. The model structure is relatively complex and the generalization performance of the model is not good enough.

[0007] Based on the above analysis, the current pedestrian attribute recognition method still has the following two problems:

[0008] 1) Attributes lack prior knowledge to guide learning. Pedestrian attribute recognition is different from conventional classification tasks. Due to the special structure, preferences or natural constraints of humans, pedestrian attribute recognition always has its own characteristics. Existing methods, whether traditional or deep learning methods, lack prior knowledge of mining PAR to guide the model to automatically learn different attributes.

[0009] 2) The PAR model is complex in design and has poor generalization ability. Existing work still uses a specially designed network structure to train large or multimodal data sets, lacking a simple and universal training framework to achieve high-precision pedestrian attribute recognition with good generalization ability. Summary of the invention

[0010] In view of this, the present invention provides a pedestrian attribute recognition method based on mask prior to solve the problem that the pedestrian attribute recognition process in the prior art lacks prior knowledge to guide learning.

[0011] In a first aspect, the present invention provides a method for pedestrian attribute recognition based on mask prior, comprising: acquiring a video image and a pedestrian attribute data set; extracting a 2D human posture of a pedestrian containing preset types of human structural attributes based on the pedestrian attribute data set, and constructing a pedestrian structural prior based on mask image modeling according to the video image combined with the preset types of human structural attributes; after constructing a training data set and a verification data set based on the pedestrian structural prior, obtaining a pedestrian attribute model in combination with visual model training; aligning the pedestrian attribute model and the structural features representing the same human body part in the video image in the same feature space; and identifying the pedestrian attributes of the video image based on the pedestrian attribute model.

[0012] The pedestrian attribute recognition method based on mask prior provided by the present invention extracts human body structure by utilizing 2D posture estimation, and the mask prior obtained by Masked Image Modeling (MIM) provides the model with semantically rich pedestrian body structure information, which can improve the accuracy of existing recognition methods on the one hand; on the other hand, it does not require the additional construction of expert models or massive data sets, and only requires a simple network structure assisted by pedestrian structure prior to detect and identify the attributes of pedestrians in the monitoring scene, has better generalization performance, enhances the model's specific learning ability for the human body, and improves the performance of the pedestrian attribute recognition method.

[0013] In an optional embodiment, the process of constructing a pedestrian structure prior based on mask image modeling according to a video image combined with preset types of human structure attributes includes: randomly dividing the video image into a preset number of branches; dividing the human structure contained in each branch according to preset types of human structure attributes, and randomly masking each branch according to a preset mask ratio to obtain a pedestrian structure prior.

[0014] In an optional implementation, the process of randomly masking each branch according to a preset mask rate includes: after dividing the video image into N blocks, embedding each branch into the N blocks for random masking, and the number of pixels in the mask area is:

[0015] N m =max{n∈Qn≤β×N}

[0016] Wherein, Nm is the number of pixels in the mask area; Q is a set of integers; n is any integer between 0 and Z; β is the mask ratio; and N is any integer greater than 0.

[0017] In an optional embodiment, the process of obtaining a pedestrian attribute model by combining visual model training includes: constructing a loss function for each branch respectively; selecting a visual model, and based on a training data set and a verification data set, respectively combining the loss function training and verification of each branch to obtain a pedestrian attribute model.

[0018] The mask prior-based pedestrian attribute recognition method provided by the present invention does not require complex special structure design and can use a general visual model. It reduces the complexity of the model structure to a certain extent and improves the generalization ability of the method. Compared with existing methods, it has certain universality.

[0019] In an optional implementation, the loss function is a contrast prediction coding function, and the calculation formula of the contrast prediction coding function is:

[0020]

[0021] Among them, X = (x1, x2, ... xN) represents a batch of branch samples; (xt+k, ct) represents a positive sample pair, (xj, ct) represents a negative sample pair, c t represents the state at the current time t, and xt+k represents the state at the future time t+k.

[0022] In an optional embodiment, the process of aligning the structural features representing the same human body part in the pedestrian attribute model and the video image includes: dividing all the human body structural features in each branch into a preset number of potential features; dividing the human body structural features in the pedestrian attribute model based on the potential features; and aligning the potential features in the pedestrian attribute model with the potential features in each branch by utilizing the principle that the structural features of each part of the human body remain unchanged.

[0023] The mask prior-based pedestrian attribute recognition method provided by the present invention utilizes the alignment method of the structures of various parts of the human body to make good use of the potential feature representations of different branches in the stage of aligning various features of the model, and maintains the consistency of the original human body structure, thereby improving the accuracy and generalization performance of the simple general model.

[0024] In a second aspect, the present invention provides a method for pedestrian attribute recognition based on mask prior, comprising: an acquisition module for acquiring video images and pedestrian attribute data sets; a construction module for extracting 2D human postures of pedestrians containing preset types of human structural attributes based on the pedestrian attribute data sets, and constructing a pedestrian structural prior based on mask image modeling according to the video image combined with the preset types of human structural attributes; a training and verification module for constructing a training data set and a verification data set based on the pedestrian structural prior, and then obtaining a pedestrian attribute model in combination with visual model training; an alignment module for aligning structural features representing the same human body part in the pedestrian attribute model and the visual model in the same feature space; and an identification module for identifying pedestrian attributes of video images based on the pedestrian attribute model.

[0025] The pedestrian attribute recognition device based on mask prior provided by the present invention extracts human body structure by utilizing 2D posture estimation, and the mask prior obtained by MIM provides the model with semantically rich pedestrian body structure information, which can improve the accuracy of existing recognition methods on the one hand; on the other hand, it does not require the additional construction of expert models, nor does it require massive data sets. At the same time, a simple network structure assisted by only pedestrian structure prior can detect and identify the attributes of pedestrians in the monitoring scene, has better generalization performance, enhances the model's specific learning ability for the human body, and improves the performance of the pedestrian attribute recognition method.

[0026] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the mask prior-based pedestrian attribute recognition method of the above-mentioned first aspect or any corresponding embodiment thereof by executing the computer instructions.

[0027] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the mask prior-based pedestrian attribute recognition method of the above-mentioned first aspect or any corresponding embodiment thereof.

[0028] In a fifth aspect, the present invention provides a computer program product, comprising computer instructions, wherein the computer instructions are used to enable a computer to execute the mask prior-based pedestrian attribute recognition method of the above-mentioned first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0030] Figure 1 is a flowchart of a method for pedestrian attribute recognition based on mask prior according to an embodiment of the present invention;

[0031] Figure 2 is a flowchart of another method for pedestrian attribute recognition based on mask prior according to an embodiment of the present invention;

[0032] Figure 3 is a flowchart of another method for pedestrian attribute recognition based on mask prior according to an embodiment of the present invention;

[0033] Figure 4 is a flowchart of another method for pedestrian attribute recognition based on mask prior according to an embodiment of the present invention;

[0034] Figure 5 is a structural block diagram of a cloud desktop clipboard data processing device according to an embodiment of the present invention;

[0035] Figure 6 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0036] The technical solution of the present invention will be described clearly and completely below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. 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.

[0037] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0038] In addition, the technical features involved in the different embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.

[0039] With the continuous development of pattern recognition and machine vision technology, pedestrian attribute recognition shows great potential in intelligent video surveillance scenarios. People are eager to obtain more features about pedestrians in the video, such as appearance characteristics, gender characteristics, age characteristics, etc.

[0040] There are relatively few datasets for pedestrian attribute recognition, mainly PETA, RAP (versions 1.0 and 2.0), PA100K, etc. These datasets have some problems in data distribution, scene diversity, and label accuracy. For example, the diversity of the PETA dataset is low, the annotation quality of RAP is unstable, and the scene distribution of PA100K is insufficient. In recent years, although some video-based pedestrian attribute recognition datasets have emerged, they still face the problems of insufficient scenes and unbalanced labels.

[0041] Pedestrian attribute recognition technology is mainly used in monitoring environments to monitor pedestrian flow, analyze crowd behavior, and even provide real-time warnings in crisis situations. For example, in traffic management, the system can automatically identify and count the number of pedestrians passing by through cameras to optimize traffic diversion plans; in public safety, it can promptly identify abnormal behavior and improve safety management efficiency. In addition, this technology can also be applied to retail, advertising, smart homes and other fields to achieve more personalized services. Efficient recognition of pedestrian attributes has become a basic task of pedestrian visual analysis and is widely used in fields such as intelligent monitoring, human-computer interaction and image retrieval, with huge academic research and commercial application value.

[0042] At present, most pedestrian attribute recognition methods only focus on the overall characteristics of pedestrians, ignoring the recognition of fine-grained features of pedestrians and the extraction of local features. When pedestrians appear in complex backgrounds, the pedestrian detection task becomes more difficult. For example, crowded crowds, cluttered backgrounds, occlusions, etc. will cause the morphological changes and blurred boundaries of pedestrian targets. The scale and posture changes of pedestrian targets are another major difficulty in pedestrian detection. The size and angle of pedestrians in the image may change due to factors such as shooting distance and viewing angle, causing the appearance and shape of the target to change, which will make it difficult for pedestrian detection algorithms to accurately capture pedestrian targets at different scales and postures. Moreover, due to changes in viewing angles and pedestrian postures, some semantic components will have different degrees of spatial offset, which brings many difficulties to pedestrian attribute recognition. At this time, conventional pedestrian detection algorithms often find it difficult to accurately locate and identify pedestrian targets. Whether it is traditional methods or deep learning methods, they lack the prior knowledge of mining PAR to guide the model to automatically learn different attributes.

[0043] To this end, this embodiment provides a pedestrian attribute recognition method based on mask priors, such as Figure 1 As shown, including:

[0044] Step S1: Obtain video images and pedestrian attribute datasets.

[0045] Exemplarily, obtain a pedestrian photo taken by a surveillance camera, and obtain a pre-stored pedestrian attribute dataset, such as PA100K, HAT, etc. The PA100K dataset is the largest dataset for pedestrian attribute recognition to date, which contains a total of 10,000 pedestrian images collected from outdoor surveillance cameras, and each image has 26 common attributes. According to official settings, the entire dataset is randomly divided into 80,000 training images, 10,000 verification images, and 10,000 test images. The information stored in the PA100K dataset generally includes: whether the pedestrian has a hat, glasses, top type (including short sleeves, long sleeves, stripes, printed patterns, contrasting clothes, plaid shirts, etc.), bottom type (including stripes, printed images, long coats, trousers, shorts, skirts / dresses, etc.), whether there are shoes, bag type (including handbags, shoulder bags, backpacks, etc.), age range, gender, body orientation, etc.

[0046] Step S2: extracting 2D human postures of pedestrians including preset types of human structural attributes based on a pedestrian attribute dataset, and constructing pedestrian structural priors based on mask image modeling according to the video image combined with the preset types of human structural attributes.

[0047] Specifically, the goal of 2D human pose estimation is to locate and identify key points of the human body, which are connected in order of joints to obtain the human torso and then the human pose. Combined with the pedestrian attribute dataset, 2D human pose is extracted based on the pedestrian photos taken by the surveillance camera.

[0048] Optionally, a process of constructing a pedestrian structure prior based on mask image modeling is performed according to the video image combined with preset types of human structure attributes, such as Figure 2 As shown, including:

[0049] Step S21: randomly dividing the video image into a preset number of branches.

[0050] For example, a pedestrian structure prior based on MIM is designed and constructed first, and the input image captured by the surveillance camera is randomly generated into three branches, for example, the image is divided into several specific areas with unique properties according to certain rules, and the objects of interest are extracted. All branches include: head, torso, limbs (left arm, right arm, left leg and right leg), left hand, right hand, left foot, right foot, etc.

[0051] Step S22: The human structures contained in each branch are divided according to preset types of human structure attributes, and each branch is randomly masked according to a preset mask ratio to obtain pedestrian structure prior.

[0052] Optionally, an input image taken by a surveillance camera is used as input x, three branches X = {x1, x2, x3} are randomly generated, and each branch is randomly masked by 30% using a masked autoencoder MAE, and then the missing pixels are reconstructed. After dividing an input image into N blocks, the random masking operation is to embed the input x into N blocks, with a mask ratio β of 30%, and the number of pixels Nm in the masked area is:

[0053] N m =max{n∈Q|n≤β×N} (1)

[0054] Wherein, Q is a set of integers; n is any integer between 0 and Z; and N is any integer greater than 0.

[0055] Step S3: After constructing a training data set and a validation data set based on the pedestrian structure prior, a pedestrian attribute model is obtained by combining visual model training.

[0056] Optionally, during the model training process, the three branches share parameters and combine the visual model training to obtain the pedestrian attribute model, such as Figure 3 As shown, including:

[0057] Step S31: construct the loss function of each branch respectively.

[0058] Step S32: Select a visual model, and obtain a pedestrian attribute model based on the training data set and the verification data set, combined with the loss function of each branch for training and verification.

[0059] Specifically, a simple and general visual model (VisionTransformer, ViT) is selected based on the training data set DATA train , validation data set DATA val , combined with the loss function training and verification to obtain the model Model,

[0060] The loss function is the contrast prediction coding function, and the calculation formula of the contrast prediction coding function is:

[0061]

[0062] Among them, X = (x1, x2, ... xN) represents a batch of branch samples; (xt+k, ct) represents a positive sample pair, (xj, ct) represents a negative sample pair, c t represents the state at the current time t, and xt+k represents the state at the future time t+k.

[0063] Step S4: In the same feature space, align the pedestrian attribute model and the structural features representing the same human body part in the video image.

[0064] For example, the alignment method of the pedestrian body parts is adopted, and after the model encoding, three potential feature representations are aligned in the same feature space to improve the representation ability of pedestrian structural semantic information. The process of aligning the pedestrian attribute model and the structural features representing the same human body part in the video image is as follows: Figure 4 As shown, including:

[0065] Step S41: Divide all human body structure features in each branch into a preset number of potential features.

[0066] Step S42: dividing the human body structure features in the pedestrian attribute model based on the latent features.

[0067] Step S43: using the principle that the structural features of each part of the human body remain unchanged, the potential features in the pedestrian attribute model are aligned with the potential features in each branch.

[0068] For example, the potential feature of each branch is represented as Z = {Z1, Z2, Z3}, and the three are aligned using the invariant alignment of the body parts. The alignment formula is:

[0069]

[0070] Among them, B is the batch size, and τ is a hyperparameter set to 0.2. Through the structural invariant alignment of various parts of the human body, in the model feature alignment stage, the potential feature representations of different branches can be well utilized and the consistency of the original human body structure can be maintained, thereby improving the accuracy and generalization performance of simple general models.

[0071] Step S5: Identify pedestrian attributes in the video image based on the pedestrian attribute model.

[0072] Specifically, a surveillance video is divided into several frames, and detect = (x1, x2, x3...xk) is obtained. Based on the model Model detection and recognition, the attribute recognition description set Attributes of the monitored object is obtained. detect =Model(detect).

[0073] The pedestrian attribute recognition method based on mask prior provided in this embodiment extracts the human body structure by utilizing 2D posture estimation, and the mask prior obtained by Masked Image Modeling (MIM) provides the model with semantically rich pedestrian body structure information, which can improve the accuracy of existing recognition methods on the one hand; on the other hand, it does not require the additional construction of expert models or massive data sets, and only requires a simple network structure assisted by pedestrian structure prior to detect and identify the attributes of pedestrians in the monitoring scene, has better generalization performance, enhances the model's specific learning ability for the human body, and improves the performance of the pedestrian attribute recognition method.

[0074] In this embodiment, a pedestrian attribute recognition device based on mask prior is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0075] This embodiment provides a pedestrian attribute recognition device based on mask priors, such as Figure 5 As shown, including:

[0076] The acquisition module 501 is used to acquire video images and pedestrian attribute data sets.

[0077] The construction module 502 is used to extract the 2D human posture of pedestrians containing preset types of human structure attributes based on the pedestrian attribute data set, and construct a pedestrian structure prior based on mask image modeling according to the video image combined with the preset types of human structure attributes.

[0078] The training and verification module 503 is used to construct a training data set and a verification data set based on the pedestrian structure prior, and then obtain a pedestrian attribute model in combination with visual model training.

[0079] The alignment module 504 is used to align the structural features representing the same human body part in the pedestrian attribute model and the visual model in the same feature space.

[0080] The recognition module 505 is used to recognize pedestrian attributes in the video image based on the pedestrian attribute model.

[0081] Specifically, the method for pedestrian attribute recognition using a pedestrian attribute recognition device based on mask prior includes:

[0082] Step S1: Obtain video images and pedestrian attribute datasets.

[0083] Step S2: extracting 2D human postures of pedestrians including preset types of human structural attributes based on a pedestrian attribute dataset, and constructing pedestrian structural priors based on mask image modeling according to the video image combined with the preset types of human structural attributes.

[0084] Step S21: randomly dividing the video image into a preset number of branches.

[0085] Step S22: The human structures contained in each branch are divided according to preset types of human structure attributes, and each branch is randomly masked according to a preset mask ratio to obtain pedestrian structure prior.

[0086] Step S3: After constructing a training data set and a validation data set based on the pedestrian structure prior, a pedestrian attribute model is obtained by combining visual model training.

[0087] Step S31: construct the loss function of each branch respectively.

[0088] Step S32: Select a visual model, and obtain a pedestrian attribute model based on the training data set and the verification data set, combined with the loss function of each branch for training and verification.

[0089] Step S4: In the same feature space, align the pedestrian attribute model and the structural features representing the same human body part in the video image.

[0090] Step S41: Divide all human body structure features in each branch into a preset number of potential features.

[0091] Step S42: dividing the human body structure features in the pedestrian attribute model based on the latent features.

[0092] Step S43: using the principle that the structural features of each part of the human body remain unchanged, the potential features in the pedestrian attribute model are aligned with the potential features in each branch.

[0093] Step S5: Identify pedestrian attributes in the video image based on the pedestrian attribute model.

[0094] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.

[0095] The mask prior-based pedestrian attribute recognition device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.

[0096] The pedestrian attribute recognition device based on mask prior provided in this embodiment extracts human body structure by utilizing 2D posture estimation, and the mask prior obtained by MIM provides the model with semantically rich pedestrian body structure information, which can improve the accuracy of existing recognition methods on the one hand; on the other hand, it does not require the additional construction of expert models, nor does it require massive data sets. At the same time, a simple network structure assisted by only pedestrian structure prior can detect and identify the attributes of pedestrians in the monitoring scene, has better generalization performance, enhances the model's specific learning ability for the human body, and improves the performance of the pedestrian attribute recognition method.

[0097] The embodiment of the present invention also provides a computer device having the above Figure 5 The mask prior-based pedestrian attribute recognition device shown.

[0098] See also Figure 6 , Figure 6 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 6 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 6 A processor 10 is taken as an example.

[0099] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.

[0100] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.

[0101] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0102] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.

[0103] The computer device further comprises a communication interface 30 for the computer device to communicate with other devices or a communication network.

[0104] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.

[0105] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.

[0106] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.

Claims

1. A pedestrian attribute recognition method based on mask prior, characterized in that: include: Obtain video images and pedestrian attribute datasets; Extracting a 2D human body posture of a pedestrian including preset types of human body structure attributes based on the pedestrian attribute dataset, and constructing a pedestrian structure prior based on mask image modeling according to the video image combined with the preset types of human body structure attributes; After constructing a training data set and a verification data set based on the pedestrian structure prior, a pedestrian attribute model is obtained by combining visual model training; In the same feature space, aligning the pedestrian attribute model and the structural features representing the same human body part in the video image; The pedestrian attributes of the video image are identified based on the pedestrian attribute model.

2. The method according to claim 1, characterized in that The process of constructing a pedestrian structure prior based on mask image modeling according to the video image combined with the preset type of human body structure attributes includes: Randomly dividing the video image into a preset number of branches; The human structures contained in each branch are divided in combination with the preset types of human structure attributes, and each branch is randomly masked according to a preset mask ratio to obtain the pedestrian structure prior.

3. The method according to claim 2, characterized in that The process of randomly masking each branch according to a preset masking rate includes: After dividing the video image into N blocks, each branch is embedded into the N blocks for random masking, and the number of pixels in the masked area is: N m =max{n∈Q|n≤β×N} Among them, N m is the number of pixels in the mask area; Q is a set of integers; n is any integer between 0 and Z; β is the mask ratio; N is any integer greater than 0.

4. The method according to claim 2 or 3, characterized in that: The process of obtaining a pedestrian attribute model by combining visual model training includes: Construct the loss function of each branch separately; A visual model is selected, and based on the training data set and the verification data set, a pedestrian attribute model is obtained by training and verifying the loss function of each branch.

5. The method according to claim 4, characterized in that The loss function is a contrast prediction coding function, and the calculation formula of the contrast prediction coding function is: Where X = (x1, x2, ... x N ) represents a batch of branch samples; (x t+k , c t ) represents a positive sample pair, (x j , c t ) represents a negative sample pair, c t represents the current state at time t, x t+k Represents the state at time t+k in the future.

6. The method according to claim 2, characterized in that The process of aligning the pedestrian attribute model with the structural features representing the same human body part in the video image includes: Dividing all human body structure features in each of the branches into a preset number of potential features; dividing the human body structure features in the pedestrian attribute model based on the potential features; By utilizing the principle that the structural features of each part of the human body remain unchanged, the latent features in the pedestrian attribute model are aligned with the latent features in each of the branches.

7. A method for pedestrian attribute recognition based on mask prior, characterized in that: include: An acquisition module is used to acquire video images and pedestrian attribute data sets; A construction module, configured to extract a 2D human posture of a pedestrian including preset types of human structure attributes based on the pedestrian attribute data set, and construct a pedestrian structure prior based on mask image modeling according to the video image combined with the preset types of human structure attributes; A training and verification module, used to construct a training data set and a verification data set based on the pedestrian structure prior, and then obtain a pedestrian attribute model in combination with visual model training; An alignment module, used for aligning structural features representing the same human body part in the pedestrian attribute model and the visual model in the same feature space; The recognition module is used to recognize the attributes of the pedestrian in the video image based on the pedestrian attribute model.

8. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the mask prior-based pedestrian attribute recognition method described in any one of claims 1 to 6 by executing the computer instructions.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the pedestrian attribute recognition method based on mask prior according to any one of claims 1 to 6.

10. A computer program product, characterized in that The method comprises computer instructions, wherein the computer instructions are used to enable a computer to execute the pedestrian attribute recognition method based on mask prior according to any one of claims 1 to 6.