Pedestrian and vehicle detection method and system based on YOLOv11

By improving the YOLOv11 model and using the CCFormer backbone network and FIE module to enhance feature representation, the problems of slow speed, low accuracy and complex background detection in pedestrian and vehicle detection are solved, and efficient and accurate target detection in traffic scenarios is achieved.

CN120932199APending Publication Date: 2025-11-11ZHEJIANG SCI-TECH UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510955580.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-11
Publication Date
2025-11-11

AI Technical Summary

Technical Problem

Existing deep learning-based pedestrian and vehicle detection methods suffer from slow detection speed, low accuracy, and poor detection performance in traffic scenarios, particularly in occluded and low-light environments.

Method used

An improved YOLOv11 model is adopted, using CCFormer as the backbone network for efficient feature extraction. A FIE module is introduced in the last layer of the network for feature enhancement. Combined with fast pyramid pooling and cross-stage partial pyramid squeezing attention, feature representation is enhanced through multi-branch convolution operations to optimize the detection model.

Benefits of technology

It improves the accuracy and speed of pedestrian and vehicle detection, and can effectively detect occluded and truncated targets in complex backgrounds and low-light environments, meeting the needs of real traffic scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120932199A_ABST
    Figure CN120932199A_ABST
Patent Text Reader

Abstract

The invention discloses a pedestrian and vehicle detection method and system based on improved YOLOv11. The method comprises the following steps: step 1, collecting traffic scene image data; step 2, preprocessing the acquired traffic scene image data; 3, making the preprocessed traffic scene image data into a data set; 4, training the data set by using a YOLOv11 model to obtain a pedestrian and vehicle detection model; and step 5, detecting an image or a video to be tested by using the pedestrian and vehicle detection model obtained in the step 4 to obtain a detection result. According to the method, the problems of low detection speed, low detection precision, low illumination, shielding and the like in a road vehicle detection task are solved, and the requirements in an actual scene can be well met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of target detection technology in traffic scenarios, specifically relating to a pedestrian and vehicle detection method and system based on an improved YOLOv11. Background Technology

[0002] In recent years, intelligent transportation systems and autonomous driving technologies have received increasing attention, gradually becoming mainstream hot topics in the automotive industry in the era of artificial intelligence. Pedestrian and vehicle detection are essential components of intelligent transportation systems and autonomous driving, playing a crucial role in achieving efficient and safe traffic management.

[0003] Thanks to the rapid development of deep learning, deep learning-based object detection methods are gradually replacing traditional algorithms as the mainstream pedestrian and vehicle detection algorithms due to their strong generalization and high accuracy. Currently, deep learning-based object detection methods can be divided into two categories: two-stage and single-stage object detection methods. The R-CNN series, as a classic two-stage detector, has high accuracy, but its region proposal operation leads to significant computational cost, thus affecting the slow inference speed and becoming a bottleneck for real-time systems. Compared to two-stage algorithms, single-stage methods such as the YOLO series and SSD do not require candidate region generation, effectively reducing computational overhead and improving detection speed, making them more suitable for pedestrian and vehicle detection tasks. Although single-stage methods can effectively reduce the time cost of detection tasks, further improvements are still needed in detection accuracy.

[0004] Based on the above situation, in order to meet the demand for accurate and fast pedestrian and vehicle detection in real traffic scenarios, this invention introduces YOLO into pedestrian and vehicle detection and proposes a pedestrian and vehicle detection method and system based on the improved YOLOv11. Summary of the Invention

[0005] To address the aforementioned problems in existing technologies, this invention provides a pedestrian and vehicle detection method and system based on an improved YOLOv11. This invention solves the problems of low detection speed, low illumination, occlusion, and complex background interference in pedestrian and vehicle detection tasks in traffic scenarios, and can better meet the requirements of real-world scenarios.

[0006] To achieve the above objectives, the present invention adopts the following technical solution:

[0007] The pedestrian and vehicle detection method based on YOLOv11 includes the following steps:

[0008] Step 1: Collect traffic scene image data;

[0009] Step 2: Preprocess the collected traffic scene image data;

[0010] Step 3: The preprocessed traffic scene image data is compiled into a dataset;

[0011] Step 4: Train the dataset from Step 3 using the improved YOLOv11 to obtain pedestrian and vehicle detection models.

[0012] Step 5: Use the pedestrian and vehicle detection model obtained in Step 4 to detect the test image or video and obtain the detection results.

[0013] Furthermore, in step 1, the methods for acquiring traffic scene image data include: obtaining image data by taking pictures of the traffic scene with a camera; or obtaining image data through open-source pedestrian and vehicle datasets.

[0014] Furthermore, in step 2, median filtering and histogram equalization are used for image preprocessing. Specifically, the vehicle and road image data acquired in step 1 are denoised using median filtering, and then histogram equalization is used to enhance contrast and sharpness. This invention effectively improves image quality through image preprocessing, which is beneficial for enhancing detection results.

[0015] Furthermore, step 3 includes the following detailed process:

[0016] Step 31: Convert the traffic scene image data format to PASCAL VOC format image data;

[0017] Step 32: Use LabelImg to manually annotate pedestrians and vehicles in each image of the dataset, and use the smallest bounding rectangle of the annotated target as the ground truth bounding box.

[0018] Step 33: Randomly divide the dataset into training set and validation set in an 8:2 ratio.

[0019] Furthermore, in step 4, the improved YOLOv11 model includes replacing the YOLOv11 backbone with CCFormer to improve the network, increase accuracy while reducing computational cost. The CCFormer structure processing flow includes: the feature map goes through four stages. The first and second stages are both downsampling to reduce the image size, and then feature extraction is performed through the ConvFormer block. The third and fourth stages are both downsampling to further reduce the image size, and then feature enhancement is performed through the CoordinateFormer block. Finally, a feature map with rich features is obtained after feature extraction processing.

[0020] Further, in step 4, the improved YOLOv11 model includes adding a Feature Interaction Enhanced Module (FIE) network structure to the input of the last layer of the YOLOv11 Neck. The FIE module process includes: feeding the input feature map into the FIE module, first dividing the feature map into four equal parts along the channel dimension, and then using different enhancement strategies (specific enhancement strategies are described in the following sections 1, 2, 3, and 4) to perform convolution operations on the feature map. Specifically, the first part performs 3x3 convolution, normalization, and Mish activation function operations; the second part performs 5x5 convolution, normalization, and Mish activation function operations; the third part performs 3x3 dilated convolution; and the fourth part performs 5x5 dilated convolution. Then, the feature maps obtained through different convolutions are added and integrated with the original feature map, and then concatenated along the channel dimension. Finally, the fused feature map is processed using a channel shuffling module (see...). Figure 4 The “Channel Shuffle” function enables information exchange between channels.

[0021] Furthermore, in step 4, the detailed process of training the dataset includes:

[0022] Step 41: Input the images from the dataset into the YOLOv11 backbone network CCFormer for feature extraction. This process consists of four stages. The second, third, and fourth stages output three effective feature layers with scales of 80x80, 40x40, and 20x20, respectively. The first stage, being the shallowest layer, does not contain much effective information and is therefore not included in the output.

[0023] Step 42: After passing the last 20x20 scale effective feature layer obtained in Step 41 through Fast Pyramid Pooling (SPPF) and Cross-Stage Partial Pyramid Squeezing Attention (C2PSA), feature enhancement is performed through the FIE module to obtain feature map p1. p1 is upsampled and concatenated with a 40x40 feature layer to obtain p2; p2 is upsampled and concatenated with an 80x80 feature layer to obtain p3; then the PANet structure in YOLOv11 performs feature fusion processing, and p3 is downsampled and concatenated with p2 to obtain M1; M1 is downsampled and concatenated with p1 to obtain Q2.

[0024] Step 43: Input the feature maps p3, M1, and Q2 obtained in step 42 into the YOLOv11 detection head (see...). Figure 5 The "Detect Head" performs dimensionality transformation, then the detection head directly predicts the probability of the object to be detected and the bounding box information to generate bounding boxes, and uses non-maximum suppression (NMS) to remove redundant boxes to obtain the final predicted box.

[0025] Step 44: At the end of each training cycle, the final predicted bounding box and the ground truth bounding box from Step 43 are used to calculate the classification confidence loss, bounding box regression loss, and target confidence loss, thereby performing backpropagation to update parameters and optimize the network.

[0026] Step 45: Determine if the number of training rounds has reached the set number. If yes, proceed to step 46; otherwise, return to step 41.

[0027] Step 46: After training, obtain the pedestrian and vehicle detection model based on the training results.

[0028] The preferred embodiment of this invention reduces computational complexity by using CCFormer in the backbone network to achieve efficient feature extraction, and introduces FIE modules at specific locations in the network for feature enhancement, laying the foundation for subsequent feature fusion. This solves the problems of slow detection speed, low detection accuracy, occlusion, and low lighting in pedestrian and vehicle detection tasks.

[0029] Furthermore, in step 4, the performance of the pedestrian and vehicle detectors is optimized by combining different parameters (batch size, learning rate, etc.) on the validation set through hyperparameter search validation.

[0030] This invention also discloses a pedestrian and vehicle detection system based on an improved YOLOv11, used to perform the above-described method, comprising the following modules:

[0031] Image acquisition module: Acquires images of traffic scenes;

[0032] Preprocessing module: preprocesses the collected traffic scene image data and divides it into training set and validation set;

[0033] Dataset creation module: Creates traffic datasets from preprocessed traffic scene image data;

[0034] Training module: The dataset is trained using an improved YOLOv11 model to obtain pedestrian and vehicle detection models;

[0035] Detection module: Uses the obtained pedestrian and vehicle detection model to detect the images or videos to be tested and obtain the detection results.

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

[0037] (1) This invention improves the YOLOv11 model by adopting a new backbone network CCFormer. This architecture consists of four stages: ConvFormer block, ConvFormer block, CoordinateFormer block, and CoordinateFormer block. Each stage is downsampled before it. This improves the network while achieving efficient feature extraction and reducing computational complexity.

[0038] (2) This invention introduces a Feature Interaction Enhanced Module (FIE) at the output position of the last layer of the YOLOv11 backbone network to enhance feature representation. This module adopts a channel splitting method to perform multi-branch convolution operations to extract a variety of semantic information. While preserving fine-grained information, it enhances rich semantic information as much as possible, thereby improving the feature representation capability of small targets. Attached Figure Description

[0039] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art 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.

[0040] Figure 1 The above is a flowchart of a preferred embodiment of the present invention for pedestrian and vehicle detection method based on improved YOLOv11;

[0041] Figure 2 A schematic diagram of the improved YOLOv11 training process according to a preferred embodiment of the present invention;

[0042] Figure 3 This is a structural diagram of the improved CCFormer module proposed in a preferred embodiment of the present invention; Figure 3 In this context, ChannelMLP stands for Channel Multilayer Perceptron, Norm stands for Normalization, input stands for Input Image, downsampling stands for Downsampling, Separable Convolution stands for Depth Separable Convolution, Shuffle Attention stands for Shuffle Attention, and Coordinate Attention stands for Coordinate Attention.

[0043] Figure 4 This is a structural diagram of the improved FIE module proposed in a preferred embodiment of the present invention; Figure 4In this context, Channel split means channel splitting, Channel shuffle means channel shuffling, C, H, and W represent the number of channels, height, and width of the feature map, respectively, CBM represents convolution, normalization, and Mish activation functions, Dilate Conv means dilated convolution, and Concat means concatenation.

[0044] Figure 5 A structural diagram of the improved YOLOv11 model according to a preferred embodiment of the present invention; Figure 5 In this context, SPPF stands for Fast Pyramid Pooling, C2PSA stands for Cross-Stage Partial Pyramid Squeezing Attention, Upsample stands for Upsampling, C3k2 stands for Feature Extraction Module, Conv stands for Convolutional Downsampling, and Concat stands for Concatenation.

[0045] Figure 6 This is a comparison chart of experimental results between the preferred embodiment of the present invention and the prior art.

[0046] Figure 7 This is a block diagram of a pedestrian and vehicle detection system based on an improved YOLOv11, according to a preferred embodiment of the present invention. Detailed Implementation

[0047] The following specific embodiments illustrate the implementation of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that, unless otherwise specified, the following embodiments and features described therein can be combined with each other.

[0048] like Figure 1 As shown in the figure, this embodiment presents a pedestrian and vehicle detection method based on an improved YOLOv11, which includes the following steps:

[0049] Step 1: Collect traffic scene image data;

[0050] Step 2: Preprocess the collected traffic scene image data;

[0051] Step 3: The preprocessed traffic scene image data is compiled into a dataset and divided into a training set and a validation set;

[0052] Step 4: Train the dataset from Step 3 using the improved YOLOv11 model to obtain a pedestrian and vehicle detection model.

[0053] Step 5: Use the detection model obtained in Step 4 to detect the test image or video and obtain the detection results.

[0054] The following is a more detailed explanation of each of the above steps.

[0055] In step 1, the dataset in this embodiment is an image dataset obtained by capturing traffic scenes through a camera.

[0056] In step 2, median filtering and histogram equalization are used for image preprocessing to denoise, enhance contrast and sharpness of the collected traffic scene image data.

[0057] Step 3 of this embodiment specifically includes:

[0058] Step 31: Convert the vehicle road image data format to PASCAL VOC format image data;

[0059] Step 32: Use LabelImg to perform artificial shape annotation on pedestrians and vehicles in each image in the dataset, and use the smallest bounding rectangle of the annotated target as the ground truth bounding box;

[0060] Step 33: Randomly divide the dataset into training and validation sets in an 8:2 ratio, and generate train.txt and val.txt files to save the corresponding image lists.

[0061] In step 4, the improvements to the YOLOv11 network model in this embodiment specifically include:

[0062] First, replace the backbone network with CCFormer. The specific steps include:

[0063] 1) Add the module CCFormer to block.py;

[0064] 2) Add the class name and modify the tasks.py configuration;

[0065] 3) Modify the YOLOv11 YAML configuration file to add CCFormer;

[0066] 4) Modify train.py.

[0067] Secondly, the proposed improved FIE module is added to the output of the last layer of the backbone network. The specific steps include:

[0068] 1) Add the module definition FIE to block.py;

[0069] 2) Add the class name and modify the tasks.py configuration;

[0070] 3) Modify the YOLOv11 YAML configuration file to add FIE;

[0071] 4) Modify train.py.

[0072] like Figure 2 As shown, step four, the process of improving the YOLOv11 model training dataset, specifically includes the following steps:

[0073] Step 41: Input the images in the dataset into CCFormer, an improved version of the YOLOv11 backbone network, for feature extraction. This process consists of four stages. The second, third, and fourth stages output three effective feature layers with scales of 80x80, 40x40, and 20x20, respectively.

[0074] Step 42: After passing the last 20x20 scale effective feature layer obtained in Step 41 through Fast Pyramid Pooling (SPPF) and Cross-Stage Partial Pyramid Squeezing Attention (C2PSA), feature enhancement is performed through the FIE module to obtain feature map p1. p1 is upsampled and concatenated with a 40x40 feature layer to obtain p2; p2 is upsampled and concatenated with an 80x80 feature layer to obtain p3; then the PANet structure in YOLOv11 performs feature fusion processing, and p3 is downsampled and concatenated with p2 to obtain M1; M1 is downsampled and concatenated with p1 to obtain Q2. Finally, three feature maps of different sizes are output, corresponding to the size of the feature map output by the backbone network.

[0075] Step 43: Input the feature maps p3, M1, and Q2 obtained in step 42 into the YOLOv11 detector head for dimension transformation. Then, the detector head will directly predict the probability of the object to be detected and the bounding box information to generate bounding boxes. Specifically, the detector head adopts a dual-branch structure. One branch uses depthwise separable convolution to predict the probability of the object to be detected, and the other branch uses standard convolution to obtain bounding box information and uses non-maximum suppression (NMS) to remove redundant boxes to obtain the final predicted box.

[0076] Step 44: At the end of each training cycle, the final predicted bounding boxes from Step 43 are compared with the ground truth bounding boxes to calculate the classification confidence loss, bounding box regression loss, and target confidence loss. The target confidence loss and classification confidence loss are calculated using binary cross-entropy, i.e.:

[0077]

[0078] Where n is the number of samples, y i It is the binary label value of the i-th sample, which is either 0 or 1 (ground truth), p(y) i =1) is the model's prediction for the i-th sample, that is, the probability that the model predicts the label value of the i-th sample to be 1.

[0079] The bounding box regression loss is calculated using CIOU Loss, i.e.:

[0080]

[0081] in,

[0082]

[0083] Where IOU is the intersection-union ratio, which is the ratio of the intersection to the union of two bounding boxes; d is the Euclidean distance between the center points of the predicted box and the ground truth box; c is the diagonal distance between the minimum bounding rectangles of the two boxes; (w gt h gt (w, h) and (w, h) are the width and height of the ground truth bounding box and the predicted bounding box, respectively, and υ is a correction factor used to further adjust the loss function, taking into account the shape and orientation of the target bounding box.

[0084] This allows for backpropagation to update parameters and optimize the network.

[0085] Step 45: Repeat steps 41-44 until the set number of iterations is reached.

[0086] Step 46: After training, a pedestrian and vehicle detection model with the best detection performance (i.e., the best PR curve) will be obtained based on the training results.

[0087] In step 5, the pedestrian and vehicle detection model obtained in step 4 is used to detect the test image or video, and the detection results are obtained. Specifically, the .pt file obtained in step 4 is placed in the model code of the test.py file, and the test image or video is placed in the source code of the test.py file. The test is then run to obtain the detection results. The results are as follows: Figure 6 As shown, the left side shows the detection results of the existing YOLOv11, and the right side shows the detection results of the present invention. It can be seen that the present invention can detect occluded and truncated vehicles more accurately in low light conditions than YOLOv11, demonstrating that the present invention can effectively cope with the influence of factors such as occlusion, truncation, and low light in traffic scenarios.

[0088] In summary, the preferred embodiment of this invention discloses a pedestrian and vehicle detection method based on an improved YOLOv11, comprising the following steps: Step 1: Acquiring traffic scene images; Step 2: Preprocessing the traffic scene road image data by denoising, enhancing contrast, and improving clarity; Step 3: After preprocessing, creating a dataset from the images and dividing it into a training set and a validation set in an 8:2 ratio; Step 4: Introducing CCFormer into the YOLOv11 backbone network to achieve efficient feature extraction and reduce computational complexity; Adding a FIE module after the last layer output of the backbone network to improve feature enhancement capabilities; Further strengthening the feature fusion capability of the network in the path aggregation network; Training the dataset using the improved YOLOv11 model to obtain a pedestrian and vehicle detector; Step 5: Using the detector obtained in Step 4 to detect test images or videos to obtain detection results. This invention introduces CCFormer into the YOLOv11 network to achieve efficient feature extraction and reduce computational complexity. It also adds a FIE module after the output of the last layer of the backbone network to enhance feature interaction capabilities. Without affecting the inference speed, it improves the accuracy of target detection and enables real-time detection of pedestrians and vehicles in daily traffic scenarios.

[0089] like Figure 7 As shown, this embodiment discloses a pedestrian and vehicle detection system based on an improved YOLOv11, used to execute the above method embodiment, including the following modules:

[0090] Image data acquisition module: Acquires image data of traffic scenes;

[0091] Preprocessing module: preprocesses the collected traffic scene image data;

[0092] Dataset creation module: The preprocessed traffic scene image data is created into a dataset and divided into a training set and a validation set;

[0093] Training module: The dataset is trained using an improved YOLOv11 model to obtain pedestrian and vehicle detection models;

[0094] Detection module: Uses the obtained pedestrian and vehicle detection model to detect images or videos to be tested, and outputs the detection results.

[0095] Other aspects of this embodiment can be found in the above method embodiments.

[0096] The beneficial effects of this invention are:

[0097] (1) Image preprocessing can effectively improve image quality and enhance detection results.

[0098] (2) This invention improves the YOLOv11 model by adopting a new backbone network CCFormer. This architecture consists of four stages: ConvFormer block, ConvFormer block, CoordinateFormer block, and CoordinateFormer block. Each stage is downsampled before it. This improves the network while achieving efficient feature extraction and reducing computational complexity.

[0099] (3) This invention introduces a Feature Interaction Enhanced Module (FIE) at the output position of the last layer of the YOLOv11 backbone network to enhance feature representation. This module adopts a channel splitting method to perform multi-branch convolution operations to extract a variety of semantic information. While preserving fine-grained information, it enhances rich semantic information as much as possible, thereby improving the feature representation capability of small targets.

[0100] The embodiments described above are merely preferred embodiments of the present invention and are not intended to limit the scope of the present invention. Various modifications and improvements made by those skilled in the art to the technical solutions of the present invention without departing from the spirit of the present invention should fall within the protection scope of the present invention.

Claims

1. A pedestrian and vehicle detection method based on YOLOv11, characterized in that, Specifically, the following steps are included: Step 1: Collect traffic scene image data; Step 2: Preprocess the collected traffic scene image data; Step 3: The preprocessed traffic scene image data is compiled into a dataset; Step 4: Train the dataset from Step 3 using the improved YOLOv11 to obtain pedestrian and vehicle detection models. Step 5: Use the pedestrian and vehicle detection model obtained in Step 4 to detect the test image or video and obtain the detection results.

2. The pedestrian and vehicle detection method based on YOLOv11 as described in claim 1, characterized in that: In step 1, the methods for acquiring traffic scene image data include: obtaining image data by taking pictures of traffic scenes through cameras; or obtaining image data through open-source pedestrian and vehicle datasets.

3. The pedestrian and vehicle detection method based on YOLOv11 as described in claim 1, characterized in that: In step 2, median filtering and histogram equalization are used for image preprocessing.

4. The pedestrian and vehicle detection method based on YOLOv11 as described in claim 1, characterized in that: Step 3 specifically includes: Step 31: Convert the traffic scene image data format to PASCAL VOC format image data; Step 32: Use LabelImg to label pedestrians and vehicles in each image in the dataset, and use the smallest bounding rectangle of the labeled target as the ground truth bounding box. Step 33: Randomly divide the dataset into training set and validation set in an 8:2 ratio.

5. The pedestrian and vehicle detection method based on YOLOv11 as described in claim 1, characterized in that: In step 4, the improvements to YOLOv11 include: introducing the CCFormer backbone network and adding the FIE network structure for feature enhancement to the input of the last layer of the Neck.

6. The pedestrian and vehicle detection method based on YOLOv11 as described in claim 5, characterized in that: The CCFormer backbone network structure processes the image as follows: the feature map goes through four stages. In the first and second stages, the image is downsampled to reduce its size, and then features are extracted through the ConvFormer block. In the third and fourth stages, the image is further downsampled to reduce its size, and then features are enhanced through the CoordinateFormer block, finally yielding the feature map.

7. The pedestrian and vehicle detection method based on YOLOv11 as described in claim 5, characterized in that: The FIE module's image processing flow is as follows: The input feature map is fed into the FIE module, which first divides the feature map into four equal parts along the channel dimension. Then, different enhancement strategies are used to perform convolution operations on the feature map. The first part undergoes 3x3 convolution, normalization, and Mish activation function operations; the second part undergoes 5x5 convolution, normalization, and Mish activation function operations; the third part undergoes 3x3 dilated convolution; and the fourth part undergoes 5x5 dilated convolution. Then, the feature maps obtained through different convolutions are added to and integrated with the original feature map, and then concatenated along the channel dimension. Finally, the channel shuffling module is used to realize information interaction between channels on the fused feature map.

8. The pedestrian and vehicle detection method based on YOLOv11 as described in any one of claims 5-7, characterized in that: In step 4, the training dataset is as follows: Step 41: Input the images in the dataset into the YOLOv11 backbone network CCFormer for feature extraction, which includes four stages. The second, third and fourth stages output three effective feature layers with scales of 80x80, 40x40 and 20x20, respectively. Step 42: After passing the last 20x20 effective feature layer obtained in Step 41 through Fast Pyramid Pooling (SPPF) and Cross-Stage Partial Pyramid Squeezing Attention (C2PSA), feature enhancement is performed through the FIE module to obtain feature map p1. Feature map p1 is upsampled and concatenated with a 40x40 feature layer to obtain feature map p2. Feature map p2 is upsampled and concatenated with an 80x80 feature layer to obtain feature map p3. Then, the PANet structure in YOLOv11 performs feature fusion processing. Feature map p3 is downsampled and concatenated with feature map p2 to obtain the output 40x40 feature map M1. M1 is then downsampled and concatenated with feature map p1 to obtain the output 20x20 feature map Q2. Step 43: Input the feature maps p3, M1, and Q2 obtained in step 42 into the YOLOv11 detector head for dimension transformation. Then, the detector head predicts the probability of the object to be detected and the bounding box information to generate bounding boxes. Non-maximum suppression (NMS) is used to remove redundant boxes to obtain the final predicted boxes. Step 44: At the end of each training cycle, the final predicted bounding box and the ground truth bounding box from Step 43 are used to calculate the classification confidence loss, bounding box regression loss, and target confidence loss, thereby performing backpropagation to update parameters and optimize the network. Step 45: Determine if the set number of training rounds has been reached. If yes, proceed to step 46; otherwise, return to step 41. Step 46: Obtain pedestrian and vehicle detection models based on the training results.

9. The pedestrian and vehicle detection method based on YOLOv11 as described in claim 8, characterized in that: In step 4, the target confidence loss and classification confidence loss are calculated using binary cross-entropy: Where n is the number of samples, y i p(y) is the binary label value of the i-th sample, which is either 0 or 1. i =1) is the model's prediction for the i-th sample; The bounding box regression loss is calculated using CIOU Loss: in, Where IOU is the intersection-union ratio, d is the Euclidean distance between the centers of the predicted and ground truth bounding boxes, c is the diagonal distance between the minimum bounding rectangles of the two boxes, and w gt h gt w and h are the width and height of the ground truth bounding box and the predicted bounding box, respectively, and υ is the correction factor.

10. A pedestrian and vehicle detection system based on YOLOv11, used to perform the method as described in any one of claims 1-9, characterized in that, Includes the following modules: Image data acquisition module: Acquires image data of traffic scenes; Preprocessing module: preprocesses the collected traffic scene image data; Dataset creation module: Creates datasets from preprocessed traffic scene image data; Training module: The dataset is trained using the improved YOLOv11 to obtain pedestrian and vehicle detection models; Detection module: Uses the obtained pedestrian and vehicle detection model to detect the images or videos to be tested, and outputs the detection results.