A target detection method and system based on privacy protection and optimal selection strategy

By locally training the object detection model in multiple client groups and using global server aggregation parameters, the problem of privacy data leakage and poor prediction results is solved, and the target detection effect with high accuracy and robustness is achieved.

CN118710871BActive Publication Date: 2025-04-15HUAZHONG NORMAL UNIV +1
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202410681974.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-29
Publication Date
2025-04-15
Estimated Expiration
2044-05-29

AI Technical Summary

Technical Problem

The existing object detection model has the risk of privacy data leakage during training, and cannot obtain the best prediction results, making it difficult to accurately identify multi-scale and multi-class data in various scenarios.

Method used

By assigning the initial data set to multiple client groups and training the local detection model on the local client, the global server is used to aggregate and update the weight parameters, so as to protect the privacy data and optimize the model parameters.

Benefits of technology

It effectively protects the privacy data on the client, improves the detection accuracy and generalization performance of the object detection model, and enhances the robustness and adaptability of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118710871B_ABST
    Figure CN118710871B_ABST
Patent Text Reader

Abstract

The present invention proposes a target detection method and system based on privacy protection and optimal selection strategy, which relates to the technical field of computer vision, including: S1, obtaining a first client group, and evenly distributing an initial data set to the first client group, wherein the first client group includes a plurality of clients to be trained; S2, screening the first client group with a preset training ratio to obtain a second client group, so that the second client group receives a weight parameter assigned by a global server, wherein each client in the second client group has a built-in local detection model; S3, preprocessing the local data of each client in the second client group to obtain an image set corresponding to each client in the second client group, and using The image set corresponding to each client performs iterative training on its built-in local detection model until a preset training round is reached, and the optimal weight parameters of each local detection model in the second client group are obtained; S4, the optimal weight parameters of all local detection models in the second client group are aggregated to obtain aggregate model parameters, and the global detection model is updated based on the aggregate model parameters, and the aggregate model parameters are distributed to each client in the second client group to update the weight parameters of each local detection model in the second client group; S5, steps S2-S4 are repeated until the communication round of the global detection model reaches the preset communication round, and the final trained global detection model and local detection model are obtained. The present invention helps to protect data privacy and enhance prediction accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of computer vision, and in particular to a target detection method and system based on privacy protection and optimal selection strategy. Background Art

[0002] Object detection is a computer vision technique that aims to identify specific objects in images or videos. Based on various deep learning and machine learning algorithms, object detection can accurately identify and locate target objects in complex environments. Some of the most famous object detection models include YOLO, RETINA-NET, FASTER R-CNN, and Single Shot MultiboxDetector (SSD), which use multi-scale feature information to detect objects of different sizes. In addition, there are various object detection models applied to solve problems in real scenarios, such as detecting the number of steel bars, detecting protective equipment for workers on construction sites, and applying them to autonomous driving and safety monitoring.

[0003] The Chinese patent with the publication number CN114241188A discloses a multi-scale target detection method and system for smoothly transmitting semantic information, which includes: S1, constructing a residual block that places the ReLU layer before the convolution layer; S2, using the residual block of S1 to construct the first-stage backbone network; S3, using the first-stage backbone network to extract features from the image to obtain a feature map; S4, inputting the feature map obtained in S3 into the second-stage target detection network for processing to obtain a region proposal; S5, mapping the region proposal to the feature map to obtain the region of interest, and obtaining the target detection result through ROI Align processing. However, the above method uses a target detection model that requires the collection of a large amount of data to train the prediction model, and there is a risk of privacy data leakage during model training, and the best prediction result cannot be obtained. Therefore, it is very necessary to provide a target detection method and system based on privacy protection and optimal selection strategy to achieve accurate recognition of multi-scale and multi-class data in various scenarios to protect data privacy and enhance prediction accuracy. Summary of the invention

[0004] In view of this, the present invention proposes a target detection method and system based on privacy protection and optimal selection strategy. By allocating data to multiple client groups, adopting local model training and global parameter update, the protection of privacy data and the optimization of aggregation model parameters are achieved. At the same time, multi-scale feature fusion and loss function optimization also make the model have stronger feature expression ability and generalization performance to enhance the model prediction accuracy.

[0005] The present invention provides a target detection method based on privacy protection and optimal selection strategy, the method comprising:

[0006] S1, obtaining a first client group and evenly distributing an initial data set to the first client group, wherein the first client group includes a plurality of clients to be trained;

[0007] S2, screening the first client group according to a preset training ratio to obtain a second client group, so that the second client group receives a weight parameter assigned by a global server, wherein each client in the second client group has a built-in local detection model;

[0008] S3, preprocessing the local data of each client in the second client group to obtain an image set corresponding to each client in the second client group, and iteratively training its built-in local detection model using the image set corresponding to each client until a preset training round is reached, thereby obtaining the optimal weight parameters of each local detection model in the second client group;

[0009] S4, aggregating the optimal weight parameters of all local detection models in the second client group to obtain aggregated model parameters, updating the global detection model based on the aggregated model parameters, and distributing the aggregated model parameters to each client in the second client group to update the weight parameters of each local detection model in the second client group;

[0010] S5, repeat steps S2-S4 until the communication round of the global detection model reaches the preset communication round, and obtain the final trained global detection model and local detection model.

[0011] Based on the above technical solution, preferably, in step S3, preprocessing the local data of each client in the second client group to obtain an image set corresponding to each client in the second client group specifically includes:

[0012] Acquire an initial data set in any client in the second client group;

[0013] Randomly selecting multiple images from the initial data set to construct an image data set;

[0014] The images in the image data set are sequentially scaled and cropped based on a preset cropping frame to obtain an image set and image labels corresponding to the image set.

[0015] On the basis of the above technical solution, preferably, the network structure of the local detection model is:

[0016] The backbone network includes a feature extraction module and a feature segmentation module, wherein the feature extraction module extracts an initial feature map corresponding to an image set, and the feature segmentation module is used to segment the initial feature map through a CSP module to obtain a first feature map and a second feature map, wherein the feature extraction module is a Focus module, two CBL modules and two CSP modules, and the feature segmentation module is two CBL modules, one CSP module and one SPP module;

[0017] The neck network includes two FPN modules and one PANet module. The neck network performs split-path fusion on the first feature map and the second feature map, and obtains fusion features of three different scales using three fusion routes respectively.

[0018] The head network consists of three convolutional modules, which detect image objects using fused features of three different scales.

[0019] More preferably, the expression of the image label is:

[0020]

[0021]

[0022]

[0023] in, RS ( ) represents the random scaling function, I represents the image dataset, crop ( ) represents the random clipping function, cropbox Represents the cropping frame, J Represents an image in the image dataset after scaling and cropping. J t Represents the image dataset that needs to be merged. x represents the image label, C represents the connection function, L Represents a label function.

[0024] More preferably, the backbone network includes a feature extraction layer, a cross-stage local layer and a spatial pyramid pooling layer, wherein:

[0025] The feature extraction layer is used to divide the image set into the initial feature map;

[0026] The cross-stage local layer is used to extract deep semantic information in the initial feature map, so that the initial feature map is differentiated into the first feature map and the second feature map;

[0027] The spatial pyramid pooling layer is used to perform a pooling operation on the first feature map and the second feature map.

[0028] More preferably, the expression of the multi-scale fusion function is:

[0029]

[0030] in, y represents the multi-scale fusion function, represents the first feature map, represents the second feature map, M ( ) represents a mapping function that inputs the second feature map into the multi-scale fusion function, T ( ) represents the transition function, F ( ) represents a transition function for fusing the first feature map and the second feature map.

[0031] More preferably, the expression of the total loss function is:

[0032]

[0033] in, L total represents the total loss function, N represents the number of samples, B i Indicates i The number of targets in samples, S*S Indicates i The number of grids into which the samples are divided, Indicates j A localization loss function, Indicates j The object loss function is Indicates j A classification loss function, Indicates j The weight corresponding to the positioning loss function is Indicates j The weight corresponding to the loss function of each object, Indicates j The weight corresponding to the classification loss function.

[0034] More preferably, the expression of the positioning loss function is:

[0035]

[0036] in, b represents the prediction box, b gt represents the ground truth box, wIndicates the width of the prediction box, h Represents the height of the prediction box, w gt represents the width of the ground truth box, h gt represents the width of the ground truth box, represents the distance between the predicted center point and the ground truth box, c is the farthest boundary distance between the predicted box and the ground truth box, is the weight coefficient.

[0037] More preferably, the aggregation model parameter expression is:

[0038]

[0039]

[0040] in, represents the optimal weight parameter output by the i-th client in the r+1-th communication round. represents the weight coefficient, Indicates the current weight of the i-th client The average gradient under represents the learning rate, represents the proportion of the i-th client in the aggregation of the r+1-th communication round, represents the aggregation model parameters, Indicates the total number of clients in the second client group.

[0041] In a second aspect of the present application, a target detection system based on privacy protection and optimal selection strategy is provided. The target detection system (1) comprises an information collection module (11), a model training module (12) and a parameter distribution module (13), wherein:

[0042] The information acquisition module (11) is used to obtain a first client group and evenly distribute the initial data set to the first client group, wherein the first client group includes a plurality of clients to be trained;

[0043] The model training module (12) is used to screen the first client group at a preset training ratio to obtain a second client group, so that the second client group receives the weight parameters assigned by the global server, wherein each client in the second client group has a built-in local detection model, and the local data of each client in the second client group is pre-processed to obtain an image set corresponding to each client in the second client group, and the built-in local detection model is iteratively trained using the image set corresponding to each client until a preset training round is reached to obtain the optimal weight parameters of each local detection model in the second client group;

[0044] The parameter distribution module (13) is used to aggregate the optimal weight parameters of all local detection models in the second client group to obtain aggregate model parameters, update the global detection model based on the aggregate model parameters, and distribute the aggregate model parameters to each client in the second client group to update the weight parameters of each local detection model in the second client group until the communication round of the global detection model reaches a preset communication round, thereby obtaining the final trained global detection model and local detection model.

[0045] The target detection method and system based on privacy protection and optimal selection strategy provided by the present invention have the following beneficial effects compared with the prior art:

[0046] By allocating the initial data set to multiple client groups and training the local detection model on the local client, the data set is avoided from being stored in the global server, thereby protecting the privacy data on each client. At the same time, multiple client groups are used for model training, and the weight parameters of all participating clients are aggregated through the global server to update the target detection model, so that the target detection model obtains better aggregate model parameters, thereby improving the detection accuracy of the target detection model. In addition, by calculating the total loss function and completing the training of the target detection model based on it, the aggregate model parameters can be better optimized, and the generalization ability and detection performance of the target detection model can be improved.

[0047] By selecting an initial data set in any client of each second client group and randomly constructing an image data set, personalized model training for individual clients can be achieved, which can better adapt to the data characteristics and needs of different clients, thereby improving the generalization performance and adaptability of the model. Randomly selecting multiple images in the image data set and applying scaling and cropping processing helps to increase the diversity and richness of training data and improve the robustness and generalization ability of the model. At the same time, by applying a preset cropping frame to process the image, obtaining an image set and the corresponding image labels, it helps to provide accurate supervision signals for the model. Accurate label information can help the model learn the characteristics and laws in the target detection task and improve the detection accuracy and performance.

[0048] The use of cross-stage local layers to extract deep semantic information helps the model to better understand the semantic content of the image. Through cross-stage information transmission and extraction, the feature map can have richer representation capabilities, thereby improving the performance of target detection. At the same time, the spatial pyramid pooling layer performs pooling operations on the first feature map and the second feature map, which can realize the aggregation and integration of feature information of different scales and spatial positions, which helps to enhance the model's detection ability for targets of different scales and improve the robustness and accuracy of the target detection model. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0050] Figure 1 A flowchart of a target detection method based on privacy protection and optimal selection strategy provided by the present invention;

[0051] Figure 2 The overall framework diagram of the target detection method based on privacy protection and optimal selection strategy provided by the present invention;

[0052] Figure 3 A structural diagram of the local target detection model provided by the present invention;

[0053] Figure 4 A schematic diagram of the structure of the target detection system based on privacy protection and optimal selection strategy provided by the present invention.

[0054] Explanation of the accompanying drawings: 1. target detection system; 11. information acquisition module; 12. model training module; 13. parameter distribution module. DETAILED DESCRIPTION

[0055] The following will be combined with the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0056] The present application embodiment discloses a target detection method based on privacy protection and optimal selection strategy, such as Figure 1 As shown, the method comprises steps S1 to S5.

[0057] Step S1, obtaining a first client group, and evenly distributing an initial data set to the first client group, wherein the first client group includes a plurality of clients to be trained.

[0058] Step S2, screening the first client group with a preset training ratio to obtain a second client group, so that the second client group receives the weight parameter assigned by the global server, wherein each client in the second client group has a built-in local detection model.

[0059] In this embodiment, respectively define Cis the total number of clients, P is the proportion of clients in the first client group participating in training, then the number of clients in the second client group can be expressed as , and set E is the number of epochs trained for each client in the second client group, and , and define the maximum communication round as R , and make the global server set the initial weight Sent to all clients participating in the training, clients in the second client group start local training.

[0060] Step S3, preprocessing the local data of each client in the second client group to obtain an image set corresponding to each client in the second client group, and iteratively training its built-in local detection model using the image set corresponding to each client until a preset training round is reached, thereby obtaining the optimal weight parameters of each local detection model in the second client group.

[0061] This step also includes steps S31 to S33.

[0062] Step S31, obtaining an initial data set in any client in the second client group.

[0063] Step S32: randomly select multiple images from the initial data set to construct an image data set.

[0064] Step S33: scaling and cropping the images in the image data set in sequence based on a preset cropping frame, and obtaining an image set and an image label corresponding to the image set.

[0065] It is understandable that in order to overcome the problem of class imbalance and small amount of training data, randomly selecting n images and build an image dataset I ( I Include I 1. I 2.…… I n ), and then scale and crop each image. The expression of an image after scaling and cropping in the image dataset is:

[0066]

[0067] The expression of the image dataset that needs to be merged is:

[0068]

[0069] Since merging images can enhance the diversity of objects in the image and enable the target detection model to better learn the target features in different scenarios, the image label expression corresponding to the image set obtained by updating the merged image is:

[0070]

[0071] in, RS ( ) represents the random scaling function, I represents an image dataset, crop ( ) represents the random clipping function, cropbox Represents the cropping frame, J Represents an image in the image dataset after scaling and cropping. J t Represents the image dataset that needs to be merged. x represents the image label, C represents the connection function, L Represents a label function.

[0072] By selecting an initial data set in any client of each second client group and randomly constructing an image data set, personalized model training for individual clients can be achieved, which can better adapt to the data characteristics and needs of different clients, thereby improving the generalization performance and adaptability of the model. Randomly selecting multiple images in the image data set and applying scaling and cropping processing helps to increase the diversity and richness of training data and improve the robustness and generalization ability of the model. At the same time, by applying a preset cropping frame to process the image, obtaining an image set and corresponding image labels, it helps to provide accurate supervision signals for the model. Accurate label information can help the model learn the characteristics and laws in the target detection task and improve detection accuracy and performance.

[0073] Step S4, aggregate the optimal weight parameters of all local detection models in the second client group to obtain aggregate model parameters, update the global detection model based on the aggregate model parameters, and distribute the aggregate model parameters to each client in the second client group to update the weight parameters of each local detection model in the second client group.

[0074] In this embodiment, the network structure of the local detection model is:

[0075] The backbone network includes a feature extraction module and a feature segmentation module. The feature extraction module extracts the initial feature map corresponding to the image set. The feature segmentation module is used to segment the initial feature map through the CSP module to obtain the first feature map and the second feature map. The feature extraction module is a Focus module, two CBL modules and two CSP modules. The feature segmentation module is two CBL modules, one CSP module and one SPP module.

[0076] The neck network includes two FPN modules and one PANet module. The neck network performs split fusion on the first feature map and the second feature map, and obtains fusion features of three different scales using three fusion routes respectively;

[0077] The head network consists of three convolutional modules, which detect image objects using fused features of three different scales.

[0078] Specifically, in this embodiment, the backbone network includes a feature extraction layer, a cross-stage local layer and a spatial pyramid pooling layer, wherein the feature extraction layer is used to divide the image set into an initial feature map; the cross-stage local layer is used to extract deep semantic information in the initial feature map to differentiate the initial feature map into a first feature map and a second feature map; the spatial pyramid pooling layer is used to perform a pooling operation on the first feature map and the second feature map.

[0079] Furthermore, if Figure 2 As shown in Figure 2, the backbone network includes Focus, Cross Stage Partial Networks (CSP) and Spatial Pyramid Pooling (SPP). The Focus structure combines the image collection x Slice the original 640×640×3 image set x Construct an initial feature map of 320×320×32 x 0. The initial feature map x 0 is divided into two parts with similar structures (the first feature map and the second feature map The first feature map Directly linked to the end of the CSP structure, the second feature map It will be connected to the end of the CSP structure through some convolutional layers. The first feature map The original feature map information is retained, so some low-level details and spatial information can be captured. The feature map will be transformed to extract higher-level semantic information and increase the nonlinear capability of the network. Then the first feature map and the second feature map will pass through the SPP structure with different specifications of pooling layers.

[0080] The use of cross-stage local layers to extract deep semantic information helps the model to better understand the semantic content of the image. Through cross-stage information transmission and extraction, the feature map can have richer representation capabilities, thereby improving the performance of target detection. At the same time, the spatial pyramid pooling layer performs pooling operations on the first feature map and the second feature map, which can realize the aggregation and integration of feature information of different scales and spatial positions, which helps to enhance the model's detection ability for targets of different scales and improve the robustness and accuracy of the target detection model.

[0081] The first feature map and the second feature map are fused based on a multi-scale fusion function to obtain a fused feature map, and the fused feature map is input into the neck module to obtain a plurality of transition feature maps of different scales corresponding to the fused feature map.

[0082] The expression of the multi-scale fusion function is:

[0083]

[0084] in, y represents the multi-scale fusion function, represents the first feature map, represents the second feature map, M ( ) represents a mapping function that inputs the second feature map into the multi-scale fusion function, T ( ) represents the transition function, F ( ) represents a transition function for fusing the first feature map and the second feature map.

[0085] In this embodiment, if Figure 3 As shown in the figure, the neck module detection process composed of the Feature Pyramid Networks (FPN) structure and the Path Aggregation Network (PANet) structure causes information loss, incomplete information, and resolution mismatch problems.

[0086] Specifically, the fused feature map passes through the FPN structure and the PANet structure to form three different scale feature maps for head module prediction. In addition, the head module needs to pass through a convolution layer to finally achieve prediction. Among them, the FPN structure includes the CSP module, the CBL module, the upsampling operation module, and the connection layer module. The CBL module contains the convolution layer, the batch normalization layer, and the LeakyReLU activation function. In the PANet structure, firstly, the FPN module and the CSP module are used to generate a scale feature map. M 1, then, M 1 Through the CBL module, the connection layer module and the CSP module, a feature map with another scale is generated M 2. Finally, M 2 Generate another scale feature map through CBL module, connection layer module and CSP module M 3。

[0087] In this embodiment, the head module uses convolutional layers to generate three feature maps: M 1. M 2 and M3 to detect objects of different sizes, so as to realize multi-scale detection of different feature maps, where: M 1> M 2> M 3.

[0088] The total loss is composed of the classification loss 、Object loss and positioning loss Composition. Classification loss It is used to measure the degree of match between the predicted target category and the true category, object loss It is used to measure the degree of match between the predicted bounding box and the ground truth box, positioning loss It is used to measure the difference or deviation between the predicted bounding box and the true bounding box in target detection.

[0089]

[0090] in, and The cross entropy loss function (BCEWithLogitsLoss) is used to calculate the object loss and classification loss in the image data respectively. use The loss is used to calculate the positioning loss. Focuses on whether the model can correctly identify the existence of the target object and the accuracy of the bounding box. Focuses on the accuracy of the model in classifying targets.

[0091] Understandably, L total represents the total loss function, N represents the number of samples, B i Indicates i The number of targets in samples, Indicates i The number of grids into which the samples are divided, Indicates j A localization loss function, Indicates j The object loss function is Indicates j A classification loss function, Indicates j The weight corresponding to the positioning loss function is Indicates j The weight corresponding to the loss function of each object, Indicates j The weight corresponding to the classification loss function.

[0092] The cross entropy loss function (BCEWithLogitsLoss) is used to calculate the object loss and classification loss in the image data respectively. The function expression is:

[0093]

[0094] in, n represents the total sample, Refers to i The labels of samples, Indicates i Sample prediction results.

[0095] The expression of the positioning loss function is:

[0096]

[0097] in, b represents the prediction box, b gt represents the ground truth box, w Indicates the width of the prediction box, h Represents the height of the prediction box, w gt represents the width of the ground truth box, h gt represents the width of the ground truth box, represents the distance between the predicted center point and the ground truth box, c is the farthest boundary distance between the predicted box and the ground truth box, is the weight coefficient.

[0098] Step S5, repeating steps S2-S4 until the communication round of the global detection model reaches the preset communication round, and obtaining the final trained global detection model and local detection model.

[0099] In this embodiment, the aggregation model parameter expression is:

[0100]

[0101]

[0102] in, represents the optimal weight parameter output by the i-th client in the r+1-th communication round. represents the weight coefficient, Indicates the current weight of the i-th client The average gradient under represents the learning rate, represents the proportion of the i-th client in the aggregation of the r+1-th communication round, represents the aggregation model parameters, Indicates the total number of clients in the second client group. The communication round here refers to the number of communications between the local detection model and the global detection model corresponding to the global server.

[0103] Specifically, each client i Train its local model and update the weights using its private data . Client i Selecting the best weights Sent to the global server.

[0104] Furthermore, the global server aggregation weight And update the aggregation model parameters. The server will update the parameters of the r+1 round. Send to the local model and start a new round of training and updating.

[0105] By distributing the initial data set to multiple client groups and training the local detection model on the local client, the data set is avoided from being stored in the global server, thereby protecting the privacy data on each client. At the same time, multiple client groups are used for model training, and the weight parameters of all participating clients are aggregated through the global server to update the target detection model, so that the target detection model obtains better aggregated model parameters, thereby improving the detection accuracy of the target detection model. In addition, by calculating the total loss function and completing the training of the target detection model based on it, the aggregated model parameters can be better optimized, and the generalization ability and detection performance of the target detection model can be improved.

[0106] Based on the above method, the embodiment of the present application discloses a target detection system based on privacy protection and optimal selection strategy, referring to Figure 4 The target detection system 1 includes an information acquisition module 11, a model training module 12 and a parameter distribution module 13, wherein:

[0107] The information collection module 11 is used to obtain a first client group and evenly distribute the initial data set to the first client group, where the first client group includes a plurality of clients to be trained;

[0108] The model training module 12 is used to screen the first client group with a preset training ratio to obtain the second client group, so that the second client group receives the weight parameters assigned by the global server, wherein each client in the second client group has a built-in local detection model, and the local data of each client in the second client group is pre-processed to obtain an image set corresponding to each client in the second client group, and the built-in local detection model is iteratively trained using the image set corresponding to each client until a preset training round is reached to obtain the optimal weight parameters of each local detection model in the second client group;

[0109] The parameter distribution module 13 is used to aggregate the optimal weight parameters of all local detection models in the second client group to obtain aggregated model parameters, update the global detection model based on the aggregated model parameters, and distribute the aggregated model parameters to each client in the second client group to update the weight parameters of each local detection model in the second client group until the communication round of the global detection model reaches the preset communication round, thereby obtaining the final trained global detection model and local detection model.

[0110] In one example, the model training module 12 is used to obtain an initial data set in any client in the second client group; randomly select multiple images in the initial data set to construct an image data set; scale and crop the images in the image data set in sequence based on a preset cropping frame, and obtain an image set and an image label corresponding to the image set.

[0111] In one example, the network structure of the local detection model is:

[0112] The backbone network includes a feature extraction module and a feature segmentation module. The feature extraction module extracts the initial feature map corresponding to the image set. The feature segmentation module is used to segment the initial feature map through the CSP module to obtain the first feature map and the second feature map. The feature extraction module is a Focus module, two CBL modules and two CSP modules. The feature segmentation module is two CBL modules, one CSP module and one SPP module.

[0113] The neck network includes two FPN modules and one PANet module. The neck network performs split fusion on the first feature map and the second feature map, and obtains fusion features of three different scales using three fusion routes respectively;

[0114] The head network consists of three convolutional modules, which detect image objects using fused features of three different scales.

[0115] In one example, the expression for an image label is:

[0116]

[0117]

[0118]

[0119] in, RS ( ) represents the random scaling function, I represents the image dataset, crop ( ) represents the random clipping function, cropbox Represents the cropping frame, J Represents an image in the image dataset after scaling and cropping.J t Represents the image dataset that needs to be merged. x represents the image label, C represents the connection function, L Represents a label function.

[0120] In one example, the backbone network includes a feature extraction layer, a cross-stage local layer, and a spatial pyramid pooling layer, wherein:

[0121] The feature extraction layer is used to split the image set into initial feature maps;

[0122] The cross-stage local layer is used to extract deep semantic information in the initial feature map, so that the initial feature map is differentiated into a first feature map and a second feature map;

[0123] The spatial pyramid pooling layer is used to perform a pooling operation on the first feature map and the second feature map.

[0124] In one example, the expression of the multi-scale fusion function is:

[0125]

[0126] in, y represents the multi-scale fusion function, represents the first feature map, represents the second feature map, M ( ) represents a mapping function that inputs the second feature map into the multi-scale fusion function, T ( ) represents the transition function, F ( ) represents a transition function for fusing the first feature map and the second feature map.

[0127] In one example, the expression of the total loss function is:

[0128] ;

[0129] in, L total represents the total loss function, N represents the number of samples, B i Indicates i The number of targets in samples, S*S Indicates i The number of grids into which the samples are divided, Indicates j A localization loss function, Indicates j The object loss function is Indicates j A classification loss function, Indicates j The weight corresponding to the positioning loss function is Indicates j The weight corresponding to the loss function of each object, Indicates j The weight corresponding to the classification loss function.

[0130] In one example, the expression of the localization loss function is:

[0131] ;

[0132] in, b represents the prediction box, b gt represents the ground truth box, w Indicates the width of the prediction box, h Represents the height of the prediction box, w gt represents the width of the ground truth box, h gt represents the width of the ground truth box, represents the distance between the predicted center point and the ground truth box, c is the farthest boundary distance between the predicted box and the ground truth box, is the weight coefficient.

[0133] In one example, the aggregate model parameter expression is:

[0134]

[0135]

[0136] in, represents the optimal weight parameter output by the i-th client in the r+1-th communication round. represents the weight coefficient, Indicates the current weight of the i-th client The average gradient under represents the learning rate, represents the proportion of the i-th client in the aggregation of the r+1-th communication round, represents the aggregation model parameters, Indicates the total number of clients in the second client group.

[0137] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A target detection method based on privacy protection and optimal selection strategy, characterized in that: The method comprises: S1, obtaining a first client group and evenly distributing an initial data set to the first client group, wherein the first client group includes a plurality of clients to be trained; S2, screening the first client group according to a preset training ratio to obtain a second client group, so that the second client group receives a weight parameter assigned by a global server, wherein each client in the second client group has a built-in local detection model; The network structure of the local detection model is: The backbone network includes a feature extraction module and a feature segmentation module, wherein the feature extraction module extracts an initial feature map corresponding to an image set, and the feature segmentation module is used to segment the initial feature map through a CSP module to obtain a first feature map and a second feature map, wherein the feature extraction module is a Focus module, two CBL modules and two CSP modules, and the feature segmentation module is two CBL modules, one CSP module and one SPP module; The neck network includes two FPN modules and one PANet module. The neck network performs split-path fusion on the first feature map and the second feature map, and obtains fusion features of three different scales using three fusion routes respectively. The head network includes three convolution modules, which respectively detect image targets using fusion features of three different scales. The head network uses a convolution layer to generate three feature maps M1, M2, and M3 to detect objects of different sizes, so as to achieve multi-scale detection of different feature maps, where M1>M2>M3; S3, preprocessing the local data of each client in the second client group to obtain an image set corresponding to each client in the second client group, and iteratively training its built-in local detection model using the image set corresponding to each client until a preset training round is reached, thereby obtaining the optimal weight parameters of each local detection model in the second client group; S4, aggregating the optimal weight parameters of all local detection models in the second client group to obtain aggregated model parameters, updating the global detection model based on the aggregated model parameters, and distributing the aggregated model parameters to each client in the second client group to update the weight parameters of each local detection model in the second client group; S5, repeat steps S2-S4 until the communication round of the global detection model reaches the preset communication round, and obtain the final trained global detection model and local detection model.

2. The method according to claim 1, characterized in that In step S3, preprocessing the local data of each client in the second client group to obtain an image set corresponding to each client in the second client group specifically includes: Acquire an initial data set in any client in the second client group; Randomly selecting multiple images from the initial data set to construct an image data set; The images in the image data set are sequentially scaled and cropped based on a preset cropping frame to obtain an image set and image labels corresponding to the image set.

3. The method according to claim 2, characterized in that The expression of the image label is: ; ; ; in, RS ( ) represents the random scaling function, I represents the image dataset, crop ( ) represents the random clipping function, cropbox Represents the cropping frame, J Represents an image in the image dataset after scaling and cropping. J t Represents the image dataset that needs to be merged. x represents the image label, C represents the connection function, L Represents a label function.

4. The method according to claim 1, characterized in that The backbone network includes a feature extraction layer, a cross-stage local layer, and a spatial pyramid pooling layer, wherein: The feature extraction layer is used to divide the image set into the initial feature map; The cross-stage local layer is used to extract deep semantic information in the initial feature map, so that the initial feature map is differentiated into the first feature map and the second feature map; The spatial pyramid pooling layer is used to perform a pooling operation on the first feature map and the second feature map.

5. The method according to claim 1, characterized in that The expression of the total loss function is: ; in, L total represents the total loss function, N represents the number of samples, B i Indicates i The number of targets in samples, S*S Indicates i The number of grids into which the samples are divided, Indicates j A localization loss function, Indicates j The object loss function is Indicates j A classification loss function, Indicates j The weight corresponding to the positioning loss function is Indicates j The weight corresponding to the loss function of each object, Indicates j The weight corresponding to the classification loss function.

6. The method according to claim 5, characterized in that The expression of the positioning loss function is: ; in, b represents the prediction box, b gt represents the ground truth box, w Indicates the width of the prediction box, h Represents the height of the prediction box, w gt represents the width of the ground truth box, h gt represents the width of the ground truth box, represents the distance between the predicted center point and the ground truth box, c is the farthest boundary distance between the predicted box and the ground truth box, is the weight coefficient.

7. The method according to claim 1, characterized in that The aggregation model parameter expression is: ; ; in, represents the optimal weight parameter output by the i-th client in the r+1-th communication round, represents the weight coefficient, Indicates the current weight of the i-th client The average gradient under represents the learning rate, represents the proportion of the i-th client in the aggregation of the r+1-th communication round, represents the aggregation model parameters, Indicates the total number of clients in the second client group.

8. A target detection system based on privacy protection and optimal selection strategy, characterized in that: The target detection system (1) comprises an information collection module (11), a model training module (12) and a parameter distribution module (13), wherein: The information acquisition module (11) is used to obtain a first client group and evenly distribute the initial data set to the first client group, wherein the first client group includes a plurality of clients to be trained; The model training module (12) is used to screen the first client group at a preset training ratio to obtain a second client group, so that the second client group receives the weight parameters assigned by the global server, wherein each client in the second client group has a built-in local detection model, and the local data of each client in the second client group is pre-processed to obtain an image set corresponding to each client in the second client group, and the built-in local detection model is iteratively trained using the image set corresponding to each client until a preset training round is reached to obtain the optimal weight parameters of each local detection model in the second client group; The network structure of the local detection model is: The backbone network includes a feature extraction module and a feature segmentation module, wherein the feature extraction module extracts an initial feature map corresponding to an image set, and the feature segmentation module is used to segment the initial feature map through a CSP module to obtain a first feature map and a second feature map, wherein the feature extraction module is a Focus module, two CBL modules and two CSP modules, and the feature segmentation module is two CBL modules, one CSP module and one SPP module; The neck network includes two FPN modules and one PANet module. The neck network performs split-path fusion on the first feature map and the second feature map, and obtains fusion features of three different scales using three fusion routes respectively. The head network includes three convolution modules, which respectively detect image targets using fusion features of three different scales. The head network uses a convolution layer to generate three feature maps M1, M2, and M3 to detect objects of different sizes, so as to achieve multi-scale detection of different feature maps, where M1>M2>M3; The parameter distribution module (13) is used to aggregate the optimal weight parameters of all local detection models in the second client group to obtain aggregate model parameters, update the global detection model based on the aggregate model parameters, and distribute the aggregate model parameters to each client in the second client group to update the weight parameters of each local detection model in the second client group until the communication round of the global detection model reaches a preset communication round, thereby obtaining the final trained global detection model and local detection model.

Citation Information

Patent Citations

  • Multi-scale target detection method and system for smoothly transmitting semantic information

    CN114241188A

  • Efficient YOLO detection method for urinary sediment examination

    CN116385334A

  • Power transmission network foreign matter detection method based on federated learning and YOLOv5

    CN117710312A