Lightweight network target detection method based on structure optimization and feature fusion

By performing structural optimization and feature fusion on the lightweight feature extraction network and C2f module, combined with the idea of ​​spatial pyramid pooling, the problem of low target detection accuracy on edge devices is solved, and target detection effects with high accuracy and low parameter volume are achieved. .

CN118710883APending Publication Date: 2024-09-27CHONGQING UNIV OF TECH +1

Patent Information

Application Number
CN202410837116.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-26
Publication Date
2024-09-27

AI Technical Summary

Technical Problem

Existing deep learning models are difficult to ensure target detection accuracy on edge devices with limited computing resources. Existing lightweight target detection algorithms reduce the number of parameters while significantly reducing detection accuracy.

Method used

Adopting a lightweight network method based on structural optimization and feature fusion, by designing the lightweight feature extraction network MobileNetv3 and the optimized C2f module, combined with the attention mechanism and depth-separable convolution, the spatial pyramid pooling idea is used for feature fusion, reducing the model parameters and improve detection accuracy.

Benefits of technology

It achieves high-precision target detection on edge devices, reduces the amount of model parameters and computing costs, improves the ability to identify small targets, and meets the real-time target detection needs of edge computing devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118710883A
    Figure CN118710883A
Patent Text Reader

Abstract

The invention discloses a lightweight network target detection method based on structure optimization and feature fusion. The method comprises the following steps: acquiring a target image data set; designing a lightweight feature extraction network MobileNetv3 and an optimized C2f module, introducing an attention mechanism and a new activation function H-swsh, and constructing a target detection model of the lightweight network based on structure optimization and feature fusion; training and verifying the target detection model by using a public data set and the target image data set to obtain a trained target detection model; and taking a to-be-processed target image as an input of the trained target detection model, and identifying and positioning the to-be-processed target image to obtain a target detection result of the to-be-processed target image. According to the method, the problem of low target detection precision of a target detection algorithm at an edge end due to the limitation of computing power resources is solved, a smaller target object is identified, and the overall detection precision of the model is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the fields of computer application technology and artificial intelligence, and in particular to a lightweight network target detection method based on structure optimization and feature fusion. Background Art

[0002] Existing deep learning-based target detection algorithms are widely used in intelligent following robots. Quickly and accurately identifying the surrounding environment through deep learning models on the edge is the basis for intelligent following robots to make correct and efficient execution strategies. Lightweight target detection algorithms on the edge are key technologies for following robots. However, on devices with limited computing resources, the accuracy of existing deep learning models is difficult to guarantee. Therefore, conducting research on lightweight target detection algorithms based on deep learning and designing edge target detection models with few parameters and high accuracy are of great significance to improving target detection accuracy and enhancing the reliability of mobile following robots.

[0003] The existing lightweight target detection algorithms mainly achieve the lightweight of deep models through network structure design optimization, model compression and quantization, hardware acceleration and other methods. Among them, the one-stage target detection algorithm is the most widely used. It can speed up the target detection speed and achieve accurate real-time target detection while ensuring a certain accuracy. For example, Li G proposed a lightweight target detection model of YOLOv5s that uses the CoordConv module to strengthen the ordinary convolution coordinate feature map. Through convolution and multi-scale separation, HS-Block CSP is used to share the receptive fields of different scales and the map features of different convolution groups, which improves the accuracy of target detection. However, its parameter volume is still as high as more than 8 million, which is not conducive to edge computing devices. Cui M uses ShuffleNet as the backbone feature extraction network of YOLOv4Tiny and reduces the model parameter volume through model compression technology. Wang H proposed a new anchor-free detection network CenterNet-auto, which meets the requirements of detection speed while ensuring detection accuracy. The backbone network uses the RepVGG model converted by structural reparameterization technology. Features of different scales are integrated, and feature pyramids and deformable convolutions are added to the backbone to detect targets of different scales. The average boundary model is proposed to support the use of boundary feature information to locate the target. Wu TH proposed YOLOv5-Ghost to reduce the amount of calculation parameters and improve the detection speed, but its detection accuracy drops too much. However, although the existing methods can reduce the number of parameters of the target detection network, its target detection accuracy also drops significantly.

[0004] Therefore, how to design an edge target detection model with fewer parameters and higher accuracy has become a problem that needs further research and solution. Summary of the invention

[0005] In view of the shortcomings of the above-mentioned prior art, the present invention provides a target detection method based on a lightweight network of structure optimization and feature fusion, optimizes the design of the C2f module by using phantom module and depthwise separable convolution, combines the idea of ​​spatial pyramid pooling, and uses two maximum pooling operations to solve the problem of low target detection accuracy at the edge due to limited computing resources.

[0006] In order to solve the above technical problems, the present invention adopts the following technical solutions:

[0007] A target detection method based on a lightweight network of structure optimization and feature fusion includes the following steps:

[0008] Obtain target image dataset;

[0009] Design a lightweight feature extraction network MobileNetv3 and an optimized C2f module, introduce an attention mechanism and a new activation function H-swish, and build a lightweight network object detection model based on structure optimization and feature fusion;

[0010] Using the public data set and the target image data set to train and verify the target detection model, to obtain a trained target detection model;

[0011] The target image to be processed is used as the input of the trained target detection model, the target image to be processed is identified and located, and a target detection result of the target image to be processed is obtained.

[0012] As a preferred solution, the design of a lightweight feature extraction network MobileNetv3 and an optimized C2f module includes: designing a backbone feature extraction network of a block structure, and designing a neck feature extraction network of a DG_C2f module.

[0013] As a preferred solution, the target detection model includes a backbone feature extraction network with a block structure, a neck feature extraction network with a DG_C2f module structure, and a detection head network; the trained target detection model uses the input target image data set as the input of the backbone feature extraction network to extract a deep feature map, processes the deep feature map through the neck feature extraction network to extract a shallow feature map, and then performs multi-scale feature fusion on the deep feature map and the shallow feature map in the neck feature extraction network to fuse the multi-scale feature map generated by fusion and input it into the detection head network to obtain the target detection result of the target image data set as the output of the target detection model.

[0014] As a preferred solution, the backbone feature extraction network includes a CBS module, a convolution unit, a first deep convolution fusion unit, a second deep convolution fusion unit and a spatial pyramid pooling module connected in sequence;

[0015] Among them, the CBS module includes cascaded convolutional layers, batch normalization layers and SiLU activation layers; the convolution unit includes 3 cascaded block modules; the first deep convolution fusion unit includes 5 cascaded seblock modules; the second deep convolution fusion unit includes 4 cascaded seblock modules; the spatial pyramid pooling module includes a first CBS module, 3 maximum pooling layers, a fully connected module and a second CBS module connected in sequence, wherein the fully connected module is used to splice the outputs of the first CBS module and the 3 maximum pooling layers and output them to the second CBS module.

[0016] As a preferred solution, the block module performs 1×1 dimensionality increase convolution processing on its input image, and then sequentially performs 3×3 depthwise separable convolution processing and 1×1 dimensionality reduction convolution processing, and then passes through an activation function and performs superposition operation with the original input image to obtain an output feature map;

[0017] The seblock module performs 1×1 dimensionality-increasing convolution on its input image, and then sequentially performs 3×3 depthwise separable convolution, attention mechanism and 1×1 dimensionality-reducing convolution, and then passes through an activation function and performs superposition operation with the original input image to obtain an output feature map.

[0018] As a preferred solution, the neck feature extraction network includes 3 upsampling feature fusion units and 2 connection feature fusion units; the upsampling feature fusion unit includes a cascaded upsampling module, a connection layer and a DG_C2f module; the connection feature fusion unit includes a cascaded CBS module, a connection layer and a DG_C2f module;

[0019] The output of the backbone feature extraction network is used as the input of the first upsampling feature fusion unit, and the output of the first deep convolution fusion unit in the backbone feature extraction network is transmitted to the connection layer in the first upsampling feature fusion unit for splicing and fusion operation, and the output of the first upsampling feature fusion unit is transmitted to the upsampling module of the second upsampling feature fusion unit and the connection layer of the first connection feature fusion unit respectively;

[0020] The output of the convolution unit in the backbone feature extraction network is input to the connection layer in the second upsampling feature fusion unit for splicing and fusion operation. The output of the second upsampling feature fusion unit is transmitted to the upsampling module of the third upsampling feature fusion unit, the CBS module of the first connection feature fusion unit and the detection head network respectively.

[0021] The output of the first block module in the convolution unit of the backbone feature extraction network and its feature map after two maximum pooling operations are input to the connection layer of the third upsampling feature fusion unit to participate in the splicing and fusion operation. The output of the third upsampling feature fusion unit is directly transmitted to the detection head network;

[0022] The output of the first connected feature fusion unit is transmitted to the CBS module and the detection head network of the second connected feature fusion unit respectively;

[0023] The output of the backbone feature extraction network is also transmitted to the connection layer in the second connection feature fusion unit to participate in the splicing and fusion operation, and the output of the second connection feature fusion unit is also directly transmitted to the detection head network.

[0024] As a preferred solution, the processing process of the DG_C2f module includes the following steps:

[0025] After performing depth-wise separable convolution on the input feature map, feature extraction is performed on the depth-wise convolution map in two branches. After slicing operation, one branch divides the input feature map into two parts. One part of the feature map enters the first phantom module, and the other part enters the second phantom module. In the other branch, two maximum pooling operations are performed to obtain multi-scale feature maps. Finally, the feature map obtained by the maximum pooling operation and the feature map obtained by the phantom module are fused in the connection layer and output after depth-wise separable convolution.

[0026] As a preferred solution, the process of training and verifying the target detection model includes:

[0027] Set the learning rate and hyperparameters of the target detection model, and adjust the scale of the target image dataset and the public dataset based on the preset input image size; set the number of iterations to train the target detection model to obtain the trained target detection model; finally, based on the adjusted public dataset, verify the trained target detection model according to the evaluation indicators.

[0028] Compared with the prior art, the present invention has the following technical effects:

[0029] (1) The present invention optimizes the design of the C2f module by replacing the traditional bottleneck module with a more lightweight phantom module and by replacing the ordinary convolution with a depthwise separable convolution, thereby reducing the number of model parameters and computational cost. Based on the idea of ​​spatial pyramid pooling, two maximum pooling operations are used to obtain more feature information, and feature fusion is performed by combining the feature information obtained from the three phantom modules after the slicing operation to enhance the feature capability of the proposed model. Finally, a depthwise separable convolution is used for output, thereby reducing the number of parameters of the target detection model and ensuring the detection accuracy.

[0030] (2) The target detection model of the lightweight network based on structure optimization and feature fusion of the present invention obtains an upsampled feature map with higher resolution and greater semantic information and detail information through an upsampling module, and fuses the feature map with the same size of the upsampled feature map in the backbone feature extraction network with the feature information after two maximum pooling operations, and finally outputs it through the DG_C2f module, which can identify smaller targets and improve the overall detection accuracy of the target detection model. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] In order to make the purpose, technical solution and advantages of the invention more clear, the present invention will be further described in detail below with reference to the accompanying drawings, in which:

[0032] Figure 1 It is a structural schematic diagram of a target detection model based on a lightweight network of structural optimization and feature fusion of the present invention;

[0033] Figure 2 It is a schematic diagram of the Block structure module of MobileNetv3 in an embodiment of the present invention;

[0034] Figure 3 Schematic diagram of the structure of ordinary convolution and depth-separable convolution in an embodiment of the present invention;

[0035] Figure 4 Schematic diagram of the structure of the DG_C2f module in an embodiment of the present invention;

[0036] Figure 5 A set of example diagrams of detection results of different models in an embodiment of the present invention;

[0037] Figure 6 Another set of test result examples of different models in the embodiment of the present invention;

[0038] Figure 7 This is a diagram of edge computing equipment used in experiments of embodiments of the present invention;

[0039] Figure 8 A performance radar comparison chart of different models in an embodiment of the present invention;

[0040] Fig. 9 This is a diagram of the SOFF-LightNet special marker training results in an embodiment of the present invention. DETAILED DESCRIPTION

[0041] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. The components of the embodiments of the present invention generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the claimed invention, but only represents selected embodiments of the present invention. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work belong to the scope of protection of the present invention.

[0042] The present invention will be further described in detail below in conjunction with the accompanying drawings.

[0043] Figure 1 The present invention discloses a lightweight network target detection method based on structural optimization and feature fusion, which inputs the acquired target image to be processed into the trained target detection model, identifies and locates the target image to be processed, and obtains the target detection result of the target image to be processed. In the face of the problem that the accuracy of the existing target detection model is difficult to guarantee on the device with limited computing power resources, the present invention has targeted technical means, which optimizes the design of the C2f module by using the phantom module and the depth-separable convolution to reduce the parameters and computational cost of the model; based on the idea of ​​spatial pyramid pooling, two maximum pooling operations are used to obtain more feature information, and the feature information obtained by the GhostBottleneck module is fused to enhance the feature capability of the target detection model; finally, the model is tested using the public data set and the target image data set, thereby improving the accuracy of the target detection model.

[0044] Specifically, the lightweight network target detection method based on structure optimization and feature fusion proposed in the present invention includes the following steps:

[0045] Obtain target image dataset;

[0046] Design a lightweight feature extraction network MobileNetv3 and an optimized C2f module, introduce an attention mechanism and a new activation function H-swish, and build a lightweight network object detection model based on structure optimization and feature fusion;

[0047] Using the public data set and the target image data set to train and test the target detection model to obtain a trained target detection model;

[0048] The target image to be processed is used as the input of the trained target detection model, the target image to be processed is identified and located, and the target object is detected by the trained target detection model.

[0049] The present invention is based on the YOLOv8 network structure for transformation. Although YOLOv8 has improved detection accuracy compared to other versions, due to the change in its configuration structure and the redesign of the feature extraction module, the amount of its calculation parameters has also increased accordingly, and further optimization is required for edge computing devices with limited computing power. YOLOv8 still has some problems in detecting small objects, because large-scale objects will mislead small-sized objects when the neural network extracts features, and the feature information of small-sized objects is less in the feature information extracted in the deep layer. In addition, when small-sized objects are blocked or overlapped with large-sized objects, the impact on their detection accuracy will be greater.

[0050] In view of this, the present invention proposes a lightweight network target detection method based on structural optimization and feature fusion, and designs a lightweight feature extraction network MobileNetv3 and an optimized C2f module, including: designing a backbone feature extraction network with a block structure, and designing a neck feature extraction network of the DG_C2f module. The lightweight feature extraction network MobileNetv3 combines the depth-separable convolution structure and the inverted residual structure, and introduces an attention mechanism network; the depth-separable convolution includes grouped convolution and point-by-point convolution. The DG_C2f module combines the depth-separable convolution module and the phantom module, and performs multi-scale fusion. This reduces the model calculation parameters, facilitates the deployment of the model on the edge device, and improves the detection effect overall.

[0051] The lightweight network target detection method based on structure optimization and feature fusion of the present invention is described in more detail below.

[0052] 1. Object detection model based on lightweight network with structure optimization and feature fusion

[0053] Existing lightweight target detection algorithms mainly achieve lightweight deep models through network structure design optimization, model compression and quantization, hardware acceleration, etc. However, on devices with limited computing resources, the accuracy of existing deep learning models is difficult to guarantee. In view of the problem that the existing target detection algorithms have low target detection accuracy due to limited computing resources at the edge, this paper proposes a new target detection model based on lightweight network (SOFF-LightNet) based on structure optimization and feature fusion. Figure 1As shown in the figure, it mainly includes a backbone feature extraction network using a lightweight feature extraction network MobileNetv3, a neck feature extraction network that redesigns the C2f module, and a detection head network. The input target image dataset is used as the input of the backbone feature extraction network to extract a deep feature map, which is then processed by the neck feature extraction network to extract a shallow feature map. The deep feature map and the shallow feature map are then multi-scale feature fused in the neck feature extraction network to generate a multi-scale feature map that is input to the detection head network to obtain the target detection result of the target image dataset as the output of the target detection model.

[0054] They are introduced in detail below.

[0055] 1.1 Backbone Feature Extraction Network

[0056] The block structure based on the lightweight feature extraction network MobileNetv3 is used as the backbone feature extraction network. The block structure is a very excellent lightweight feature extraction module. As shown in Table 1, compared with the parameters of the mainstream lightweight neural network (all lightweight neural network models are of version 1.0, and Mobilenetv3 is selected as Mobilenetv3_small(1.0)), Top-1 is the accuracy of the first-ranked category of each lightweight neural network in the ImageNet classification task and the actual result, and Time is the time required for inference. From the perspective of comprehensive performance, the MobileNetv3 network structure is more suitable for edge computing devices, which have limited computing power and high real-time requirements.

[0057] Table 1 Lightweight neural network performance parameters

[0058]

[0059] The backbone feature extraction network includes a CBS module, a convolution unit, a first deep convolution fusion unit, a second deep convolution fusion unit and a spatial pyramid pooling module connected in sequence;

[0060] Among them, the CBS module includes cascaded convolutional layers, batch normalization layers and SiLU activation layers; the convolution unit includes 3 cascaded block modules; the first deep convolution fusion unit includes 5 cascaded seblock modules; the second deep convolution fusion unit includes 4 cascaded seblock modules; the spatial pyramid pooling module includes a first CBS module, 3 maximum pooling layers, a fully connected module and a second CBS module connected in sequence, wherein the fully connected module is used to splice the outputs of the first CBS module and the 3 maximum pooling layers and output them to the second CBS module.

[0061] Among them, the processing process of block module and seblock module is as follows Figure 2 As shown in the figure, the block module performs 1×1 dimensionality-increasing convolution on its input image, and then successively performs 3×3 depth-separable convolution and 1×1 dimensionality reduction convolution, and then passes through the activation function and is superimposed with the original input image to obtain the output feature map; the seblock module performs 1×1 dimensionality-increasing convolution on its input image, and then successively performs 3×3 depth-separable convolution, attention mechanism and 1×1 dimensionality reduction convolution, and then passes through the activation function and is superimposed with the original input image to obtain the output feature map.

[0062] Among them, the depth-wise separable convolution can reduce the number of parameters to 1 / 9 of the original, which is equivalent to splitting the ordinary convolution into group convolutions and then point-by-point convolutions. Figure 3 As shown in the figure, the number of channels output by ordinary convolution requires the number of convolution kernels. Here, the number of input channels is 3 and the number of output channels is 4. The ordinary convolution requires 4 3*3*3 convolution kernels, and the total number of parameters is 4*3*3*3, which is equal to 108. The depthwise separable convolution first uses grouped convolution, which requires 3 3*3 convolution kernels, and then uses 4 1*1*3 convolution kernels. The final total number of parameters is 4*1*1*3+27, which is equal to 39. Therefore, the use of depthwise separable convolution can reduce a lot of computational costs. Since the ReLU activation function used by the depthwise separable convolution will make all values ​​less than 0 0, this will lose a lot of useful feature information. In order to prevent the gradient from disappearing, a Block module with an inverted residual structure is designed to replace the activation function after pointwise convolution. The Block structure of the MobileNetv3 structure adds the SE module (attention mechanism) on this basis, introduces the new activation function H-swish, combines the two technologies NAS and NetAdapt in the network structure, and finally modifies the last stage of the network end.

[0063] 1.2 Neck feature extraction network

[0064] Based on the redesign of the C2f module, it is replaced by the improved DG_C2f module. Because the backbone feature extraction network completely replaces the lightweight neural network, the DG_C2f module is only used in the neck network, and all residual structures are retained, such as Figure 4 As shown, the neck feature extraction network includes 3 upsampling feature fusion units and 2 connection feature fusion units; the upsampling feature fusion unit includes a cascaded upsampling module, a connection layer and a DG_C2f module; the connection feature fusion unit includes a cascaded CBS module, a connection layer and a DG_C2f module.

[0065] The output of the backbone feature extraction network is used as the input of the first upsampling feature fusion unit, and the output of the first deep convolution fusion unit in the backbone feature extraction network is transmitted to the connection layer in the first upsampling feature fusion unit for splicing and fusion operation, and the output of the first upsampling feature fusion unit is transmitted to the upsampling module of the second upsampling feature fusion unit and the connection layer of the first connection feature fusion unit respectively;

[0066] The output of the convolution unit in the backbone feature extraction network is input to the connection layer in the second upsampling feature fusion unit for splicing and fusion operation. The output of the second upsampling feature fusion unit is transmitted to the upsampling module of the third upsampling feature fusion unit, the CBS module of the first connection feature fusion unit and the detection head network respectively.

[0067] The output of the first block module in the convolution unit of the backbone feature extraction network and its feature map after two maximum pooling operations are input to the connection layer of the third upsampling feature fusion unit to participate in the splicing and fusion operation. The output of the third upsampling feature fusion unit is directly transmitted to the detection head network;

[0068] The output of the first connected feature fusion unit is transmitted to the CBS module and the detection head network of the second connected feature fusion unit respectively;

[0069] The output of the backbone feature extraction network is also transmitted to the connection layer in the second connection feature fusion unit to participate in the splicing and fusion operation, and the output of the second connection feature fusion unit is also directly transmitted to the detection head network.

[0070] In the specific implementation, the upsampling module is used to increase the detection head of the larger feature map, and the features of the feature map in the backbone feature extraction network are obtained through two pooling operations to obtain features of different scales, and multi-scale feature fusion is performed in the neck network, so that the small target detection head can obtain richer feature information and can more accurately identify small-sized objects.

[0071] Among them, the DG_C2f module includes a depthwise separable convolution module, a phantom module, a maximum pooling layer and a connection layer, wherein the phantom module is composed of two phantom convolutions and one depthwise separable convolution. The processing process of the DG_C2f module includes the following steps: after performing a depthwise separable convolution on the input feature map, the feature extraction of two branches is performed on the depthwise convolution map respectively, one branch performs a slicing operation, and the input feature map is divided into two parts, one part of the feature map after the segmentation enters the first phantom module, and the other part of the feature map enters the second phantom module; in the other branch, two maximum pooling operations are performed to obtain a multi-scale feature map; finally, the feature map obtained by the maximum pooling operation and the feature map obtained by the phantom module are fused in the connection layer, and output after a depthwise separable convolution.

[0072] Normally, the size of the model output is relative to the size of the original input image. Larger feature map outputs are usually used to detect smaller targets, while smaller feature map outputs are used to detect larger targets. This is because larger feature maps have more location information and can more easily detect smaller targets, while smaller feature maps can more accurately locate larger targets. In the DG_C2f module, the traditional Bottleneck module is replaced by a more lightweight ghost module (GhostBottleneck), and ordinary convolutions use depthwise separable convolutions to reduce computational costs. In order to ensure that the module has sufficient feature extraction capabilities, the idea of ​​spatial pyramid pooling (SPPF) is adopted, and multi-scale fusion is performed on the C2f module, which does not increase the amount of calculation too much, but the feature information can be richer.

[0073] GhostBottleneck is a staged convolutional computing module in GhostNet designed by Huawei Noah's Ark Laboratory. It consists of two ghost convolutions (GhostConv) stacked together. The first layer is used to increase the number of channels for the expansion layer, and the second layer is used to reduce the number of channels and match them with shortcuts, thereby eliminating redundancy and obtaining a lighter model.

[0074] The process of training and verifying the target detection model includes: setting the learning rate and hyperparameters of the target detection model, adjusting the scale of the target image dataset and the public dataset based on the preset input image size; setting the number of iterations to train the target detection model to obtain the trained target detection model; and finally verifying the trained target detection model based on the evaluation indicators based on the adjusted public dataset.

[0075] 1.3 Detection Head Network

[0076] The detection head network serves as the output end of the target detection model. The present invention uses four head detection heads to predict and output the final target detection results, including object position information and category information.

[0077] 2. Experimental testing and verification

[0078] In order to test and verify the proposed target detection neural network model, KITTI and VOC2007 datasets are used in the experiment. The goal of the KITTI target detection task is to detect and locate different kinds of vehicles, pedestrians and bicycles in the image. These targets are annotated in the image in the form of bounding boxes, and the labels include category and location information. The dataset includes images under different time, weather and lighting conditions to increase the diversity of the data and help test the robustness of the algorithm. VOC2007 is a dataset widely used in target detection and image segmentation research. The dataset is maintained by the PASCAL project organization to promote research and development in the field of computer vision. The VOC2007 dataset includes 20 different object categories, covering common objects and animals. The VOC2007 dataset is challenging because it contains multiple categories and the images have different perspectives, scales and occlusions. This makes the performance requirements of the target detection algorithm higher, and it can accurately detect and locate the target in various complex situations. The VOC2007 dataset has become one of the standard benchmarks for target detection algorithms in the field of computer vision. Many research papers and competitions use this dataset to evaluate the performance of different algorithms. It provides researchers with an important tool to test and compare various target detection techniques.

[0079] In the specific implementation, in the training target detection neural network model, all models are trained without pre-trained weight files, the learning rate is 0.01, the optimizer selects SGD, the optimizer weight decay is 0.0005, the bounding box loss weight is 7.5, the category loss weight is 0.5, the loss weight is 1.5, the batch size is 16, the momentum is 0.937, the early stopping round number (patience) is 50 rounds, the input image size (imgsz) is 640, the working thread is set to 8 threads, the number of rounds in the warm-up phase (warmup_epochs) is 3.0, the initial momentum in the warm-up phase (warmup_momentum) is 8.0, the initial bias learning rate in the warm-up phase (warmup_bias_lr) is 0.1, and the iteration is 200 times. The target detection neural network model is trained under the pytorch framework. The training uses a Dell server, the CPU is Intel-Xeon, and the graphics card is NVIDIA 3080TI.

[0080] Evaluate the detection performance and calculation parameters of the target detection model according to the evaluation indicators, including network parameters, precision, recall, mean average precision (mAP), and F1 score;

[0081] The precision refers to the proportion of correctly detected targets among all detected objects. The lower the precision, the lower the probability of misjudgment of target detection. The calculation formula is as follows:

[0082]

[0083] In the formula, P is the precision, TP is the correct prediction target, and FP is the wrong prediction target;

[0084] The recall rate is the ratio of correctly detected targets among all targets that need to be predicted. The higher the recall rate, the more likely the model can capture all positive samples as much as possible. The calculation formula is as follows:

[0085]

[0086] In the formula, R is the recall rate, and FN is the target that needs to be detected but is not correctly detected;

[0087] The average precision is the average value of the area enclosed by the precision and recall curves, and its calculation formula is as follows:

[0088]

[0089] Where AP is the area enclosed by the curve formed by precision and recall, mAP is the average value of AP, and k is the number of categories;

[0090] The F1 score is a commonly used indicator for evaluating the performance of classification models. It comprehensively considers the precision and recall of the model, so it can provide a more comprehensive evaluation when different categories are unbalanced. The calculation formula is as follows:

[0091]

[0092] Where F1 is the F1 score.

[0093] 2.1 Experimental Results Analysis

[0094] In this embodiment, the SOFF-LightNet object detection model is tested and verified by qualitative analysis and quantitative analysis on the KITTI and PASCAL VOC datasets, respectively. They are described in detail below.

[0095] 2.1.1 Qualitative analysis results

[0096] To verify the SOFF-LightNet target detection model, YOLOv5s, YOLOv8s and SOFF-LightNet target detection models are used for comparative analysis on KITTI and PASCAL VOC datasets. The comparison results are shown in the figure below. Figure 5 and Figure 6 As shown, Figure 5 is a set of test result example pictures. Figure 6 This is another set of test result examples. Figure 5 middle, Figure 5 (a) and 5(d) are the detection results of the YOLOv5s model. Figure 5 (b) and 5(e) are the detection results of the YOLOv8s model. Figure 5 (c) and 5(f) are the detection results of the SOFF-LightNet target detection model; Figure 6 middle, Figure 6 (a) and 6(d) are the detection results of the YOLOv5s model. Figure 6 (b) and 6(e) are the detection result diagrams of the YOLOv8s model; Figure 6 (c) and 6(f) are the detection result images of the SOFF-LightNet target detection model.

[0097] Depend on Figure 5 and Figure 6 It can be seen that the target detection model in this embodiment detects the most correct objects and has better recognition ability for smaller targets. Compared with the original version and YOLOv5s version of the target detection neural network, the SOFF-LightNet target detection neural network model in this embodiment can better recognize distant vehicles and small-sized people and bicycles. At the same time, SOFF-LightNet also has better detection performance for occluded objects, which is of great significance for autonomous driving. In addition, in real road conditions, vehicles and pedestrians are mostly in an occluded state, such as Figure 6 As shown, Figure 6 There are many overlapping parts of many people and bicycles in the image. YOLOv5s has more missed detections. YOLOv8s detects more occluded objects, but still fails to detect people occluded in the distance. SOFF-LightNet has a significant improvement in occluded object detection.

[0098] 2.1.2 Quantitative analysis results

[0099] In order to quantitatively analyze the target detection performance of the SOFF-LightNet target detection model, YOLOv5s, YOLOv8s, YOLOv8m, YOLOv8s+Mobilenetv3, YOLOv8s+Mobilenetv3+DG_C2f are used to conduct comparative experiments with the proposed model on the KITTI and PASCAL VOC datasets. At the same time, precision, recall, F1 score, mean average precision (mAP) and network parameters are used to quantitatively evaluate all models. The results are shown in Tables 2 and 3.

[0100] Table 2 Quantitative detection results of KITTI dataset ablation experiment

[0101]

[0102] Table 3 Quantitative detection results of PASCAL VOC ablation experiment

[0103]

[0104] As shown in Tables 2 and 3, the SOFF-LightNet target detection model has good recognition accuracy and fewer network parameters in the KITTI and PASCAL VOC datasets. The use of the Mobilenetv3 lightweight neural network structure reduces the number of parameters by 35.1%, and the number of parameters is further reduced by 16.0% after the C2f improvement. The number of parameters in the final SOFF-LightNet model is 47.0% less than that of the original YOLOv8s model, and the SOFF-LightNet model has fewer parameters than a small model such as YOLOv5s. After replacing the backbone feature extraction network of YOLOv8s with the block of the Mobilenetv3 lightweight neural network structure, the detection accuracy decreases. In the KITTI dataset, mAP0.5 and mAP0.5:0.95 decrease by 3.06% and 4.27% respectively, the recall rate and precision rate decrease by 3.11% and 4.3% respectively, and the F1 score decreases by 3.63. In the VOC2007 dataset, mAP0.5 and mAP0.5:0.95 decreased by 0.25% and 2.76% respectively, the recall rate increased by 1.63%, the precision rate decreased by 2.95%, and the F1 score decreased by 0.18. After adding the DG_C2f module, all indicators did not change much. In the KITTI dataset, mAP0.5 and mAP0.5:0.95 decreased by 0.24% and 1.84% respectively, the recall rate decreased by 0.5%, the precision rate increased by 2.2%, and the F1 score increased by 0.26. In the VOC 2007 dataset, mAP0.5 and mAP0.5:0.95 increased by 0.27% and 0.81% respectively, the recall rate decreased by 0.07%, the precision rate increased by 0.37%, and the F1 score increased by 0.12. Finally, the detection indicators of the model after overall structural adjustment in the data set are improved, surpassing the original YOLOv8s model in some aspects. In the KITTI data set, compared with the original YOLOv8s model, mAP0.5 and mAP0.5:0.95 increased by 0.82% and 0.31% respectively, the recall rate decreased by 1.69%, the precision rate increased by 1.05%, and the F1 score decreased by 0.41. In the VOC 2007 data set, mAP0.5 increased by 1.25%, mAP0.5:0.95 decreased by 0.18%, the recall rate decreased by 1.00%, the precision rate increased by 3.68%, and the F1 score increased by 0.69.

[0105] After replacing the backbone feature extraction network with the block module of the Mobilenetv3 structure, the detection accuracy in both datasets has decreased to varying degrees. This is because the number of parameters of the modified model has been greatly reduced, resulting in a decrease in the model's feature extraction ability. After adding the DG_C2f module, the number of model parameters has been further reduced, but its detection accuracy in the two datasets has changed little, and even improved in the VOC 2007 dataset. This is because although the DG_C2f structure uses a lighter phantom module and depthwise separable convolution, it combines the idea of ​​spatial pyramid pooling to obtain more feature information for fusion. Finally, upsampling is used to obtain an upsampled feature map with greater resolution, semantic information and detail information, and the feature map of the backbone feature network with the same size as the upsampled feature map is fused with the upsampled feature map after two maximum pooling operations, and output through the DG_C2f module. The number of parameters of the proposed model is slightly increased, but the detection accuracy is significantly improved in the two datasets. The number of parameters of YOLOv5s, YOLOv8s and YOLOv8m models are 7022326, 11166544 and 25902624 respectively, while the number of parameters of the proposed model is only 5919768. However, its performance in the two public dataset experiments has surpassed the YOLOv5s model, and some performance has surpassed the YOLOv8s model and is close to the YOLOv8m model. Therefore, the proposed model can be better applied to edge computing devices and ensure high target detection accuracy.

[0106] 2.2 Detection speed test

[0107] To further verify the target detection rate of the proposed model, the target detection speed of different models was tested under the same experimental conditions. The edge computing device used NVIDIA jetson AGX Orin as the experimental device. The specific performance parameters are shown in Table 4. It is equipped with 2048 NVIDIA CUDA cores and AI computing performance of 275TOPS. The software environment is ubuntu20.04 operating system, NVIDIA JetPack5.1.1, cuda11.3, pytorch1.14.0. The target detection neural network model is deployed in the edge computing device, and the weight files of different models are selected for real-time target detection. The experimental equipment is as follows: Figure 7 As shown, the real-time detection speed of different models is shown in the table.

[0108] Table 4 Edge computing equipment performance parameters

[0109]

[0110] Table 5 Real-time detection speed of edge computing devices in different network models

[0111]

[0112] As shown in Table 5, under the same experimental conditions, the real-time detection speed of the proposed model is relatively fast, which meets the requirements of actual engineering applications. Compared with the YOLOv8 model, the complexity and number of layers of the proposed model have increased, and the detection speed has decreased. The frame rate of a general video is about 25 frames, which means that the detection speed of about 40ms can meet the requirements of real-time target detection. Therefore, the proposed SOFF-LightNet can still meet the requirements of real-time target detection.

[0113] 2.3 Comprehensive performance analysis

[0114] In order to comprehensively analyze the comprehensive performance of the proposed model, a radar chart is used to compare and analyze all models. The results are as follows: Figure 8 As shown by Figure 8 It can be seen that the proposed model has the best comprehensive performance. The number of parameters of the improved SOFF-LightNet target detection model is only 53% of the original YOLOv8s model. Using two public datasets, KITTI and PASCAL VOC, for training, the target detection accuracy of the SOFF-LightNet model has been improved to a certain extent compared with the original YOLOv8s model. Due to the increase in model complexity and the number of layers, the detection speed has increased slightly, but it can still meet the needs of real-time target detection. The performance of the SOFF-LightNet model in most aspects is better than that of the original YOLOv8s and YOLOv5s models. The YOLOv8m model has excellent performance in some aspects, but its huge amount of parameter calculation is not suitable for edge computing devices. In terms of parameter quantity, it is also less and more in line with the deployment requirements of edge computing devices.

[0115] 3. Application of target detection model

[0116] The above experiments show that the SOFF-LightNet target detection model meets the requirements of practical engineering applications. Therefore, the proposed model is applied to a four-wheel drive following robot system and is quantitatively evaluated. At the same time, a unique marker is designed to achieve effective following of the target person. For this purpose, a target detection dataset is specially prepared, which contains image samples of special markers under various angles and lighting conditions. Such a dataset not only enriches the training data of the model, but also provides diverse scene information, which helps the robustness and accuracy of the model in practical applications. After training the model, the model performs well in target detection and following tasks. This study provides useful technical support and theoretical guidance for the application field of four-wheel drive following robots, and lays a solid foundation for further research and application in related fields.

[0117] like Fig. 9 As shown, Fig. 9 is the training result of SOFF-LightNet special markers, Fig. 9 It can be seen that the SOFF-LightNet target detection model shows good recognition effect in the four-wheel drive following robot application. The recall rate (Recall) of the proposed model is 99.41%, the precision (Precision) is 99.81%, the F1 score is 99.61%, the average precision mAP0.5 is 99.50%, the mAP0.5:0.95 is 76.94%, and the network parameters are 5.92M. In addition, the loss function has converged within the first 200 rounds of training, which shows its efficient training process. The special markers used in this training have accumulated a large number of data sets in various scenarios, including different distances and light conditions. The evaluation results show that the average precision (mAP) of the markers reaches 99.50% at the 0.5IoU (intersection over union) threshold, and still reaches 76.94% at the more stringent 0.95IoU threshold. Therefore, the proposed model shows good generalization performance and can be effectively applied to intelligent following robot systems.

[0118] 4. Overview

[0119] The present invention proposes a lightweight network target detection method based on structure optimization and feature fusion, and uses the block structure in the lightweight neural network model Mobilenetv3 proposed by Google as the backbone feature extraction network of the model. A lighter module is used for the C2f structure, which reduces a large number of parameters and enhances the feature extraction capability by combining the spatial pyramid pooling operation. An upsampled feature map with higher resolution, richer semantic information and detail information is added as the output of the detection head and the overall structure is adjusted.

[0120] The proposed SOFF-LightNet model improves the detection accuracy of the model while reducing the model calculation parameters, and has stronger detection capabilities for small-sized objects. Tests and comparisons were conducted on two public datasets, PASCAL VOC and KITTI. Through experiments and analysis, the feasibility of optimization of each part was verified. The results show that the detection performance of the SOFF-LightNet model is better than that of the YOLOv5s and YOLOv8s models, and is close to that of the YOLOv8m. The SOFF-LightNet model was deployed on edge devices for testing and applied to a smart following robot.

[0121] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described with reference to the preferred embodiments of the present invention, it should be understood by those skilled in the art that various changes may be made in form and details without departing from the spirit and scope of the present invention as defined in the appended claims.

Claims

1. A lightweight network target detection method based on structure optimization and feature fusion, characterized in that: The steps include: Obtain target image dataset; Design a lightweight feature extraction network MobileNetv3 and an optimized C2f module, introduce an attention mechanism and a new activation function H-swish, and build a lightweight network object detection model based on structure optimization and feature fusion; Using the public data set and the target image data set to train and verify the target detection model, to obtain a trained target detection model; The target image to be processed is used as the input of the trained target detection model, the target image to be processed is identified and located, and a target detection result of the target image to be processed is obtained.

2. The lightweight network target detection method based on structure optimization and feature fusion according to claim 1 is characterized in that: The design of the lightweight feature extraction network MobileNetv3 and the optimized C2f module includes: designing a backbone feature extraction network with a block structure, and designing a neck feature extraction network with a DG_C2f module structure.

3. The lightweight network target detection method based on structure optimization and feature fusion according to claim 1 is characterized in that: The target detection model includes a backbone feature extraction network with a block structure, a neck feature extraction network with a DG_C2f module structure, and a detection head network; the trained target detection model uses the input target image data set as the input of the backbone feature extraction network to extract a deep feature map, processes the deep feature map through the neck feature extraction network to extract a shallow feature map, and then performs multi-scale feature fusion on the deep feature map and the shallow feature map in the neck feature extraction network to fuse the generated multi-scale feature map and input it into the detection head network to obtain the target detection result of the target image data set as the output of the target detection model.

4. The lightweight network target detection method based on structure optimization and feature fusion according to claim 3 is characterized in that: The backbone feature extraction network includes a CBS module, a convolution unit, a first deep convolution fusion unit, a second deep convolution fusion unit and a spatial pyramid pooling module connected in sequence; Among them, the CBS module includes cascaded convolutional layers, batch normalization layers and SiLU activation layers; the convolution unit includes 3 cascaded block modules; the first deep convolution fusion unit includes 5 cascaded seblock modules; the second deep convolution fusion unit includes 4 cascaded seblock modules; the spatial pyramid pooling module includes a first CBS module, 3 maximum pooling layers, a fully connected module and a second CBS module connected in sequence, wherein the fully connected module is used to splice the outputs of the first CBS module and the 3 maximum pooling layers and output them to the second CBS module.

5. The lightweight network target detection method based on structure optimization and feature fusion according to claim 4 is characterized in that: The block module performs 1×1 dimensionality-increasing convolution on its input image, and then sequentially performs 3×3 depthwise separable convolution and 1×1 dimensionality-reducing convolution, and then passes through an activation function and performs superposition operation with the original input image to obtain an output feature map; The seblock module performs 1×1 dimensionality-increasing convolution on its input image, and then sequentially performs 3×3 depthwise separable convolution, attention mechanism and 1×1 dimensionality-reducing convolution, and then passes through an activation function and performs superposition operation with the original input image to obtain an output feature map.

6. The lightweight network target detection method based on structure optimization and feature fusion according to claim 4 is characterized in that: The neck feature extraction network includes three upsampling feature fusion units and two connection feature fusion units; the upsampling feature fusion unit includes a cascaded upsampling module, a connection layer and a DG_C2f module; the connection feature fusion unit includes a cascaded CBS module, a connection layer and a DG_C2f module; The output of the backbone feature extraction network is used as the input of the first upsampling feature fusion unit, and the output of the first deep convolution fusion unit in the backbone feature extraction network is transmitted to the connection layer in the first upsampling feature fusion unit for splicing and fusion operation, and the output of the first upsampling feature fusion unit is transmitted to the upsampling module of the second upsampling feature fusion unit and the connection layer of the first connection feature fusion unit respectively; The output of the convolution unit in the backbone feature extraction network is input to the connection layer in the second upsampling feature fusion unit for splicing and fusion operation. The output of the second upsampling feature fusion unit is transmitted to the upsampling module of the third upsampling feature fusion unit, the CBS module of the first connection feature fusion unit and the detection head network respectively. The output of the first block module in the convolution unit of the backbone feature extraction network and its feature map after two maximum pooling operations are input to the connection layer of the third upsampling feature fusion unit to participate in the splicing and fusion operation. The output of the third upsampling feature fusion unit is directly transmitted to the detection head network; The output of the first connected feature fusion unit is transmitted to the CBS module and the detection head network of the second connected feature fusion unit respectively; The output of the backbone feature extraction network is also transmitted to the connection layer in the second connection feature fusion unit to participate in the splicing and fusion operation, and the output of the second connection feature fusion unit is also directly transmitted to the detection head network.

7. The lightweight network target detection method based on structure optimization and feature fusion according to claim 6 is characterized in that: The processing process of the DG_C2f module includes the following steps: After performing depth-wise separable convolution on the input feature map, feature extraction is performed on the depth-wise convolution map in two branches. After slicing operation, one branch divides the input feature map into two parts. One part of the feature map enters the first phantom module, and the other part enters the second phantom module. In the other branch, two maximum pooling operations are performed to obtain multi-scale feature maps. Finally, the feature map obtained by the maximum pooling operation and the feature map obtained by the phantom module are fused in the connection layer and output after depth-wise separable convolution.

8. The lightweight network target detection method based on structure optimization and feature fusion according to claim 1 is characterized in that: The process of training and validating the target detection model includes: Set the learning rate and hyperparameters of the target detection model and adjust the target image dataset based on the preset input image size and scaling of public datasets; setting the number of iterations to train the target detection model to obtain a trained target detection model; Finally, based on the adjusted public dataset, the trained object detection model is verified according to the evaluation indicators.

Citation Information

Patent Citations

  • Lightweight target detection method

    CN114120019A

  • Safety equipment detection method based on improved YOLOv5s

    CN115496951A

  • SAR image vessel detection method based on deep fusion optimization feature enhancement network

    CN118212523A

Cited By

  • Lightweight service robot target detection method and device

    CN119399438A

  • Improved YOLOv8n-based crowded scene pedestrian detection method

    CN119540869A

  • One-stage target detection method, device and equipment applied to medical detection

    CN119851094A

  • Road surface open scene target detection method based on thermal infrared identification

    CN119919771A

  • Improved YOLOv8n-based crowded scene pedestrian detection method

    CN119942428A