A license plate recognition method
Through federated learning and compression strategies, the LPRNet license plate recognition model is used to conduct distributed training in the parking lot, solving the problem of data silos and large communication overhead, and achieving efficient license plate recognition model training.
Patent Information
- Application Number
- CN202310304283.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-24
- Publication Date
- 2025-08-15
- Estimated Expiration
- 2043-03-24
AI Technical Summary
In parking lots, how to effectively use multi-party data to train the license plate recognition model without collecting license plate data, reduce communication overhead between the client and the central server, and protect data privacy.
The federated learning method is adopted, by initializing the global license plate recognition model, the client conducts local training and compresses weight update values, the central server performs model aggregation, and uses LPRNet license plate recognition model and compression strategy to reduce the amount of communication data.
On the premise of protecting data privacy, the training efficiency and accuracy of the license plate recognition model are improved, communication overhead is reduced, and communication costs are saved for the client.
Smart Images

Figure CN116168382B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image recognition, and in particular to a license plate recognition method. Background Art
[0002] With the advancement of science and technology, artificial intelligence (AI) technology has rapidly developed globally and is widely applied in many areas of life. Unmanned parking lots aim to utilize an unmanned management model, effectively reducing labor costs and expenditures. To prevent parking fee loss, parking lots require the implementation of intelligent parking fee collection systems. License plate recognition models based on AI are key to implementing intelligent parking fee collection. Training a deep learning-based license plate recognition model with good generalization requires a large license plate dataset. However, due to the limited license plate image data available to a single parking lot manager, the ability to train a license plate recognition model is limited. Therefore, it is necessary to fully coordinate and utilize license plate image data from multiple parking lot managers. However, because license plate datasets contain commercial secrets of each parking lot and may affect the privacy of passing vehicles, most parking lot managers are reluctant to share their data with a central server for centralized model training, resulting in the "data silo" problem. Federated learning has emerged as a new solution to effectively utilize data from multiple sources without requiring data aggregation.
[0003] A complete federated learning process requires multiple rounds of communication and interaction between the local license plate recognition model and the global license plate recognition model. Large-scale neural network models often contain millions of parameters. During the entire training process, local clients need to frequently exchange data with the central server, which means that global license plate recognition model training will incur huge communication overhead. Parking lots are responsible for license plate data collection using general mobile edge devices with limited access bandwidth. Their communication efficiency restricts the overall global license plate recognition model training efficiency of federated learning. Therefore, how to appropriately reduce the amount of data transmitted between the client and the central server while ensuring the accuracy of global license plate recognition model training is a problem that those skilled in the art currently need to solve. Summary of the Invention
[0004] The present invention provides a license plate recognition method for a parking lot license plate model training scenario. While ensuring the global license plate recognition model training accuracy, the amount of data transmitted between a client and a central server is appropriately reduced.
[0005] To achieve the above effects, the technical solutions of the present invention are as follows:
[0006] Step 1: The central server initializes the global license plate recognition model and sends it to each client. The client accepts the global license plate recognition model sent by the central server to update the client's local license plate recognition model.
[0007] Step 2: The client performs local training based on the local dataset of the local license plate model to obtain the weight update value of the local license plate recognition model;
[0008] Step 3: The client compresses the updated weight value and uploads the compressed data to the central server;
[0009] Step 4: The central server receives the compressed data uploaded by the client and reconstructs the weight update value for round t;
[0010] Step 5: The central server updates the global license plate recognition model based on the t-th round weight update value of each client, and sends the updated global license plate recognition model to each client;
[0011] Step 6: The client updates the current local license plate recognition model based on the updated global license plate recognition model, and the tth round of communication is completed; repeat steps 2 to 6 until the current local license plate recognition model converges; input the license plate to be recognized into the converged current local license plate recognition model to obtain the license plate recognition result.
[0012] Furthermore, the global license plate recognition model described in step 1 adopts the LPRNet license plate recognition model.
[0013] In the above-mentioned solution, the present invention, based on federated learning, uses it to organize multiple parking lot managers to jointly train a common LPRNet license plate recognition model, while protecting the privacy of their own license plate image data. This collaboratively improves model accuracy. Using a unified server-specified compression factor, the compression ratio of each LPRNet license plate recognition model is adjusted on demand, resolving the trade-off between communication overhead and global license plate recognition model accuracy during the federated learning process. This approach achieves efficient federated learning with minimal communication cost. This approach addresses the "data island" problem of LPRNet license plate recognition model training and the issue of excessive communication overhead and the inability to adjust on demand.
[0014] Furthermore, step 2 is specifically as follows: when the client completes the t-1th round of communication, that is, step 6, the local license plate recognition model is After the client completes local training for t rounds of communication, i.e. step 2, the local license plate recognition model is Will The weight parameter of the convolution layer of the kth layer is recorded as The weight parameter of the convolution layer of the kth layer is recorded as W local Size (Co ut ,C in ,K1,K2); where C out 、C inand (K1, K2) are the output channel, input channel and convolution kernel size respectively; 11 ,K2) is used as the basic unit of model compression; the weight update value of the kth layer of the local license plate recognition model is
[0015] Furthermore, the client in step 3 compresses the weight update value, and the specific steps include:
[0016] Step 3.1: Determine the pruning rate ρ of the weight parameter of the convolutional layer according to the compression multiple specified by the server;
[0017] Step 3.2, calculate the weight update value W change The L2 norm of The convolution kernels are set to zero to obtain a sparse matrix in Update the value W for the weight change After pruned sparse matrix, complete the weight update value W change Sparse; where M is a binary mask matrix with a size of (C out ,C in ),make is a sparse matrix The non-zero matrices in ;
[0018] Step 3.3, save the non-zero matrix The positive and negative value of and the absolute value of the non-zero matrix Record the absolute value of the non-zero matrix The maximum and minimum values of
[0019] Step 3.4, absolute value of non-zero matrix Quantization is performed element by element, and the quantization interval is The quantization level is L, and the quantization interval is Δ. The quantization interval can be divided into where l∈{0,1,2,…,L-2}; for all like Then order Get the quantized index matrix The quantized index matrix Size and absolute value of nonzero matrices Same, means The value at a certain position is quantized to a certain quantized value; using Recover the absolute value of the quantized non-zero weight update value use Recover the absolute value of the non-zero weight update value The positive and negative values of Then the quantized non-zero weight update value Can be used W index 、 Indicates that, using the binary mask matrix M and Restore the quantized sparse matrix weight update value
[0020] Step 3.5, index matrix Compression to obtain the encoded data of the index matrix At this time, the quantized sparse matrix weight update value Compressed tuples express;
[0021] Step 3.6, repeat steps 3.2 to 3.5 for all convolutional layers of the local license plate recognition model, and compress all tuples And the local license plate recognition model weight update value W change The parameters other than are packaged and uploaded to the central server as the weight update value of the communication client in the tth round.
[0022] Furthermore, the absolute value of the non-zero matrix in step 3.3 Non-zero matrix The positive and negative value of They are:
[0023]
[0024]
[0025] Furthermore, step 3.5 performs the index matrix Compression to obtain the encoded data of the index matrix Specifically: for the index matrix Use Huffman coding of the probability compression algorithm to obtain the encoded data of the index matrix
[0026] Furthermore, the specific steps of step 4 are:
[0027] Step 4.1: After the central server receives the data uploaded by client i, it compresses the weight of the k-th convolution layer into the compressed tuple Decompress; according to ε H (W index ), get the absolute value of the quantized non-zero weight update value
[0028] Step 4.2: Restore the absolute value sign of the non-zero weight update value to obtain the quantized non-zero weight update value.
[0029] Step 4.3: Use the binary mask matrix M to recover the weight update value W of the k-th convolutional layer of client i. i k ;
[0030] Step 4.4: Execute steps 4.1 to 4.3 for all other compressed tuples to obtain the sparse and quantized weight update value of client i in the tth round of communication. After collecting the weight update values of all clients participating in the tth round of training, the quantized weight update values Perform model aggregation to obtain the global weight update value of round t
[0031] Furthermore, step 4.2 is specifically to restore the absolute value sign of the non-zero weight update value according to formula (3) to obtain the quantized non-zero weight update value
[0032]
[0033] Furthermore, step 4.4 updates the quantized weights. Perform model aggregation to obtain the global weight update value of round t Specifically, the quantized weight update value Use the federated average algorithm to aggregate the model and obtain the global weight update value of the tth round
[0034] Furthermore, the central server in step 5 updates the global license plate recognition model according to the weight update value of the tth round, specifically including: the central server updates the global weight update value of the tth round And the t-1 round global license plate recognition model Update the global license plate recognition model for round t
[0035] Compared with the prior art, the beneficial effects of the technical solution of the present invention are:
[0036] This invention implements distributed training of license plate recognition models, leveraging data resources from multiple sources to train a model with excellent generalization capabilities while protecting the privacy of each parking lot's local license plate dataset. Client-side weight update compression significantly reduces communication overhead and client-side costs without sacrificing global model training accuracy, thereby improving model training efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] The accompanying drawings are for illustrative purposes only and are not to be construed as limiting the present invention. To better illustrate the present embodiment, certain components of the accompanying drawings may be omitted, enlarged, or reduced in size, and do not represent the dimensions of actual products. It is understandable to those skilled in the art that certain well-known structures and their descriptions may be omitted from the accompanying drawings.
[0038] Figure 1 A schematic diagram of a method provided by an embodiment of the present invention;
[0039] Figure 2 The present invention is a structural diagram of the license plate recognition system of the present invention;
[0040] Figure 3 This is an overall schematic diagram of the LPRNet license plate recognition model provided by an embodiment of the present invention;
[0041] Figure 4 This is a schematic diagram of the weight sparseness of the convolutional layer of the license plate recognition model provided by an embodiment of the present invention;
[0042] Figure 5 Schematic diagram of weight quantization of the convolutional layer of the license plate recognition model provided by an embodiment of the present invention;
[0043] Figure 6 Schematic diagram showing how the training accuracy changes with the compression ratio according to an embodiment of the present invention;
[0044] Figure 7 2 is a schematic diagram of a curve showing compression ratio and single-round communication overhead of a single client provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0045] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings of 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 making creative efforts are within the scope of protection of the present invention.
[0046] Example 1
[0047] For easier understanding, see Figure 1 、 Figure 4 、 Figure 5 The present invention provides a license plate recognition method, which is applied to a license plate recognition federated learning system, an embodiment of a client and a central server, comprising the following steps:
[0048] Step 1: The central server initializes the global license plate recognition model And the global license plate recognition model Sent to each client, the client accepts the global license plate recognition model sent by the central server to update the client's local license plate recognition model Among them, the license plate recognition federated learning system includes a central server and N clients, N>1;
[0049] The global license plate recognition model adopts the LPRNet license plate recognition model;
[0050] Step 2: The client performs local training based on the current local license plate recognition model using the local dataset to obtain the weight update value W of the local license plate recognition model. change The local dataset is the data that the client has, and specifically includes the following steps:
[0051] When the client completes the t-1th round of communication, that is, step 6, the local license plate recognition model is After the client completes local training for t rounds of communication, i.e. step 2, the local license plate recognition model is (In step 6 of round t-1 communication, the client updates the local license plate recognition model based on the global license plate recognition model Therefore, at the beginning of the tth round of communication, the local license plate recognition model is After completing local training, the local license plate recognition model is );Will The weight parameter of the convolution layer of the kth layer is recorded as The weight parameter of the convolution layer of the kth layer is recorded as W local Size (Co ut ,C in ,K1,K2); where C out 、C in and (K1, K2) are the output channel, input channel and convolution kernel size respectively; the convolution kernel weight update value of size (K1, K2) is used as the basic unit of model compression; then the weight update value of the k-th convolution layer of the local license plate recognition model is
[0052] Step 3: The client updates the weight value W change Compress and upload the compressed data to the central server;
[0053] Wherein, the client updates the weight value W change To perform compression, the specific steps include:
[0054] Step 3.1: Determine the pruning rate ρ of the weight parameter of the convolutional layer according to the compression multiple specified by the server (such as 10 times or 20 times);
[0055] Step 3.2, calculate the weight update value W change The L2 norm of The convolution kernels are set to zero to obtain a sparse matrix in Update the value W for the weight change After pruned sparse matrix, complete the weight update value W change Sparse; where M is a binary mask matrix with a size of (C out ,C in ),make is a sparse matrix The non-zero matrices in ;
[0056] It should be noted that the sparseness here is based on the convolution kernel as the basic unit, and sparse means that the convolution kernel weights are all 0. For all convolution kernels whose weights are not all 0;
[0057] Step 3.3, save the non-zero matrix The positive and negative value of and the absolute value of the non-zero matrix Record the absolute value of the non-zero matrix The maximum and minimum values of
[0058] Absolute value of a nonzero matrix Non-zero matrix The positive and negative value of They are:
[0059]
[0060]
[0061] Step 3.4, absolute value of non-zero matrix Quantization is performed element by element, and the quantization interval is The quantization level is L, L=8, and the quantization interval is Δ. The quantization interval can be divided into where l∈{0,1,2,3,4,,5,6}; for all like Then order Get and quantize the index matrix The quantized index matrix Size and absolute value of nonzero matrices Same, means The value at a certain position is quantized to a certain quantized value; using The absolute value of the quantized non-zero weight update value can be recovered use Recover the absolute value of the non-zero weight update value The positive and negative values of Then the quantized non-zero weight update value Can be used W index 、 Indicates that, using the binary mask matrix M and The quantized sparse matrix weight update value can be restored
[0062] Step 3.5, due to the statistical characteristics of the index matrix, the index matrix Using Huffman coding, we get At this time, the quantized sparse matrix weight update value Compressed tuples express;
[0063] Step 3.6, repeat steps 3.2 to 3.5 for all convolutional layers of the local license plate recognition model, and compress all tuples And the local license plate recognition model weight convolution layer update value W change The parameters other than are packaged, and the packaged data is used as the weight update value of the communication client in the tth round and uploaded to the central server through the network communication device;
[0064] Step 4: The central server receives the compressed data uploaded by the client and reconstructs the weight update value for round t. The specific steps are as follows:
[0065] Step 4.1: After the central server receives the data uploaded by client i, it will compress the weights of the k-th convolution layer into the compressed tuples of all convolution layers. Decompress; according to ε H (W index ), get the absolute value of the quantized non-zero weight update value
[0066] Step 4.2: Restore the absolute value sign of the non-zero weight update value according to formula (3) to obtain the quantized non-zero weight update value
[0067]
[0068] Step 4.3: Use the binary mask matrix M to recover the weight update value W of the k-th convolutional layer of client i. i k ;
[0069] Step 4.4: Execute steps 4.1 to 4.3 for all other compressed tuples to obtain the sparse and quantized weight update value of client i in the tth round of communication. After collecting the weight update values of all clients participating in the tth round of training, the quantized weight update values The Federated Averaging (FedAvg) algorithm is used to aggregate the models and obtain the global weight update value of the tth round.
[0070] Step 5: The central server updates the global license plate recognition model based on the t-th round weight update value of each client, and sends the updated global license plate recognition model to each client;
[0071] The central server updates the global license plate recognition model according to the weight update value of the tth round, specifically including: the central server updates the global weight update value of the tth round And the t-1 round global license plate recognition model Update the global license plate recognition model for round t
[0072] Step 6: The client updates the current local license plate recognition model The tth round of communication is completed; steps 2 to 6 are repeated until the model converges; the license plate to be recognized is input into the converged current local license plate recognition model to obtain the license plate recognition result.
[0073] Model training stops can also be adjusted based on a set maximum number of training epochs.
[0074] The system structure of the present invention is shown in the attached Figure 2 As shown, it includes N clients (i.e., parking lot manager A, parking lot manager B, ..., parking lot manager N) and a central server. Each client has a reliable communication channel with the central server for uploading and downloading local license plate recognition models; each client has its own local license plate dataset.
[0075] The present invention determines the weight update value (i.e., the parameter to be compressed) based on the change in the convolutional layer weights in the local license plate recognition model parameters before and after training. The weight update value is compressed using sparse, quantized, and Huffman coding techniques. The compressed parameter is used as the change in the model's t-th round on the client, packaged with the remaining parameters (parameters other than the convolutional layer weight update value), and uploaded to the central server as the weight update value. Compression is only performed on the weight update value of the convolutional layer of the local license plate recognition model. All other parameters, such as the bias of the convolutional layer and all parameters of the BN layer, are not compressed and are uploaded directly to the central server.
[0076] The present invention performs model aggregation based on the federated averaging method, does not change the overall model training logic, is simple to implement, and the compression operation takes little time (millisecond level), does not affect the normal training and convergence of the model. While ensuring the accuracy of global license plate recognition model training, it appropriately reduces the amount of data transmitted between the client and the central server, reduces communication overhead, and accelerates the learning process.
[0077] Example 2
[0078] Specifically, based on Example 1, the solution is described in conjunction with specific implementation examples to further demonstrate the technical effects of this solution. Specifically:
[0079] In this embodiment, the network structure of the LPRNet (License Plate Recognition via Deep Neural Networks) license plate recognition model of the present invention is as follows Figure 3 As shown, the network architecture includes 16 convolutional layers and 6 batch normalization layers. The batch normalization layers can accelerate model training and convergence, control gradient explosion, prevent gradient vanishing, and prevent overfitting. The SmallBasic Block network (see Table 1) uses 1×1 convolutions to reduce model computational complexity, increase network depth, introduce more nonlinearities, and enhance network expressiveness. The model decomposes the 3×3 convolution into 3×1 and 1×3 asymmetric convolutions, reducing the number of parameters and improving test speed.
[0080] In this embodiment, the RGB image of the license plate to be recognized is processed into 94×24 pixels and then input into the LPRNet license plate recognition model. After passing through the first convolutional layer and the first batch normalization layer, a feature map of (64, 22, 94) is obtained, which is recorded as out1. The obtained out1 is sequentially input into the first pooling layer, the first small basic block network (the small basic block structure is shown in the table), and the second batch normalization layer, and a feature map of (128, 20, 90) is obtained, which is recorded as out2. out2 then passes through the second pooling layer, the second small basic block network, the third batch normalization layer, the third small basic block network, and the fourth batch normalization layer to obtain a feature map of (256, 18, 44), which is recorded as out3. After Out3 passes through the third pooling layer, the fourteenth convolution layer, the fifth BN layer, the fifteenth convolution layer, and the sixth BN layer, a feature map out4 of (66, 20, 90) is obtained. Then, out1, out2, and out3 are passed through the corresponding pooling layers to obtain matrices out′1, out′2, and out′3 of (64, 4, 18), (128, 4, 18), and (256, 4, 18), respectively. Out′1, out′2, out′3, and out4 are concatenated to obtain a feature map of size (514, 4, 18) (out′1, out′2, out′3, and out4). Finally, the feature map of size (514, 4, 18) passes through the sixteenth convolution layer to obtain a feature map of size (66, 4, 18). The average is taken on the first dimension of the (66, 4, 18) matrix to obtain a set of (66, 18) vectors for license plate sequence recognition and output of the license plate recognition result.
[0081] Table 1 Small basic block network structure
[0082] Layer Type Parameters Input C(in)*H*W feature map Convolution #C(out) / 4 1*1stride 1 Convolution #C(out) / 4 3*1strideh=1,padh=1 Convolution #C(out) / 4 1*3stridew=1, padw=1 Convolution #C(out)1*1stride 1 Output C(out)*H*W feature map
[0083] In order to solve the problems of client data privacy and security protection and high communication cost between the client and the central server in the current federated learning-based LPRNet license plate recognition model training, the present invention uses federated learning to organize multiple parking lot managers to jointly train the same LPRNet license plate recognition model while protecting the privacy of the license plate image data owned by each parking lot manager, thereby jointly improving the accuracy of the LPRNet license plate recognition model. At the same time, the present invention further uses a compression strategy to adjust the compression ratio of each LPRNet license plate recognition model on demand, thereby reducing the communication overhead in federated learning, saving communication overhead, and improving transmission efficiency.
[0084] In the current network setting, the model parameter communication size is approximately 14.3 Mbits; the number of clients participating in model training is set to 100 (N=100); since most of the clients that can participate in training in federated learning are mobile edge devices, allowing all clients to participate in training each time will increase the probability of clients with limited connectivity falling behind and lead to longer communication time, resulting in greater communication overhead; therefore, in each round of communication, we only randomly select some clients to participate in the tth round of model aggregation; 10% (i.e., 10 users) are selected each round to participate in the model update; the number of iterations of local license plate recognition model training is set to 30, that is, the client uses its own data to perform global weight updates after 30 rounds of local training.
[0085] In this embodiment, the local license plate dataset uses the CCPD-Base category in the CCPD2019 license plate dataset for model training. The CCPD-Base category has a total of 162,121 license plates, 109,100 of which are divided into training sets and 53,021 are divided into test sets. The global license plate recognition model communication rounds are set to 10 rounds, and there are 100 clients participating in the model training. Each user has 1,091 license plate photos.
[0086] In order to compare the model training effect, the compression ratio is set to 1 as a comparative experiment. At this time, the LPRNet license plate recognition model is not compressed and uses the federal average algorithm. Figure 6 The curve showing the variation of the model training accuracy with the compression ratio in this embodiment is shown as follows: Figure 7 This is a curve diagram of the compression ratio and the average communication consumption of a single client in a single round of communication. Figure 6 As shown, the compression ratio of the first point is 1, and the model is the federated average algorithm. Due to the compression strategy, even if the LPRNet license plate recognition model is not pruned, quantization and Huffman coding can still achieve a certain degree of compression, with the minimum compression ratio being approximately between 5.7 and 6. In the compression range of 6 to 25, the accuracy of the LPRNet license plate recognition model is relatively stable, and the downward trend does not change significantly. It can be seen that the accuracy of the present invention is good in the embodiment. When the compression ratio is between 6 and 25, the accuracy of the present invention (above 0.8) is close to that of the federated average algorithm, while significantly saving communication overhead.
[0087] Obviously, the above embodiments of the present invention are merely examples for the purpose of clearly illustrating the present invention, and are not intended to limit the embodiments of the present invention. Those skilled in the art will appreciate that other variations or modifications can be made based on the above description. It is not necessary and impossible to enumerate all embodiments here. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention shall be included within the scope of protection of the claims of the present invention.
Claims
1. A license plate recognition method, applied to a license plate recognition federated learning system, characterized in that: The following steps are involved: Step 1: The central server initializes the global license plate recognition model and sends it to each client. The client accepts the global license plate recognition model sent by the central server to update the client's local license plate recognition model. Step 2: The client performs local training based on the local dataset of the local license plate model to obtain the weight update value of the local license plate recognition model; Step 3: The client compresses the weight update value, including: Step 3.1: Determine the pruning rate of the weight parameters of the convolution layer according to the compression multiple specified by the server. ρ ; Step 3.2, calculate the updated weight value The L2 norm of The convolution kernels are set to zero to obtain a sparse matrix ,in Update the value for the weight After pruned sparse matrix, complete the weight update value sparse; is a binary mask matrix of size ,make is a sparse matrix The non-zero matrices in ; Step 3.3, save the non-zero matrix The positive and negative value of and the absolute value , record the absolute value of the non-zero matrix The maximum and minimum values of , ; Step 3.4, absolute value of non-zero matrix Quantization is performed element by element, and the quantization interval is , the quantization level is , the quantization interval is , , the quantization interval can be divided into ,in ; for all ,like , then let , get the quantized index matrix , where the quantized index matrix Size and absolute value of non-zero sparse matrices Same, means The value at a certain position is quantized to a certain quantized value; using 、 , Recover the absolute value of the quantized non-zero weight update value ,use Recover the absolute value of the non-zero weight update value The positive and negative values of ; then the non-zero weight update value after quantization Can be used 、 、 、 Represented by using a binary mask matrix and Restore the quantized sparse matrix weight update value ; Step 3.5, index matrix Compression to obtain the encoded data of the index matrix , at this time the quantized sparse matrix weight update value Compressed tuples express; Step 3.6, repeat steps 3.2 to 3.5 for all convolutional layers of the local license plate recognition model, and compress all tuples And the local license plate recognition model weight update value The parameters other than are packaged and the packaged data is uploaded to the central server as the weight update value of the communication client in the tth round; Step 4: The central server receives the compressed data uploaded by the client and reconstructs the weight update value for round t; Step 5: The central server updates the global license plate recognition model based on the t-th round weight update value of each client, and sends the updated global license plate recognition model to each client; Step 6: The client updates the current local license plate recognition model based on the updated global license plate recognition model, and the tth round of communication is completed; repeat steps 2 to 6 until the current local license plate recognition model converges; input the license plate to be recognized into the converged current local license plate recognition model to obtain the license plate recognition result.
2. A license plate recognition method according to claim 1, characterized in that: The global license plate recognition model described in step 1 adopts the LPRNet license plate recognition model.
3. A license plate recognition method according to claim 1, characterized in that: Step 2 is as follows: The client completes t -1 round of communication, the local license plate recognition model is , the client completes t After local training of round-by-round communication, the local license plate recognition model is ;Will Middle k The convolutional layer weight parameters of the layer are recorded as , Middle k The convolutional layer weight parameters of the layer are recorded as , Size ;in 、 and are the output channel, input channel and convolution kernel size respectively; the size is The convolution kernel weight update value is used as the basic unit of model compression; then the local license plate recognition model k The updated value of the layer weight is , .
4. A license plate recognition method according to claim 1, characterized in that: The absolute value of the non-zero matrix in step 3.3 , non-zero matrix The positive and negative value of They are: (1) (2)。 5. A license plate recognition method according to claim 4, characterized in that: Step 3.5 Index Matrix Compression to obtain the encoded data of the index matrix Specifically: for the index matrix Use Huffman coding to get the encoded data of the index matrix .
6. A license plate recognition method according to claim 5, characterized in that: Step 4: Step 4.1: The central server receives the client's i After uploading the data, for the k-th convolution layer weight, the compressed tuple Decompress; according to 、 、 , get the absolute value of the quantized non-zero weight update value ; Step 4.2, restore the non-zero weight update value The absolute value sign of , and the quantized non-zero weight update value is obtained ; Step 4.3, using the binary mask matrix , restore the client No. k Convolutional layer weight update value ; Step 4.4: Execute steps 4.1 to 4.3 for all other compressed tuples to obtain the communication client for round t. Sparse, quantized weight update values ; After collecting the weight update values of all clients participating in the tth round of training, the quantized weight update values Perform model aggregation to obtain the global weight update value of round t .
7. A license plate recognition method according to claim 6, characterized in that: Specifically, step 4.2 is to restore the absolute value sign of the non-zero weight update value according to formula (3) to obtain the quantized non-zero weight update value ; (3)。 8. A license plate recognition method according to claim 7, characterized in that: Step 4.4 Update the quantized weights Perform model aggregation to obtain the global weight update value of round t Specifically, the quantized weight update value Use the federated average algorithm to aggregate the model and obtain the global weight update value of the tth round .
9. A license plate recognition method according to claim 8, characterized in that: Step 5: The central server updates the global license plate recognition model according to the weight update value of the tth round, specifically including: the central server updates the global weight update value of the tth round And the t-1th round global license plate recognition model , update the t-th round global license plate recognition model , .
Citation Information
Patent Citations
Federal learning system and method based on model pruning and transmission compression optimization
CN115564062A
Compression Framework for Distributed or Federated Learning with Predictive Compression Paradigm
US20220335269A1