Edge device pedestrian detection model construction method under finite communication budget

Through sparse training and pruning of the improved YOLOv3 target detection model, combined with federated learning model aggregation, the problems of data leakage and large communication overhead in pedestrian detection technology are solved, and efficient pedestrian detection on low computing power devices is achieved, improving the System privacy and accuracy.

CN118570834APending Publication Date: 2024-08-30KASHGAR ELECTRONIC INFORMATION IND TECH RES INST
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410338146.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-03-25
Publication Date
2024-08-30

AI Technical Summary

Technical Problem

Existing pedestrian detection technology has data leakage privacy issues in distributed models, high communication overhead, and slow inference speed of edge devices, making it difficult to achieve large-scale deployment.

Method used

The improved YOLOv3 target detection model is used for sparse training and pruning, combined with federated learning model aggregation, to reduce communication overhead, improve the inference speed and model accuracy of edge devices, and improve system privacy.

Benefits of technology

It effectively reduces the communication cost between edge devices and central servers, improves the inference speed and accuracy of the model on low computing power devices, ensures the privacy and security of the system, and is suitable for large-scale deployment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118570834A
    Figure CN118570834A
Patent Text Reader

Abstract

The invention belongs to the technical field of pedestrian detection, and discloses an edge device pedestrian detection model construction method under a finite communication budget, each edge device uses a local pedestrian target detection data set to carry out sparse training on a pedestrian target detection model, then pruning is carried out to obtain a lightweight pedestrian target detection model, and the lightweight pedestrian target detection model is sent to a central server; and the central server aggregates the lightweight pedestrian target detection models from the edge devices and then feeds back the lightweight pedestrian target detection models to the edge devices, and the edge devices update the lightweight pedestrian target detection models. According to the method, the YOLOv3 backbone network is improved, the overall parameter quantity of the model is reduced, sparse training and pruning are introduced, and finally the accuracy of pedestrian detection is kept while the target detection model is lightened.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of pedestrian detection, and relates to a pedestrian detection model construction technology, and in particular to an edge device pedestrian detection model construction method under a limited communication budget. Background Art

[0002] Pedestrian detection technology has been widely used in the fields of intelligent driving, security, and the Internet of Things. It can effectively assist drivers in urban environments to respond to the external environment in a timely manner, avoid collisions with pedestrians, and reduce traffic accidents. Pedestrian detection technology can also help the government in other fields such as criminal investigation and finding lost children.

[0003] Patent application number CN201410196878.7 discloses a distributed pedestrian detection system and method based on a mobile robot platform, the detection system includes a mobile robot platform and a Microsoft Kinect camera carried by the mobile robot platform, a desktop computer and a network communication device. The detection method integrates various mature pedestrian-related detection algorithms and the robot operating system ROS (Robot Operating System), and uses the robot operating system ROS distributed computing nodes to calculate various features of pedestrians, mainly gradient histogram HOG (Histogram of Gradients), face detection node, upper body gradient histogram HOG node, skin color detection node, point cloud detection node and posture detection node, and integrates the various feature data calculated to achieve stable tracking of pedestrian targets during the robot movement process and improve the accuracy of detection. However, the training of traditional distributed models requires that the data sets of all parties be gathered in a central server, and the central server sends the trained model to the distributed nodes after unified training, and then each distributed node performs local tasks. When the distributed nodes need to upload data sets and other content, it is easy to cause data leakage, endangering the privacy of the entire system. Moreover, due to the large amount of data, a large number of distributed nodes transmitting data will result in excessively high communication overhead; at the same time, due to the high cost of robots, it is impossible to apply them to large-scale deployment, and the advantages of the distributed pedestrian detection system are lost; if edge devices with low computing power are to be used for large-scale deployment, the pedestrian detection model is large, which will cause the edge devices to perform reasoning tasks more slowly. Summary of the invention

[0004] The purpose of the present invention is to address the above-mentioned deficiencies in the prior art. The present invention provides a method for constructing a pedestrian detection model for an edge device under a limited communication budget, which can effectively improve the privacy of the system, reduce the communication overhead between the edge device and the central server, and speed up the reasoning speed of the edge device, so that the model can be deployed on low-cost and low-computing-power edge devices, and ultimately can be applied to large-scale deployment. It can also effectively solve the problem of data heterogeneity, improve the accuracy of the edge model, and make it better adapt to its own tasks.

[0005] In order to achieve the above-mentioned object of the invention, the present invention adopts the following technical solutions to achieve it.

[0006] The present invention provides a method for constructing an edge device pedestrian detection model under a limited communication budget, comprising the following steps:

[0007] S1 The central server sends a training signal to each edge device connected to it;

[0008] S2 Each edge device uses the local pedestrian target detection data set to perform sparse training on the pedestrian target detection model and then prune it to obtain a lightweight pedestrian target detection model; the pedestrian target detection model uses an improved YOLOv3 target detection model, which includes an input layer, a backbone network layer, a neck network layer and a prediction network layer; this step includes the following sub-steps:

[0009] S21 uses the local pedestrian target detection dataset to perform sparse training on the pedestrian target detection model once;

[0010] S22 calculates a pruning threshold and prunes channels whose scaling factors in the improved YOLOv3 target detection model are less than the pruning threshold;

[0011] S23 fine-tunes the cropped improved YOLOv3 target detection model;

[0012] S24 performs a first accuracy test on the fine-tuned improved YOLOv3 target detection model. If the requirements are met, a local lightweight pedestrian target detection model is obtained, and step S3 is entered. Otherwise, the sparse training index is adjusted by using adaptive sparsity, and step S21 is returned to, and steps S21-S24 are repeated until the first accuracy of the model meets the requirements;

[0013] Each edge device in S3 sends the lightweight pedestrian target detection model to the central server;

[0014] The S4 central server aggregates the lightweight pedestrian target detection models from each edge device and then feeds them back to each edge device;

[0015] S5 Each edge device freezes the prediction network layer of the local lightweight improved YOLOv3 target detection model, and only uses the received aggregated lightweight pedestrian target detection model to update the input layer, backbone network layer, and neck network layer of the local lightweight improved YOLOv3 target detection model;

[0016] S6 Each edge device performs a second accuracy test. If the requirements are met, the local model training is completed. Otherwise, it returns to step S2 and repeats steps S2-S6 until the second accuracy meets the requirements.

[0017] In the above step S1, the central server sends the training signal to the edge device and sends the initialized pedestrian target detection model to the edge device.

[0018] In the above step S2, the pedestrian target detection model is an improved YOLOv3 target detection model (DSSYOLO network for short); the improved YOLOv3 target detection model can make the network channel smoother and reduce the accuracy loss during pruning through sparse training. The improved YOLOv3 target detection model is used to extract features of different depths for the image to be tested, and then fuse the test, which includes an input layer, a backbone network layer, a neck network layer and a prediction network layer; the input layer, the neck network layer and the prediction network layer use the input layer, the neck network layer and the prediction network layer in the conventional settings of the conventional YOLOv3 network. The backbone network layer is an improved Darknet network, referred to as DSDN network; the DSDN network is improved from the Darknet-53 network; a deeper structure part is used in the partial residual network, and the ordinary convolution in the partial residual module is replaced with a depth separable convolution (DSconv) to reduce the overall model parameter amount. The replaced residual module includes several groups of convolution units; each convolution unit includes two convolution modules arranged in sequence, and the input end of each convolution unit is jump-connected to the output end; the convolution module includes a DSconv convolution layer, a BN layer and an activation function layer (LeakyRelu) connected in sequence. The pedestrian target detection model is provided with three Loss components, namely, prediction box Loss, category Loss and prediction box confidence Loss.

[0019] The prediction box Loss is expressed as:

[0020]

[0021] In the formula, λ coord is a hyperparameter used to adjust the weight of the bounding box loss; s represents the grid size; B represents the number of anchor boxes; Indicates whether the anchor box at i, j has a target. If so, is 1, otherwise it is 0; wi 、h i Respectively represent the width and height of the object; Respectively represent the width and height of the prediction box; x i ,y i Indicates the coordinates of the center point of the object; Represents the coordinates of the center point of the prediction box;

[0022] The category Loss is expressed as:

[0023]

[0024] In the formula, λ class is a hyperparameter used to adjust the weight of classification loss; p i (c) Represent the true category confidence and predicted category confidence of the object respectively;

[0025] The prediction box confidence Loss is expressed as:

[0026]

[0027] In the formula, λ noobj , obj is a hyperparameter used to adjust the weight of confidence loss; Indicates whether the anchor box at i, j has no target. If there is no target is 1, otherwise it is 0; c i , Represent the confidence of the real box and the confidence of the predicted box respectively;

[0028] Therefore, the loss function of the improved YOLOv3 target detection model is: loss = lbox + lobj + lcls.

[0029] Afterwards, the parameter γ of each channel of the BN layer can be used as a scaling factor, and the pruning ratio r can be set. The pruning ratio r and the channel length of the BN layer can be multiplied as the pruning threshold t of the corresponding layer; the channels in the corresponding layer whose scaling factor γ is less than the pruning threshold t are pruned. In a preferred implementation, the pruning ratio r and the sum of the channel lengths of all BN layers are multiplied as the global pruning threshold T; each BN layer is traversed, and the distance between the pruning threshold of each layer and the global pruning threshold is calculated using the L2 norm. If the distance is greater than the set distance threshold, the corresponding layer uses the global pruning threshold as its pruning threshold, otherwise the pruning threshold of the corresponding layer is maintained; the channels whose scaling factor γ of each layer is less than the pruning threshold of the corresponding layer are pruned. The loss function g(γ) obtained based on the scaling factor γ is as follows:

[0030] The output of the corresponding BN layer is:

[0031]

[0032]

[0033] Among them, z in represents the input of the BN layer, z out represents the output of the BN layer, μ B , σ B It represents the mean and variance of the input features of the BN layer, ε represents a very small number to avoid the situation where the denominator is zero, γ represents a trainable scale factor, which is used to indicate the importance of the BN layer, and β represents the bias.

[0034] Then the loss function L for sparse training of the improved YOLOv3 target detection model is:

[0035]

[0036] Where λ is a hyperparameter, i.e., the sparse training index, which is used as a penalty factor to control the sparsity of the BN layer parameters and is used to balance the two losses in L. g(γ) = |γ| represents L1 regularization, and Γ represents the BN layer set.

[0037] Through the above step S21, the local pedestrian target monitoring model is sparsely trained once to obtain the loss L.

[0038] Pruning a channel corresponds to deleting all incoming and outgoing connections of the channel. Through the pruning operation, a lightweight improved YOLOv3 target detection model with lower parameter count and lower computational operations is obtained.

[0039] In the above step S23, according to the final loss function L, the DBN (DepthBatchNormalization) optimization algorithm is used to optimize and adjust the weight parameters and scaling factors of the pruned improved YOLOv3 target detection model.

[0040] In the above step S24, if the fine-tuned improved YOLOv3 target detection model does not meet the first accuracy requirement, it indicates that the model needs to be compressed. At this time, adjust the sparse training index, then return to step S21, and repeat steps S21-S24 until the loss function value of the model meets the first accuracy requirement. The first accuracy is the measurement standard for edge device training.

[0041] The specific operation of the above step S4 is as follows: the central server fixes the prediction network layer of its pedestrian target detection model, and only uses the input layer, backbone network layer and neck network layer of each lightweight pedestrian target detection model for aggregation to obtain an aggregated lightweight pedestrian target detection model. The improved FedAvg algorithm (see Mcmahan HB, MooreE, Ramage D, et al. Communication-Efficient Learning of Deep Networks from Decentralized Data[J].2016.DOI:10.48550 / arXiv.1602.05629) can be used to aggregate the input layer, backbone network layer and neck network layer parameters to obtain an aggregated lightweight pedestrian target detection model. The central server then feeds the aggregated lightweight pedestrian target detection model back to each edge device.

[0042] In the above step S6, each edge device recalculates the final loss function L' of the lightweight improved YOLOv3 target detection model updated in step S5, and determines whether the loss function value of the updated lightweight improved YOLOv3 target detection model meets the second accuracy requirement. The second accuracy is the measurement standard for the central server to train each edge device. If the second accuracy requirement is not met, it indicates that the model needs to be further trained. At this time, according to the final loss function L', the weight parameters of the improved YOLOv3 target detection model are optimized and adjusted respectively through the DBN optimization algorithm, and then return to step S2, and repeat steps S2-S6 until the second accuracy of the model meets the requirements.

[0043] The present invention has the following beneficial effects:

[0044] (1) Starting from the target detection task of edge devices, since edge devices need to be deployed in large numbers, it is necessary to reduce the communication cost between edge devices and central servers, and at the same time, the performance requirements of edge devices will be reduced; in this case, if the original YOLOv3 target detection model continues to be used, it will lead to high communication overhead and low model reasoning speed; therefore, the present invention improves the YOLOv3 backbone network, replaces part of the convolutional layers in the original backbone network structure with depthwise separable convolution, reduces the overall parameter amount of the model, and introduces sparse training and pruning, ultimately achieving a lightweight target detection model while maintaining the accuracy of pedestrian detection.

[0045] (2) The pruning operation in the present invention is for the network model after sparse training, so sparse training is crucial to improving the subsequent model compression rate; the present invention relates to adaptive sparsity, which dynamically adjusts the sparse training index according to the training results during the sparse training process to make the channel smoother, reduce the accuracy loss during the pruning process, and improve the final accuracy of the model.

[0046] (3) The present invention is based on federated learning model aggregation, which ensures the privacy between edge devices and improves the overall security of the system.

[0047] (4) The present invention utilizes a personalized federated learning aggregation algorithm, i.e., freezing the head (including the input layer, backbone network layer, and neck network layer) and only updating the body part (i.e., the prediction network layer), effectively solving the data heterogeneity problem of federated learning and improving the accuracy of edge devices in performing local tasks.

[0048] (5) In the present invention, the edge device will implement a self-screening mechanism for the trained model (through the set first accuracy), and only upload the models that meet the conditions after screening, further reducing the network communication overhead between the edge device and the central server. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1 A schematic diagram of a flow chart of a method for constructing a pedestrian detection model for an edge device under a limited communication budget provided by an embodiment of the present invention;

[0050] Figure 2 This is a schematic diagram of the training process of the lightweight pedestrian target detection model;

[0051] Figure 3 Schematic diagram of the communication process between the central server and the edge device. DETAILED DESCRIPTION

[0052] The specific implementation modes of the present invention are described below so that those skilled in the art can understand the present invention. However, it should be clear that the present invention is not limited to the scope of the specific implementation modes. For those of ordinary skill in the art, as long as various changes are within the spirit and scope of the present invention as defined and determined by the attached claims, these changes are obvious, and all inventions and creations utilizing the concept of the present invention are protected.

[0053] Example 1

[0054] Based on the horizontal federated learning framework, this embodiment provides a method for constructing a pedestrian detection model for edge devices under a limited communication budget. The pedestrian target detection model targeted by the present invention is an improved YOLOv3 target detection model, referred to as the DSSYOLO network. The improved YOLOv3 target detection model includes an input layer, a backbone network layer, a neck network layer, and a prediction network layer; the input layer, the neck network layer, and the prediction network layer use conventional YOLOv3 network conventional settings, see Redmon J, Farhadi A. YOLOv3: An Incremental Improvement [J]. arXiv e-prints, 2018. DOI: 10.48550 / arXiv.1804.02767. The backbone network layer is an improved Darknet network (called DSDN network), which is obtained by improving the Darknet-53 network. Specifically, the ordinary convolution in the residual module Residual Block×8 in the Darknet-53 network is replaced by a depth-separable convolution (DSconv, see Gennari M, Fawcett R, Prisacariu V A. DSConv: Efficient Convolution Operator [J]. 2019. DOI: 10.48550 / arXiv.1901.01928) to reduce the overall number of model parameters. The replaced residual module is called DS_Residual Block×8. The DS_Residual Block×8 module includes 8 groups of convolution units. Each group of convolution units includes two convolution modules set in sequence, and the input end of each convolution unit is jump-connected to the output end; the convolution module includes a DSconv convolution layer, a BN layer, and an activation function layer (LeakyRelu) connected in sequence.

[0055] Through the above-mentioned pedestrian target detection model (i.e., the improved YOLOv3 target detection model), features of different scales can be extracted and features can be fused at different scales (13×13, 26×26, 52×52), so that the network can better identify large, medium and small objects. Finally, the model outputs three feature maps of different scales.

[0056] The pedestrian target detection model is set with three Loss components, namely prediction box Loss, category Loss and prediction box confidence Loss.

[0057] The prediction box Loss is expressed as:

[0058]

[0059] In the formula, λ coordis a hyperparameter used to adjust the weight of the bounding box loss; s represents the grid size; B represents the number of anchor boxes; Indicates whether the anchor box at i, j has a target. If so, is 1, otherwise it is 0; w i 、h i Respectively represent the width and height of the object; Respectively represent the width and height of the prediction box; x i ,y i Indicates the coordinates of the center point of the object; Represents the coordinates of the center point of the prediction box;

[0060] The category Loss is expressed as:

[0061]

[0062] In the formula, λ class is a hyperparameter used to adjust the weight of classification loss; p i (c) Represent the true category confidence and predicted category confidence of the object respectively;

[0063] The prediction box confidence Loss is expressed as:

[0064]

[0065] In the formula, λ noobj , obj is a hyperparameter used to adjust the weight of confidence loss; Indicates whether the anchor box at i, j has no target. If there is no target is 1, otherwise it is 0; c i , Represent the confidence of the real box and the confidence of the predicted box respectively;

[0066] Therefore, the loss function of the improved YOLOv3 target detection model is: loss = lbox + lobj + lcls.

[0067] Taking the parameter γ of the BN layer as the scaling factor, the output of the corresponding BN layer is:

[0068]

[0069]

[0070] z in represents the input of the BN layer, z out represents the output of the BN layer, μ B , σ BIt represents the mean and variance of the input features of the BN layer, ε represents a very small number to avoid the situation where the denominator is zero, γ represents a trainable scale factor, which is used to indicate the importance of the BN layer, and β represents the bias.

[0071] Construct the loss function g(γ) for training the scaling factor γ.

[0072] The final loss function L for jointly training the weights and scaling factors of the improved YOLOv3 target detection model is:

[0073]

[0074] Where λ is a hyperparameter, i.e., the sparse training index, which is used as a penalty factor to control the sparsity of the BN layer parameters and is used to balance the two losses in L. g(γ) = |γ| represents L1 regularization, and Γ represents the BN layer set.

[0075] This embodiment provides a method for constructing an edge device pedestrian detection model under a limited communication budget, such as Figure 1-Figure 3 As shown, it includes the following steps:

[0076] The S1 central server sends a training signal to the edge device connected to it for communication.

[0077] The central server sends the training signal to the edge device and sends the initialized pedestrian target detection model to the edge device.

[0078] Each edge device in S2 uses the local pedestrian target detection dataset to perform sparse training on the pedestrian target detection model and then prunes it to obtain a lightweight pedestrian target detection model; this step includes the following sub-steps:

[0079] S21 uses the local pedestrian target detection dataset to train the pedestrian target detection model once.

[0080] The local pedestrian target monitoring model is trained once through the above step S21 to obtain the loss function loss.

[0081] S22 calculates a pruning threshold and prunes channels whose scaling factors in the improved YOLOv3 target detection model are less than the pruning threshold.

[0082] The parameter γ of each channel of the BN layer is used as the scaling factor, the pruning ratio r is set, and the pruning ratio r is multiplied by the channel length of the BN layer as the pruning threshold t of the corresponding layer; the channels in the corresponding layer whose scaling factor γ is less than the pruning threshold t are pruned. In the preferred implementation, the pruning ratio r is multiplied by the sum of the channel lengths of all BN layers as the global pruning threshold T; each BN layer is traversed, and the distance between the pruning threshold of each layer and the global pruning threshold is calculated using the L2 norm. If the distance is greater than the set distance threshold, the corresponding layer uses the global pruning threshold as its pruning threshold, otherwise the pruning threshold of the corresponding layer is maintained; the channels in each layer whose scaling factor γ is less than the pruning threshold of the corresponding layer are pruned.

[0083] For example, the global pruning threshold is calculated to be T=70%. Then the distance between each layer's pruning threshold t and the global pruning threshold T is calculated. If the distance is greater than the set distance threshold, the corresponding layer uses the global pruning threshold as its pruning threshold t. The channels whose scale factor γ is less than t in each layer are pruned.

[0084] S23 fine-tunes the pruned improved YOLOv3 object detection model.

[0085] Here, according to the final loss function L, the DBN optimization algorithm is used to optimize and adjust the weight parameters and scaling factors of the pruned improved YOLOv3 target detection model.

[0086] S24 performs a first accuracy test on the fine-tuned improved YOLOv3 target detection model. If the requirements are met, a local lightweight pedestrian target detection model is obtained and step S3 is entered. Otherwise, the sparse training index is adjusted using adaptive sparsity, and the process returns to step S21. Steps S21-S24 are repeated until the loss function value of the model meets the first accuracy requirement.

[0087] Each S3 edge device sends the lightweight pedestrian target detection model to the central server.

[0088] The S4 central server aggregates the lightweight pedestrian target detection models from each edge device and then feeds them back to each edge device.

[0089] like Figure 3 As shown in the figure, the central server fixes the prediction network layer of its pedestrian target detection model, and only uses the input layer, backbone network layer and neck network layer of each lightweight pedestrian target detection model for aggregation to obtain the aggregated lightweight pedestrian target detection model. The improved FedAvg algorithm can be used to aggregate the input layer, backbone network layer and neck network layer parameters to obtain the aggregated lightweight pedestrian target detection model. The central server then feeds the aggregated lightweight pedestrian target detection model back to each edge device.

[0090] Each edge device in S5 freezes the prediction network layer of the local lightweight improved YOLOv3 target detection model, and only uses the received aggregated lightweight pedestrian target detection model to update the input layer, backbone network layer and neck network layer of the local lightweight improved YOLOv3 target detection model.

[0091] S6 Each edge device performs a second accuracy test. If the requirements are met, the local model training is completed. Otherwise, return to step S2 and repeat steps S2-S6 until the loss function value of the model meets the second accuracy requirements.

[0092] Each edge device recalculates the final loss function L' of the lightweight improved YOLOv3 target detection model updated in step S5, and determines whether the updated lightweight improved YOLOv3 target detection model meets the second accuracy requirement. If the second accuracy requirement is not met, it indicates that the model needs to be further trained. At this time, according to the final loss function L', the weight parameters of the improved YOLOv3 target detection model are optimized and adjusted respectively through the DBN optimization algorithm, and then returns to step S2, and repeats steps S2-S6 until the second accuracy of the model meets the requirements.

[0093] The first accuracy here is the measurement standard for edge device training. The second accuracy is the measurement standard for the central server to train each edge device. The second accuracy is slightly higher than the first accuracy and is used to judge the final model effect.

[0094] Experimental example

[0095] Here the traditional YOLOv3 model is used as a comparison model.

[0096] (1) On the same device, the traditional YOLOv3 model is trained using 8,000 images. Then, the YOLOv3 model is sparsely trained and pruned according to the method provided in step S2 above to obtain the corresponding pruned model.

[0097] Similarly, the DSSYOLO network model is trained using 8,000 images. Then, the DSSYOLO network model is sparsely trained and pruned according to the method provided in step S2 to obtain the corresponding pruned model.

[0098] The test set (2000 images) was then used to test the YOLOv3 model and its pruned model, the DSSYOLO network model and its pruned model. The test results are shown in Tables 1 and 2.

[0099] Table 1 Pruning results of YOLOv3 and its pruned models

[0100]

[0101] Table 2 Pruning results of DSSYOLO network model and its pruned model

[0102]

[0103] It can be seen from the test results of the YOLOv3 pruning model that, under the above sparse training conditions, when the YOLOv3 model is pruned, the mAP value of the model will drop a lot for every 0.1 increase in the pruning ratio. Although the larger the pruning rate, the more parameters and model size of the model will also decrease significantly, it cannot reach a good balance with the decreasing mAP value. In particular, when the pruning rate reaches 0.8, the mAP value of the model is almost close to zero, and the model can no longer be used.

[0104] The test results of the DSSYOLO pruned model show the results of the DSSYOLO model after pruning. When the pruning rates are 0.6 and 0.7, the mAP value of the pruned model can remain higher than that of the unpruned model, and at a pruning rate of 0.8, the mAP is only about 0.7% lower than that of the unpruned model, indicating that the stability of the DSSYOLO model is better than that of the YOLOv3 model, proving the superiority of the model's network architecture.

[0105] (2) Taking a central server and five edge devices as an example, each edge device is assigned 1600 images as a training set and 400 images as a test set. Then, using the 1600 images, the YOLOv3 model of each edge device is sparsely trained and pruned according to the method provided in the above steps S1-S6 to obtain the corresponding pruned model; then, the YOLOv3 model and its pruned model are tested using 400 images, and the sum of the communication overhead of the YOLOv3 model and its pruned model of each edge device is counted, as shown in Table 3.

[0106] Taking a central server and five edge devices as an example, each edge device is assigned 1600 images as a training set and 400 images as a test set. Then, using the 1600 images, the DSSYOLO network model of each edge device is sparsely trained and pruned according to the method provided in the above steps S1-S6 to obtain the corresponding pruned model; then, the DSSYOLO network model and its pruned model are tested using 400 images, and the sum of the communication overhead of the YOLOv3 model and its pruned model of each edge device is counted, as shown in Table 4.

[0107] Table 3 Communication overhead of YOLOv3 and its pruned models

[0108]

[0109] Table 4 Communication overhead of DSSYOLO and its pruned models

[0110]

[0111] From the communication overhead table of YOLOv3 and its pruned models, it can be seen that the mAP values ​​of the YOLOv3 model and its pruned model after federated training are slightly lower than those of direct training; compared with the YOLOv3 model, the communication overhead of YOLOv3-60 is reduced by 68.1%, and the communication overhead of YOLOv3-70 is reduced by about 71.7%, but the mAP of the model is not high and the accuracy is low. YOLOv3-80 has no application value due to its too low accuracy, so it is not federated trained.

[0112] From the communication overhead table of DSSYOLO and its pruned models, we can see that compared with the YOLOv3 model, the communication overhead of DSSYOLO has decreased by about 17.0%, the communication overhead of DSSYOLO-60 has decreased by about 67.0%, the communication overhead of DSSYOLO-70 has decreased by about 69.6%, and the communication overhead of DSSYOLO-80 has decreased by about 76.3%. The DSSYOLO model itself has a very limited reduction in communication overhead, only about 17.0%, but the model is highly stable, and its pruned model is also highly stable. The DSSYOLO-60, DSSYOLO-70, and DSSYOLO-80 models can all maintain high mAP values ​​and have a significant reduction in communication overhead.

[0113] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0114] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0115] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0116] The present invention uses specific embodiments to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

[0117] Those skilled in the art will appreciate that the embodiments described herein are intended to help readers understand the principles of the present invention, and should be understood that the protection scope of the present invention is not limited to such specific statements and embodiments. Those skilled in the art can make various other specific variations and combinations that do not deviate from the essence of the present invention based on the technical revelations disclosed by the present invention, and these variations and combinations are still within the protection scope of the present invention.

Claims

1. A method for constructing a pedestrian detection model for edge devices under limited communication budget, characterized in that: The following steps are involved: S1 The central server sends a training signal to each edge device connected to it; S2 Each edge device uses the local pedestrian target detection data set to perform sparse training on the pedestrian target detection model and then prune it to obtain a lightweight pedestrian target detection model; the pedestrian target detection model uses an improved YOLOv3 target detection model, which includes an input layer, a backbone network layer, a neck network layer and a prediction network layer; this step includes the following sub-steps: S21 uses the local pedestrian target detection dataset to perform sparse training on the pedestrian target detection model once; S22 calculates a pruning threshold and prunes channels whose scaling factors in the improved YOLOv3 target detection model are less than the pruning threshold; S23 fine-tunes the cropped improved YOLOv3 target detection model; S24 performs a first accuracy test on the fine-tuned improved YOLOv3 target detection model. If the requirements are met, a local lightweight pedestrian target detection model is obtained, and step S3 is entered. Otherwise, the sparse training index is adjusted by using adaptive sparsity, and step S21 is returned to, and steps S21-S24 are repeated until the first accuracy of the model meets the requirements; Each edge device in S3 sends the lightweight pedestrian target detection model to the central server; The S4 central server aggregates the lightweight pedestrian target detection models from each edge device and then feeds them back to each edge device; S5 Each edge device freezes the prediction network layer of the local lightweight improved YOLOv3 target detection model, and only uses the received aggregated lightweight pedestrian target detection model to update the input layer, backbone network layer, and neck network layer of the local lightweight improved YOLOv3 target detection model; S6 Each edge device performs a second accuracy test. If the requirements are met, the local model training is completed. Otherwise, it returns to step S2 and repeats steps S2-S6 until the second accuracy meets the requirements.

2. The method for constructing an edge device pedestrian detection model under a limited communication budget according to claim 1, characterized in that: In step S2, the backbone network layer of the improved YOLOv3 target detection model is an improved Darknet network; the improved Darknet network is obtained by improving the Darknet-53 network, and some residual modules of the Darknet-53 network are replaced, and the replaced residual modules include several groups of convolution units; each convolution unit includes two convolution modules arranged in sequence, and the input end of each convolution unit is jump-connected to the output end; the convolution module includes a DSconv convolution layer, a BN layer and an activation function layer connected in sequence.

3. The method for constructing an edge device pedestrian detection model under a limited communication budget according to claim 2, characterized in that: The pedestrian target detection model is set with three Loss components, namely, prediction box Loss, category Loss and prediction box confidence Loss; The prediction box Loss is expressed as: In the formula, λ coord is a hyperparameter used to adjust the weight of the bounding box loss; s represents the grid size; B represents the number of anchor boxes; Indicates whether the anchor box at i, j has a target. If so, is 1, otherwise it is 0; w i 、h i Respectively represent the width and height of the object; Respectively represent the width and height of the prediction box; x i ,y i Indicates the coordinates of the center point of the object; Represents the coordinates of the center point of the prediction box; The category Loss is expressed as: In the formula, λ class is a hyperparameter used to adjust the weight of classification loss; p i (c) Represent the true category confidence and predicted category confidence of the object respectively; The prediction box confidence Loss is expressed as: In the formula, λ noobj , obj is a hyperparameter used to adjust the weight of confidence loss; Indicates whether the anchor box at i, j has no target. If there is no target is 1, otherwise 0; c i , Represent the confidence of the real box and the confidence of the predicted box respectively; Therefore, the loss function of the improved YOLOv3 target detection model is: loss = lbox + lobj + lcls.

4. The method for constructing an edge device pedestrian detection model under a limited communication budget according to claim 3, characterized in that: In step S22, the parameter γ of each channel of the BN layer is used as a scaling factor, and the pruning ratio r is set. The pruning threshold t of the corresponding layer is obtained by multiplying the pruning ratio r by the channel length of the BN layer. The channels in the corresponding layer whose scaling factor γ is less than the pruning threshold t are pruned.

5. The method for constructing an edge device pedestrian detection model under a limited communication budget according to claim 4, characterized in that: The pruning ratio r is multiplied by the sum of the channel lengths of all BN layers as the global pruning threshold T; each BN layer is traversed, and the distance between the pruning threshold of each layer and the global pruning threshold is calculated using the L2 norm. If the distance is greater than the set distance threshold, the corresponding layer uses the global pruning threshold as its pruning threshold, otherwise the pruning threshold of the corresponding layer is maintained; the channels whose proportional factor γ of each layer is less than the pruning threshold of the corresponding layer are pruned.

6. The method for constructing an edge device pedestrian detection model under a limited communication budget according to claim 5, characterized in that: The loss function g(γ) obtained according to the scaling factor γ: g(γ) = |γ| represents L1 regularization.

7. The method for constructing an edge device pedestrian detection model under a limited communication budget according to claim 6, characterized in that: The final loss function L for training the improved YOLOv3 target detection model is: Where Γ represents the BN layer set, λ represents the hyperparameter, that is, the sparse training index, which serves as a penalty factor to control the sparsity of the BN layer parameters.

8. The method for constructing an edge device pedestrian detection model under a limited communication budget according to claim 1, characterized in that: The specific operation of step S4 is: the central server fixes the prediction network layer of its pedestrian target detection model, and only uses the input layer, backbone network layer and neck network layer of each lightweight pedestrian target detection model for aggregation to obtain the aggregated lightweight pedestrian target detection model.

9. The method for constructing an edge device pedestrian detection model under a limited communication budget according to claim 8, characterized in that: The improved FedAvg algorithm is used to aggregate the parameters of the input layer, backbone network layer and neck network layer to obtain the aggregated lightweight pedestrian target detection model; the central server then feeds the aggregated lightweight pedestrian target detection model back to each edge device.