A complex scene pedestrian detection method, system and electronic device

By improving the Deformable DETR model and combining a dehomogenized encoder generator with a simplified decoder structure, the problems of repeated detection, false detection, and missed detection in pedestrian detection in complex scenarios are solved, achieving higher detection accuracy and efficiency.

CN117975499BActive Publication Date: 2026-11-24YUNNAN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311259629.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-27
Publication Date
2026-11-24
Estimated Expiration
2043-09-27

AI Technical Summary

Technical Problem

In complex scenarios, pedestrian detection faces challenges such as high occlusion rates leading to duplicate detections, false positives, and missed detections, as well as insufficient detection accuracy and speed.

Method used

A pedestrian detection model based on Deformable DETR is adopted. It is trained by L1 position loss and Giou comprehensive prediction quality loss, combined with a dehomogenized encoder generator and a simplified aligned decoder structure, including a multi-head cross attention layer and a feedforward neural network, to reduce the number of model parameters and improve the deduplication capability.

Benefits of technology

It improves the accuracy and efficiency of pedestrian detection in complex scenarios, reduces the false negative rate, increases the average precision, and reduces the number of parameters, demonstrating strong robustness.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117975499B_ABST
    Figure CN117975499B_ABST
Patent Text Reader

Abstract

This invention provides a method, system, and electronic device for pedestrian detection in complex scenes, belonging to the field of computer vision. The method includes: acquiring images of pedestrians to be detected; determining the position and category of pedestrians in the images based on a pedestrian detection model; the pedestrian detection model is constructed based on Deformable DETR and trained using a training sample set, based on L1 position loss and Giou comprehensive prediction quality loss; the pedestrian detection model includes a feature extraction network, a first alignment decoder, a dehomogenization encoder generator, a second alignment decoder, and a prediction module connected in sequence; the first alignment decoder is also connected to the second alignment decoder and the prediction module; both the first and second alignment decoders include a multi-head cross-attention layer and a feedforward neural network. This invention improves the accuracy and efficiency of pedestrian detection in complex scenes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer vision, and in particular to a method, system, and electronic device for pedestrian detection in complex scenes based on an improved Deformable DETR. Background Technology

[0002] With the development of cutting-edge fields such as autonomous driving, intelligent transportation, and intelligent video surveillance, pedestrian detection, as one of the key technologies leading to these advancements, has become a research hotspot. Pedestrian detection utilizes computer vision technology to determine the presence and precise location of pedestrians in images or video sequences. This technology can be combined with pedestrian tracking and pedestrian re-identification technologies for applications in vehicle driver assistance systems, intelligent robots, intelligent video surveillance, human behavior analysis, and intelligent transportation. For example, in the field of vehicle driver assistance systems, radar cameras and sensors are used to detect pedestrians and brake in time to reduce accident injuries.

[0003] Traditional pedestrian detection algorithms mainly construct features by calculating histogram of oriented gradients (HOG) and combine them with a support vector machine (SVM) classifier to achieve target detection. Although this method solves some problems such as local occlusion, it requires a large number of manually set parameters, which means it can only be applied to fixed scenarios, and its detection accuracy and efficiency are significantly insufficient.

[0004] With the widespread application of deep learning in computer vision, the performance of deep learning-based detectors has been significantly improved compared to traditional methods. For pedestrian detection in non-dense scenes, two-stage detection models represented by Faster R-CNN and one-stage detection models represented by YOLO have achieved industrial-grade detection results. Both of these can be classified as anchor-based detection models. However, anchor-based detection models generally use post-processing based on greedy algorithms such as non-maximum suppression (NMS), which makes it easy to miss or duplicate detections.

[0005] In addition, there are end-to-end query-based detectors that treat object detection as a set prediction problem. The detection network integrates deduplication and other post-processing work into the network to learn deduplication capabilities end-to-end. Query-based models are represented by two main categories: convolution-based Sparse RCNN and transformer-based DETR. During the training phase, bipartite graph matching is used to learn deduplication capabilities within the network, achieving end-to-end training and prediction. This avoids the need for manual setting of anchors and NMS and other pre- and post-processing work, resulting in better performance. Among them, deformable DETR, an improvement on the DETR model, incorporates local prior features of the image into the attention mechanism and fuses multi-scale features. It achieved an average accuracy of 91.5% and a false negative rate of 43.7% on the CrowdHuman dense pedestrian detection dataset. However, its actual detection performance is still not satisfactory.

[0006] In summary, pedestrian detection in dense scenes still faces three main problems: (1) In dense scenes with high occlusion rates, duplicate detection will occur for the same target; (2) Due to the small visible area of ​​pedestrians in dense scenes with high occlusion, false detection and missed detection will occur; (3) In dense scenes, the overall performance of the detector in terms of accuracy and speed is insufficient. Summary of the Invention

[0007] The purpose of this invention is to provide a method, system, and electronic device for pedestrian detection in complex scenes, which can improve the accuracy and efficiency of pedestrian detection in complex scenes.

[0008] To achieve the above objectives, the present invention provides a pedestrian detection method for complex scenes, comprising the following steps.

[0009] Obtain images of pedestrians to be detected.

[0010] The pedestrian detection model determines the location and category of pedestrians in the pedestrian image to be detected. The pedestrian detection model is built based on Deformable DETR and trained using a training sample set, based on L1 position loss and Giou comprehensive prediction quality loss. The training sample set includes multiple sample images and position and category labels in each sample image. The pedestrian detection model includes a feature extraction network, a first alignment decoder, a dehomogenization encoder generator, a second alignment decoder, and a prediction module connected in sequence. The first alignment decoder is also connected to the second alignment decoder and the prediction module. Both the first alignment decoder and the second alignment decoder include a multi-head cross-attention layer and a feedforward neural network.

[0011] To achieve the above objectives, the present invention also provides a pedestrian detection system for complex scenes, including an image acquisition unit and a detection unit.

[0012] The image acquisition unit is used to acquire images of the pedestrians to be detected.

[0013] A detection unit, connected to the image acquisition unit, is used to determine the position and category of pedestrians in the pedestrian image to be detected based on a pedestrian detection model. The pedestrian detection model is constructed based on DeformableDETR and trained using a training sample set, based on L1 position loss and Giou comprehensive prediction quality loss. The training sample set includes multiple sample images and position and category labels in each sample image. The pedestrian detection model includes a feature extraction network, a first alignment decoder, a dehomogenization encoder generator, a second alignment decoder, and a prediction module connected in sequence. The first alignment decoder is also connected to the second alignment decoder and the prediction module. Both the first alignment decoder and the second alignment decoder include a multi-head cross-attention layer and a feedforward neural network.

[0014] To achieve the above objectives, the present invention also provides an electronic device, including a memory and a processor, wherein the memory is used to store a computer program, and the processor runs the computer program to enable the electronic device to perform the above-described pedestrian detection method for complex scenes.

[0015] According to specific embodiments provided by the present invention, the following technical effects are disclosed: The present invention is based on Deformable DETR and uses a training sample set to train a pedestrian detection model based on L1 position loss and Giou comprehensive prediction quality loss. The false negative rate of the pedestrian detection model is reduced by the Giou comprehensive prediction quality loss. The pedestrian detection model includes a feature extraction network, a first alignment decoder, a dehomogenization encoder generator, a second alignment decoder, and a prediction module connected in sequence. Both the first alignment decoder and the second alignment decoder include a multi-head cross-attention layer and a feedforward neural network. The dehomogenization encoder generator improves the ability of the pedestrian detection model to remove duplicate predictions. By discarding the self-attention layer of the decoder in Deformable DETR and retaining only the multi-head cross-attention layer and the feedforward neural network, the number of parameters of the pedestrian detection model is reduced, thereby improving the accuracy and efficiency of the pedestrian detection model in complex scenes. Attached Figure Description

[0016] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0017] Figure 1 The flowchart of the pedestrian detection method for complex scenes provided by the present invention.

[0018] Figure 2 This is a schematic diagram of the pedestrian detection model.

[0019] Figure 3 This is a schematic diagram of the structure of the dehomogenization encoding generator.

[0020] Figure 4 This is a flowchart of the pedestrian detection model training process.

[0021] Figure 5 This is a schematic diagram of the pedestrian detection system for complex scenes provided by the present invention.

[0022] Symbol explanation: 1-Image acquisition unit, 2-Detection unit. Detailed Implementation

[0023] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0024] The purpose of this invention is to provide a pedestrian detection method, system, and electronic device for complex scenes, which solves problems such as pedestrians occluding each other, small visible areas, dense crowds, and excessively large parameters of actual deployed detectors in complex scenes.

[0025] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0026] Example 1: As Figure 1 As shown in the figure, this embodiment provides a pedestrian detection method for complex scenes, which includes the following two steps.

[0027] Step 100: Obtain the image of the pedestrian to be detected.

[0028] Step 200: Determine the location and category of pedestrians in the pedestrian image to be detected based on the pedestrian detection model.

[0029] Specifically, the pedestrian detection model is built based on Deformable DETR and trained using a training sample set, employing L1 position loss and Giou comprehensive prediction quality loss. The training sample set includes multiple sample images and their position and category labels. As a specific implementation, the training sample set uses the dense pedestrian detection dataset CrowdHuman.

[0030] This invention first improves the structure of Deformable DETR based on the PyTorch deep learning framework to construct a pedestrian detection model. The structure of the pedestrian detection model is as follows: Figure 2 As shown, the system includes a feature extraction network, a first alignment decoder, a dehomogenization encoder generator, a second alignment decoder, and a prediction module connected in sequence. The first alignment decoder is also connected to the second alignment decoder and the prediction module. The feature extraction network includes a backbone network and six encoders connected in sequence. Both the first and second alignment decoders include a multi-head cross-attention layer and a feedforward neural network.

[0031] This invention, based on the PyTorch deep learning framework, adds a dehomogenization encoder generator to the decoder structure of Deformable DETR. The dehomogenization encoder generator enhances the deduplication capability of the pedestrian detection model while improving the encoder's training efficiency. For example... Figure 3 The diagram shows the specific structure of the dehomogenization encoding generator.

[0032] Replacing the Deformable DETR decoder with an aligned decoder reduces the number of decoder layers from six to just two aligned layers. This simplified decoder structure reduces the number of model parameters without compromising accuracy. The self-attention layer between query elements in the original Deformable DETR decoder structure is removed. The single aligned decoder retains only the deformable cross-attention layer and the feedforward neural network, further reducing the number of parameters in the pedestrian detection model without affecting its accuracy.

[0033] Furthermore, step 200 specifically includes the following six steps (21) to (26).

[0034] (21) The features of the pedestrian image to be detected are extracted through the feature extraction network to obtain a feature vector map, and multiple preliminary query elements are determined based on the feature vector map. Each preliminary query element corresponds to a pedestrian.

[0035] Specifically, the existing pre-trained backbone network (such as Resnet50, Swintransformer, etc.) and 6-layer encoder are first used to encode the features of the pedestrian image to be detected. The resulting feature vector map is used to obtain the confidence prediction score of each feature vector through a fully connected classification head. Multiple preliminary query elements are initialized according to the confidence prediction scores in descending order.

[0036] (22) Each preliminary query element is decoded by the first alignment decoder to obtain multiple corresponding preliminary decoded query elements.

[0037] (23) The prediction module performs bounding box regression on each preliminary decoded query element to determine the position of the pedestrian in the pedestrian image to be detected.

[0038] (24) The dehomogenization query element is generated for each preliminary decoded query element by the dehomogenization encoder generator.

[0039] The dehomogenization encoding generator process consists of two stages: The first stage uses the De-homo ID Encoder module to generate a De-homo ID for each initially decoded query element, enabling difference information learning—essentially, the initial difference information of the initially decoded query element. The De-homo ID Encoder module comprises a linear transformation layer, a ReLU activation function, another linear transformation layer, and a normalization layer, connected sequentially. In the second stage, an asymmetric difference fusion mechanism integrates the difference information of surrounding initially decoded query elements. While generating the dehomogenized difference information (De-Homo Encoding), it also facilitates information communication between initially decoded query elements, replacing self-attention between queries.

[0040] Specifically, for any initially decoded query element, the initially decoded query element is sequentially encoded and normalized to obtain its initial difference information. A fully connected layer is used to determine the confidence prediction result and location prediction result for each initially decoded query element. Based on the initial difference information, confidence prediction result, and location prediction result of each initially decoded query element, max pooling is used to determine the de-homogenized difference information for each initially decoded query element. For any initially decoded query element, based on the initially decoded query element and its de-homogenized difference information, the de-homogenized query element is determined.

[0041] In this embodiment, the formula is used. Determine the preliminary difference information for the i-th preliminary decoded query element; where, For the initial difference information of the i-th pre-decoded query element, qi For the i-th initially decoded query element, Used to apply q through two fully connected layers and an activation function i Encoding is performed; LN() stands for LayerNorm, used to encode... Normalization is performed to provide a unified calculation benchmark for subsequent difference calculations.

[0042] Using formula Determine the dehomogenization difference information of the i-th preliminary decoded query element; where, Maxpooling() is the maximum pooling operation used to obtain the homogenization difference information for the i-th initially decoded query element. This provides the initial difference information for the i-th pre-decoded query element. For the initial difference information of the j-th pre-decoded query element, c i For the confidence prediction result of the i-th preliminary decoded query element, c j For the confidence prediction result of the j-th preliminary decoded query element, b i b is the position prediction result of the i-th preliminary decoded query element. j For the position prediction result of the j-th preliminary decoded query element, C low A pre-set minimum confidence threshold is used to avoid a large amount of low-confidence noise significantly increasing the computational complexity of the algorithm. This confidence-based asymmetric relationship can further enhance differentiated information, that is, each query unidirectionally fuses surrounding predictions with higher confidence than itself. As an indicator function, in c j >c i When the value is 1, in c j ≤c i When the value is 0, IoU() is the intersection-union ratio function.

[0043] Using formula Determine the homogenized query element for the i-th preliminary decoded query element; where, For the i-th initially decoded query element, q is the dehomogenized query element. i For the i-th initially decoded query element, For the i-th preliminary decoded query element, the dehomogenization difference information is used. ffn() is a fully connected linear transformation layer, consisting of two fully connected layers and one activation layer.

[0044] (25) Each de-homogenized query element is decoded by the second alignment decoder to obtain multiple corresponding final decoded query elements. The de-homogenized query elements are input into the second alignment decoder to obtain confidence predictions, so as to solve the problem that homogenized query elements make it difficult for the model to learn deduplication capabilities.

[0045] (26) The confidence score of each final decoded query element is determined by the prediction module to obtain the category of the pedestrian in the pedestrian image to be detected.

[0046] Specifically, the prediction module outputs a position vector and a class vector through two fully connected headers, respectively, and plots the position vector and class vector on the pedestrian image to be detected to obtain the final detection result.

[0047] The training process of the pedestrian detection model is as follows: 15,000 sample images from the dense pedestrian detection dataset CrowdHuman are input into the pedestrian detection model for training. During training, the encoder loss is replaced with a Giou-aware loss for supervised training, i.e., the Giou comprehensive prediction quality loss. The feature vector map output by the encoder is processed by a fully connected classification head to obtain the confidence prediction score of each feature vector. Then, the Topk algorithm is used to select the feature vector with the highest confidence prediction score to initialize a fixed number of queries, called the Giou-aware query selector. During training, a standard ResNet-50 pre-trained on ImageNet is used as the backbone network, and the AdamW optimizer is used to train the model, with momentum set to 0.9 and weight decay set to 0.0001. The learning rate of the model is 0.0002, and the learning rate of the backbone network is 0.00002. The batch size is 8, and the number of heads is set to 8. Training is performed using 4 Graphics Processing Units (GPUs) for 55 epochs. The model parameters with the minimum loss are selected as the final parameters to obtain the final pedestrian detection model. Figure 4 The image shows the training process of the pedestrian detection model.

[0048] To verify the effectiveness of this invention, the batch size was uniformly set to 8 samples and the training epochs to 50. The model was trained using the AdamW optimizer with a momentum of 0.9 and a weight decay of 0.0001. The learning rate of the model and the backbone network was both 0.0002. Note that the number of heads was set to 8, and training was performed using 4 GPUs. All end-to-end detectors used in the experiments employed the default 6-layer encoder and 6-layer decoder configurations. Only a 6-layer encoder and 3-layer decoder were used, while other hyperparameter settings remained consistent with deformable DETR. The test results demonstrate that this invention can achieve better detection performance with fewer parameters.

[0049] Giou's comprehensive prediction of quality loss To address the mismatch between prediction confidence and IOU (i.e., candidate predictions with high IOU but low confidence scores), a joint quality score of GIOU and confidence is considered. This prevents the Topk algorithm from filtering out initial query elements with low confidence and high IOU from the original network. Combining the idea of ​​Focal Loss to focus more on learning from difficult samples, the final supervised loss of the improved encoder in the last stage, i.e., the loss during the pedestrian detection model training process, is:

[0050]

[0051]

[0052] in, This represents the loss value used during the training of the pedestrian detection model. For L1 position loss, To predict the overall mass loss for Giou, The prediction results of the pedestrian detection model, including location prediction values. and category predictions y represents the label, including the location label b and the category label c. The predicted value for the location of the prediction box. The coordinates of the predicted bounding box. The width of the prediction box. Let b be the height of the predicted bounding box, b = (x', y', w', h') be the location label of the ground truth bounding box, (x', y') be the location coordinates of the ground truth bounding box, w' be the width of the ground truth bounding box, h' be the height of the ground truth bounding box, and Giou be the Giou value of the predicted location value (predicted bounding box) and the location label (ground truth bounding box). || represents taking the absolute value. ω represents the predicted score output by the feature extraction network, and ω is the weight. Similar to the Focal Loss loss function, it is used to determine the level of attention given to easy and difficult samples. γ is an adjustable factor, γ > 0. For samples whose predicted values ​​are very close to the true values, ω approaches 0. For difficult samples with inaccurate predictions, ω will have a higher weight.

[0053] This invention uses a three-layer alignment decoder during the training process of the pedestrian detection model. In testing and practical applications, only the first two layers of alignment decoders, namely the first alignment decoder and the second alignment decoder, are used. This reduces the number of parameters in the pedestrian detection model without affecting its accuracy. Finally, the pedestrian detection model outputs the detection results of the pedestrian image to be detected, namely the pedestrian detection box and confidence prediction, to determine the location and category of the pedestrian.

[0054] This invention makes a series of adaptive improvements to deformable DETR, making it suitable for pedestrian detection in complex scenes. Specifically, it reduces the false negative rate of the pedestrian detection model through Giou-aware loss, improves the ability of the pedestrian detection model to remove duplicate predictions through a dehomogenized encoder generator, and reduces the number of parameters in the pedestrian detection model through an aligned and simplified decoder structure. This results in improved performance in objective metrics such as Average Precision (AP) and False Negative Rate (MR). -2 Significant improvements were achieved in performance, and strong robustness was demonstrated across scenarios with varying densities. The final test results showed a lower false negative rate (MR) compared to the original two-stage deformable DETR model. -2 The accuracy was reduced by 4%, the average precision was improved by 0.8%, and the number of parameters was reduced by 8%. This improved the overall detection performance of the pedestrian detection model.

[0055] Example 2: In order to execute the method corresponding to Example 1 above and achieve the corresponding functions and technical effects, a pedestrian detection system for complex scenes is provided below.

[0056] like Figure 5 As shown, the pedestrian detection system for complex scenes provided in this embodiment includes an image acquisition unit and a detection unit.

[0057] The image acquisition unit is used to acquire images of pedestrians to be detected.

[0058] The detection unit is connected to the image acquisition unit, and the detection unit is used to determine the position and category of pedestrians in the pedestrian image to be detected based on the pedestrian detection model.

[0059] The pedestrian detection model is built on Deformable DETR and trained using a training sample set, employing L1 location loss and Giou comprehensive prediction quality loss. The training sample set includes multiple sample images and location and category labels for each image.

[0060] The pedestrian detection model comprises a feature extraction network, a first alignment decoder, a dehomogenization encoder generator, a second alignment decoder, and a prediction module, connected in sequence. The first alignment decoder is also connected to the second alignment decoder and the prediction module. Both the first and second alignment decoders include a multi-head cross-attention layer and a feedforward neural network.

[0061] Compared with the prior art, the pedestrian detection system for complex scenes provided in this embodiment has the same beneficial effects as the pedestrian detection method for complex scenes provided in Embodiment 1, and will not be repeated here.

[0062] Example 3: This example provides an electronic device, including a memory and a processor. The memory is used to store computer programs, and the processor runs the computer programs to enable the electronic device to execute the pedestrian detection method for complex scenes in Example 1.

[0063] Alternatively, the aforementioned electronic device may be a server.

[0064] In addition, embodiments of the present invention also provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the pedestrian detection method for complex scenes in Embodiment 1.

[0065] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.

[0066] This document uses specific examples to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. Furthermore, those skilled in the art will recognize that, based on the ideas of the present invention, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. A pedestrian detection method for complex scenes, characterized in that, The pedestrian detection method for complex scenes includes: Acquire images of the pedestrians to be detected; The pedestrian detection model determines the location and category of pedestrians in the pedestrian image to be detected. The pedestrian detection model is built based on Deformable DETR and trained using a training sample set, based on L1 position loss and Giou comprehensive prediction quality loss. The training sample set includes multiple sample images and position and category labels in each sample image. The pedestrian detection model includes a feature extraction network, a first alignment decoder, a dehomogenization encoder generator, a second alignment decoder, and a prediction module connected in sequence. The first alignment decoder is also connected to the second alignment decoder and the prediction module. Both the first alignment decoder and the second alignment decoder include a multi-head cross-attention layer and a feedforward neural network. Specifically, determining the location and category of pedestrians in the pedestrian image to be detected based on a pedestrian detection model includes: The feature extraction network extracts features from the pedestrian image to be detected, resulting in a feature vector map. Based on the feature vector map, multiple preliminary query elements are determined; each preliminary query element corresponds to a pedestrian. The first alignment decoder decodes each preliminary query element to obtain multiple corresponding preliminary decoded query elements. The prediction module performs bounding box regression on each initially decoded query element to determine the position of the pedestrian in the pedestrian image to be detected. The dehomogenization encoding generator generates a dehomogenized query element for each preliminary decoded query element, specifically including: for any preliminary decoded query element, sequentially encoding and normalizing the preliminary decoded query element to obtain preliminary difference information; determining the confidence prediction result and position prediction result of each preliminary decoded query element through a fully connected layer; determining the dehomogenization difference information of each preliminary decoded query element using max pooling based on the preliminary difference information, confidence prediction result, and position prediction result; and for any preliminary decoded query element, determining the dehomogenized query element based on the preliminary decoded query element and its dehomogenization difference information. The second alignment decoder decodes each dehomogenized query element to obtain multiple final decoded query elements. The prediction module determines the confidence score of each final decoded query element to obtain the category of the pedestrian in the pedestrian image to be detected.

2. The pedestrian detection method for complex scenes according to claim 1, characterized in that, The feature extraction network includes a backbone network and six encoders connected in sequence.

3. The pedestrian detection method for complex scenes according to claim 1, characterized in that, The following formula is used to determine the first i Preliminary difference information for each initially decoded query element: ; in, For the first i Preliminary difference information for the initial decoded query elements. q i For the first i A preliminary decoded query element, Used to pass through two fully connected layers and an activation function to q i Encode, LayerNorm is used to... Normalize.

4. The pedestrian detection method for complex scenes according to claim 1, characterized in that, The following formula is used to determine the first i Initial decoding of the dehomogenization difference information of the query element: ; in, For the first i The initial decoding of the homogenization difference information of the query element. For max pooling operation, For the first i Preliminary difference information for the initial decoded query elements. For the first j Preliminary difference information for the initial decoded query elements. c i For the first i The initial confidence prediction results for the decoded query element. c j For the first j The initial confidence prediction results for the decoded query element. b i For the first i Preliminary decoding results of the predicted position of the query element. b j For the first j Preliminary decoding results of the predicted position of the query element. C low The pre-set minimum confidence threshold, For indicator functions, in c j > c i Take 1 at time, in c j ≤ c i Take 0 at time, It is the intersection-union ratio function.

5. The pedestrian detection method for complex scenes according to claim 1, characterized in that, The following formula is used to determine the first i De-homogenizing query elements from the initial decoded query elements: ; in, For the first i A preliminary decoding of the query elements to remove homogenized query elements. q i For the first i A preliminary decoded query element, For the first i The initial decoding of the homogenization difference information of the query element. It is a fully connected linear transformation layer.

6. The pedestrian detection method for complex scenes according to claim 1, characterized in that, The loss during the training process of the pedestrian detection model is: ; ; ; in, This represents the loss value used during the training of the pedestrian detection model. For L1 position loss, To predict the overall mass loss for Giou, The prediction results of the pedestrian detection model, including location prediction values. and category predictions , For tags, including location tags b and category labels c , Giou The Giou values ​​are the predicted location value and the location label. To take the absolute value, The predicted score output by the feature extraction network. As weight, , It is an adjustable factor. .

7. A pedestrian detection system for complex scenes, applied to the pedestrian detection method for complex scenes according to any one of claims 1-6, characterized in that, The complex scene pedestrian detection system includes: The image acquisition unit is used to acquire images of the pedestrians to be detected. A detection unit, connected to the image acquisition unit, is used to determine the position and category of pedestrians in the pedestrian image to be detected based on a pedestrian detection model. The pedestrian detection model is constructed based on Deformable DETR and trained using a training sample set, based on L1 position loss and Giou comprehensive prediction quality loss. The training sample set includes multiple sample images and position and category labels in each sample image. The pedestrian detection model includes a feature extraction network, a first alignment decoder, a dehomogenization encoder generator, a second alignment decoder, and a prediction module connected in sequence. The first alignment decoder is also connected to the second alignment decoder and the prediction module. Both the first alignment decoder and the second alignment decoder include a multi-head cross-attention layer and a feedforward neural network.

8. An electronic device, characterized in that, The device includes a memory and a processor, the memory being used to store a computer program, and the processor running the computer program to cause the electronic device to perform the pedestrian detection method for complex scenes as described in any one of claims 1 to 6.