[go: up one dir, main page]

WO2023123923A1 - Human body weight identification method, human body weight identification device, computer device, and medium - Google Patents

Human body weight identification method, human body weight identification device, computer device, and medium Download PDF

Info

Publication number
WO2023123923A1
WO2023123923A1 PCT/CN2022/100384 CN2022100384W WO2023123923A1 WO 2023123923 A1 WO2023123923 A1 WO 2023123923A1 CN 2022100384 W CN2022100384 W CN 2022100384W WO 2023123923 A1 WO2023123923 A1 WO 2023123923A1
Authority
WO
WIPO (PCT)
Prior art keywords
human body
feature
feature extraction
training
training image
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/CN2022/100384
Other languages
French (fr)
Chinese (zh)
Inventor
何烨林
魏新明
肖嵘
王孝宇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Intellifusion Technologies Co Ltd
Original Assignee
Shenzhen Intellifusion Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Intellifusion Technologies Co Ltd filed Critical Shenzhen Intellifusion Technologies Co Ltd
Publication of WO2023123923A1 publication Critical patent/WO2023123923A1/en
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/22Matching criteria, e.g. proximity measures
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/23Clustering techniques
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/25Fusion techniques
    • G06F18/253Fusion techniques of extracted features
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods

Definitions

  • the present application relates to the technical field of computer vision, in particular to a method for body weight recognition, a body weight recognition device, computer equipment and media.
  • Human body re-identification technology is a technology that uses computer vision technology to perform non-overlapping camera retrieval on a given image, thereby identifying images belonging to the same human body.
  • human body recognition technology can track, match and identify the same human body across time and space. It has been widely used in all aspects of social life and has become a research hotspot in the field of computer vision in recent years. one.
  • the deep learning model is used to learn the relationship between human bodies to extract features and search, and the performance of the model depends heavily on the quality and quantity of data.
  • the training data used to train the human body weight recognition model needs to label pedestrian relationships across cameras, which leads to high training costs and difficulties for the human body weight recognition model.
  • the technical problem to be solved in this application is to overcome the defects in the prior art that rely too much on data quality and quantity when using the human body weight recognition model to perform human body weight recognition, so as to provide a human body weight recognition method, a human body weight recognition device, computer equipment and medium.
  • the present application provides a method for human body weight recognition, the method comprising: acquiring an image of a human body to be detected.
  • the first human body feature of the human body image is extracted through a pre-trained human body weight recognition model, and the human body weight recognition model is trained based on a human body training image collected by a single camera. Comparing the first human body feature with a plurality of human body features in a preset database, and determining a second human body feature with the highest similarity to the first human body feature. When the similarity is greater than or equal to a specified threshold, the human body category corresponding to the second human body feature is matched to the human body category most similar to the human body image.
  • the human body weight recognition model that can be trained based on the human body training image collected by a single camera can be used among the multiple human body features in the preset database as the The detected human body images are matched to the most similar human body category, thereby improving the accuracy of human body category recognition and reducing the occurrence of misidentification.
  • the present application also provides a device for body weight recognition, which includes: an acquisition unit configured to acquire an image of a human body to be detected.
  • the extraction unit is configured to extract the first human body feature of the human body image through a pre-trained human body weight recognition model, and the human body weight recognition model is trained based on human body training images collected by a single camera.
  • a comparing unit configured to compare the first human body feature with a plurality of human body features in a preset database, and determine a second human body feature with the highest similarity to the first human body feature.
  • a determining unit configured to match the human body category corresponding to the second human body feature to the human body category most similar to the human body image when the similarity is greater than or equal to a specified threshold.
  • the human body re-identification model is trained based on the human body training images collected by a single camera using the following unit: a first acquisition unit, configured to acquire multiple sets of first human body In the training image set, the first human body training image sets of different groups are collected by different cameras, and the human body types included in different first human body training image sets are the same.
  • the first training unit is configured to input each of the first human body training image sets into the feature extraction network to be trained, train the feature extraction network to extract human body features corresponding to each of the human body categories, and obtain the first feature extraction Model.
  • the second obtaining unit is used to obtain a second human body training image set and a human body training feature set that are the same as the human body category included in the first human body training image set, and the multiple human body training features included in the human body training feature set are each The set of group human body images corresponds to the overall human body characteristics of the first human body training images.
  • the second training unit is configured to input the second human body training image set into the first feature extraction model, train the first feature extraction model according to the human body training feature set, and obtain the human body weight recognition model.
  • the embodiment of the present application further provides a computer device, including a memory and a processor, the memory and the processor are connected to each other in communication, the memory stores computer instructions, and the processor passes Execute the computer instructions, so as to execute the human body weight recognition method in any one of the first aspect and its optional implementations.
  • the embodiments of the present application further provide a computer-readable storage medium, the computer-readable storage medium stores computer instructions, and the computer instructions are used to make the computer execute the first aspect and optional implementations thereof A human body weight recognition method in any one of the ways.
  • Fig. 1 is a flow chart of a method for body weight recognition proposed according to an exemplary embodiment.
  • Fig. 2 is a flowchart of a method for training a human body weight recognition model according to an exemplary embodiment.
  • Fig. 3 is a flowchart of a method for training a first feature extraction model according to an exemplary embodiment.
  • Fig. 4 is a flow chart of another training method for a first feature extraction model proposed according to an exemplary embodiment.
  • Fig. 5 is a flowchart of a method for acquiring a human body training feature set according to an exemplary embodiment.
  • Fig. 6 is a flow chart of another method for acquiring a human body training feature set according to an exemplary embodiment.
  • Fig. 7 is a flowchart of another training method for a human body weight recognition model according to an exemplary embodiment.
  • Fig. 8 is a flowchart of another method for acquiring a human body training feature set according to an exemplary embodiment.
  • Fig. 9 is a flowchart of a method for acquiring a human body training image set according to an exemplary embodiment.
  • Fig. 10 is a structural block diagram of a human body weight recognition device according to an exemplary embodiment.
  • Fig. 11 is a schematic diagram of a hardware structure of a computer device according to an exemplary embodiment.
  • the detection model when training the human body weight recognition model, is used to detect human body pictures from the original pictures captured by multiple cameras and form a base library.
  • a feature extraction network based on manual annotation results, input pedestrian pictures into the feature extraction network to obtain high-dimensional vector feature representations, obtain loss values according to the metric distance and cross-entropy calculated by the features, and select the optimizer to iterate to find the minimum value of the loss function. And continuously update the parameters of the network to achieve the effect of optimized learning, and obtain the final human body weight recognition model.
  • an embodiment of the present application provides a human body weight recognition method for use in computer equipment.
  • its execution subject can be a human body weight recognition device, which can be implemented through software, hardware or a combination of software and hardware. Realized as part or all of the storage device in a manner, wherein the computer device can be a terminal or a client or a server, and the server can be a single server, or a server cluster composed of multiple servers.
  • the Terminals can be smart phones, personal computers, tablet computers, wearable devices, and other smart hardware devices such as smart robots.
  • the execution subject is a computer device as an example for illustration.
  • the computer device in the embodiment of the present application is applied to a usage scenario of performing human body weight recognition detection on a human body image of an unknown human body type.
  • the human body weight recognition method provided by this application, when performing human body weight recognition detection on the human body image to be detected, the human body weight recognition model that can be trained based on the human body training image collected by a single camera, and then multiple people in the preset database In the body feature, the most similar human body category is matched to the human body image to be detected, thereby improving the accuracy of human body category recognition and reducing the occurrence of misidentification.
  • Fig. 1 is a flow chart of a method for body weight recognition proposed according to an exemplary embodiment. As shown in FIG. 1 , the distributed cluster expansion method includes the following steps S101 to S104.
  • step S101 an image of a human body to be detected is acquired.
  • the human body image to be detected can be understood as an image that does not specify that the human body image specifically corresponds to a human body category.
  • Human body category can be understood as a category used to distinguish different human bodies, and each independent individual corresponds to a human body category.
  • Pedestrian A and Pedestrian B are two different human categories.
  • the form of an identity document (id) can be used to record and distinguish each human body category.
  • id1 corresponds to the first human category
  • id2 corresponds to the first human category.
  • step S102 the first human body feature of the human body image is extracted by using a pre-trained human body re-identification model.
  • the pre-trained human body weight recognition model is obtained by training based on the human body training images collected by a single camera.
  • the shooting characteristics of the human body improve the accuracy of human body feature extraction, and then when the human body category corresponding to the human body image is subsequently matched, it helps to improve the matching accuracy.
  • step S103 the first human body feature is compared with multiple human body features in a preset database, and the second human body feature with the highest similarity to the first human body feature is determined.
  • the human body categories corresponding to the multiple human body characteristics in the preset database are known, and the human body characteristics corresponding to each human body category can be specified. Comparing the first human body feature with multiple human body features in a preset database, so as to determine whether any human body feature similar to the first human body feature is included in the multiple human body features of known human body categories. Since the higher the similarity, the greater the possibility that the two belong to the same human body category, therefore, based on the comparison results, determine the second human body feature with the highest similarity to the first human body feature among multiple human body features, so as to pass the The second human body feature determines the human body category corresponding to the first human body feature. In an example, when determining the similarity between the first human body feature and each human body feature, it may be determined by cosine similarity, Euclidean distance or Minkowski distance.
  • step S104 when the similarity is greater than or equal to a specified threshold, the human body category corresponding to the second human body feature is matched to the human body category most similar to the human body image.
  • the specified threshold can be understood as an error-tolerant threshold for determining whether the first human body feature and the second human body feature belong to the same human body category.
  • the similarity is greater than or equal to the specified threshold, it indicates that the first human body feature and the second human body feature are too similar, and the first human body feature and the second human body feature may belong to the same human body category.
  • the similarity is less than the specified threshold, it indicates that the similarity between the first human body feature and the second human body feature is low, and it can be determined that the first human body feature and the second human body feature do not belong to the same human body category.
  • the human body category corresponding to the second human body feature can be matched as the most similar human body category of the human body image, so that the final corresponding human body category of the human body image can be determined according to the matched human body category.
  • the human body category corresponding to the second human body feature with the largest similarity value is determined to be the most similar human body category to the human body image.
  • the human body weight recognition model that can be trained based on the human body training image collected by a single camera, and then among the multiple human body features in the preset database are the human body weight recognition models to be
  • the detected human body images are matched to the most similar human body category, which helps to improve the accuracy of human body category recognition and reduce the occurrence of misidentification.
  • the similarity between the first human body feature and the second human body feature is less than a specified threshold, it can be determined that the human body category corresponding to the human body image is a new human body category, and then the first human body category of the human body image can be A human body feature and the corresponding human body category are stored in a preset database, so that the accuracy of recognition and tracking can be improved in subsequent human body weight recognition and tracking.
  • Fig. 2 is a flowchart of a method for training a human body weight recognition model according to an exemplary embodiment. As shown in Figure 2, the training method of the human body weight recognition model includes the following steps.
  • step S201 multiple groups of first human body training image sets are acquired.
  • different sets of first human body training image sets are collected by different cameras, and the types of human bodies included in different first human body training image sets are the same. That is, the human body categories included in the first human body training image sets of different groups are the same, but the first human body training image sets of different groups are collected by different cameras.
  • the first human body training image set of group A is collected by camera A
  • the first human body training image set of group B is collected by camera B.
  • the first human body training image set of group A includes the same human body category as that included in the first human body training image set of group B.
  • each first human body training image set is input into the feature extraction network to be trained, and the trained feature extraction network extracts human body features corresponding to each human body category to obtain a first feature extraction model.
  • each first human body training image set is input into the feature extraction network to be trained respectively, and the first human body training image set collected by each camera is respectively carried out by the feature extraction network.
  • Human body feature extraction and then according to the extracted human body features, train the feature extraction network to obtain the first feature extraction model.
  • the acquired first human body training image sets are three groups A, B and C respectively.
  • A, B, and C are respectively input into the feature extraction network for human body feature extraction, and the feature extraction network extracts the human body feature a of each human body category corresponding to A, and extracts the human body feature a corresponding to B.
  • the human body feature b of each human body category and extract the human body feature c of each human body category corresponding to C, and then train the feature extraction network based on a, b and c to extract the human body features corresponding to each human category, and obtain the first feature extraction model.
  • the human body training images used are all images marked with human body categories.
  • the feature extraction model since the first human body training image set collected by each camera is separately input into the feature network model for training, and then when annotating the human body training image in advance, there is no need to label across cameras, only for The current camera can be labeled, which reduces the difficulty of labeling, saves labeling time, and helps to improve labeling efficiency.
  • step S203 a second human body training image set and a human body training feature set of the same human body category as included in the first human body training image set are acquired.
  • the multiple human body training features included in the human body training feature set are the total human body features corresponding to the first human body training image in each group of human body image sets.
  • the first feature extraction model is used to extract human body features from the first human body training image sets respectively, to obtain the human body feature sets corresponding to each first human body training image set, and to combine the human body feature sets to obtain the human body training image set. feature set.
  • the human body categories included in the human body training feature set are the same as the human body categories included in the first human body training image set, and then the subsequent training of the first feature extraction model can perform targeted training when the first feature extraction model can perform feature recognition across cameras.
  • the second human body training image set may be a human body training image set obtained by merging each group of first human body training image sets.
  • step S204 the second human body training image set is input to the first feature extraction model, and the first feature extraction model is trained according to the human body training feature set to obtain a human body re-identification model.
  • the human body weight recognition model used for human body weight recognition needs to learn from multiple cameras Human body weight recognition is performed on the human body images to be detected in the collected human body images. Therefore, in order to enable the first feature extraction model to realize cross-camera human body re-identification, the acquired second human body training image set is input into the first feature extraction model, and the first feature is trained according to the acquired human body training feature set.
  • the extraction model learns the human body features of the same human body type in human body images collected by different cameras, and then obtains a human body weight recognition model for human body weight recognition.
  • the process of training the human body weight recognition model is divided into two stages.
  • training the first feature extraction model stage based on the first human body training image collection collected by a single camera, it is helpful to enhance the learning and extraction of the first feature extraction model.
  • the robustness of human body features collected by a single camera, and then the subsequent training of the first feature extraction model to learn the human body features of the same body type in human body images collected by different cameras, helps to enhance the robustness of human body feature extraction Therefore, it is more accurate when performing human feature extraction in actual use.
  • Fig. 3 is a flowchart of a method for training a first feature extraction model according to an exemplary embodiment. As shown in Fig. 3, the training method of the first feature extraction model includes the following steps.
  • step S301 the current group of first human body training image sets are input into the feature extraction network to be trained for human body feature extraction, and the feature extraction results are input into the preset first classification network for feature classification, and the first classification results.
  • the feature extraction network to be trained is a network model for feature extraction. If only based on the human body features output by the feature extraction network, it is impossible to determine whether the extracted human body features are accurate and whether the extracted human body features can reflect Differences between different human body types. Therefore, when training the feature extraction network, combined with the preset first classification network, the feature extraction network performs classification on the output feature extraction results of human body feature extraction for each first human body training image, and obtains the first human body feature corresponding Classification results, so as to adjust the parameters of the feature extraction network according to the first classification results corresponding to the first human body training images and the corresponding human body categories, so as to obtain the first feature extraction model.
  • the feature extraction network may be a backbone feature extraction network (a type of neural network), and its network architecture includes convolutional layers and pooling layers. Among them, the convolutional layer is used to reduce the dimensionality and feature extraction of the input image, and the pooling layer is used to reduce the model size and enhance the robustness. Since the structure of the backbone feature extraction network is relatively simple and the iteration speed is fast, it is helpful to improve the training efficiency and reduce the training cost during training.
  • a backbone feature extraction network a type of neural network
  • its network architecture includes convolutional layers and pooling layers.
  • the convolutional layer is used to reduce the dimensionality and feature extraction of the input image
  • the pooling layer is used to reduce the model size and enhance the robustness. Since the structure of the backbone feature extraction network is relatively simple and the iteration speed is fast, it is helpful to improve the training efficiency and reduce the training cost during training.
  • the first classification network may be a fully connected classification layer connected to the output end of the feature extraction network, and is used to assist the feature extraction network in training human body feature extraction.
  • the number of fully connected classification layers is the same as the number of groups of the first human body training image set, and corresponds to each group of first human body training image sets, and the number of classifications calculated by the fully connected classification layer is also the same as the number of groups corresponding to the first human body training image set.
  • a human body training image set includes the same number of human body categories. It can be understood that, when training the feature extraction network, after the current first human body training image set is input to the feature extraction network, the feature extraction result output by the feature extraction network is input to the fully connected classification layer corresponding to the current first human body training image set The feature classification is carried out to obtain the first classification result of extracting the current first human body training image set.
  • step S302 based on the first classification result and the human body categories included in the first human body training image set, the training feature extraction network extracts the human body features corresponding to each human body category to obtain the first feature extraction model.
  • the loss generated when the first classification network performs classification is determined through the loss function, and then the parameters of the feature extraction network are adjusted accordingly , and according to the adjusted parameters, train the feature extraction network to extract the human body features corresponding to each human body category, so as to obtain the first feature extraction model.
  • the loss function used may include Arcface loss, cross-entropy loss function or triplet loss function.
  • training based on the first classification network helps to improve the accuracy of the feature extraction network learning and extracting human body features, and then makes the human body features extracted by the first feature extraction model better.
  • the differences in human body categories can be expressed, which lays a good feature extraction foundation for the subsequent training of the human body weight recognition model, thereby enhancing the robustness of the human body weight recognition model.
  • the training process of the first feature extraction model may be as shown in FIG. 4 .
  • Fig. 4 is a flow chart of another training method for a first feature extraction model proposed according to an exemplary embodiment.
  • the number of groups of the first human body training image set used to train the backbone feature extraction network is n, corresponding to n cameras respectively, n>1, and n is an integer.
  • n is an integer.
  • the process of training the backbone feature extraction network with the first human body training image set corresponding to the camera 1 will be described as an example below.
  • the process of training the backbone feature extraction network with the first human body training image set corresponding to any one of cameras 2 to n is the same as the process of training the backbone feature extraction network with the first human body training image set corresponding to camera 1, and will not be carried out here repeat.
  • the loss may be calculated using a cross-entropy loss function. Calculated as follows: Among them, loss n is the loss value corresponding to the nth camera, P is the predicted probability of the fully connected classification layer, and i and m correspond to a certain human body category and the total number of human body categories of a single camera, respectively.
  • Fig. 5 is a flowchart of a method for acquiring a human body training feature set according to an exemplary embodiment. As shown in Fig. 5, the method for obtaining the human body training feature set includes the following steps.
  • step S501 the human body feature sets corresponding to the first human body training image sets are respectively extracted through the first feature extraction model.
  • step S502 the first human body feature in the current human body feature set is sequentially matched with the second human body features in the next human body feature set, and the second human body feature with the highest matching degree with the first human body feature in the next human body feature set is determined. human body features.
  • the first human body features in the current human body feature set are sequentially matched with the second human body features in the next human body feature set, and the next human body feature set and the first human body feature are determined.
  • the second human body feature with the highest similarity is determined.
  • each first human body feature is fused into the second human body feature with the highest matching degree to obtain a new second human body feature, and a pseudo-label corresponding to each new second human body feature is generated.
  • the human body category corresponding to the second human body feature with the highest similarity with the first human body feature can be determined to be the same as the first human body.
  • the corresponding human body category of the feature is the same human body category, and then the first human body feature and the second human body feature with the highest similarity with the first human body feature can be fused to obtain a new second human body feature, and generate the new second human body Pseudo-labels corresponding to features.
  • the pseudo-label can be understood as a human body category corresponding to the new second human body feature.
  • each human body feature set is cycled in turn until the new second human body features corresponding to each human body category in each group of human body feature sets and corresponding pseudo-labels are obtained to obtain a human body training feature set.
  • the second human body features corresponding to each first human body feature in the current human body feature set are sequentially determined in the next human body feature set, and each first human body feature is fused into the corresponding second human body feature to obtain multiple New secondary human traits.
  • the current human body feature set is canceled, and the next human body feature set including multiple new second human body features is used as a new current human body feature set, and the new Each new second human body characteristic in the current human body characteristic set is used as the first human body characteristic, and is compared with each second human body characteristic in the next human body characteristic set, and the second human body characteristic corresponding to each first human body characteristic is determined.
  • each first human body feature is fused into the corresponding second human body feature, until the new second human body feature corresponding to each human body category in each group of human body feature sets and the corresponding pseudo-label are obtained, and the human body training feature set is obtained. That is, any human body training feature in the human body training feature set includes the total human body features of the pseudo-label corresponding to the human body training feature in each human body feature set, and the human body training feature is the finally generated new second human body feature.
  • the human body features collected by each camera are fused into the same human body training feature, which is helpful for the subsequent training of the first feature extraction model, so that the first feature extraction model can fully learn the human body features of each human body category, and then make
  • the obtained human body weight recognition model can reduce the difference in human body feature detection due to different cameras when performing feature extraction, thereby helping to improve the accuracy of detection results.
  • Fig. 6 is a flow chart of another method for acquiring a human body training feature set according to an exemplary embodiment.
  • id represents the human body category
  • id m represents the first human body feature in the human body feature set corresponding to camera n
  • id k represents the second human body feature in the human body feature set corresponding to camera p.
  • the following embodiments will illustrate the specific training process of training the human weight recognition model through the first feature extraction model.
  • Fig. 7 is a flowchart of another training method for a human body weight recognition model according to an exemplary embodiment. As shown in FIG. 7 , the training method of the human body weight recognition model includes the following steps.
  • step S701 the second human body training image set is input into the first feature extraction model for human body feature extraction, and the feature extraction result is input into a preset second classification network for feature classification to obtain a second classification result.
  • the second classification network may be a fully connected classification layer connected to the output end of the first feature extraction model, by classifying the output results of the first feature extraction model, and assisting The first feature extraction model performs training for human feature extraction.
  • the second classification network model and the first classification network model may be the same classification network model.
  • the second classification network model and the first classification network model may be two different classification network models, which are used in different training stages respectively.
  • the training stage includes: the training stage of obtaining the first feature extraction model by training the feature extraction network, and the training stage of obtaining the human body re-identification model stage by training the first feature extraction model.
  • step S702 based on the second classification result and the human body training feature set, the first feature extraction model is trained to extract each human body feature in the second human body training image set to obtain a human body re-identification model.
  • the loss generated by the second classification network is determined through the loss function, and then the parameters of the first feature extraction model are adjusted accordingly , and train the first feature extraction model according to the adjusted parameters to extract the human body features corresponding to each human body category, so as to obtain the human body weight recognition model.
  • the used loss function may include Arcface loss, cross-entropy loss function or triplet loss function.
  • parameter adjustment may be performed by continuously iteratively updating network parameters through gradient backpropagation.
  • training the first feature extraction model based on the human body training features extracted correspondingly from multiple cameras helps the first feature extraction model to fully learn the corresponding human body features of the same human body category in different shooting scenes, thereby making
  • the human body weight recognition model extracts human body features, it can fully express the human body characteristics corresponding to different human body types, thereby improving the accuracy of human body weight recognition detection.
  • each second human body training image in the second human body training image set may be scaled to the same specified size, and then the subsequent extraction of human body features , which helps to save computational cost.
  • the training process of the human body weight recognition model may be as shown in FIG. 8 .
  • Fig. 8 is a flowchart of another training method for a human body weight recognition model according to an exemplary embodiment.
  • step S801 the second human body training image in the second human body training image set is scaled to a specified size.
  • step S802 the second human body training image scaled to a specified size is input to the first feature extraction model for feature extraction, and a feature extraction result is obtained.
  • step S803 the feature extraction result is input to the fully connected classification layer for classification, and the pseudo-label corresponding to the second human body training image is determined.
  • step S804 the fully connected classification layer is determined to determine the classification loss of the pseudo-label corresponding to the second human body training image.
  • each of the first human body training images in the first human body training image set is marked with the human body category that first appears in the video captured by the current camera, and the target tracking algorithm is used to extract the multiple corresponding human body categories in the video.
  • the first human body training image is obtained to obtain the first human body training image set, so that when labeling the first human body training image, there is no need to pay attention to the same human body appearing between the cameras, thereby helping to reduce the difficulty of labeling.
  • multiple annotators can also annotate multiple videos at the same time, which helps to improve the efficiency of annotation.
  • the target tracking algorithm may include a detection tracking algorithm (Tracking By Detection, TBD) or a SORT algorithm (an online real-time multi-target tracking algorithm), which is not limited in this application.
  • TBD Tracking By Detection
  • SORT an online real-time multi-target tracking algorithm
  • Fig. 9 is a flowchart of a method for acquiring a human body training image set according to an exemplary embodiment.
  • step S901 the video captured by the current camera is obtained.
  • step S902 it is judged whether the current human body category appears in the video for the first time.
  • step S903 if the current human body type appears in the video for the first time, mark and extract the first human body training image in which the current human body type appears in the first frame image.
  • step S904 the first human body training image of the current human body category in other frame images is extracted through target tracking to obtain a first human body training image set.
  • the present application also provides a human body weight recognition device.
  • Fig. 10 is a structural block diagram of a human body weight recognition device according to an exemplary embodiment.
  • the human body weight recognition device includes an acquisition unit 1001 , an extraction unit 1002 , a comparison unit 1003 and a determination unit 1004 .
  • An acquisition unit 1001 configured to acquire a human body image to be detected
  • the extraction unit 1002 is used to extract the first human body feature of the human body image through the pre-trained human body weight recognition model, and the human body weight recognition model is trained based on the human body training image collected by a single camera;
  • a comparison unit 1003 configured to compare the first human body feature with a plurality of human body features in a preset database, and determine a second human body feature with the highest similarity to the first human body feature;
  • the determining unit 1004 is configured to match the human body category corresponding to the second human body feature to the human body category most similar to the human body image when the similarity is greater than or equal to a specified threshold.
  • the human body weight recognition model is trained based on the human body training images collected by a single camera using the following units: the first acquisition unit is used to acquire multiple groups of first human body training image sets, different groups of first human body training images The sets are collected by different cameras, and the categories of human bodies included in different first human training image sets are the same.
  • the first training unit is configured to input each first human body training image set into the feature extraction network to be trained, and train the feature extraction network to extract human body features corresponding to each human body category to obtain a first feature extraction model.
  • the second acquisition unit is used to acquire a second human body training image set and a human body training feature set that are the same as the human body category included in the first human body training image set, and the multiple human body training features included in the human body training feature set are each group of human body image sets The overall human body features corresponding to the first human body training image.
  • the second training unit is configured to input the second human body training image set into the first feature extraction model, train the first feature extraction model according to the human body training feature set, and obtain the human body re-identification model.
  • the first training unit includes: a first extraction unit, configured to input the current set of first human body training image sets into the feature extraction network to be trained for human body feature extraction, and input the feature extraction results to The feature classification is performed in the preset first classification network to obtain the first classification result.
  • the first training subunit is configured to train the feature extraction network to extract human body features corresponding to each human body category based on the first classification result and the human body categories included in the first human body training image set, so as to obtain a first feature extraction model.
  • the second acquiring unit includes: a second extracting unit, configured to respectively extract human body feature sets corresponding to each first human body training image set through the first feature extraction model.
  • the first matching unit is configured to sequentially match the first human body features in the current human body feature set with the second human body features in the next human body feature set, and determine the person with the highest matching degree with the first human body feature in the next human body feature set Secondary human characteristics.
  • the fusion unit is used to fuse the first human body features into the second human body features with the highest matching degree to obtain new second human body features, and generate pseudo-labels corresponding to the human body categories of each new second human body features.
  • the second obtaining subunit is used to cycle through each human body feature set in turn until obtaining a new second human body feature corresponding to each human body category in each group of human body feature sets and corresponding pseudo-labels to obtain a human body training feature set.
  • the second training unit includes: a third extraction unit, configured to input the second human body training image set into the first feature extraction model for human body feature extraction, and input the feature extraction result into a preset
  • the feature classification is performed in the second classification network to obtain the second classification result.
  • the second training subunit is used to train the first feature extraction model to extract the features of each human body in the second human body training image set based on the second classification result and the human body training feature set to obtain a human body re-identification model.
  • the second acquiring unit includes: a determining unit configured to determine and mark the first-appearing human body category according to the video captured by the current camera.
  • the first image extraction unit is configured to extract a plurality of first human body training images corresponding to each of the human body categories in the video through a target tracking algorithm, and obtain a first human body training image set corresponding to the current camera.
  • the second acquisition unit includes: a merging unit, configured to combine the first human body training image sets to obtain a second human body training image set.
  • each of the above-mentioned modules can be fully or partially realized by software, hardware and a combination thereof.
  • the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, and can also be stored in the memory of the computer device in the form of software, so that the processor can invoke and execute the corresponding operations of the above-mentioned modules.
  • Fig. 11 is a schematic diagram of a hardware structure of a computer device according to an exemplary embodiment.
  • the device includes one or more processors 1110 and a memory 1120 , and the memory 1120 includes a persistent memory, a volatile memory, and a hard disk.
  • one processor 1110 is taken as an example.
  • the device may also include: an input device 1130 and an output device 1140 .
  • the processor 1110, the memory 1120, the input device 1130, and the output device 1140 may be connected via a bus or in other ways, and connection via a bus is taken as an example in FIG. 11 .
  • the processor 1110 may be a central processing unit (Central Processing Unit, CPU).
  • the processor 1110 can also be other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), application-specific integrated circuits (Application Specific Integrated Circuit, ASIC), field-programmable gate array (Field-Programmable Gate Array, FPGA) or Other chips such as programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or combinations of the above-mentioned types of chips.
  • DSP Digital Signal Processor
  • ASIC Application Specific Integrated Circuit
  • FPGA Field-Programmable Gate Array
  • a general-purpose processor may be a microprocessor, or the processor may be any conventional processor, or the like.
  • the memory 1120 is a non-transitory computer-readable storage medium, including persistent memory, volatile memory and hard disk, and can be used to store non-transitory software programs, non-transitory computer executable programs and modules, such as the The program instruction/module corresponding to the business management method.
  • the processor 1110 executes various functional applications and data processing of the server by running the non-transitory software programs, instructions and modules stored in the memory 1120, that is, implements any one of the above human body re-identification methods.
  • the memory 1120 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and an application program required by at least one function;
  • the memory 1120 may include a high-speed random access memory, and may also include a non-transitory memory, such as at least one magnetic disk storage device, a flash memory device, or other non-transitory solid-state storage devices.
  • the memory 1120 may optionally include memory located remotely relative to the processor 1110, and these remote memories may be connected to the data processing device through a network. Examples of the aforementioned networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
  • the input device 1130 can receive input numbers or character information, and generate key signal input related to user settings and function control.
  • the output device 1140 may include a display device such as a display screen.
  • One or more modules are stored in the memory 1120, and when executed by the one or more processors 1110, perform the methods shown in FIGS. 1-9.
  • the embodiment of the present application also provides a non-transitory computer storage medium, the computer storage medium stores computer-executable instructions, and the computer-executable instructions can execute the authentication method in any of the above method embodiments.
  • the storage medium can be a magnetic disk, an optical disk, a read-only memory (Read-Only Memory, ROM), a random access memory (Random Access Memory, RAM), a flash memory (Flash Memory), a hard disk (Hard Disk Drive) , abbreviation: HDD) or solid-state drive (Solid-State Drive, SSD), etc.; the storage medium may also include a combination of the above-mentioned types of memory.

Landscapes

  • Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Evolutionary Computation (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Evolutionary Biology (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Computational Linguistics (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Image Analysis (AREA)
  • Collating Specific Patterns (AREA)

Abstract

The present application provides a human body weight identification method, a human body weight identification device, a computer device, and a medium. The human body weight identification method comprises: acquiring a human body image to be evaluated; extracting a first human body feature of the human body image by means of a pre-trained human body weight identification model, the human body weight identification model being trained on the basis of human body training images captured by a single camera; comparing the first human body feature with a plurality of human body features in a preconfigured database, and determining a second human body feature having a highest similarity measure to the first human body feature; and when the similarity measure is greater than or equal to a specified threshold, causing a human body category corresponding to the second human body feature to be matched as a most similar human body category to the human body image. According to the present application, the human body weight identification and evaluation is performed on the basis of the human body weight identification model trained via a single camera, facilitating matching a most similar human body category for the human body image to be evaluated among the plurality of human body features in the preset database, and consequently reducing the occurrence of misidentification.

Description

人体重识别方法、人体重识别装置、计算机设备及介质Human body weight recognition method, human body weight recognition device, computer equipment and medium

本申请要求于2021年12月30日提交中国专利局,申请号为202111682643.5、申请名称为“人体重识别方法、人体重识别装置、计算机设备及介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application with the application number 202111682643.5 and the application name "Human body weight recognition method, human body weight recognition device, computer equipment and media" submitted to the China Patent Office on December 30, 2021, the entire content of which Incorporated in this application by reference.

技术领域technical field

本申请涉及计算机视觉技术领域,具体涉及一种人体重识别方法、人体重识别装置、计算机设备及介质。The present application relates to the technical field of computer vision, in particular to a method for body weight recognition, a body weight recognition device, computer equipment and media.

背景技术Background technique

人体重识别技术是一种利用计算机视觉技术对给定图像进行非重叠摄像头检索,从而识别出属于同一个人体图像的技术。随着人工智能技术的发展与进步,人体重识别技术能够实现跨越时间和空间对同一人体进行跟踪、匹配与身份鉴定,已经大量应用于社会生活中的方方面面,是近年来计算机视觉领域的研究热点之一。Human body re-identification technology is a technology that uses computer vision technology to perform non-overlapping camera retrieval on a given image, thereby identifying images belonging to the same human body. With the development and progress of artificial intelligence technology, human body recognition technology can track, match and identify the same human body across time and space. It has been widely used in all aspects of social life and has become a research hotspot in the field of computer vision in recent years. one.

相关技术中,基于深度学习模型训练人体重识别模型时,是利用深度学习模型学习人体之间的关系以提取特征和搜索,模型性能严重依赖于数据质量和数量。但用于训练人体重识别模型的训练数据需要跨摄像头标注行人关系,进而导致人体重识别模型的训练成本高、难度大。In related technologies, when training a human body re-identification model based on a deep learning model, the deep learning model is used to learn the relationship between human bodies to extract features and search, and the performance of the model depends heavily on the quality and quantity of data. However, the training data used to train the human body weight recognition model needs to label pedestrian relationships across cameras, which leads to high training costs and difficulties for the human body weight recognition model.

申请内容application content

本申请要解决的技术问题在于克服现有技术中利用人体重识别模型在进行人体重识别时过于依赖数据质量和数量的缺陷,从而提供一种人体重识别方法、人体重识别装置、计算机设备及介质。The technical problem to be solved in this application is to overcome the defects in the prior art that rely too much on data quality and quantity when using the human body weight recognition model to perform human body weight recognition, so as to provide a human body weight recognition method, a human body weight recognition device, computer equipment and medium.

在第一方面,本申请提供一种人体重识别方法,所述方法包括:获取待检测的人体图像。通过预先训练好的人体重识别模型,提取所述人体图像的 第一人体特征,所述人体重识别模型基于单摄像头采集的人体训练图像进行训练。将所述第一人体特征与预置数据库中的多个人体特征进行对比,确定与所述第一人体特征相似度最高的第二人体特征。当所述相似度大于或者等于指定阈值时,将所述第二人体特征对应的人体类别匹配为所述人体图像最相似的人体类别。In a first aspect, the present application provides a method for human body weight recognition, the method comprising: acquiring an image of a human body to be detected. The first human body feature of the human body image is extracted through a pre-trained human body weight recognition model, and the human body weight recognition model is trained based on a human body training image collected by a single camera. Comparing the first human body feature with a plurality of human body features in a preset database, and determining a second human body feature with the highest similarity to the first human body feature. When the similarity is greater than or equal to a specified threshold, the human body category corresponding to the second human body feature is matched to the human body category most similar to the human body image.

在该方式中,在对待检测的人体图像进行人体重识别检测时,能够基于单摄像头采集的人体训练图像进行训练的人体重识别模型,进而在预置的数据库中的多个人体特征中为待检测的人体图像匹配出最相似人体类别,进而提高人体类别识别的准确性,减少误识别的情况发生。In this way, when performing human body weight recognition detection on the human body image to be detected, the human body weight recognition model that can be trained based on the human body training image collected by a single camera can be used among the multiple human body features in the preset database as the The detected human body images are matched to the most similar human body category, thereby improving the accuracy of human body category recognition and reducing the occurrence of misidentification.

在第二方面,本申请还提供一种人体重识别装置,所述装置包括:获取单元,用于获取待检测的人体图像。提取单元,用于通过预先训练好的人体重识别模型,提取所述人体图像的第一人体特征,所述人体重识别模型基于单摄像头采集的人体训练图像进行训练。对比单元,用于将所述第一人体特征与预置数据库中的多个人体特征进行对比,确定与所述第一人体特征相似度最高的第二人体特征。确定单元,用于当所述相似度大于或者等于指定阈值时,将所述第二人体特征对应的人体类别匹配为所述人体图像最相似的人体类别。In a second aspect, the present application also provides a device for body weight recognition, which includes: an acquisition unit configured to acquire an image of a human body to be detected. The extraction unit is configured to extract the first human body feature of the human body image through a pre-trained human body weight recognition model, and the human body weight recognition model is trained based on human body training images collected by a single camera. A comparing unit, configured to compare the first human body feature with a plurality of human body features in a preset database, and determine a second human body feature with the highest similarity to the first human body feature. A determining unit, configured to match the human body category corresponding to the second human body feature to the human body category most similar to the human body image when the similarity is greater than or equal to a specified threshold.

结合第二方面,在第二方面的第一实施例中,所述人体重识别模型基于单摄像头采集的人体训练图像采用下述单元进行训练:第一获取单元,用于获取多组第一人体训练图像集,不同组的第一人体训练图像集由不同摄像头采集,不同第一人体训练图像集之间包括的人体类别相同。第一训练单元,用于将各所述第一人体训练图像集分别输入至待训练的特征提取网络中,训练所述特征提取网络提取各所述人体类别对应的人体特征,得到第一特征提取模型。第二获取单元,用于获取与所述第一人体训练图像集包括的人体类别相同的第二人体训练图像集和人体训练特征集,所述人体训练特征集中包括的多个人体训练特征为各组人体图像集对应第一人体训练图像的总人体特征。第二训练单元,用于将所述第二人体训练图像集输入至所述第一特征提取模型,根据所述人体训练特征集训练所述第一特征提取模型,得到所述人 体重识别模型。With reference to the second aspect, in the first embodiment of the second aspect, the human body re-identification model is trained based on the human body training images collected by a single camera using the following unit: a first acquisition unit, configured to acquire multiple sets of first human body In the training image set, the first human body training image sets of different groups are collected by different cameras, and the human body types included in different first human body training image sets are the same. The first training unit is configured to input each of the first human body training image sets into the feature extraction network to be trained, train the feature extraction network to extract human body features corresponding to each of the human body categories, and obtain the first feature extraction Model. The second obtaining unit is used to obtain a second human body training image set and a human body training feature set that are the same as the human body category included in the first human body training image set, and the multiple human body training features included in the human body training feature set are each The set of group human body images corresponds to the overall human body characteristics of the first human body training images. The second training unit is configured to input the second human body training image set into the first feature extraction model, train the first feature extraction model according to the human body training feature set, and obtain the human body weight recognition model.

根据第三方面,本申请实施方式还提供一种计算机设备,包括存储器和处理器,所述存储器和所述处理器之间互相通信连接,所述存储器中存储有计算机指令,所述处理器通过执行所述计算机指令,从而执行第一方面及其可选实施方式中任一项的人体重识别方法。According to the third aspect, the embodiment of the present application further provides a computer device, including a memory and a processor, the memory and the processor are connected to each other in communication, the memory stores computer instructions, and the processor passes Execute the computer instructions, so as to execute the human body weight recognition method in any one of the first aspect and its optional implementations.

根据第四方面,本申请实施方式还提供一种计算机可读存储介质,所述计算机可读存储介质存储有计算机指令,所述计算机指令用于使所述计算机执行第一方面及其可选实施方式中任一项的人体重识别方法。According to the fourth aspect, the embodiments of the present application further provide a computer-readable storage medium, the computer-readable storage medium stores computer instructions, and the computer instructions are used to make the computer execute the first aspect and optional implementations thereof A human body weight recognition method in any one of the ways.

附图说明Description of drawings

下面将对本申请实施例中所需要使用的附图作介绍。The drawings that need to be used in the embodiments of the present application will be introduced below.

图1是根据一示例性实施例提出的一种人体重识别方法的流程图。Fig. 1 is a flow chart of a method for body weight recognition proposed according to an exemplary embodiment.

图2是根据一示例性实施例提出的一种人体重识别模型的训练方法的流程图。Fig. 2 is a flowchart of a method for training a human body weight recognition model according to an exemplary embodiment.

图3是根据一示例性实施例提出的一种第一特征提取模型的训练方法的流程图。Fig. 3 is a flowchart of a method for training a first feature extraction model according to an exemplary embodiment.

图4是根据一示例性实施例提出的另一种第一特征提取模型的训练方法的流程图。Fig. 4 is a flow chart of another training method for a first feature extraction model proposed according to an exemplary embodiment.

图5是根据一示例性实施例提出的一种人体训练特征集的获取方法的流程图。Fig. 5 is a flowchart of a method for acquiring a human body training feature set according to an exemplary embodiment.

图6是根据一示例性实施例提出的另一种人体训练特征集的获取方法的流程图。Fig. 6 is a flow chart of another method for acquiring a human body training feature set according to an exemplary embodiment.

图7是根据一示例性实施例提出的另一种人体重识别模型的训练方法的流程图。Fig. 7 is a flowchart of another training method for a human body weight recognition model according to an exemplary embodiment.

图8是根据一示例性实施例提出的又一种人体训练特征集的获取方法的流程图。Fig. 8 is a flowchart of another method for acquiring a human body training feature set according to an exemplary embodiment.

图9是根据一示例性实施例提出的一种人体训练图像集的获取方法的流程图。Fig. 9 is a flowchart of a method for acquiring a human body training image set according to an exemplary embodiment.

图10是根据一示例性实施例提出的一种人体重识别装置的结构框图。Fig. 10 is a structural block diagram of a human body weight recognition device according to an exemplary embodiment.

图11是根据一示例性实施例提出的一种计算机设备的硬件结构示意图。Fig. 11 is a schematic diagram of a hardware structure of a computer device according to an exemplary embodiment.

具体实施方式Detailed ways

相关技术中,在对人体重识别模型进行训练时,是通过检测模型从由多个摄像头拍摄得到的原始图片中检测出人体图片并组成底库。使用已有模型对底库图片进行人体特征提取,并用聚类方法将对底库特征分类。对聚类结果中的每一簇进行人工核对筛选。计算人工筛选结果中簇与簇之间的相似性,生成簇之间相似性大于设置阈值的推荐组合,再交由人工核对合并,最终生成人工标注结果。根据人工标注结果训练一个特征提取网络,将行人图片输入特征提取网络中以获取高维向量特征表示,根据特征所计算的度量距离和交叉熵得到损失值,选取优化器迭代找到损失函数最小值,并不断更新网络的参数达到优化学习的效果,得到最终的人体重识别模型。In related technologies, when training the human body weight recognition model, the detection model is used to detect human body pictures from the original pictures captured by multiple cameras and form a base library. Use the existing model to extract human body features from the bottom library pictures, and use the clustering method to classify the bottom library features. Manually check and screen each cluster in the clustering results. Calculate the similarity between clusters in the manual screening results, generate a recommended combination whose similarity between clusters is greater than the set threshold, and then submit it to manual checking and merging, and finally generate manual labeling results. Train a feature extraction network based on manual annotation results, input pedestrian pictures into the feature extraction network to obtain high-dimensional vector feature representations, obtain loss values according to the metric distance and cross-entropy calculated by the features, and select the optimizer to iterate to find the minimum value of the loss function. And continuously update the parameters of the network to achieve the effect of optimized learning, and obtain the final human body weight recognition model.

由于同一人体可能在不同摄像头之间反复出现,每个摄像头中出现的人体数目多,因此,但采用该种方式训练人体重识别模型时,需要将不同摄像头中出现的同一个人体匹配出来,排列组合数目十分巨大,进而导致需要大量的时间成本进行训练。Since the same human body may appear repeatedly between different cameras, the number of human bodies appearing in each camera is large. Therefore, when using this method to train the human body re-identification model, it is necessary to match the same human body appearing in different cameras and arrange them. The number of combinations is very large, which leads to a large amount of time cost for training.

为解决上述问题,本申请实施例中提供一种人体重识别方法,用于计算机设备中,需要说明的是,其执行主体可以是人体重识别装置,该装置可以通过软件、硬件或者软硬件结合的方式实现成为存储设备的部分或者全部,其中,该计算机设备可以是终端或客户端或服务器,服务器可以是一台服务器,也可以为由多台服务器组成的服务器集群,本申请实施例中的终端可以是智能手机、个人电脑、平板电脑、可穿戴设备以及智能机器人等其他智能硬件设备。下述方法实施例中,均以执行主体是计算机设备为例来进行说明。In order to solve the above problems, an embodiment of the present application provides a human body weight recognition method for use in computer equipment. It should be noted that its execution subject can be a human body weight recognition device, which can be implemented through software, hardware or a combination of software and hardware. Realized as part or all of the storage device in a manner, wherein the computer device can be a terminal or a client or a server, and the server can be a single server, or a server cluster composed of multiple servers. In the embodiment of this application, the Terminals can be smart phones, personal computers, tablet computers, wearable devices, and other smart hardware devices such as smart robots. In the following method embodiments, the execution subject is a computer device as an example for illustration.

本申请实施例中的计算机设备,应用于对未知人体类别的人体图像进行人体重识别检测的使用场景。通过本申请提供的人体重识别方法,在对待检测的人体图像进行人体重识别检测时,能够基于单摄像头采集的人体训练图像进行训练的人体重识别模型,进而在预置的数据库中的多个人体特征中为 待检测的人体图像匹配出最相似人体类别,进而提高人体类别识别的准确性,减少误识别的情况发生。The computer device in the embodiment of the present application is applied to a usage scenario of performing human body weight recognition detection on a human body image of an unknown human body type. Through the human body weight recognition method provided by this application, when performing human body weight recognition detection on the human body image to be detected, the human body weight recognition model that can be trained based on the human body training image collected by a single camera, and then multiple people in the preset database In the body feature, the most similar human body category is matched to the human body image to be detected, thereby improving the accuracy of human body category recognition and reducing the occurrence of misidentification.

图1是根据一示例性实施例提出的一种人体重识别方法的流程图。如图1所示,分布式集群扩容方法包括如下步骤S101至步骤S104。Fig. 1 is a flow chart of a method for body weight recognition proposed according to an exemplary embodiment. As shown in FIG. 1 , the distributed cluster expansion method includes the following steps S101 to S104.

在步骤S101中,获取待检测的人体图像。In step S101, an image of a human body to be detected is acquired.

在本申请实施例中,待检测的人体图像可以理解为是未明确该人体图像具体对应人体类别的图像。人体类别可以理解为是用于区分不同人体的类别,每一个独立的个人对应一个人体类别。例如:行人A和行人B即为两个不同的人体类别。在一例中,为便于记录,可以采用身份标识号(Identity document,id)的形式记录和区分各人体类别。例如:id1对应第一个人体类别,id2对应第一个人体类别。In the embodiment of the present application, the human body image to be detected can be understood as an image that does not specify that the human body image specifically corresponds to a human body category. Human body category can be understood as a category used to distinguish different human bodies, and each independent individual corresponds to a human body category. For example: Pedestrian A and Pedestrian B are two different human categories. In one example, for the convenience of recording, the form of an identity document (id) can be used to record and distinguish each human body category. For example: id1 corresponds to the first human category, and id2 corresponds to the first human category.

在步骤S102中,通过预先训练好的人体重识别模型,提取人体图像的第一人体特征。In step S102, the first human body feature of the human body image is extracted by using a pre-trained human body re-identification model.

在本申请实施例中,预先训练好的人体重识别模型基于单摄像头采集的人体训练图像进行训练得到的,进而采用该种人体重识别模型提取人体图像的第一人体特征时,能够基于单摄像头的拍摄特性提高人体特征提取的准确度,进而后续匹配该人体图像对应的人体类别时,有助于提高匹配准确度。In the embodiment of the present application, the pre-trained human body weight recognition model is obtained by training based on the human body training images collected by a single camera. The shooting characteristics of the human body improve the accuracy of human body feature extraction, and then when the human body category corresponding to the human body image is subsequently matched, it helps to improve the matching accuracy.

在步骤S103中,将第一人体特征与预置数据库中的多个人体特征进行对比,确定与第一人体特征相似度最高的第二人体特征。In step S103, the first human body feature is compared with multiple human body features in a preset database, and the second human body feature with the highest similarity to the first human body feature is determined.

在本申请实施例中,预置数据库中的多个人体特征对应的人体类别是已知的,可以明确各人体类别对应的人体特征。将第一人体特征与预置数据库中的多个人体特征进行对比,以便确定在已知人体类别的多个人体特征中是否包括与该第一人体特征相似的人体特征。由于相似度越高,则表征二者属于同一人体类别的可能性越大,因此,基于对比结果,在多个人体特征中确定与第一人体特征相似度最高的第二人体特征,以便通过该第二人体特征确定第一人体特征对应的人体类别。在一示例中,确定第一人体特征与各人体特征之间的相似度时,可以通过余弦相似度、欧几里得距离或者闵可夫斯基距离进行确定。In the embodiment of the present application, the human body categories corresponding to the multiple human body characteristics in the preset database are known, and the human body characteristics corresponding to each human body category can be specified. Comparing the first human body feature with multiple human body features in a preset database, so as to determine whether any human body feature similar to the first human body feature is included in the multiple human body features of known human body categories. Since the higher the similarity, the greater the possibility that the two belong to the same human body category, therefore, based on the comparison results, determine the second human body feature with the highest similarity to the first human body feature among multiple human body features, so as to pass the The second human body feature determines the human body category corresponding to the first human body feature. In an example, when determining the similarity between the first human body feature and each human body feature, it may be determined by cosine similarity, Euclidean distance or Minkowski distance.

在步骤S104中,当相似度大于或者等于指定阈值时,将第二人体特征对应的人体类别匹配为人体图像最相似的人体类别。In step S104, when the similarity is greater than or equal to a specified threshold, the human body category corresponding to the second human body feature is matched to the human body category most similar to the human body image.

在本申请实施例中,由于同一人体类别在不同场景下进行拍摄时,所提取到的人体特征可能存在差异。故指定阈值可以理解为是用于确定第一人体特征与第二人体特征是否属于同一人体类别的容错阈值。当相似度大于或者等于该指定阈值,则表征第一人体特征与第二人体特征之间过于相似,第一人体特征与第二人体特征可能属于同一人体类别。当相似度小于该指定阈值,则表征第一人体特征与第二人体特征之间的相似度较低,可以确定第一人体特征与第二人体特征不属于同一人体类别。因此,当相似度大于或者等于指定阈值时,可以将第二人体特征对应的人体类别匹配为人体图像最相似的人体类别,以便后续根据匹配到的人体类别明确该人体图像最终对应的人体类别。在一例中,若存在多个相似度大于或者等于指定阈值的第二人体特征时,则将相似度值最大的第二人体特征对应的人体类别确定为是该人体图像最相似的人体类别。In the embodiment of the present application, since the same human body type is photographed in different scenes, there may be differences in the extracted human body features. Therefore, the specified threshold can be understood as an error-tolerant threshold for determining whether the first human body feature and the second human body feature belong to the same human body category. When the similarity is greater than or equal to the specified threshold, it indicates that the first human body feature and the second human body feature are too similar, and the first human body feature and the second human body feature may belong to the same human body category. When the similarity is less than the specified threshold, it indicates that the similarity between the first human body feature and the second human body feature is low, and it can be determined that the first human body feature and the second human body feature do not belong to the same human body category. Therefore, when the similarity is greater than or equal to the specified threshold, the human body category corresponding to the second human body feature can be matched as the most similar human body category of the human body image, so that the final corresponding human body category of the human body image can be determined according to the matched human body category. In one example, if there are multiple second human body features whose similarity is greater than or equal to a specified threshold, the human body category corresponding to the second human body feature with the largest similarity value is determined to be the most similar human body category to the human body image.

通过上述实施例,在对待检测的人体图像进行人体重识别检测时,能够基于单摄像头采集的人体训练图像进行训练的人体重识别模型,进而在预置的数据库中的多个人体特征中为待检测的人体图像匹配出最相似人体类别,从而有助于提高人体类别识别的准确性,减少误识别的情况发生。Through the above-mentioned embodiment, when performing human body weight recognition detection on the human body image to be detected, the human body weight recognition model that can be trained based on the human body training image collected by a single camera, and then among the multiple human body features in the preset database are the human body weight recognition models to be The detected human body images are matched to the most similar human body category, which helps to improve the accuracy of human body category recognition and reduce the occurrence of misidentification.

在一实施例中,若第一人体特征与第二人体特征之间的相似度小于指定阈值,则可以确定该人体图像对应的人体类别是新出现的人体类别,进而可以将该人体图像的第一人体特征以及对应的人体类别存储至预置的数据库中,以便后续进行人体重识别追踪时,能够提高识别、追踪的准确性。In one embodiment, if the similarity between the first human body feature and the second human body feature is less than a specified threshold, it can be determined that the human body category corresponding to the human body image is a new human body category, and then the first human body category of the human body image can be A human body feature and the corresponding human body category are stored in a preset database, so that the accuracy of recognition and tracking can be improved in subsequent human body weight recognition and tracking.

以下实施例将说明人体重识别模型的具体训练过程。The following examples will illustrate the specific training process of the human weight recognition model.

图2是根据一示例性实施例提出的一种人体重识别模型的训练方法的流程图。如图2所示,人体重识别模型的训练方法包括如下步骤。Fig. 2 is a flowchart of a method for training a human body weight recognition model according to an exemplary embodiment. As shown in Figure 2, the training method of the human body weight recognition model includes the following steps.

在步骤S201中,获取多组第一人体训练图像集。In step S201, multiple groups of first human body training image sets are acquired.

在本申请实施例中,不同组的第一人体训练图像集由不同摄像头采集,不同第一人体训练图像集之间包括的人体类别相同。即,不同组第一人体训 练图像集中包括的人体类别是相同的,但不同组的第一人体训练图像集是通过不同摄像头采集得到的。例如:A组的第一人体训练图像集是由摄像头A采集得到的,B组的第一人体训练图像集是由摄像头B采集得到的。A组的第一人体训练图像集包括的人体类别与B组的第一人体训练图像集包括的人体类别相同。In the embodiment of the present application, different sets of first human body training image sets are collected by different cameras, and the types of human bodies included in different first human body training image sets are the same. That is, the human body categories included in the first human body training image sets of different groups are the same, but the first human body training image sets of different groups are collected by different cameras. For example: the first human body training image set of group A is collected by camera A, and the first human body training image set of group B is collected by camera B. The first human body training image set of group A includes the same human body category as that included in the first human body training image set of group B.

在步骤S202中,将各第一人体训练图像集分别输入至待训练的特征提取网络中,训练特征提取网络提取各人体类别对应的人体特征,得到第一特征提取模型。In step S202, each first human body training image set is input into the feature extraction network to be trained, and the trained feature extraction network extracts human body features corresponding to each human body category to obtain a first feature extraction model.

在本申请实施例中,在训练特征提取网络时,将各第一人体训练图像集分别输入至待训练的特征提取网络中,由特征提取网络针对各摄像头采集的第一人体训练图像集分别进行人体特征提取,进而根据提取到的人体特征,训练该特征提取网络,得到第一特征提取模型。例如:获取的第一人体训练图像集分别为A、B和C三组。在训练特征提取网络时,将A、B和C分别输入至特征提取网络中进行人体特征提取,由该特征提取网络分别提取A对应的包括的各人体类别的人体特征a、提取B对应的包括的各人体类别的人体特征b以及提取C对应的包括的各人体类别的人体特征c,进而基于a、b和c训练特征提取网络提取各人体类别对应的人体特征,得到第一特征提取模型。In the embodiment of the present application, when training the feature extraction network, each first human body training image set is input into the feature extraction network to be trained respectively, and the first human body training image set collected by each camera is respectively carried out by the feature extraction network. Human body feature extraction, and then according to the extracted human body features, train the feature extraction network to obtain the first feature extraction model. For example: the acquired first human body training image sets are three groups A, B and C respectively. When training the feature extraction network, A, B, and C are respectively input into the feature extraction network for human body feature extraction, and the feature extraction network extracts the human body feature a of each human body category corresponding to A, and extracts the human body feature a corresponding to B. The human body feature b of each human body category and extract the human body feature c of each human body category corresponding to C, and then train the feature extraction network based on a, b and c to extract the human body features corresponding to each human category, and obtain the first feature extraction model.

在进行第一特征提取模型训练时,所采用的人体训练图像均是已标注人体类别的图像。在对特征提取模型进行训练时,由于是将各摄像头采集的第一人体训练图像集分开输入至特征网络模型中进行训练,进而预先在对人体训练图像进行标注时,无需跨摄像头标注,只针对当前摄像头进行标注即可,从而降低标注难度,节省标注时间,有助于提升标注效率。When training the first feature extraction model, the human body training images used are all images marked with human body categories. When training the feature extraction model, since the first human body training image set collected by each camera is separately input into the feature network model for training, and then when annotating the human body training image in advance, there is no need to label across cameras, only for The current camera can be labeled, which reduces the difficulty of labeling, saves labeling time, and helps to improve labeling efficiency.

在步骤S203中,获取与第一人体训练图像集包括的人体类别相同的第二人体训练图像集和人体训练特征集。In step S203, a second human body training image set and a human body training feature set of the same human body category as included in the first human body training image set are acquired.

在本申请实施例中,人体训练特征集中包括的多个人体训练特征为各组人体图像集对应第一人体训练图像的总人体特征。在一示例中,通过第一特征提取模型,分别对第一人体训练图像集进行人体特征提取,得到各第一人 体训练图像集对应的人体特征集,将各人体特征集合并,得到该人体训练特征集。In the embodiment of the present application, the multiple human body training features included in the human body training feature set are the total human body features corresponding to the first human body training image in each group of human body image sets. In one example, the first feature extraction model is used to extract human body features from the first human body training image sets respectively, to obtain the human body feature sets corresponding to each first human body training image set, and to combine the human body feature sets to obtain the human body training image set. feature set.

人体训练特征集中所包括的人体类别与第一人体训练图像集包括的人体类别相同,进而后续训练第一特征提取模型能够跨摄像头进行特征识别时,能够进行针对性的训练。The human body categories included in the human body training feature set are the same as the human body categories included in the first human body training image set, and then the subsequent training of the first feature extraction model can perform targeted training when the first feature extraction model can perform feature recognition across cameras.

在一示例中,第二人体训练图像集可以是将各组第一人体训练图像集进行合并后得到的人体训练图像集。In an example, the second human body training image set may be a human body training image set obtained by merging each group of first human body training image sets.

在步骤S204中,将第二人体训练图像集输入至第一特征提取模型,根据人体训练特征集训练第一特征提取模型,得到人体重识别模型。In step S204, the second human body training image set is input to the first feature extraction model, and the first feature extraction model is trained according to the human body training feature set to obtain a human body re-identification model.

在本申请实施例中,由于第一特征训练模型是针对单摄像头采集的第一人体训练图像集训练得到的,而在实际应用中,用于人体重识别的人体重识别模型需要从多个摄像头所采集的人体图像中对待检测的人体图像进行人体重识别。因此,为使第一特征提取模型能够实现跨摄像头的人体重识别,则将获取的第二人体训练图像集输入至第一特征提取模型中,根据获取的人体训练特征集,训练该第一特征提取模型学习同一人体类型在不同摄像头下所采集的人体图像中的人体特征,进而得到用于人体重识别的人体重识别模型。In the embodiment of the present application, since the first feature training model is trained on the first human body training image set collected by a single camera, in practical applications, the human body weight recognition model used for human body weight recognition needs to learn from multiple cameras Human body weight recognition is performed on the human body images to be detected in the collected human body images. Therefore, in order to enable the first feature extraction model to realize cross-camera human body re-identification, the acquired second human body training image set is input into the first feature extraction model, and the first feature is trained according to the acquired human body training feature set. The extraction model learns the human body features of the same human body type in human body images collected by different cameras, and then obtains a human body weight recognition model for human body weight recognition.

通过上述实施例,将训练人体重识别模型的过程分为两个阶段,基于单摄像头采集的第一人体训练图像集训练第一特征提取模型阶段时,有助于增强第一特征提取模型学习提取单摄像头采集人体图像对应人体特征的鲁棒性,进而后续训练第一特征提取模型学习同一人体类型在不同摄像头下所采集的人体图像中的人体特征时,有助于增强提取人体特征的鲁棒性,从而在实际使用中进行人体特征提取时,更具有准确性。Through the above-mentioned embodiment, the process of training the human body weight recognition model is divided into two stages. When training the first feature extraction model stage based on the first human body training image collection collected by a single camera, it is helpful to enhance the learning and extraction of the first feature extraction model. The robustness of human body features collected by a single camera, and then the subsequent training of the first feature extraction model to learn the human body features of the same body type in human body images collected by different cameras, helps to enhance the robustness of human body feature extraction Therefore, it is more accurate when performing human feature extraction in actual use.

以下实施例将说明第一特征提取模型的具体训练过程。The following embodiments will illustrate the specific training process of the first feature extraction model.

图3是根据一示例性实施例提出的一种第一特征提取模型的训练方法的流程图。如图3所示,第一特征提取模型的训练方法包括如下步骤。Fig. 3 is a flowchart of a method for training a first feature extraction model according to an exemplary embodiment. As shown in Fig. 3, the training method of the first feature extraction model includes the following steps.

在步骤S301中,将当前组第一人体训练图像集输入至待训练的特征提取网络中进行人体特征提取,并将特征提取结果输入至预置的第一分类网络中进行特征分类,得到第一分类结果。In step S301, the current group of first human body training image sets are input into the feature extraction network to be trained for human body feature extraction, and the feature extraction results are input into the preset first classification network for feature classification, and the first classification results.

在本申请实施例中,待训练的特征提取网络是用于特征提取的网络模型,若仅根据特征提取网络输出的人体特征,无法确定提取的人体特征是否准确,提取到的人体特征是否能够体现出不同人体类别的差异。因此,在训练特征提取网络时,结合预置的第一分类网络,对该特征提取网络对各第一人体训练图像进行人体特征提取输出的特征提取结果进行分类,得到各人体特征对应的第一分类结果,以便后续根据各第一人体训练图像对应第一分类结果以及对应的人体类别调整特征提取网络的参数,从而得到第一特征提取模型。在一例中,特征提取网络可以是骨干特征提取网络(一种神经网络),其网络架构包括卷积层和池化层。其中,卷积层用于对输入的图像进行降维和特征提取,池化层用于缩减模型规模,增强鲁棒性。由于骨干特征提取网络的结构相对简单,且迭代速度快,因此,在进行训练时,有助于提高训练效率,进而有助于降低训练成本。In the embodiment of the present application, the feature extraction network to be trained is a network model for feature extraction. If only based on the human body features output by the feature extraction network, it is impossible to determine whether the extracted human body features are accurate and whether the extracted human body features can reflect Differences between different human body types. Therefore, when training the feature extraction network, combined with the preset first classification network, the feature extraction network performs classification on the output feature extraction results of human body feature extraction for each first human body training image, and obtains the first human body feature corresponding Classification results, so as to adjust the parameters of the feature extraction network according to the first classification results corresponding to the first human body training images and the corresponding human body categories, so as to obtain the first feature extraction model. In one example, the feature extraction network may be a backbone feature extraction network (a type of neural network), and its network architecture includes convolutional layers and pooling layers. Among them, the convolutional layer is used to reduce the dimensionality and feature extraction of the input image, and the pooling layer is used to reduce the model size and enhance the robustness. Since the structure of the backbone feature extraction network is relatively simple and the iteration speed is fast, it is helpful to improve the training efficiency and reduce the training cost during training.

在一示例中,第一分类网络可以是与特征提取网络的输出端连接的全连接分类层,用于辅助特征提取网络进行人体特征提取的训练。In an example, the first classification network may be a fully connected classification layer connected to the output end of the feature extraction network, and is used to assist the feature extraction network in training human body feature extraction.

在另一示例中,全连接分类层的数量与第一人体训练图像集的组数相同,且与各组第一人体训练图像集一一对应,全连接分类层计算的分类数量也与对应第一人体训练图像集包括的人体类别的数量相同。可以理解为,在训练特征提取网络时,当前第一人体训练图像集输入至特征提取网络后,将特征提取网络输出的特征提取结果输入至该当前第一人体训练图像集对应的全连接分类层中进行特征分类,得到提取当前第一人体训练图像集的第一分类结果。In another example, the number of fully connected classification layers is the same as the number of groups of the first human body training image set, and corresponds to each group of first human body training image sets, and the number of classifications calculated by the fully connected classification layer is also the same as the number of groups corresponding to the first human body training image set. A human body training image set includes the same number of human body categories. It can be understood that, when training the feature extraction network, after the current first human body training image set is input to the feature extraction network, the feature extraction result output by the feature extraction network is input to the fully connected classification layer corresponding to the current first human body training image set The feature classification is carried out to obtain the first classification result of extracting the current first human body training image set.

在步骤S302中,基于第一分类结果和第一人体训练图像集包括的人体类别,训练特征提取网络提取各人体类别对应的人体特征,得到第一特征提取模型。In step S302, based on the first classification result and the human body categories included in the first human body training image set, the training feature extraction network extracts the human body features corresponding to each human body category to obtain the first feature extraction model.

在本申请实施例中,根据第一分类结果和第一人体训练图像集包括的人体类别,通过损失函数,确定第一分类网络进行分类时所产生的损失,进而对特征提取网络的参数相应调整,并根据调整后的参数训练特征提取网络提取各人体类别对应的人体特征,从而得到第一特征提取模型。在一例中,所 采用的损失函数可以包括Arcface损失、交叉熵损失函数或者三元组损失函数。In the embodiment of the present application, according to the first classification result and the human body category included in the first human body training image set, the loss generated when the first classification network performs classification is determined through the loss function, and then the parameters of the feature extraction network are adjusted accordingly , and according to the adjusted parameters, train the feature extraction network to extract the human body features corresponding to each human body category, so as to obtain the first feature extraction model. In one example, the loss function used may include Arcface loss, cross-entropy loss function or triplet loss function.

通过上述实施例,在训练特征提取网络时,基于第一分类网络进行训练,有助于提高特征提取网络学习提取人体特征的准确性,进而使通过第一特征提取模型提取的人体特征能够更好的表达出人体类别的差异,为后续训练人体重识别模型奠定良好的特征提取基础,从而增强人体重识别模型的鲁棒性。Through the above embodiments, when training the feature extraction network, training based on the first classification network helps to improve the accuracy of the feature extraction network learning and extracting human body features, and then makes the human body features extracted by the first feature extraction model better. The differences in human body categories can be expressed, which lays a good feature extraction foundation for the subsequent training of the human body weight recognition model, thereby enhancing the robustness of the human body weight recognition model.

在一实施场景中,第一特征提取模型的训练过程可以如图4所示。图4是根据一示例性实施例提出的另一种第一特征提取模型的训练方法的流程图。其中,用于训练骨干特征提取网络的第一人体训练图像集的组数为n,分别对应n个摄像头,n>1,且n为整数。为便于描述,以下将以摄像头1对应的第一人体训练图像集训练骨干特征提取网络的过程为例进行描述。In an implementation scenario, the training process of the first feature extraction model may be as shown in FIG. 4 . Fig. 4 is a flow chart of another training method for a first feature extraction model proposed according to an exemplary embodiment. Wherein, the number of groups of the first human body training image set used to train the backbone feature extraction network is n, corresponding to n cameras respectively, n>1, and n is an integer. For ease of description, the process of training the backbone feature extraction network with the first human body training image set corresponding to the camera 1 will be described as an example below.

将摄像头1对应的第一人体训练图像集输入至骨干特征提取网络中进行人体特征提取,并将输出的特征提取结果输入至与摄像头1对应全连接分类层1中进行特征分类,得到第一分类结果,并计算分类损失,进而对特征提取网络的参数相应调整,并根据调整后的参数训练特征提取网络提取各人体类别对应的人体特征。Input the first human body training image set corresponding to camera 1 into the backbone feature extraction network for human body feature extraction, and input the output feature extraction results into the fully connected classification layer 1 corresponding to camera 1 for feature classification, and obtain the first classification As a result, the classification loss is calculated, and then the parameters of the feature extraction network are adjusted accordingly, and the feature extraction network is trained according to the adjusted parameters to extract the human body features corresponding to each human body category.

以摄像头2至n中任意一个摄像头对应的第一人体训练图像集训练骨干特征提取网络的过程,与以摄像头1对应的第一人体训练图像集训练骨干特征提取网络的过程相同,在此不在进行赘述。The process of training the backbone feature extraction network with the first human body training image set corresponding to any one of cameras 2 to n is the same as the process of training the backbone feature extraction network with the first human body training image set corresponding to camera 1, and will not be carried out here repeat.

当针对各组第一人体训练图像集的训练均结束后,得到第一特征提取模型。After the training for each group of first human body training image sets is completed, a first feature extraction model is obtained.

在另一实施场景中,若第一人体训练图像集中的人体类别数量较少时,则可以采用交叉熵损失函数计算损失。计算公式如下:

Figure PCTCN2022100384-appb-000001
其中,loss n为第n个摄像头对应的损失值,P为全连接分类层的预测概率,i,m分别对应单个摄像头的某一人体类别和人体类别的总数量。 In another implementation scenario, if the number of human body categories in the first human body training image set is small, the loss may be calculated using a cross-entropy loss function. Calculated as follows:
Figure PCTCN2022100384-appb-000001
Among them, loss n is the loss value corresponding to the nth camera, P is the predicted probability of the fully connected classification layer, and i and m correspond to a certain human body category and the total number of human body categories of a single camera, respectively.

以下实施例将说明人体训练特征集的具体获取过程。The following embodiments will illustrate the specific acquisition process of the human body training feature set.

图5是根据一示例性实施例提出的一种人体训练特征集的获取方法的流程图。如图5所示,人体训练特征集的获取方法包括如下步骤。Fig. 5 is a flowchart of a method for acquiring a human body training feature set according to an exemplary embodiment. As shown in Fig. 5, the method for obtaining the human body training feature set includes the following steps.

在步骤S501中,通过第一特征提取模型,分别提取各第一人体训练图像集对应的人体特征集。In step S501, the human body feature sets corresponding to the first human body training image sets are respectively extracted through the first feature extraction model.

在步骤S502中,将当前人体特征集中的第一人体特征与下一人体特征集中的各第二人体特征依次进行匹配,确定下一人体特征集中与所述第一人体特征匹配度最高的第二人体特征。In step S502, the first human body feature in the current human body feature set is sequentially matched with the second human body features in the next human body feature set, and the second human body feature with the highest matching degree with the first human body feature in the next human body feature set is determined. human body features.

在本申请实施例中,在进行匹配融合时,将当前人体特征集中的第一人体特征依次与下一人体特征集中的各第二人体特征进行匹配,确定下一人体特征集中与第一人体特征相似度最高的第二人体特征。In the embodiment of the present application, when performing matching and fusion, the first human body features in the current human body feature set are sequentially matched with the second human body features in the next human body feature set, and the next human body feature set and the first human body feature are determined. The second human body feature with the highest similarity.

在步骤S503中,将各第一人体特征融合至对应匹配度最高的第二人体特征中,得到新的第二人体特征,并生成与各新的第二人体特征对应人体类别的伪标签。In step S503, each first human body feature is fused into the second human body feature with the highest matching degree to obtain a new second human body feature, and a pseudo-label corresponding to each new second human body feature is generated.

在本申请实施例中,由于各第一人体训练图像集中包括的人体类别相同,因此,可以将与第一人体特征相似度最高的第二人体特征对应的人体类别,确定为是与第一人体特征对应的人体类别相同的人体类别,进而可以将第一人体特征和与第一人体特征相似度最高的第二人体特征进行融合,得到新的第二人体特征,并生成该新的第二人体特征对应的伪标签。其中,伪标签可以理解为是该新的第二人体特征对应的人体类别。In the embodiment of the present application, since the human body categories included in each first human body training image set are the same, the human body category corresponding to the second human body feature with the highest similarity with the first human body feature can be determined to be the same as the first human body. The corresponding human body category of the feature is the same human body category, and then the first human body feature and the second human body feature with the highest similarity with the first human body feature can be fused to obtain a new second human body feature, and generate the new second human body Pseudo-labels corresponding to features. Wherein, the pseudo-label can be understood as a human body category corresponding to the new second human body feature.

在步骤S504中,依次轮循各人体特征集,直至得到包括各组人体特征集中各人体类别对应的新的第二人体特征以及对应的伪标签,得到人体训练特征集。In step S504, each human body feature set is cycled in turn until the new second human body features corresponding to each human body category in each group of human body feature sets and corresponding pseudo-labels are obtained to obtain a human body training feature set.

在本申请实施例中,依次确定当前人体特征集中各第一人体特征在下一人体特征集中对应的第二人体特征,并将各第一人体特征融合至对应的第二人体特征中,得到多个新的第二人体特征。当当前人体特征集中的各第一人体特征均完成融合后,取消当前人体特征集,将包括多个新的第二人体特征的下一人体特征集作为新的当前人体特征集,并将该新的当前人体特征集中的各新的第二人体特征作为第一人体特征,与下一人体特征集中的各第二人体特征进行对比,确定与各第一人体特征对应的第二人体特征。依次类推,将各第一人体特征融合至对应的第二人体特征中,直至得到包括各组人体特 征集中各人体类别对应的新的第二人体特征以及对应的伪标签,得到人体训练特征集。即,在人体训练特征集中的任一人体训练特征包括该人体训练特征对应伪标签在各人体特征集中的总人体特征,人体训练特征即为最终生成的新的第二人体特征。In the embodiment of the present application, the second human body features corresponding to each first human body feature in the current human body feature set are sequentially determined in the next human body feature set, and each first human body feature is fused into the corresponding second human body feature to obtain multiple New secondary human traits. After all the first human body features in the current human body feature set are fused, the current human body feature set is canceled, and the next human body feature set including multiple new second human body features is used as a new current human body feature set, and the new Each new second human body characteristic in the current human body characteristic set is used as the first human body characteristic, and is compared with each second human body characteristic in the next human body characteristic set, and the second human body characteristic corresponding to each first human body characteristic is determined. By analogy, each first human body feature is fused into the corresponding second human body feature, until the new second human body feature corresponding to each human body category in each group of human body feature sets and the corresponding pseudo-label are obtained, and the human body training feature set is obtained. That is, any human body training feature in the human body training feature set includes the total human body features of the pseudo-label corresponding to the human body training feature in each human body feature set, and the human body training feature is the finally generated new second human body feature.

通过上述实施例,将各摄像头采集的人体特征融合至同一人体训练特征中,有助于后续训练第一特征提取模型时,能够使第一特征提取模型充分学习各人体类别的人体特征,进而使得到的人体重识别模型在进行特征提取时,能够降低由于摄像头不同而导致人体特征检测的差异,从而有助于提高检测结果的准确性。Through the above-mentioned embodiment, the human body features collected by each camera are fused into the same human body training feature, which is helpful for the subsequent training of the first feature extraction model, so that the first feature extraction model can fully learn the human body features of each human body category, and then make The obtained human body weight recognition model can reduce the difference in human body feature detection due to different cameras when performing feature extraction, thereby helping to improve the accuracy of detection results.

在一实施场景中,人体训练特征集的获取过程可以如图6所示。图6是根据一示例性实施例提出的另一种人体训练特征集的获取方法的流程图。其中,id表示人体类别,id m表示摄像头n对应人体特征集中的第一人体特征,id k表示摄像头p对应人体特征集中的第二人体特征。将摄像头n中id m对应的第一人体特征,分别与摄像头p对应人体特征集中的各第二人体特征进行对比,确定摄像头p对应人体特征集中与id m相似度最高的 In an implementation scenario, the acquisition process of the human body training feature set may be as shown in FIG. 6 . Fig. 6 is a flow chart of another method for acquiring a human body training feature set according to an exemplary embodiment. Among them, id represents the human body category, id m represents the first human body feature in the human body feature set corresponding to camera n, and id k represents the second human body feature in the human body feature set corresponding to camera p. Compare the first human body feature corresponding to id m in camera n with the second human body features in the human body feature set corresponding to camera p, and determine the highest similarity to id m in the human body feature set corresponding to camera p

id k,将id m和id k合并,并生成对应的伪标签。 id k , merge id m and id k , and generate corresponding pseudo-labels.

以下实施例将说明通过第一特征提取模型训练人体重识别模型的具体训练过程。The following embodiments will illustrate the specific training process of training the human weight recognition model through the first feature extraction model.

图7是根据一示例性实施例提出的另一种人体重识别模型的训练方法的流程图。如图7所示,人体重识别模型的训练方法包括如下步骤。Fig. 7 is a flowchart of another training method for a human body weight recognition model according to an exemplary embodiment. As shown in FIG. 7 , the training method of the human body weight recognition model includes the following steps.

在步骤S701中,将第二人体训练图像集输入至第一特征提取模型中进行人体特征提取,并将特征提取结果输入至预置的第二分类网络中进行特征分类,得到第二分类结果。In step S701, the second human body training image set is input into the first feature extraction model for human body feature extraction, and the feature extraction result is input into a preset second classification network for feature classification to obtain a second classification result.

在本申请实施例中,第二分类网络可以是与第一特征提取模型的输出端连接的全连接分类层,通过对第一特征提取模型的输出结果进行分类,根据得到的第二分类结果辅助第一特征提取模型进行人体特征提取的训练。在一示例中,第二分类网络模型和第一分类网络模型可以为同一分类网络模型。在另一示例中,第二分类网络模型和第一分类网络模型可以为两个不同的分 类网络模型,分别用在不同训练阶段。其中,训练阶段包括:通过训练特征提取网络,得到第一特征提取模型的训练阶段,以及通过训练第一特征提取模型,得到人体重识别模型阶段的训练阶段。In the embodiment of the present application, the second classification network may be a fully connected classification layer connected to the output end of the first feature extraction model, by classifying the output results of the first feature extraction model, and assisting The first feature extraction model performs training for human feature extraction. In an example, the second classification network model and the first classification network model may be the same classification network model. In another example, the second classification network model and the first classification network model may be two different classification network models, which are used in different training stages respectively. Wherein, the training stage includes: the training stage of obtaining the first feature extraction model by training the feature extraction network, and the training stage of obtaining the human body re-identification model stage by training the first feature extraction model.

在步骤S702中,基于第二分类结果和人体训练特征集,训练第一特征提取模型提取第二人体训练图像集中各人体特征,得到人体重识别模型。In step S702, based on the second classification result and the human body training feature set, the first feature extraction model is trained to extract each human body feature in the second human body training image set to obtain a human body re-identification model.

在本申请实施例中,根据第二分类结果和各人体训练特征对应的伪标签,通过损失函数,确定第二分类网络进行分类时所产生的损失,进而对第一特征提取模型的参数相应调整,并根据调整后的参数训练第一特征提取模型提取各人体类别对应的人体特征,从而得到人体重识别模型。在一例中,所采用的损失函数可以包括Arcface损失、交叉熵损失函数或者三元组损失函数。In the embodiment of the present application, according to the second classification result and the pseudo-label corresponding to each human body training feature, the loss generated by the second classification network is determined through the loss function, and then the parameters of the first feature extraction model are adjusted accordingly , and train the first feature extraction model according to the adjusted parameters to extract the human body features corresponding to each human body category, so as to obtain the human body weight recognition model. In one example, the used loss function may include Arcface loss, cross-entropy loss function or triplet loss function.

在一示例中,在调整第一特征提取模型的参数时,可以通过梯度反传不断迭代更新网络参数的方式进行参数调整。In an example, when adjusting the parameters of the first feature extraction model, parameter adjustment may be performed by continuously iteratively updating network parameters through gradient backpropagation.

通过上述实施例,基于包括各多个摄像头对应提取的人体训练特征训练第一特征提取模型,有助于第一特征提取模型充分学习同一人体类别在不同拍摄场景下所对应的人体特征,进而使得到人体重识别模型在提取人体特征时,能够充分表达出不同人体类型对应的人体特征,从而提高人体重识别检测的准确性。Through the above-mentioned embodiment, training the first feature extraction model based on the human body training features extracted correspondingly from multiple cameras helps the first feature extraction model to fully learn the corresponding human body features of the same human body category in different shooting scenes, thereby making When the human body weight recognition model extracts human body features, it can fully express the human body characteristics corresponding to different human body types, thereby improving the accuracy of human body weight recognition detection.

在一实施例中,将第二人体训练图像集输入至第一特征提取模型之前,可以将第二人体训练图像集中的各第二人体训练图像缩放至同一指定尺寸后,进而后续提取人体特征时,有助于节省计算成本。In an embodiment, before inputting the second human body training image set to the first feature extraction model, each second human body training image in the second human body training image set may be scaled to the same specified size, and then the subsequent extraction of human body features , which helps to save computational cost.

在一实施场景中,人体重识别模型的训练过程可以如图8所示。图8是根据一示例性实施例提出的又一种人体重识别模型的训练方法的流程图。In an implementation scenario, the training process of the human body weight recognition model may be as shown in FIG. 8 . Fig. 8 is a flowchart of another training method for a human body weight recognition model according to an exemplary embodiment.

在步骤S801中,将第二人体训练图像集中的第二人体训练图像缩放至指定尺寸。In step S801, the second human body training image in the second human body training image set is scaled to a specified size.

在步骤S802中,将缩放至指定尺寸的第二人体训练图像输入至第一特征提取模型进行特征提取,得到特征提取结果。In step S802, the second human body training image scaled to a specified size is input to the first feature extraction model for feature extraction, and a feature extraction result is obtained.

在步骤S803中,将特征提取结果输入至全连接分类层进行分类,确定第二人体训练图像对应的伪标签。In step S803, the feature extraction result is input to the fully connected classification layer for classification, and the pseudo-label corresponding to the second human body training image is determined.

在步骤S804中,确定全连接分类层确定第二人体训练图像对应的伪标签的分类损失。In step S804, the fully connected classification layer is determined to determine the classification loss of the pseudo-label corresponding to the second human body training image.

在另一实施场景中,若输出的分类损失未达到训练要求,则调整第一特征提取模型的参数,根据调整后的参数继续进行训练。In another implementation scenario, if the output classification loss does not meet the training requirements, then adjust the parameters of the first feature extraction model, and continue training according to the adjusted parameters.

在一实施例中,第一人体训练图像集中各第一人体训练图像,是当前摄像头拍摄的视频中首次出现的人体类别进行标注,通过目标跟踪算法,提取各人体类别在该视频中对应的多个第一人体训练图像,得到第一人体训练图像集,使在对第一人体训练图像进行标注时,无需关注摄像头之间出现的相同人体,从而有助于降低标注难度。并且,多名标注人员也可以对多个视频同时进行标注,从而有助于提高标注效率。In one embodiment, each of the first human body training images in the first human body training image set is marked with the human body category that first appears in the video captured by the current camera, and the target tracking algorithm is used to extract the multiple corresponding human body categories in the video. The first human body training image is obtained to obtain the first human body training image set, so that when labeling the first human body training image, there is no need to pay attention to the same human body appearing between the cameras, thereby helping to reduce the difficulty of labeling. Moreover, multiple annotators can also annotate multiple videos at the same time, which helps to improve the efficiency of annotation.

在一示例中,目标跟踪算法可以包括检测跟踪算法(Tracking By Detection,TBD)或者SORT算法(一种在线实时多目标跟踪算法),在本申请中不进行限定。In an example, the target tracking algorithm may include a detection tracking algorithm (Tracking By Detection, TBD) or a SORT algorithm (an online real-time multi-target tracking algorithm), which is not limited in this application.

在一实施场景中,获取第一人体训练图像集的过程可以如图9所示。图9是根据一示例性实施例提出的一种人体训练图像集的获取方法的流程图。In an implementation scenario, the process of acquiring the first human body training image set may be as shown in FIG. 9 . Fig. 9 is a flowchart of a method for acquiring a human body training image set according to an exemplary embodiment.

在步骤S901中,获取当前摄像头拍摄的视频。In step S901, the video captured by the current camera is obtained.

在步骤S902中,判断当前人体类别是否为首次出现在视频中。In step S902, it is judged whether the current human body category appears in the video for the first time.

在步骤S903中,若当前人体类别是首次出现在视频中,则标注并提取当前人体类别出现在首帧图像中的第一人体训练图像。In step S903, if the current human body type appears in the video for the first time, mark and extract the first human body training image in which the current human body type appears in the first frame image.

在步骤S904中,通过目标跟踪,提取当前人体类别在其他帧图像中的第一人体训练图像,得到第一人体训练图像集。In step S904, the first human body training image of the current human body category in other frame images is extracted through target tracking to obtain a first human body training image set.

基于相同申请构思,本申请还提供一种人体重识别装置。Based on the same application concept, the present application also provides a human body weight recognition device.

图10是根据一示例性实施例提出的一种人体重识别装置的结构框图。如图10所示,人体重识别装置包括获取单元1001、提取单元1002、对比单元1003和确定单元1004。Fig. 10 is a structural block diagram of a human body weight recognition device according to an exemplary embodiment. As shown in FIG. 10 , the human body weight recognition device includes an acquisition unit 1001 , an extraction unit 1002 , a comparison unit 1003 and a determination unit 1004 .

获取单元1001,用于获取待检测的人体图像;An acquisition unit 1001, configured to acquire a human body image to be detected;

提取单元1002,用于通过预先训练好的人体重识别模型,提取人体图像的第一人体特征,人体重识别模型基于单摄像头采集的人体训练图像进行训 练;The extraction unit 1002 is used to extract the first human body feature of the human body image through the pre-trained human body weight recognition model, and the human body weight recognition model is trained based on the human body training image collected by a single camera;

对比单元1003,用于将第一人体特征与预置数据库中的多个人体特征进行对比,确定与第一人体特征相似度最高的第二人体特征;A comparison unit 1003, configured to compare the first human body feature with a plurality of human body features in a preset database, and determine a second human body feature with the highest similarity to the first human body feature;

确定单元1004,用于当相似度大于或者等于指定阈值时,将第二人体特征对应的人体类别匹配为人体图像最相似的人体类别。The determining unit 1004 is configured to match the human body category corresponding to the second human body feature to the human body category most similar to the human body image when the similarity is greater than or equal to a specified threshold.

在一实施例中,人体重识别模型基于单摄像头采集的人体训练图像采用下述单元进行训练:第一获取单元,用于获取多组第一人体训练图像集,不同组的第一人体训练图像集由不同摄像头采集,不同第一人体训练图像集之间包括的人体类别相同。第一训练单元,用于将各第一人体训练图像集分别输入至待训练的特征提取网络中,训练特征提取网络提取各人体类别对应的人体特征,得到第一特征提取模型。第二获取单元,用于获取与第一人体训练图像集包括的人体类别相同的第二人体训练图像集和人体训练特征集,人体训练特征集中包括的多个人体训练特征为各组人体图像集对应第一人体训练图像的总人体特征。第二训练单元,用于将第二人体训练图像集输入至第一特征提取模型,根据人体训练特征集训练第一特征提取模型,得到人体重识别模型。In one embodiment, the human body weight recognition model is trained based on the human body training images collected by a single camera using the following units: the first acquisition unit is used to acquire multiple groups of first human body training image sets, different groups of first human body training images The sets are collected by different cameras, and the categories of human bodies included in different first human training image sets are the same. The first training unit is configured to input each first human body training image set into the feature extraction network to be trained, and train the feature extraction network to extract human body features corresponding to each human body category to obtain a first feature extraction model. The second acquisition unit is used to acquire a second human body training image set and a human body training feature set that are the same as the human body category included in the first human body training image set, and the multiple human body training features included in the human body training feature set are each group of human body image sets The overall human body features corresponding to the first human body training image. The second training unit is configured to input the second human body training image set into the first feature extraction model, train the first feature extraction model according to the human body training feature set, and obtain the human body re-identification model.

在另一实施例中,第一训练单元包括:第一提取单元,用于将当前组第一人体训练图像集输入至待训练的特征提取网络中进行人体特征提取,并将特征提取结果输入至预置的第一分类网络中进行特征分类,得到第一分类结果。第一训练子单元,用于基于第一分类结果和第一人体训练图像集包括的人体类别,训练特征提取网络提取各人体类别对应的人体特征,得到第一特征提取模型。In another embodiment, the first training unit includes: a first extraction unit, configured to input the current set of first human body training image sets into the feature extraction network to be trained for human body feature extraction, and input the feature extraction results to The feature classification is performed in the preset first classification network to obtain the first classification result. The first training subunit is configured to train the feature extraction network to extract human body features corresponding to each human body category based on the first classification result and the human body categories included in the first human body training image set, so as to obtain a first feature extraction model.

在又一实施例中,第二获取单元包括:第二提取单元,用于通过第一特征提取模型,分别提取各第一人体训练图像集对应的人体特征集。第一匹配单元,用于将当前人体特征集中的第一人体特征与下一人体特征集中的各第二人体特征依次进行匹配,确定下一人体特征集中与所述第一人体特征匹配度最高的第二人体特征。融合单元,用于将各第一人体特征融合至对应匹配度最高的第二人体特征中,得到新的第二人体特征,并生成与各新的第二人 体特征对应人体类别的伪标签。第二获取子单元,用于依次轮循各人体特征集,直至得到包括各组人体特征集中各人体类别对应的新的第二人体特征以及对应的伪标签,得到人体训练特征集。In yet another embodiment, the second acquiring unit includes: a second extracting unit, configured to respectively extract human body feature sets corresponding to each first human body training image set through the first feature extraction model. The first matching unit is configured to sequentially match the first human body features in the current human body feature set with the second human body features in the next human body feature set, and determine the person with the highest matching degree with the first human body feature in the next human body feature set Secondary human characteristics. The fusion unit is used to fuse the first human body features into the second human body features with the highest matching degree to obtain new second human body features, and generate pseudo-labels corresponding to the human body categories of each new second human body features. The second obtaining subunit is used to cycle through each human body feature set in turn until obtaining a new second human body feature corresponding to each human body category in each group of human body feature sets and corresponding pseudo-labels to obtain a human body training feature set.

在又一实施例中,第二训练单元包括:第三提取单元,用于将第二人体训练图像集输入至第一特征提取模型中进行人体特征提取,并将特征提取结果输入至预置的第二分类网络中进行特征分类,得到第二分类结果。第二训练子单元,用于基于第二分类结果和人体训练特征集,训练第一特征提取模型提取第二人体训练图像集中各人体特征,得到人体重识别模型。In yet another embodiment, the second training unit includes: a third extraction unit, configured to input the second human body training image set into the first feature extraction model for human body feature extraction, and input the feature extraction result into a preset The feature classification is performed in the second classification network to obtain the second classification result. The second training subunit is used to train the first feature extraction model to extract the features of each human body in the second human body training image set based on the second classification result and the human body training feature set to obtain a human body re-identification model.

在又一实施例中,第二获取单元,包括:确定单元,用于根据当前摄像头拍摄的视频,确定并标注首次出现的人体类别。第一图像提取单元,用于通过目标跟踪算法,提取各所述人体类别在所述视频中对应的多个第一人体训练图像,得到当前摄像头对应的第一人体训练图像集。In yet another embodiment, the second acquiring unit includes: a determining unit configured to determine and mark the first-appearing human body category according to the video captured by the current camera. The first image extraction unit is configured to extract a plurality of first human body training images corresponding to each of the human body categories in the video through a target tracking algorithm, and obtain a first human body training image set corresponding to the current camera.

在又一实施例中,第二获取单元包括:合并单元,用于将各所述第一人体训练图像集进行合并,得到第二人体训练图像集。In yet another embodiment, the second acquisition unit includes: a merging unit, configured to combine the first human body training image sets to obtain a second human body training image set.

上述人体重识别装置的具体限定以及有益效果可以参见上文中对于人体重识别方法的限定,在此不再赘述。上述各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。The specific limitations and beneficial effects of the above-mentioned human body weight recognition device can refer to the above-mentioned definition of the human body weight recognition method, and will not be repeated here. Each of the above-mentioned modules can be fully or partially realized by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, and can also be stored in the memory of the computer device in the form of software, so that the processor can invoke and execute the corresponding operations of the above-mentioned modules.

图11是根据一示例性实施例提出的一种计算机设备的硬件结构示意图。如图11所示,该设备包括一个或多个处理器1110以及存储器1120,存储器1120包括持久内存、易失内存和硬盘,图11中以一个处理器1110为例。该设备还可以包括:输入装置1130和输出装置1140。Fig. 11 is a schematic diagram of a hardware structure of a computer device according to an exemplary embodiment. As shown in FIG. 11 , the device includes one or more processors 1110 and a memory 1120 , and the memory 1120 includes a persistent memory, a volatile memory, and a hard disk. In FIG. 11 , one processor 1110 is taken as an example. The device may also include: an input device 1130 and an output device 1140 .

处理器1110、存储器1120、输入装置1130和输出装置1140可以通过总线或者其他方式连接,图11中以通过总线连接为例。The processor 1110, the memory 1120, the input device 1130, and the output device 1140 may be connected via a bus or in other ways, and connection via a bus is taken as an example in FIG. 11 .

处理器1110可以为中央处理器(Central Processing Unit,CPU)。处理器1110还可以为其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated  Circuit,ASIC)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等芯片,或者上述各类芯片的组合。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。The processor 1110 may be a central processing unit (Central Processing Unit, CPU). The processor 1110 can also be other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), application-specific integrated circuits (Application Specific Integrated Circuit, ASIC), field-programmable gate array (Field-Programmable Gate Array, FPGA) or Other chips such as programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or combinations of the above-mentioned types of chips. A general-purpose processor may be a microprocessor, or the processor may be any conventional processor, or the like.

存储器1120作为一种非暂态计算机可读存储介质,包括持久内存、易失内存和硬盘,可用于存储非暂态软件程序、非暂态计算机可执行程序以及模块,如本申请实施例中的业务管理方法对应的程序指令/模块。处理器1110通过运行存储在存储器1120中的非暂态软件程序、指令以及模块,从而执行服务器的各种功能应用以及数据处理,即实现上述任意一种人体重识别方法。The memory 1120 is a non-transitory computer-readable storage medium, including persistent memory, volatile memory and hard disk, and can be used to store non-transitory software programs, non-transitory computer executable programs and modules, such as the The program instruction/module corresponding to the business management method. The processor 1110 executes various functional applications and data processing of the server by running the non-transitory software programs, instructions and modules stored in the memory 1120, that is, implements any one of the above human body re-identification methods.

存储器1120可以包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需要的应用程序;存储数据区可存储根据、需要使用的数据等。此外,存储器1120可以包括高速随机存取存储器,还可以包括非暂态存储器,例如至少一个磁盘存储器件、闪存器件、或其他非暂态固态存储器件。在一些实施例中,存储器1120可选包括相对于处理器1110远程设置的存储器,这些远程存储器可以通过网络连接至数据处理装置。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。The memory 1120 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and an application program required by at least one function; In addition, the memory 1120 may include a high-speed random access memory, and may also include a non-transitory memory, such as at least one magnetic disk storage device, a flash memory device, or other non-transitory solid-state storage devices. In some embodiments, the memory 1120 may optionally include memory located remotely relative to the processor 1110, and these remote memories may be connected to the data processing device through a network. Examples of the aforementioned networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

输入装置1130可接收输入的数字或字符信息,以及产生与用户设置以及功能控制有关的键信号输入。输出装置1140可包括显示屏等显示设备。The input device 1130 can receive input numbers or character information, and generate key signal input related to user settings and function control. The output device 1140 may include a display device such as a display screen.

一个或者多个模块存储在存储器1120中,当被一个或者多个处理器1110执行时,执行如图1-9所示的方法。One or more modules are stored in the memory 1120, and when executed by the one or more processors 1110, perform the methods shown in FIGS. 1-9.

上述产品可执行本申请实施例所提供的方法,具备执行方法相应的功能模块和有益效果。未在本实施例中详尽描述的技术细节,具体可参见如图1-9所示的实施例中的相关描述。The above-mentioned products can execute the method provided by the embodiment of the present application, and have corresponding functional modules and beneficial effects for executing the method. For technical details that are not described in detail in this embodiment, please refer to the relevant description in the embodiment shown in FIGS. 1-9 for details.

本申请实施例还提供了一种非暂态计算机存储介质,计算机存储介质存储有计算机可执行指令,该计算机可执行指令可执行上述任意方法实施例中的认证方法。其中,存储介质可为磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)、随机存储记忆体(Random Access Memory,RAM)、快闪存 储器(Flash Memory)、硬盘(Hard Disk Drive,缩写:HDD)或固态硬盘(Solid-State Drive,SSD)等;存储介质还可以包括上述种类的存储器的组合。The embodiment of the present application also provides a non-transitory computer storage medium, the computer storage medium stores computer-executable instructions, and the computer-executable instructions can execute the authentication method in any of the above method embodiments. Wherein, the storage medium can be a magnetic disk, an optical disk, a read-only memory (Read-Only Memory, ROM), a random access memory (Random Access Memory, RAM), a flash memory (Flash Memory), a hard disk (Hard Disk Drive) , abbreviation: HDD) or solid-state drive (Solid-State Drive, SSD), etc.; the storage medium may also include a combination of the above-mentioned types of memory.

显然,上述实施例仅仅是为清楚地说明所作的举例,而并非对实施方式的限定。对于所属领域的普通技术人员来说,在上述说明的基础上还可以做出其它不同形式的变化或变动。这里无需也无法对所有的实施方式予以穷举。而由此所引伸出的显而易见的变化或变动仍处于本申请创造的保护范围之中。Apparently, the above-mentioned embodiments are only examples for clear description, rather than limiting the implementation. For those of ordinary skill in the art, other changes or changes in different forms can be made on the basis of the above description. It is not necessary and impossible to exhaustively list all the implementation manners here. However, the obvious changes or changes derived therefrom are still within the protection scope of the invention of the present application.

Claims (10)

一种人体重识别方法,其中,所述方法包括:A method for human body weight recognition, wherein the method includes: 获取待检测的人体图像;Obtain the human body image to be detected; 通过预先训练好的人体重识别模型,提取所述人体图像的第一人体特征,所述人体重识别模型基于单摄像头采集的人体训练图像进行训练;Extracting the first human body feature of the human body image through a pre-trained human body weight recognition model, the human body weight recognition model is trained based on a human body training image collected by a single camera; 将所述第一人体特征与预置数据库中的多个人体特征进行对比,确定与所述第一人体特征相似度最高的第二人体特征;Comparing the first human body feature with a plurality of human body features in a preset database, and determining a second human body feature with the highest similarity to the first human body feature; 当所述相似度大于或者等于指定阈值时,将所述第二人体特征对应的人体类别匹配为所述人体图像最相似的人体类别。When the similarity is greater than or equal to a specified threshold, the human body category corresponding to the second human body feature is matched to the human body category most similar to the human body image. 根据权利要求1所述的方法,其中,所述人体重识别模型基于单摄像头采集的人体训练图像进行训练,包括:The method according to claim 1, wherein the human body weight recognition model is trained based on a human body training image collected by a single camera, comprising: 获取多组第一人体训练图像集,不同组的第一人体训练图像集由不同摄像头采集,不同第一人体训练图像集之间包括的人体类别相同;Obtain multiple sets of first human body training image sets, the first human body training image sets of different groups are collected by different cameras, and the human body categories included in different first human body training image sets are the same; 将各所述第一人体训练图像集分别输入至待训练的特征提取网络中,训练所述特征提取网络提取各所述人体类别对应的人体特征,得到第一特征提取模型;Input each of the first human body training image sets into the feature extraction network to be trained, train the feature extraction network to extract the human body features corresponding to each of the human body categories, and obtain the first feature extraction model; 获取与所述第一人体训练图像集包括的人体类别相同的第二人体训练图像集和人体训练特征集,所述人体训练特征集中包括的多个人体训练特征为各组人体图像集对应第一人体训练图像的总人体特征;Acquire a second human body training image set and a human body training feature set that are the same as the human body category included in the first human body training image set, and the multiple human body training features included in the human body training feature set are each group of human body image sets corresponding to the first Total human features of human training images; 将所述第二人体训练图像集输入至所述第一特征提取模型,根据所述人体训练特征集训练所述第一特征提取模型,得到所述人体重识别模型。The second human body training image set is input to the first feature extraction model, and the first feature extraction model is trained according to the human body training feature set to obtain the human body re-identification model. 根据权利要求2所述的方法,其中,所述将各所述第一人体训练图像集分别输入至待训练的特征提取网络中,训练所述特征提取网络提取各所述人体类别对应的人体特征,得到第一特征提取模型,包括:The method according to claim 2, wherein the first human body training image sets are respectively input into the feature extraction network to be trained, and the feature extraction network is trained to extract human body features corresponding to each of the human body categories , get the first feature extraction model, including: 将当前组第一人体训练图像集输入至待训练的特征提取网络中进行人体特征提取,并将特征提取结果输入至预置的第一分类网络中进行特征分类,得到第一分类结果;Inputting the first human body training image set of the current group into the feature extraction network to be trained for human body feature extraction, and inputting the feature extraction result into the preset first classification network for feature classification to obtain the first classification result; 基于所述第一分类结果和所述第一人体训练图像集包括的人体类别,训 练所述特征提取网络提取各所述人体类别对应的人体特征,得到第一特征提取模型。Based on the first classification result and the human body categories included in the first human body training image set, train the feature extraction network to extract the human body features corresponding to each of the human body categories to obtain a first feature extraction model. 根据权利要求3所述的方法,其中,获取所述人体训练特征集,包括:The method according to claim 3, wherein obtaining the human body training feature set comprises: 通过所述第一特征提取模型,分别提取各所述第一人体训练图像集对应的人体特征集;Using the first feature extraction model, respectively extracting human body feature sets corresponding to each of the first human body training image sets; 将当前人体特征集中的第一人体特征与下一人体特征集中的各第二人体特征依次进行匹配,确定所述下一人体特征集中与所述第一人体特征匹配度最高的第二人体特征;sequentially matching the first human body features in the current human body feature set with the second human body features in the next human body feature set, and determining the second human body feature with the highest matching degree between the next human body feature set and the first human body feature; 将各所述第一人体特征融合至对应匹配度最高的第二人体特征中,得到新的第二人体特征,并生成与各所述新的第二人体特征对应人体类别的伪标签;Fusing each of the first human body features into the second human body feature with the highest matching degree to obtain a new second human body feature, and generating a pseudo-label corresponding to the human body category of each of the new second human body features; 依次轮循各所述人体特征集,直至得到包括各组人体特征集中各人体类别对应的新的第二人体特征以及对应的伪标签,得到人体训练特征集。Each of the human body feature sets is cycled in turn until the new second human body features corresponding to each human body category in each group of human body feature sets and corresponding pseudo-labels are obtained, so as to obtain a human body training feature set. 根据权利要求4所述的方法,其中,所述将所述第二人体训练图像集输入至所述第一特征提取模型,根据所述人体训练特征集训练所述第一特征提取模型,得到所述人体重识别模型,包括:The method according to claim 4, wherein the second human body training image set is input to the first feature extraction model, and the first feature extraction model is trained according to the human body training feature set to obtain the The human body weight recognition model includes: 将所述第二人体训练图像集输入至所述第一特征提取模型中进行人体特征提取,并将特征提取结果输入至预置的第二分类网络中进行特征分类,得到第二分类结果;Inputting the second human body training image set into the first feature extraction model for human body feature extraction, and inputting the feature extraction result into a preset second classification network for feature classification to obtain a second classification result; 基于所述第二分类结果和所述人体训练特征集,训练所述第一特征提取模型提取所述第二人体训练图像集中各人体特征,得到所述人体重识别模型。Based on the second classification result and the human body training feature set, train the first feature extraction model to extract each human body feature in the second human body training image set to obtain the human body re-identification model. 根据权利要求2-5中任一项所述的方法,其中,所述获取多组第一人体训练图像集,包括:The method according to any one of claims 2-5, wherein said obtaining multiple sets of first human body training image sets comprises: 根据当前摄像头拍摄的视频,确定并标注首次出现的人体类别;According to the video captured by the current camera, determine and mark the human body category that appears for the first time; 通过目标跟踪算法,提取各所述人体类别在所述视频中对应的多个第一人体训练图像,得到所述当前摄像头对应的第一人体训练图像集。A plurality of first human body training images corresponding to each of the human body types in the video are extracted through a target tracking algorithm to obtain a first human body training image set corresponding to the current camera. 根据权利要求6所述的方法,其中,所述获取与所述第一人体训练图像集包括的人体类别相同的第二人体训练图像集,包括:The method according to claim 6, wherein said obtaining a second human body training image set identical to the human body category included in said first human body training image set comprises: 将各所述第一人体训练图像集进行合并,得到第二人体训练图像集。Merge each of the first human body training image sets to obtain a second human body training image set. 一种人体重识别装置,其中,所述装置包括:A human body weight recognition device, wherein the device includes: 获取单元,用于获取待检测的人体图像;an acquisition unit, configured to acquire a human body image to be detected; 提取单元,用于通过预先训练好的人体重识别模型,提取所述人体图像的第一人体特征,所述人体重识别模型基于单摄像头采集的人体训练图像进行训练;The extraction unit is used to extract the first human body feature of the human body image through a pre-trained human body weight recognition model, and the human body weight recognition model is trained based on a human body training image collected by a single camera; 对比单元,用于将所述第一人体特征与预置数据库中的多个人体特征进行对比,确定与所述第一人体特征相似度最高的第二人体特征;A comparing unit, configured to compare the first human body feature with a plurality of human body features in a preset database, and determine a second human body feature with the highest similarity to the first human body feature; 确定单元,用于当所述相似度大于或者等于指定阈值时,将所述第二人体特征对应的人体类别匹配为所述人体图像最相似的人体类别。A determining unit, configured to match the human body category corresponding to the second human body feature to the human body category most similar to the human body image when the similarity is greater than or equal to a specified threshold. 一种计算机设备,其中,包括存储器和处理器,所述存储器和所述处理器之间互相通信连接,所述存储器中存储有计算机指令,所述处理器通过执行所述计算机指令,从而执行权利要求1-7中任一项所述的人体重识别方法。A computer device, including a memory and a processor, the memory and the processor are connected in communication with each other, and computer instructions are stored in the memory, and the processor implements the rights by executing the computer instructions The human body weight identification method described in any one of claims 1-7. 一种计算机可读存储介质,其中,所述计算机可读存储介质存储有计算机指令,所述计算机指令用于使所述计算机执行权利要求1-7中任一项所述的人体重识别方法。A computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to make the computer execute the human body re-identification method according to any one of claims 1-7.
PCT/CN2022/100384 2021-12-30 2022-06-22 Human body weight identification method, human body weight identification device, computer device, and medium Ceased WO2023123923A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111682643.5 2021-12-30
CN202111682643.5A CN114519863B (en) 2021-12-30 2021-12-30 Human body weight recognition method, human body weight recognition device, computer equipment and medium

Publications (1)

Publication Number Publication Date
WO2023123923A1 true WO2023123923A1 (en) 2023-07-06

Family

ID=81596037

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/100384 Ceased WO2023123923A1 (en) 2021-12-30 2022-06-22 Human body weight identification method, human body weight identification device, computer device, and medium

Country Status (2)

Country Link
CN (1) CN114519863B (en)
WO (1) WO2023123923A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118351340A (en) * 2024-06-17 2024-07-16 中国海洋大学 Double-branch non-supervision target re-identification method and system based on sample mining

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114519863B (en) * 2021-12-30 2025-04-25 深圳云天励飞技术股份有限公司 Human body weight recognition method, human body weight recognition device, computer equipment and medium
CN116188919B (en) * 2023-04-25 2023-07-14 之江实验室 A testing method, device, readable storage medium and electronic equipment
CN117036319A (en) * 2023-08-18 2023-11-10 南京师范大学 Visibility level detection method based on monitoring camera image

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140169664A1 (en) * 2012-12-17 2014-06-19 Electronics And Telecommunications Research Institute Apparatus and method for recognizing human in image
CN112052819A (en) * 2020-09-15 2020-12-08 浙江智慧视频安防创新中心有限公司 Pedestrian re-identification method, device, equipment and storage medium
CN112801116A (en) * 2021-01-27 2021-05-14 商汤集团有限公司 Image feature extraction method and device, electronic equipment and storage medium
CN112861695A (en) * 2021-02-02 2021-05-28 北京大学 Pedestrian identity re-identification method and device, electronic equipment and storage medium
CN114519863A (en) * 2021-12-30 2022-05-20 深圳云天励飞技术股份有限公司 Human body weight recognition method, human body weight recognition apparatus, computer device, and medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109145777A (en) * 2018-08-01 2019-01-04 北京旷视科技有限公司 Vehicle recognition methods, apparatus and system again
CN109886222B (en) * 2019-02-26 2022-03-15 北京市商汤科技开发有限公司 Face recognition method, neural network training method, device and electronic equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140169664A1 (en) * 2012-12-17 2014-06-19 Electronics And Telecommunications Research Institute Apparatus and method for recognizing human in image
CN112052819A (en) * 2020-09-15 2020-12-08 浙江智慧视频安防创新中心有限公司 Pedestrian re-identification method, device, equipment and storage medium
CN112801116A (en) * 2021-01-27 2021-05-14 商汤集团有限公司 Image feature extraction method and device, electronic equipment and storage medium
CN112861695A (en) * 2021-02-02 2021-05-28 北京大学 Pedestrian identity re-identification method and device, electronic equipment and storage medium
CN114519863A (en) * 2021-12-30 2022-05-20 深圳云天励飞技术股份有限公司 Human body weight recognition method, human body weight recognition apparatus, computer device, and medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118351340A (en) * 2024-06-17 2024-07-16 中国海洋大学 Double-branch non-supervision target re-identification method and system based on sample mining

Also Published As

Publication number Publication date
CN114519863B (en) 2025-04-25
CN114519863A (en) 2022-05-20

Similar Documents

Publication Publication Date Title
CN110070067B (en) Video classification method, training method and device of video classification method model and electronic equipment
WO2023123923A1 (en) Human body weight identification method, human body weight identification device, computer device, and medium
CN108960080B (en) Face recognition method based on active defense against image adversarial attack
CN106095829B (en) Cross-media retrieval method based on deep learning and consistent expression space learning
CN110717411A (en) A Pedestrian Re-identification Method Based on Deep Feature Fusion
CN110717526A (en) An Unsupervised Transfer Learning Method Based on Graph Convolutional Networks
US20110116690A1 (en) Automatically Mining Person Models of Celebrities for Visual Search Applications
WO2018196396A1 (en) Person re-identification method based on consistency constraint feature learning
WO2020253127A1 (en) Facial feature extraction model training method and apparatus, facial feature extraction method and apparatus, device, and storage medium
WO2017096753A1 (en) Facial key point tracking method, terminal, and nonvolatile computer readable storage medium
CN110837846A (en) An image recognition model construction method, image recognition method and device
US12080100B2 (en) Face-aware person re-identification system
CN109522872A (en) A kind of face identification method, device, computer equipment and storage medium
CN107735795A (en) Method and system for social relationships identification
CN113065409A (en) An Unsupervised Person Re-Identification Method Based on Different Alignment Constraints of Camera Segmentation
CN110381392B (en) Video abstract extraction method, system, device and storage medium thereof
WO2023124278A1 (en) Image processing model training method and apparatus, and image classification method and apparatus
CN110717401A (en) Age estimation method and device, equipment and storage medium
WO2019196626A1 (en) Media processing method and related apparatus
CN112766218B (en) Cross-domain pedestrian re-recognition method and device based on asymmetric combined teaching network
Xie et al. Inducing predictive uncertainty estimation for face recognition
CN111931859A (en) Multi-label image identification method and device
Baddar et al. On-the-fly facial expression prediction using lstm encoded appearance-suppressed dynamics
Booysens et al. Ear biometrics using deep learning: a survey
CN118097729A (en) Palm vein-based identity recognition method, device, storage medium and electronic device

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22913212

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 22913212

Country of ref document: EP

Kind code of ref document: A1