Human body target detection method and device, equipment, storage medium and computer program
By using projection function and mask processing technology in human object detection, the target feature map is generated and the detection model is trained, the problem of low detection accuracy in complex scenarios is solved, and the accuracy and robustness of detection are improved.
Patent Information
- Application Number
- CN202411354440.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-27
- Publication Date
- 2025-02-21
AI Technical Summary
The existing human object detection methods have low detection accuracy in complex scenarios and are difficult to meet monitoring needs.
By obtaining the training sample data set, the sample is mapped to the measurement space using a projection function, the optimal measurement parameters are determined, the mask is constructed, the feature map is processed, the target feature map is generated, and the human object detection model is trained.
It improves the accuracy and robustness of human object detection in complex scenarios, and enhances the generalization ability of the model under unknown occlusion.
Smart Images

Figure CN119495050A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer vision technology, and in particular to a method, apparatus, device, storage medium and computer program for detecting a human target. Background Art
[0002] With the continuous advancement of science and technology, various industries are paying more and more attention to security issues. For example, in order to improve the safety of public places, surveillance cameras are installed in important areas such as banks, airports, subways, stations, and communities for video surveillance; in order to improve the safety of workers in the workshop, surveillance cameras are installed in the workshop for monitoring. People are the main body of the monitoring scene. By detecting human targets in the monitoring scene, human behavior analysis, motion analysis, and identity recognition can be achieved. The tracking of human targets and subsequent behavior recognition analysis are heavily dependent on the accuracy of human target detection. Therefore, how to accurately detect human targets in monitoring scenes has become one of the hot topics widely concerned by academia and industry.
[0003] Traditional human target detection methods, such as those based on background subtraction, frame difference or feature matching, often rely on complete target appearance and shape information. Once this information is blocked, the detection effect is usually poor and the performance will be greatly reduced. However, the monitoring scene is usually more complex. Taking the maintenance workshop as an example, due to the complex working environment, the operators in the images collected by the monitoring camera will frequently be blocked. The existing methods have low accuracy when facing human target detection with different degrees of occlusion, which is difficult to meet the monitoring needs. Therefore, it is urgent to improve the accuracy of human target detection. Summary of the invention
[0004] The present disclosure provides a human target detection method, apparatus, device, storage medium and computer program to solve the problem of low detection accuracy of existing methods in complex scenes.
[0005] In a first aspect, the present disclosure provides a method for detecting a human target, comprising:
[0006] Obtain a training sample data set, where each training sample in the training sample data set includes a sample and a corresponding label, and the label is used to indicate the degree of occlusion of a human target in the sample;
[0007] For each query sample in the training sample data set, a projection function is used to map it to the metric space, and the optimal metric parameter of the projection function is determined based on the distance between the query sample and the similar sample in the similar set being less than or equal to the distance between the query sample and the dissimilar sample in the dissimilar set, thus obtaining the optimal projection function;
[0008] For each training sample in the training sample data set, a feature map of the training sample is determined, and normalization processing is performed to obtain a normalized feature map of the training sample;
[0009] The training samples are mapped to the metric space using the optimal projection function to obtain the projection vector corresponding to the training samples, and the occlusion metric corresponding to the training samples is determined according to the projection vector corresponding to the training samples;
[0010] Determine a dynamic adjustment parameter corresponding to the training sample according to the occlusion metric corresponding to the training sample, and construct a mask corresponding to the training sample according to the dynamic adjustment parameter corresponding to the training sample;
[0011] The normalized feature map of the training sample is processed using the mask corresponding to the training sample to obtain the target feature map of the training sample;
[0012] The target feature map of the training samples is used to train the human target detection model.
[0013] In some embodiments, determining the occlusion metric corresponding to the training sample according to the projection vector corresponding to the training sample includes:
[0014] The occlusion metric corresponding to the training sample is determined according to the following expression:
[0015]
[0016] Among them, i represents the occlusion metric corresponding to the i-th training sample, z i represents the projection vector corresponding to the i-th training sample, z i,j Indicates z i The j-th element of , d represents the dimension of the projection vector.
[0017] In some embodiments, determining the dynamic adjustment parameter corresponding to the training sample according to the occlusion metric corresponding to the training sample includes:
[0018] The dynamic adjustment parameter γ′ corresponding to the training sample is determined according to the following expression:
[0019] γ′=γ·α i
[0020] Among them, γ is a constant coefficient, α i is the adjustment factor corresponding to the i-th training sample;
[0021] Determine γ according to the following expression:
[0022]
[0023] Among them, keep_prob represents the parameter that affects the frequency of feature map discarding, block_size represents the parameter that affects the size of the feature map discarding block, and feat_size represents the size of the feature map;
[0024] Determine α according to the following expression i :
[0025]
[0026] Among them, β>0 and μ>0 are the parameters of the function g.
[0027] In some embodiments, the normalized feature map of the training sample is processed using the mask corresponding to the training sample to obtain the target feature map of the training sample, including:
[0028] Multiply the normalized feature map of the training sample by the mask corresponding to the training sample to obtain the masked feature map of the training sample;
[0029] The masked feature map of the training sample is scaled according to the following expression to obtain the target feature map of the training sample:
[0030]
[0031] Among them, I” (n) It represents the feature map after the training sample is masked, count(M) represents the number of elements in the mask M, count_ones(M) represents the number of 1s in the mask M, I n Represents the target feature map of the training sample.
[0032] In some embodiments, the labels include slight occlusion, moderate occlusion, and severe occlusion, where slight occlusion means the hands are occluded, moderate occlusion means the head and legs are occluded, and severe occlusion means the torso is occluded.
[0033] In some embodiments, the similar set consists of similar samples having the same label as the query sample, and the dissimilar set consists of dissimilar samples having different labels from the query sample.
[0034] In a second aspect, the present disclosure provides a human target detection device, comprising:
[0035] An acquisition module is used to acquire a training sample data set, where each training sample in the training sample data set includes a sample and a corresponding label, and the label is used to indicate the degree of occlusion of a human target in the sample;
[0036] A learning module is used to map each query sample in the training sample data set to a metric space using a projection function, and determine an optimal metric parameter of the projection function according to the distance between the query sample and the similar sample in the similar set being less than or equal to the distance between the query sample and the dissimilar sample in the dissimilar set, so as to obtain an optimal projection function;
[0037] A normalization module is used to determine a feature map of each training sample in the training sample data set, and perform normalization processing to obtain a normalized feature map of the training sample;
[0038] A projection module is used to map the training sample to the metric space using the optimal projection function, obtain the projection vector corresponding to the training sample, and determine the occlusion metric corresponding to the training sample according to the projection vector corresponding to the training sample;
[0039] A construction module, used to determine the dynamic adjustment parameters corresponding to the training samples according to the occlusion metrics corresponding to the training samples, and to construct the masks corresponding to the training samples according to the dynamic adjustment parameters corresponding to the training samples;
[0040] A processing module, used to process the normalized feature map of the training sample using the mask corresponding to the training sample to obtain a target feature map of the training sample;
[0041] The training module is used to train the human target detection model using the target feature map of the training samples.
[0042] In a third aspect, the present disclosure provides a computer device, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of the method described in the above aspects.
[0043] In a fourth aspect, the present disclosure provides a computer-readable storage medium having a computer program stored thereon, which implements the steps of the method described in the above aspects when executed by a processor.
[0044] In a fifth aspect, the present disclosure provides a computer program product, including a computer program, which implements the steps of the method described in the above aspects when executed by a processor.
[0045] The present disclosure provides a method, apparatus, device, storage medium and computer program for detecting a human target. The method comprises the following steps: obtaining a training sample data set, wherein each training sample in the training sample data set includes a sample and a corresponding label, wherein the label is used to indicate the degree of occlusion of a human target in the sample; for each query sample in the training sample data set, a projection function is used to map the query sample to a metric space, and according to the fact that the distance from the query sample to a similar sample in a similar set is less than or equal to the distance from the query sample to a dissimilar sample in a dissimilar set, an optimal metric parameter of the projection function is determined to obtain an optimal projection function; for each training sample in the training sample data set, a feature map of the training sample is determined, and normalization processing is performed to obtain a normalized feature map of the training sample; the training sample is mapped to the metric space using the optimal projection function to obtain a projection vector corresponding to the training sample, and an occlusion metric corresponding to the training sample is determined according to the projection vector corresponding to the training sample; a dynamic adjustment parameter corresponding to the training sample is determined according to the occlusion metric corresponding to the training sample, and a mask corresponding to the training sample is constructed according to the dynamic adjustment parameter corresponding to the training sample; the normalized feature map of the training sample is processed using the mask corresponding to the training sample to obtain a target feature map of the training sample; and a human target detection model is trained using the target feature map of the training sample. By learning the feature representation of human targets under different occlusion levels and paying more attention to the key features of human targets; by dynamically adjusting parameters, the model learns more generalized feature representations during the training process, and improves the generalization ability of the model when encountering unknown occlusion situations in practical applications, thereby improving the accuracy and robustness of human target detection in complex scenes. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] The present disclosure will be described in more detail below based on embodiments and with reference to the accompanying drawings:
[0047] Figure 1 A schematic diagram of a flow chart of a human target detection method provided by an embodiment of the present disclosure;
[0048] Figure 2 A schematic diagram of separable and inseparable samples in a projection space provided by an embodiment of the present disclosure;
[0049] Figure 3 An improved domain-adaptive DropBlock flow chart provided in an embodiment of the present disclosure;
[0050] Figure 4 A schematic diagram of mask construction provided in an embodiment of the present disclosure;
[0051] Figure 5 A schematic diagram of the structure of a human target detection device provided by an embodiment of the present disclosure;
[0052] Figure 6A flowchart of a method for detecting a human target is provided in accordance with another embodiment of the present disclosure.
[0053] In the drawings, the same reference numerals are used for the same components and the drawings are not drawn to scale. DETAILED DESCRIPTION
[0054] In order to enable those skilled in the art to better understand the technical solution of the present disclosure, and to fully understand and implement how the present disclosure applies technical means to solve technical problems and achieve the corresponding technical effects, the technical solution in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only embodiments of a part of the present disclosure, not all of the embodiments. The embodiments of the present disclosure and the various features in the embodiments can be combined with each other without conflict, and the technical solutions formed are all within the scope of protection of the present disclosure. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without making creative work should fall within the scope of protection of the present disclosure.
[0055] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product, or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products, or devices.
[0056] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0057] Embodiment 1
[0058] Figure 1 A flow chart of a human target detection method provided by an embodiment of the present disclosure. Figure 1 As shown, the human target detection method provided in this embodiment may include:
[0059] S101. Obtain a training sample data set. Each training sample in the training sample data set includes a sample and a corresponding label. The label is used to indicate the occlusion degree of a human target in the sample.
[0060] In order to enable the human target detection model to learn the feature representation of human targets under different occlusion degrees, the occlusion degree of the human target is first defined in this embodiment, and an occlusion degree is marked as a label for each human target in the training sample. These labels can provide important information for subsequent metric learning tasks.
[0061] In this embodiment, the degree of occlusion is defined according to each part of the body. Specifically, the label used to indicate the degree of occlusion of the human target in the sample may include three levels: slight occlusion, moderate occlusion, and severe occlusion. The body occlusion parts are divided into four parts: head, hands, legs, and torso. Slight occlusion means that the hands are occluded, moderate occlusion means that the head and legs are occluded, and severe occlusion means that the torso is occluded.
[0062] S102. For each query sample in the training sample data set, a projection function is used to map it to the metric space, and based on the distance from the query sample to the similar sample in the similar set being less than or equal to the distance from the query sample to the dissimilar sample in the dissimilar set, the optimal metric parameter of the projection function is determined to obtain the optimal projection function.
[0063] Assume that the training sample data set G includes N training samples, that is where y i ∈{1,2,3} (1, 2, 3 represent slight occlusion, moderate occlusion, and severe occlusion, respectively) is x i ∈R d The query sample can be any sample in the training sample dataset. The query sample x i Mapped to a common space (i.e., metric space), the formula is:
[0064]
[0065] Among them, z i For the query sample x i The corresponding projection vector in the metric space, R d represents a d-dimensional real vector, and θ is the metric parameter of the projection function.
[0066] Then we can get two samples x by parameterizing them with θ i and x j The distance function is:
[0067] d θ (x i ,x j )=|zi -z j |
[0068] For each query sample x i , its similarity set S i By label y i The corresponding dissimilar set D i By label and y i That is, in some optional implementations, the similar set consists of similar samples with the same label as the query sample, and the dissimilar set consists of dissimilar samples with different labels from the query sample.
[0069] In this embodiment, Adaptive Neighborhood Metric Learning (ANML) is used to determine the optimal metric parameter θ of the projection function. * , and get the optimal projection function. For example, the optimal metric parameter of the projection function can be determined based on the distance between the query sample and the similar sample in the similar set being less than or equal to the distance between the query sample and the dissimilar sample in the dissimilar set, and the optimal projection function can be obtained.
[0070] S103: For each training sample in the training sample data set, determine a feature map of the training sample, and perform normalization processing to obtain a normalized feature map of the training sample.
[0071] In this embodiment, the feature map I of the training sample is first determined (n) , and the obtained feature map is normalized according to the following expression:
[0072]
[0073] Get the normalized feature map I' corresponding to the training sample (n) .
[0074] S104, using an optimal projection function to map the training sample to a metric space, obtaining a projection vector corresponding to the training sample, and determining an occlusion metric corresponding to the training sample according to the projection vector corresponding to the training sample.
[0075] In this embodiment, the weight of each channel in the feature map is adjusted by the optimal metric parameter obtained in S102. Specifically, the optimal projection function is used. The training samples are mapped to the metric space to obtain the projection vector corresponding to the training samples, and the occlusion metric corresponding to the training samples is determined based on the projection vector corresponding to the training samples. For example, the norm of the projection vector can be used to represent the degree of occlusion of the training samples in the metric space. The norm gives the position information of the projection vector in the metric space. The higher the degree of occlusion of a sample, the larger the norm of its projection vector, indicating that it is farther away from similar samples in the metric space.
[0076] S105 . Determine a dynamic adjustment parameter corresponding to the training sample according to the occlusion metric corresponding to the training sample, and construct a mask corresponding to the training sample according to the dynamic adjustment parameter corresponding to the training sample.
[0077] After determining the occlusion metric corresponding to the training sample, the sigmoid function can be used to map the occlusion metric to an adjustment factor in the (0,1) interval, and then the adjustment factor is used to dynamically adjust the constant coefficient in the neighborhood adaptive DropBlock to obtain the dynamic adjustment parameter of DropBlock. Then, the mask is constructed using the Bernoulli distribution based on the dynamic adjustment parameter. The size of the mask M is the same as the feature map of the training sample. 0 in M means that the corresponding feature map element will be ignored (i.e., multiplied by 0), while 1 means that the element will be retained.
[0078] S106: Use the mask corresponding to the training sample to process the normalized feature map of the training sample to obtain the target feature map of the training sample.
[0079] After obtaining the mask corresponding to the training sample, the normalized feature map of the training sample can be processed using the mask. For example, the mask can be multiplied by the normalized feature map to obtain the target feature map of the training sample.
[0080] S107, using the target feature map of the training sample to train the human target detection model.
[0081] Finally, the target feature map of the training sample is used to train the human target detection model, so that the human target detection model can learn more generalized feature representations on the training data set containing different degrees of occlusion. These feature representations can help the human target detection model better handle human target detection problems under different occlusion conditions in practical applications. Finally, the trained human target detection model is used to analyze the surveillance video, which can effectively improve the accuracy of human target detection in complex scenes.
[0082] This embodiment first uses an adaptive neighborhood metric learning method to learn the feature representation of human target samples under different occlusion degrees, and then uses an improved neighborhood adaptive Dropblock method to perform mask operations on samples with different occlusion degrees during the training phase, so that the human target detection model learns the key features under different occlusion degrees and can better detect human targets in complex scenes.
[0083] The human target detection method provided by the present embodiment obtains a training sample data set, wherein each training sample in the training sample data set includes a sample and a corresponding label, and the label is used to indicate the degree of occlusion of the human target in the sample; for each query sample in the training sample data set, a projection function is used to map it to a metric space, and according to the distance from the query sample to a similar sample in a similar set being less than or equal to the distance from the query sample to a dissimilar sample in a dissimilar set, an optimal metric parameter of the projection function is determined to obtain an optimal projection function; for each training sample in the training sample data set, a feature map of the training sample is determined, and normalization processing is performed to obtain a normalized feature map of the training sample; the training sample is mapped to the metric space using the optimal projection function to obtain a projection vector corresponding to the training sample, and an occlusion metric corresponding to the training sample is determined according to the projection vector corresponding to the training sample; a dynamic adjustment parameter corresponding to the training sample is determined according to the occlusion metric corresponding to the training sample, and a mask corresponding to the training sample is constructed according to the dynamic adjustment parameter corresponding to the training sample; the normalized feature map of the training sample is processed using the mask corresponding to the training sample to obtain a target feature map of the training sample; and a human target detection model is trained using the target feature map of the training sample. By learning the feature representation of human targets under different occlusion levels and paying more attention to the key features of human targets; by dynamically adjusting parameters, the model learns more generalized feature representations during the training process, and improves the generalization ability of the model when encountering unknown occlusion situations in practical applications, thereby improving the accuracy and robustness of human target detection in complex scenes.
[0084] Embodiment 2
[0085] Based on the above embodiment, this embodiment will further explain in detail how to learn the feature representation of human target samples under different occlusion levels based on adaptive neighborhood metric learning.
[0086] Assume there are N labeled human target sample sets under occlusion where y i ∈{1,2,3} (1, 2, 3 represent human targets under slight, moderate and severe occlusion respectively) is x i ∈R d Corresponding labels, the samples are mapped to a common space through the projection function, and the formula is:
[0087]
[0088] Then we get two samples x through θ parameterization i and x j The distance function is:
[0089] d θ (x i ,x j )=|z i -z j |
[0090] For each query sample x i , its similarity set S i By label y i The corresponding dissimilar set D i By label and y i Different dissimilar samples are composed, and then the appropriate threshold θ is found through metric learning so that S i Similar samples in enter the first neighborhood A i In, so that D i Different samples in the second neighborhood B i .
[0091] like Figure 2 As shown, the blue circle represents the query sample x i , white circles represent separable similar samples, black circles represent inseparable similar samples, white squares represent separable dissimilar samples, and black squares represent inseparable dissimilar samples. Assume θ * is the projection function The optimal parameters of , then query sample x i The first neighbor A i and the second neighbor B i The projections are and According to A i and B i By definition, after projection, only samples similar to all are located among them. Similar samples outside and located Dissimilar samples within are inseparable samples.
[0092] For query x i , we can find two integers K a priori s and K d , let K s The most distant similar samples and K d The nearest dissimilar samples become inseparable samples.
[0093] Using symbols and Respectively represent {d θ (x i ,x j )|x j ∈X}. There are two integers K s and K d ,make and Thresholds are used to identify separable similar samples and different samples. Because the threshold determined by a single sample is less robust to noise, the influence of noise can be reduced by considering the distance of K samples and calculating their average or median, and a more stable and reliable threshold can be obtained. The specific formula for designing a more robust threshold is as follows:
[0094]
[0095] Where X is the sample set, α∈{-1,1} represents a coefficient, when α=1, it represents the maximum distance, and when α=-1, it represents the minimum distance. K is a positive integer, which represents the number of distances considered when calculating the threshold. The range of r(X,θ,x,Kα) is where Kα∈{±1,...,±|X|}. Therefore, there are two pairs (K1,α1) and (K2,α2) such that r(S i ,θ * ,x i ,K1α1) and r(D i ,θ * ,x i ,K2α2) approximate threshold and To identify separable samples, divide the samples into separable and inseparable ones, so as to focus on those samples that help improve model performance during training.
[0096] Through each x i The boundary of the neighborhood of is used to separate the separable dissimilar and similar samples. Therefore, the query sample x i The two types of neighborhoods are defined as:
[0097]
[0098] Then the goal of metric learning can be described by the following mathematical method:
[0099] r(S i ,θ * ,x,K1α1)≤r(D i ,θ * ,x,K2α2)
[0100] This inequality constrains the optimal solution θ * , that is, similar samples S i should be better than dissimilar samples D i Closer to query sample x i When K1α1 and K2α2 are determined to meet the goal of metric learning, they can be used to construct a metric learning formula because it constrains the optimal solution θ * , providing a clear optimization goal. Therefore, the expression of the adaptive neighborhood metric learning constructed at last is as follows:
[0101]
[0102] in, represents an optimization objective, l represents the loss function, κ is a subset of X, and Represents from the set D i The set of all possible combinations of K2 samples is selected from, where |κ| is the number of elements in κ. S and κ α is S consisting of K1 samples i A subset of , and κ d is composed of K2 samples. i is a subset of . g(α)(α∈{1,-1}) is an indicator function with g(1)=1 and g(-1)=0.
[0103] From the above content, it can be seen that when the parameters (K1, α1) and (K2, α2) are fixed, this method can automatically select S i and D i The human target samples in the case of separable occlusion are used to support the neighborhood A i and B i At the same time, solve the optimal metric parameter θ * , so that the model can learn the feature representation of human target samples under different occlusion levels, so as to facilitate further training of the model and improve the detection performance.
[0104] The human target detection method provided in this embodiment, based on the above-mentioned embodiment, further uses neighborhood adaptive metric learning to enable the human target detection model to learn the feature representation of human targets under different occlusion levels, pay more attention to the key features of human targets, and thus adaptively adjust the detection strategy.
[0105] Embodiment 3
[0106] Based on any of the above embodiments, this embodiment will further explain in detail how to use the improved neighborhood adaptive Dropblock method to perform mask operations on samples with different occlusion levels to help the model learn key features under different occlusion levels so as to better detect human targets.
[0107] For the task of human target detection under different degrees of occlusion, this embodiment proposes an improved neighborhood adaptive DropBlock method to train the human target detection model. Specifically, the weight of each channel in the feature map is adjusted by metric learning parameters and integrated into the dynamic γ calculation of DropBlock. Then some blocks are randomly selected in the feature map, and an adaptive mask (a binary map used to indicate which pixels are retained and which are discarded) is generated according to the pixel values, and the pixels in the top p percentiles are discarded in these blocks. This can effectively remove the areas with the highest activation values in the feature map, thereby encouraging the network to rely not only on the most significant features during training, but also to consider less prominent features to improve the generalization and robustness of the model. The flow chart is shown in the figure. Figure 3 shown.
[0108] During model training, for human target images with different degrees of occlusion, first obtain the corresponding feature representation through the method in the previous step, and then perform the current feature map I (n) Normalize and get a new feature map I' (n) , the specific formula is as follows:
[0109]
[0110] The original DropBlock algorithm sets a constant coefficient for all positions in the feature map, as shown in the following formula:
[0111]
[0112] Where keep_prob and block_size are mixed parameters that affect the feature map discarding frequency and the drop block size, and feat_size is the size of the feature map. Different from the original DropBlock, in the neighborhood adaptive DropBlock algorithm of this embodiment, a dynamic adjustment parameter is used instead of a constant coefficient γ, and the dynamic adjustment parameter depends on the optimal metric parameter θ * .
[0113] In the metric learning of the above embodiment, the feature representation of each sample is obtained by the projection function f θ (x i ) is mapped to the metric space to obtain z iIn this embodiment, determining the occlusion metric corresponding to the training sample according to the projection vector corresponding to the training sample may specifically include:
[0114] The occlusion metric corresponding to the training sample is determined according to the following expression:
[0115]
[0116] Among them, i represents the occlusion metric corresponding to the i-th training sample, z i represents the projection vector corresponding to the i-th training sample, z i,j Indicates z i The j-th element of , d represents the dimension of the projection vector.
[0117] Furthermore, in some embodiments, determining the dynamic adjustment parameter corresponding to the training sample according to the occlusion metric corresponding to the training sample may specifically include:
[0118] The dynamic adjustment parameter γ′ corresponding to the training sample is determined according to the following expression:
[0119] γ′=γ·α i
[0120] Among them, γ is a constant coefficient, α i is the adjustment factor corresponding to the i-th training sample;
[0121] Determine γ according to the following expression:
[0122]
[0123] Among them, keep_prob represents the parameter that affects the frequency of feature map discarding, block_size represents the parameter that affects the size of the feature map discarding block, and feat_size represents the size of the feature map;
[0124] Determine α according to the following expression i :
[0125]
[0126] Among them, β>0 and μ>0 are the parameters of the function g.
[0127] Then, the mask M corresponding to the training sample is constructed according to the dynamic adjustment parameters corresponding to the training sample. i,j~Bernoulli(γ) randomly selects some blocks in the feature map. In each block, the first p percentile elements of the selected feature map are set to 0, and the rest are set to 1. The size of the mask M is the same as the feature map, and all values are 1 initially. After applying the mask operation, a 0 in M means that the corresponding feature map element will be ignored (i.e. multiplied by 0), while a 1 means that the element will be retained. Figure 4 As shown in the figure, blue represents the target feature, green represents the valid seed area, and × represents that the corresponding element is set to 0.
[0128] Finally, the normalized feature map of the training sample is processed using the mask corresponding to the training sample to obtain the target feature map of the training sample, which may specifically include:
[0129] Multiply the normalized feature map of the training sample by the mask corresponding to the training sample to obtain the masked feature map of the training sample;
[0130] The masked feature map of the training sample is scaled according to the following expression to obtain the target feature map of the training sample:
[0131]
[0132] Among them, I” (n) It represents the feature map after the training sample is masked, count(M) represents the number of elements in the mask M, count_ones(M) represents the number of 1s in the mask M, I n Represents the target feature map of the training sample. By scaling factor This ensures that the expected value of the modified feature map is approximately the same as the expected value of the original feature map.
[0133] Finally, we get the scaled feature map I n , that is, the target feature map of the training sample, is represented as the original image feature after the neighborhood adaptive DropBlock processing, which is used in the model training process. In this way, the model can learn more generalized feature representations on data sets containing different degrees of occlusion. These feature representations can help the model better handle the problem of human detection under different occlusion conditions in practical applications.
[0134] The human target detection method provided in this embodiment, based on the above embodiment, further dynamically adjusts the parameters in the adaptive neighborhood DropBlock through the obtained optimal metric parameters, so that the model learns more generalized feature representations during the training process, and improves the generalization ability of the model when encountering unknown occlusion situations in actual applications, thereby improving the accuracy and robustness of human target detection in complex scenes.
[0135] Embodiment 4
[0136] Figure 5 Schematic diagram of the structure of a human target detection device provided by an embodiment of the present disclosure. Figure 5 As shown, the human target detection device 50 provided in this embodiment may include:
[0137] An acquisition module 501 is used to acquire a training sample data set, where each training sample in the training sample data set includes a sample and a corresponding label, where the label is used to indicate the degree of occlusion of a human target in the sample;
[0138] The learning module 502 is used to map each query sample in the training sample data set to the metric space using a projection function, and determine the optimal metric parameter of the projection function according to the distance between the query sample and the similar sample in the similar set being less than or equal to the distance between the query sample and the dissimilar sample in the dissimilar set, so as to obtain the optimal projection function;
[0139] A normalization module 503 is used to determine a feature map of each training sample in the training sample data set, and perform normalization processing to obtain a normalized feature map of the training sample;
[0140] A projection module 504 is used to map the training sample to the metric space using an optimal projection function to obtain a projection vector corresponding to the training sample, and determine an occlusion metric corresponding to the training sample according to the projection vector corresponding to the training sample;
[0141] A construction module 505 is used to determine a dynamic adjustment parameter corresponding to the training sample according to the occlusion metric corresponding to the training sample, and to construct a mask corresponding to the training sample according to the dynamic adjustment parameter corresponding to the training sample;
[0142] A processing module 506 is used to process the normalized feature map of the training sample using the mask corresponding to the training sample to obtain a target feature map of the training sample;
[0143] The training module 507 is used to train the human target detection model using the target feature map of the training sample.
[0144] The device of this embodiment can be used to perform Figure 1 The technical solution of the method embodiment shown has similar implementation principles and technical effects, which will not be repeated here.
[0145] In some embodiments, the projection module 504 is used to determine the occlusion metric corresponding to the training sample according to the projection vector corresponding to the training sample, which may specifically include:
[0146] The occlusion metric corresponding to the training sample is determined according to the following expression:
[0147]
[0148] Among them, i represents the occlusion metric corresponding to the i-th training sample, z i represents the projection vector corresponding to the i-th training sample, z i,j Indicates z i The j-th element of , d represents the dimension of the projection vector.
[0149] In some embodiments, the construction module 505 is used to determine the dynamic adjustment parameters corresponding to the training samples according to the occlusion metrics corresponding to the training samples, which may specifically include:
[0150] The dynamic adjustment parameter γ′ corresponding to the training sample is determined according to the following expression:
[0151] γ′=γ·α i
[0152] Among them, γ is a constant coefficient, α i is the adjustment factor corresponding to the i-th training sample;
[0153] Determine γ according to the following expression:
[0154]
[0155] Among them, keep_prob represents the parameter that affects the frequency of feature map discarding, block_size represents the parameter that affects the size of the feature map discarding block, and feat_size represents the size of the feature map;
[0156] Determine α according to the following expression i :
[0157]
[0158] Among them, β>0 and μ>0 are the parameters of the function g.
[0159] In some embodiments, the processing module 506 is used to process the normalized feature map of the training sample using the mask corresponding to the training sample to obtain the target feature map of the training sample, which may specifically include:
[0160] Multiply the normalized feature map of the training sample by the mask corresponding to the training sample to obtain the masked feature map of the training sample;
[0161] The masked feature map of the training sample is scaled according to the following expression to obtain the target feature map of the training sample:
[0162]
[0163] Among them, I” (n)It represents the feature map after the training sample is masked, count(M) represents the number of elements in the mask M, count_ones(M) represents the number of 1s in the mask M, I n Represents the target feature map of the training sample.
[0164] In some embodiments, the labels include slight occlusion, moderate occlusion, and severe occlusion, where slight occlusion means the hands are occluded, moderate occlusion means the head and legs are occluded, and severe occlusion means the torso is occluded.
[0165] In some embodiments, the similar set consists of similar samples having the same label as the query sample, and the dissimilar set consists of dissimilar samples having different labels from the query sample.
[0166] Embodiment 5
[0167] On the basis of the above embodiments, this embodiment provides an application example. In order to solve the problem of low detection accuracy of existing methods in complex scenarios, this application is based on adaptive neighborhood metric learning and improved neighborhood adaptive DropBlock technology to improve the detection performance of human target detection models. First, the feature representation of human target samples under different occlusion levels is learned using the adaptive neighborhood metric learning method, and then the improved neighborhood adaptive Dropblock method is used in the training stage to perform mask operations on samples with different occlusion levels, to help the model learn to better extract key features and detect human targets under different occlusion levels. The specific process is as follows: Figure 6 As shown, the following steps are included:
[0168] Step 1: Neighborhood Adaptive Metric Learning
[0169] In order to make the model learn the feature representation of human targets under different occlusion levels, we first need to define the occlusion level of human targets and label each human target sample with an occlusion level. These labels provide important information for the subsequent metric learning task. However, in actual scenarios, due to the combination and unevenness of occlusion (such as multiple parts of a human target being occluded at the same time or occlusion distributed in various parts of the body), even if the samples are clearly labeled with the occlusion level, there may still be some samples that are not highly distinguishable in the feature space, that is, they are inseparable to some extent, making it difficult for the model to learn the feature representation of these samples.
[0170] To address this problem, this solution adopts an adaptive neighborhood metric learning method. By adjusting the parameters of the distance metric, it learns a distance metric that can effectively distinguish between human target samples with different degrees of occlusion. These learned feature representations are also used for subsequent model training needs to improve the model's detection performance.
[0171] Step 1.1: Occlusion level definition
[0172] For the definition of different occlusion levels of human targets, this design defines the occlusion level according to different parts of the body. Specifically, the occlusion level is divided into three levels: slight, moderate, and severe, and the occluded parts of the body are divided into four parts: head, hands, legs, and torso. Arm occlusion is defined as slight occlusion, head and leg occlusion is defined as moderate occlusion, and torso occlusion is defined as severe occlusion. According to this definition, label categories are assigned to human target samples under occlusion.
[0173] Step 1.2: Adaptive Neighborhood Metric Learning
[0174] Assume there are N labeled human target sample sets under occlusion where y i ∈{1,2,3} (1, 2, 3 represent human targets under slight, moderate and severe occlusion respectively) is x i ∈R d Corresponding labels, the samples are mapped to a common space through the projection function, and the formula is:
[0175]
[0176] Then we get two samples x through θ parameterization i and x j The distance function is:
[0177] d θ (x i ,x j )=|z i -z j |(2)
[0178] For each query sample x i , its similarity set S i By label y i The corresponding dissimilar set D i By label and y i Different dissimilar samples are composed, and then the appropriate threshold θ is found through metric learning so that D i Different samples in the neighborhood B i , so that S i Similar samples in enter the neighborhood A i Inside.
[0179] like Figure 2 As shown, the blue circle represents the query sample x i, white circles represent separable similar samples, black circles represent inseparable similar samples, white squares represent separable dissimilar samples, and black squares represent inseparable dissimilar samples. Assume θ * is the projection function The optimal parameters of , then query sample x i Neighborhood A i and B i The projections are and According to A i and B i By definition, after projection, only samples similar to all are located among them. Similar samples outside and located Dissimilar samples within are inseparable samples.
[0180] For query x i , we can find two integers K a priori s and K d , let K s The most distant similar samples and K d The nearest dissimilar samples become inseparable samples.
[0181] Using symbols and Respectively represent {d θ (x i ,x j )|x j ∈X}. There are two integers K s and K d ,make and Thresholds are used to identify separable similar samples and different samples. Because the threshold determined by a single sample is less robust to noise, the influence of noise can be reduced by considering the distance of K samples and calculating their average or median, and a more stable and reliable threshold can be obtained. The specific formula for designing a more robust threshold is as follows:
[0182]
[0183] Where X is the sample set, α∈{-1,1} represents a coefficient, when α=1, it represents the maximum distance, and when α=-1, it represents the minimum distance. K is a positive integer, which represents the number of distances considered when calculating the threshold. The range of r(X,θ,x,Kα) is where Kα∈{±1,...,±|X|}. Therefore, there are two pairs (K1,α1) and (K2,α2) such that r(S i ,θ * ,xi ,K1α1) and r(D i ,θ * ,x i ,K2α2) approximate threshold and To identify separable samples, divide the samples into separable and inseparable ones, so as to focus on those samples that help improve model performance during training.
[0184] Through each x i The boundary of the neighborhood of is used to separate the separable dissimilar and similar samples. Therefore, the query sample x i The two types of neighborhoods are defined as:
[0185]
[0186] Then the goal of metric learning can be described by the following mathematical method:
[0187] r(S i ,θ * ,x,K1α1)≤r(D i ,θ * ,x,K2α2)(6)
[0188] This inequality constrains the optimal solution θ * , that is, similar samples S i should be better than dissimilar samples D i Closer to query sample x i When K1α1 and K2α2 are determined to meet the goal of metric learning, they can be used to construct a metric learning formula because it constrains the optimal solution θ * , providing a clear optimization goal. Therefore, the expression of the adaptive neighborhood metric learning constructed at last is as follows:
[0189]
[0190] in, represents an optimization objective, l represents the loss function, κ is a subset of X, and |κ d |=K2 and Represents from the set D i The set of all possible combinations of K2 samples is selected from, where |κ| is the number of elements in κ. S and κ α is S consisting of K1 samples i A subset of , and κ d is composed of K2 samples. i is a subset of . g(α)(α∈{1,-1}) is an indicator function with g(1)=1 and g(-1)=0.
[0191] From the above content, it can be seen that when the parameters (K1, α1) and (K2, α2) are fixed, this method can automatically select S i and D i The human target samples in the separable occlusion case are used to support the neighborhood A i and B i At the same time, solve the optimal metric parameter θ * , so that the model can learn the feature representation of human target samples under different occlusion levels, so as to facilitate further training of the model and improve the detection performance.
[0192] Step 2: Improved Neighborhood Adaptive DropBlock
[0193] For the task of human target detection under different degrees of occlusion, a training method for human target detection network based on improved neighborhood adaptive DropBlock is proposed. This method adjusts the weight of each channel in the feature map by metric learning parameters and integrates them into the dynamic γ calculation of DropBlock. Then, some blocks are randomly selected in the feature map, and an adaptive mask (a binary map that indicates which pixels are retained and which are discarded) is generated according to the pixel values. The pixels in the top p percentiles are discarded in these blocks. This can effectively remove the areas with the highest activation values in the feature map, thereby encouraging the network to rely not only on the most salient features during training, but also to consider less prominent features to improve the generalization ability and robustness of the model. The flowchart of this method is shown in the figure below. Figure 3 shown.
[0194] During model training, for human target images with different degrees of occlusion, first obtain the corresponding feature representation through the method in the previous step, and then perform the current feature map I (n) Normalize and get a new feature map I' (n) , the specific formula is as follows:
[0195]
[0196] The original DropBlock algorithm sets a constant coefficient for all positions in the feature map, as shown in the following formula:
[0197]
[0198] Among them, keep_prob and block_size are mixed parameters that affect the feature map discarding frequency and the drop block size, and feat_size is the size of the feature map. Different from the original DropBlock, in the proposed neighborhood adaptive DropBlock algorithm, γ is a dynamic coefficient that depends on the metric learning parameter θ * .
[0199] In the metric learning of step 1, the feature representation of each sample is obtained by the projection function f θ (x i ) is mapped to the metric space to obtain z i Therefore, this scheme uses z i The norm of is used as a metric to represent the degree of occlusion of the sample in the metric space. By calculating its L2 norm as the occlusion metric o i The formula is as follows:
[0200]
[0201] z i,j Indicates z i The L2 norm gives z i Position information in the metric space. In the context of human target detection under occlusion, we can define that the higher the degree of occlusion of a sample, the smaller its projection z i The larger the norm of , the farther it is from similar samples in the metric space.
[0202] Then define a function g to occlude the metric o i Mapped to the adjustment factor α i , adjustment factor α i is a factor used to adjust the gamma value in DropBlock, which is based on the occlusion metric of the sample o i Dynamically adjust gamma:
[0203]
[0204] Among them, β>0 and μ>0 are the parameters of the function g, which is a sigmoid function that converts o i Mapped to the (0,1) interval. i When α increases, i Approaching 1, the size of the DropBlock mask increases. Then use α i To adjust the parameter γ:
[0205] γ'=γ·α i (12)
[0206] Then construct the mask according to M i,j~Bernoulli(γ) randomly selects some blocks in the feature map. In each block, the first p percentile elements of the selected feature map are set to 0, and the rest are set to 1. The size of the mask M is the same as the feature map, and all values are 1 initially. After applying the mask operation, a 0 in M means that the corresponding feature map element will be ignored (i.e. multiplied by 0), while a 1 means that the element will be retained. Figure 4 As shown in the figure, blue represents the target feature, green represents the valid seed area, and × represents that the corresponding element is set to 0.
[0207] Then the normalized feature map I' (n) Multiplying with the mask M, the 0 position in the mask will set the corresponding value in the feature map to 0, while the 1 position will keep the original value. The formula is as follows:
[0208] I” (n) =I' (n) ×M (13)
[0209] The masked feature map I" (n) Scaling is performed to keep the overall numerical characteristics of the feature map similar to the original feature map. The specific formula is as follows:
[0210]
[0211] Among them, count(M) represents the number of elements in the mask, count_ones(M) represents the number of 1s in the mask, and the scaling factor This ensures that the expected value of the modified feature map is approximately the same as the expected value of the original feature map.
[0212] Finally, we get the scaled feature map I n , which is represented by the original image features after neighborhood adaptive DropBlock processing, is used in the model training process. In this way, the model can learn more generalized feature representations on data sets containing different degrees of occlusion, which can help the model better handle the problem of human detection under different occlusion conditions in practical applications.
[0213] In summary, the human target detection method provided by the present application enables the model to learn the feature representation of human targets under different occlusion degrees through neighborhood adaptive metric learning, and pays more attention to the key features of human targets, thereby adaptively adjusting the detection strategy; the parameters in the adaptive neighborhood DropBlock are dynamically adjusted through the obtained metric parameters, so that the model learns a more generalized feature representation during the training process, and improves the generalization ability of the model when encountering unknown occlusion situations in practical applications; by combining the above two technologies, the model is helped to learn to extract key features under different occlusion degrees, thereby improving the accuracy and robustness of human target detection in complex scenes in the maintenance depot workshop monitoring video.
[0214] Embodiment 6
[0215] On the basis of the above embodiments, this embodiment provides a computer device, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of the method described in the above embodiments.
[0216] In some implementations of this embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method described in the above embodiment are implemented.
[0217] In some implementations of this embodiment, a computer program product is provided, including a computer program, which implements the steps of the method described in the above embodiment when executed by a processor.
[0218] The processor may include, but is not limited to, one or more processors or microprocessors, etc. Each processor may be an application specific integrated circuit (ASIC), a digital signal processor (DSP), a digital signal processing device (DSPD), a programmable logic device (PLD), a field programmable gate array (FPGA), a controller, a microcontroller, a microprocessor or other electronic components to execute the methods in the above embodiments.
[0219] The computer-readable storage medium may be implemented by any type of volatile or non-volatile storage device or a combination thereof, and the computer-readable storage medium may include but is not limited to, for example, random access memory (RAM), read-only memory (ROM), flash memory, EPROM memory, EEPROM memory, registers, computer storage media (e.g., hard disk, floppy disk, solid-state drive, removable disk, CD-ROM, DVD-ROM, Blu-ray disc, etc.).
[0220] The computer-readable storage medium may also store at least one computer executable program / instruction, which may be, for example, a computer-readable instruction. The computer-readable storage medium includes, but is not limited to, for example, a volatile memory and / or a non-volatile memory. The volatile memory may include, for example, a random access memory (RAM) and / or a cache memory (cache), etc. The computer-readable storage medium may include, for example, a read-only memory (ROM), a hard disk, a flash memory, etc. For example, a non-transitory computer-readable storage medium may be connected to a computing device such as a computer, and then, when the computing device runs the computer-readable instructions stored on the computer-readable storage medium, the various methods described above may be performed.
[0221] In addition, the computer device may also include (but not limited to) a data bus, an input / output (I / O) bus, a display, and input / output devices (eg, keyboard, mouse, speaker, etc.), etc.
[0222] The processor may communicate with external devices via an I / O bus via a wired or wireless network.
[0223] In one embodiment, the at least one computer executable instruction may also be compiled into or constitute a software product / computer program product, wherein one or more computer executable instructions are executed by a processor to perform the various functions and / or method steps in the embodiments described in the present technology.
[0224] In the embodiments provided in the present disclosure, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the above-mentioned module, program segment or a part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0225] It should be noted that in the present disclosure, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element limited by the sentence "includes a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0226] Although the embodiments disclosed in the present disclosure are as above, the above contents are only embodiments adopted for facilitating the understanding of the present disclosure and are not intended to limit the present disclosure. Any technician in the technical field to which the present disclosure belongs can make any modifications and changes in the form and details of the implementation without departing from the spirit and scope disclosed in the present disclosure, but the scope of patent protection of the present disclosure shall still be subject to the scope defined in the attached claims.
Claims
1. A human target detection method, characterized in that: include: Acquire a training sample data set, wherein each training sample in the training sample data set includes a sample and a corresponding label, and the label is used to indicate the degree of occlusion of a human target in the sample; For each query sample in the training sample data set, a projection function is used to map it to a metric space, and according to the distance between the query sample and a similar sample in a similar set being less than or equal to the distance between the query sample and a dissimilar sample in a dissimilar set, an optimal metric parameter of the projection function is determined to obtain an optimal projection function; For each training sample in the training sample data set, determining a feature map of the training sample, and performing normalization processing to obtain a normalized feature map of the training sample; Mapping the training sample to a metric space using the optimal projection function to obtain a projection vector corresponding to the training sample, and determining an occlusion metric corresponding to the training sample according to the projection vector corresponding to the training sample; Determining a dynamic adjustment parameter corresponding to the training sample according to the occlusion metric corresponding to the training sample, and constructing a mask corresponding to the training sample according to the dynamic adjustment parameter corresponding to the training sample; Processing the normalized feature map of the training sample using the mask corresponding to the training sample to obtain the target feature map of the training sample; The target feature map of the training sample is used to train the human target detection model.
2. The method according to claim 1, characterized in that: The determining the occlusion metric corresponding to the training sample according to the projection vector corresponding to the training sample includes: The occlusion metric corresponding to the training sample is determined according to the following expression: Among them, i represents the occlusion metric corresponding to the i-th training sample, z i represents the projection vector corresponding to the i-th training sample, z i,j Indicates z i The j-th element of , d represents the dimension of the projection vector.
3. The method according to claim 2, characterized in that The determining the dynamic adjustment parameter corresponding to the training sample according to the occlusion metric corresponding to the training sample includes: The dynamic adjustment parameter γ′ corresponding to the training sample is determined according to the following expression: γ′=γ·α i Among them, γ is a constant coefficient, α i is the adjustment factor corresponding to the i-th training sample; Determine γ according to the following expression: Among them, keep_prob represents the parameter that affects the frequency of feature map discarding, block_size represents the parameter that affects the size of the feature map discarding block, and feat_size represents the size of the feature map; Determine α according to the following expression i : Among them, β>0 and μ>0 are the parameters of the function g.
4. The method according to claim 1, characterized in that The step of processing the normalized feature map of the training sample using the mask corresponding to the training sample to obtain the target feature map of the training sample includes: Multiplying the normalized feature map of the training sample by the mask corresponding to the training sample to obtain a masked feature map of the training sample; The masked feature map of the training sample is scaled according to the following expression to obtain the target feature map of the training sample: Among them, I” (n) It represents the feature map after the training sample is masked, count(M) represents the number of elements in the mask M, count_ones(M) represents the number of 1s in the mask M, I n Represents the target feature map of the training sample.
5. The method according to any one of claims 1 to 4, characterized in that: The labels include slight occlusion, moderate occlusion and severe occlusion, wherein slight occlusion refers to that the hands are occluded, moderate occlusion refers to that the head and legs are occluded, and severe occlusion refers to that the torso is occluded.
6. The method according to any one of claims 1 to 4, characterized in that: The similar set consists of similar samples having the same label as the query sample, and the dissimilar set consists of dissimilar samples having different labels from the query sample.
7. A human target detection device, characterized in that: include: An acquisition module is used to acquire a training sample data set, each training sample in the training sample data set includes a sample and a corresponding label, and the label is used to indicate the degree of occlusion of a human target in the sample; A learning module, for mapping each query sample in the training sample data set to a metric space using a projection function, and determining an optimal metric parameter of the projection function according to the distance between the query sample and a similar sample in a similar set being less than or equal to the distance between the query sample and a dissimilar sample in a dissimilar set, so as to obtain an optimal projection function; A normalization module, used for determining a feature map of each training sample in the training sample data set, and performing normalization processing to obtain a normalized feature map of the training sample; A projection module, used to map the training sample to a metric space using the optimal projection function, obtain a projection vector corresponding to the training sample, and determine an occlusion metric corresponding to the training sample according to the projection vector corresponding to the training sample; A construction module, used to determine the dynamic adjustment parameter corresponding to the training sample according to the occlusion metric corresponding to the training sample, and to construct the mask corresponding to the training sample according to the dynamic adjustment parameter corresponding to the training sample; A processing module, used to process the normalized feature map of the training sample using the mask corresponding to the training sample to obtain a target feature map of the training sample; The training module is used to train the human target detection model using the target feature map of the training sample.
8. A computer device comprising a memory, a processor and a computer program stored in the memory, characterized in that: The processor executes the computer program to implement the steps of the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.