A lightweight face recognition method and system based on SqueezeNet

By improving the SqueezeNet network and employing filter importance pruning techniques, the problem of excessively large face recognition models on mobile devices was solved, enabling efficient face recognition verification on resource-limited devices.

CN117275062BActive Publication Date: 2026-01-30SHANDONG INSPUR SCI RES INST CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202311185314.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-14
Publication Date
2026-01-30
Estimated Expiration
2043-09-14

AI Technical Summary

Technical Problem

Existing deep convolutional neural network face recognition models, when deployed on mobile devices, suffer from excessive parameters, resulting in excessive storage and computing resource requirements and making it difficult to achieve real-time and reliable authentication.

Method used

An improved SqueezeNet network is adopted, which combines the Fire module structure, batch normalization and iterative filter pruning techniques. By calculating the importance score of the filter and removing the unimportant filter during training, the network parameters and computational complexity are reduced.

Benefits of technology

While maintaining a high recognition rate, the model size and computational load are significantly reduced, making it suitable for resource-constrained mobile devices and achieving lightweight face recognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117275062B_ABST
    Figure CN117275062B_ABST
Patent Text Reader

Abstract

This invention discloses a lightweight face recognition method and system based on SqueezeNet, belonging to the field of face recognition technology. The technical problem this invention aims to solve is how to reduce the network size and achieve face recognition through a more compact network. The technical solution adopted is as follows: The SqueezeNet network is improved; the improved SqueezeNet network is pre-trained on the MS-Celeb-1M dataset for 100k training rounds; 25% of the data from the VGGFace2 training set is randomly selected for iterative pruning of the network; the pruned network is trained and evaluated using 90% of the data from the VGGFace2 training set, and the resulting network is fine-tuned to recover the potential accuracy loss caused by filter removal; the remaining 10% of the data from the VGGFace2 training set is used for validation; and the pruned network is deployed on a mobile device. The system includes an improvement module, a pre-training module, an iterative pruning module, a fine-tuning module, and a validation module.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of face recognition, in particular to a lightweight face recognition method and system based on SqueezeNet. BACKGROUND

[0002] The widespread use of mobile devices in various digital services has created a demand for reliable and real-time personal identity verification, for example, the widespread use of smartphones as an all-in-one platform has led to an increasing number of people relying on them to access online services such as e-commerce and banking. This makes it essential to implement a strong user identity verification mechanism to ensure secure device unlocking and protected transactions. And due to the popularity of cameras in mobile devices and their integration with everyday applications, facial recognition technology has become a common method for verifying user identity today. The rapid development of deep convolutional neural networks (CNNs) has led to the emergence of many face verification architectures. However, these models are usually large, with too many parameters, requiring a large amount of storage and computing resources, which poses a major challenge to deploying them on resource-limited mobile devices.

[0003] Over the years, several lightweight neural networks have been proposed, mainly for common vision tasks in ImageNet. They use different techniques to achieve the purpose of reducing parameters and speeding up processing, such as pointwise convolution, depthwise separable convolution, variable group convolution, hybrid convolution, etc. Some work has applied these networks to the field of face recognition.

[0004] Therefore, how to reduce the network and achieve face recognition through a more compact network is a technical problem to be solved at present. SUMMARY

[0005] The technical task of the present application is to provide a lightweight face recognition method and system based on SqueezeNet to solve the problem of large face recognition verification models.

[0006] The technical task of the present application is achieved in the following manner, a lightweight face recognition method based on SqueezeNet, which is as follows:

[0007] Improving the SqueezeNet network;

[0008] Pre-training the improved SqueezeNet network on the MS-Celeb-1M dataset (referred to as "MS1M"), completing 100k rounds of training; wherein the MS-Celeb-1M dataset contains 1 million celebrity images collected from the Internet, and the scale is relatively large;

[0009] Randomly extracting 25% of the data on the VGGFace2 training set to iteratively prune the network;

[0010] The pruned network was trained and evaluated using 90% of the data on the VGGFace2 training set, and the resulting network was fine-tuned to recover the potential accuracy loss caused by filter removal.

[0011] Validation was performed using the remaining 10% of the VGGFace2 training set, and the pruned network was deployed on a mobile device.

[0012] As a preferred option, the SqueezeNet network is improved as follows:

[0013] The stride of the first volume layer is set to 1, and the input of the SqueezeNet network is 113×113; batch normalization is added between the convolutional layer and the ReLU layer.

[0014] The SqueezeNet network employs a Fire module structure, which includes a squeezing stage and an expanding stage. The squeezing stage uses 1×1 convolutional kernels to reduce the number of channels in the input feature map, thereby reducing the number of parameters and computational complexity. In the expanding stage, both 1×1 and 3×3 convolutional kernels are used to expand the number of channels, improving the model's expressive power. This allows SqueezeNet to maintain high accuracy while reducing model size and computational load.

[0015] As a preferred approach, the network is iteratively pruned as follows:

[0016] The VGGFace2 dataset was used as the training set. The VGGFace2 dataset contains more than 3.3 million images of approximately 9,131 different people, including various poses, expressions, lighting conditions, and occlusions, making it more comprehensive. In each iteration, 25% of the data in the VGGFace2 training set was randomly selected to calculate the importance score of each convolutional filter. The importance score is defined as the squared change in error caused by removing a specific filter from the network.

[0017] More preferably, iterative pruning of the network involves using a first-order Taylor approximation to calculate the gradient elements during training and iteratively removing filters with low importance scores; specifically as follows:

[0018] Given a parameter W = {w0, w1, ..., w...} M A network of} and a network of inputs (x) i ) and output (y i )right The training set The purpose of network training is to solve To minimize the classification error E; parameter w mThe importance of is defined by its impact on error during removal; under the assumption of independent and identically distributed error, the induced error is quantified as the squared difference between the prediction errors E with and without parameters:

[0019]

[0020] Each parameter is calculated The network needs to be evaluated once, and the computation process is very complex; the first-order term of the Taylor expansion is used. Approximately in the vicinity of W To avoid this situation; among them The gradient g is the gradient of w; some scholars have proposed a second-order term of the Taylor expansion, but this requires calculating the Hessian matrix of E, so a first-order approximation is used for a more compact and faster computation; the gradient g is obtained from backpropagation, so it is easy to compute. To calculate a set of parameters W S The joint importance of (e.g., filters), applied

[0021] The optimizer is SGDM, with a batch size of 128 and a learning rate of 0.01. Gradient calculation is performed on mini-batches, and network weights are updated through gradient descent. The importance of each filter is calculated, and at the end of each round, the importance score of each filter is averaged on the mini-batch. The 1% of filters with the lowest scores are removed, and the network is iteratively pruned on the training set until 40% of the network is pruned, at which point the entire pruning task is considered complete. The recognition performance of networks with different pruning degrees is compared, and the network with the highest recognition rate is selected as the final network.

[0022] A lightweight face recognition system based on SqueezeNet, the system comprising:

[0023] An improvement module for enhancing the SqueezeNet network;

[0024] The pre-training module is used to pre-train the improved SqueezeNet network on the MS-Celeb-1M dataset (hereinafter referred to as "MS1M"), completing 100k training rounds; the MS-Celeb-1M dataset contains 1 million celebrity images collected from the Internet, which is quite large in scale.

[0025] The iterative pruning module is used to randomly sample 25% of the data from the VGGFace2 training set to iteratively prune the network.

[0026] The fine-tuning module is used to train and evaluate the pruned network using 90% of the data on the VGGFace2 training set, and to fine-tune the resulting network to recover the potential accuracy loss caused by filter removal.

[0027] The validation module is used to validate the network using the remaining 10% of the VGGFace2 training set and deploy the pruned network on mobile devices.

[0028] Preferably, the improved module sets the stride of the first convolutional layer to 1 and the input of the SqueezeNet network to 113×113; at the same time, batch normalization is added between the convolutional layer and the ReLU layer.

[0029] More preferably, the SqueezeNet network adopts a Fire module structure, which includes a compression squeze stage and an expansion stage. In the compression squeze stage, 1×1 convolutional kernels are used to reduce the number of channels in the input feature map, thereby reducing the number of parameters and computational complexity. In the expansion stage, 1×1 and 3×3 convolutional kernels are used simultaneously to expand the number of channels, improving the expressive power of the model. This allows SqueezeNet to reduce the size of the model and the computational load while maintaining high accuracy.

[0030] More preferably, the iterative pruning module uses a first-order Taylor approximation to calculate the gradient elements during training and iteratively removes filters with low importance scores; specifically as follows:

[0031] Given a parameter W = {w0, w1, ..., w...} M A network of} and a network of inputs (x) i ) and output (y i )right The training set The purpose of network training is to solve To minimize the classification error E; parameter w m The importance of is defined by its impact on error during removal; under the assumption of independent and identically distributed error, the induced error is quantified as the squared difference between the prediction errors E with and without parameters:

[0032]

[0033] Each parameter is calculated The network needs to be evaluated once, and the computation process is very complex; the first-order term of the Taylor expansion is used. Approximately in the vicinity of W To avoid this situation; among them The gradient g is the gradient of w; some scholars have proposed a second-order term of the Taylor expansion, but this requires calculating the Hessian matrix of E, so a first-order approximation is used for a more compact and faster computation; the gradient g is obtained from backpropagation, so it is easy to compute. To calculate a set of parameters W S The joint importance of (e.g., filters), applied

[0034] The optimizer is SGDM, with a batch size of 128 and a learning rate of 0.01. Gradient calculation is performed on mini-batches, and network weights are updated through gradient descent. The importance of each filter is calculated, and at the end of each round, the importance score of each filter is averaged on the mini-batch. The 1% of filters with the lowest scores are removed, and the network is iteratively pruned on the training set until 40% of the network is pruned, at which point the entire pruning task is considered complete. The recognition performance of networks with different pruning degrees is compared, and the network with the highest recognition rate is selected as the final network.

[0035] An electronic device includes: a memory and at least one processor;

[0036] The memory contains computer programs;

[0037] The at least one processor executes the computer program stored in the memory, causing the at least one processor to perform the lightweight face recognition method based on SqueezeNet as described above.

[0038] A computer-readable storage medium storing a computer program that can be executed by a processor to implement the lightweight face recognition method based on SqueezeNet as described above.

[0039] The lightweight face recognition method and system based on SqueezeNet of the present invention has the following advantages:

[0040] (i) This invention employs a pruning method based on the importance score of network filters to reduce the network; iteratively estimates the importance score of the filters based on their impact on network loss, and then prunes the filters with the lowest scores to form a more compact network, which helps to deploy face recognition networks on resource-limited mobile devices and has important practical application value.

[0041] (ii) This invention applies network compression to the existing architecture and develops a lightweight face recognition network based on SqueezeNet. This network uses an improved SqueezeNet architecture and employs a pruning method based on the importance score of the network filter to reduce the network size.

[0042] (III) This invention iteratively estimates the importance score of the filter based on its impact on network loss, and then prunes the filter with the lowest score to form a more compact network, thus solving the problem of the face verification model being too large;

[0043] (iv) This invention is achieved by compressing the network, using a pruning method based on the importance score of the network filter to reduce the network size;

[0044] (V) This invention assigns an importance metric to each filter of a given network by applying a CNN pruning method based on Taylor scoring. Starting with a network trained to achieve the target task of face recognition, the network is iteratively pruned by deleting the filter with the least importance. In order to recover the potential accuracy loss, the pruned network will eventually be retrained for the target task. The resulting lightweight face recognition network can be used for personal authentication in mobile devices. Its lightweight advantage can better meet the requirements of mobile applications and has important practical application value. Attached Figure Description

[0045] The invention will be further described below with reference to the accompanying drawings.

[0046] Appendix Figure 1 This is a flowchart of a lightweight face recognition method based on SqueezeNet;

[0047] Appendix Figure 2 A schematic diagram of the improved SqueezeNe network;

[0048] Appendix Figure 3 This is a schematic diagram of the Fire module of SqueezeNet. Detailed Implementation

[0049] The lightweight face recognition method and system based on SqueezeNet of the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments.

[0050] Example 1:

[0051] As attached Figure 1 This embodiment provides a lightweight face recognition method based on SqueezeNet, which is as follows:

[0052] S1. Improve the SqueezeNet network;

[0053] S2. Pre-train the improved SqueezeNet network on the MS-Celeb-1M dataset (hereinafter referred to as "MS1M") and complete 100k training rounds; the MS-Celeb-1M dataset contains 1 million celebrity images collected from the Internet, which is relatively large in scale.

[0054] S3. Randomly select 25% of the data from the VGGFace2 training set and iteratively prune the network.

[0055] S4. Use 90% of the data on the VGGFace2 training set to train and evaluate the pruned network, and fine-tune the resulting network to recover the potential accuracy loss caused by filter removal.

[0056] S5. Validate using the remaining 10% of the VGGFace2 training set and deploy the pruned network on a mobile device.

[0057] The specific improvements to the SqueezeNet network in step S1 of this embodiment are as follows:

[0058] As attached Figure 2 As shown, the stride of the first convolutional layer is set to 1, and the input of the SqueezeNet network is 113×113; batch normalization is added between the convolutional layer and the ReLU layer.

[0059] As attached Figure 3 As shown, the SqueezeNet network adopts a Fire module structure, which includes a squeezing stage and an expanding stage. In the squeezing stage, 1×1 convolutional kernels are used to reduce the number of channels in the input feature map, thereby reducing the number of parameters and computational complexity. In the expanding stage, 1×1 and 3×3 convolutional kernels are used simultaneously to expand the number of channels, improving the expressive power of the model. This allows SqueezeNet to reduce the size of the model and the computational load while maintaining high accuracy.

[0060] The iterative pruning of the network in step S3 of this embodiment is as follows:

[0061] The VGGFace2 dataset was used as the training set. The VGGFace2 dataset contains more than 3.3 million images of approximately 9,131 different people, including various poses, expressions, lighting conditions, and occlusions, making it more comprehensive. In each iteration, 25% of the data in the VGGFace2 training set was randomly selected to calculate the importance score of each convolutional filter. The importance score is defined as the squared change in error caused by removing a specific filter from the network.

[0062] In this embodiment, step S3 involves iteratively pruning the network by calculating the gradient elements during training using a first-order Taylor approximation, and iteratively removing filters with low importance scores; specifically as follows:

[0063] Given a parameter W = {w0, w1, ..., w...} M A network of} and a network of inputs (x) i ) and output (y i )right The training set The purpose of network training is to solve To minimize the classification error E; parameter w m The importance of is defined by its impact on error during removal; under the assumption of independent and identically distributed error, the induced error is quantified as the squared difference between the prediction errors E with and without parameters:

[0064]

[0065] Each parameter is calculated The network needs to be evaluated once, and the computation process is very complex; the first-order term of the Taylor expansion is used. Approximately in the vicinity of W To avoid this situation; among them The gradient g is the gradient of w; some scholars have proposed a second-order term of the Taylor expansion, but this requires calculating the Hessian matrix of E, so a first-order approximation is used for a more compact and faster computation; the gradient g is obtained from backpropagation, so it is easy to compute. To calculate a set of parameters W S The joint importance of (e.g., filters), applied

[0066] The optimizer is SGDM, with a batch size of 128 and a learning rate of 0.01. Gradient calculation is performed on mini-batches, and network weights are updated through gradient descent. The importance of each filter is calculated, and at the end of each round, the importance score of each filter is averaged on the mini-batch. The 1% of filters with the lowest scores are removed, and the network is iteratively pruned on the training set until 40% of the network is pruned, at which point the entire pruning task is considered complete. The recognition performance of networks with different pruning degrees is compared, and the network with the highest recognition rate is selected as the final network.

[0067] Example 2:

[0068] This embodiment provides a lightweight face recognition system based on SqueezeNet, which includes:

[0069] An improvement module for enhancing the SqueezeNet network;

[0070] The pre-training module is used to pre-train the improved SqueezeNet network on the MS-Celeb-1M dataset (hereinafter referred to as "MS1M"), completing 100k training rounds; the MS-Celeb-1M dataset contains 1 million celebrity images collected from the Internet, which is quite large in scale.

[0071] The iterative pruning module is used to randomly sample 25% of the data from the VGGFace2 training set to iteratively prune the network.

[0072] The fine-tuning module is used to train and evaluate the pruned network using 90% of the data on the VGGFace2 training set, and to fine-tune the resulting network to recover the potential accuracy loss caused by filter removal.

[0073] The validation module is used to validate the network using the remaining 10% of the VGGFace2 training set and deploy the pruned network on mobile devices.

[0074] As attached Figure 2 As shown, the improved module in this embodiment sets the stride of the first convolutional layer to 1, and the input of the SqueezeNet network to 113×113; at the same time, batch normalization is added between the convolutional layer and the ReLU layer.

[0075] As attached Figure 3 As shown, the SqueezeNet network in this embodiment adopts a Fire module structure. A Fire module structure includes a compression squeze stage and an expansion stage. In the compression squeze stage, 1×1 convolutional kernels are used to reduce the number of channels in the input feature map, thereby reducing the number of parameters and computational complexity. In the expansion stage, 1×1 and 3×3 convolutional kernels are used simultaneously to expand the number of channels, improving the expressive power of the model. This allows SqueezeNet to reduce the size of the model and computational load while maintaining high accuracy.

[0076] The iterative pruning module in this embodiment uses a first-order Taylor approximation to calculate the gradient elements during training and iteratively removes filters with low importance scores; specifically as follows:

[0077] Given a parameter W = {w0, w1, ..., w...} M A network of} and a network of inputs (x) i ) and output (y i )right The training set The purpose of network training is to solve To minimize the classification error E; parameter w mThe importance of is defined by its impact on error during removal; under the assumption of independent and identically distributed error, the induced error is quantified as the squared difference between the prediction errors E with and without parameters:

[0078]

[0079] Each parameter is calculated The network needs to be evaluated once, and the computation process is very complex; the first-order term of the Taylor expansion is used. Approximately in the vicinity of W To avoid this situation; among them The gradient g is the gradient of w; some scholars have proposed a second-order term of the Taylor expansion, but this requires calculating the Hessian matrix of E, so a first-order approximation is used for a more compact and faster computation; the gradient g is obtained from backpropagation, so it is easy to compute. To calculate a set of parameters W S The joint importance of (e.g., filters), applied

[0080] The optimizer is SGDM, with a batch size of 128 and a learning rate of 0.01. Gradient calculation is performed on mini-batches, and network weights are updated through gradient descent. The importance of each filter is calculated, and at the end of each round, the importance score of each filter is averaged on the mini-batch. The 1% of filters with the lowest scores are removed, and the network is iteratively pruned on the training set until 40% of the network is pruned, at which point the entire pruning task is considered complete. The recognition performance of networks with different pruning degrees is compared, and the network with the highest recognition rate is selected as the final network.

[0081] Example 3:

[0082] This embodiment also provides an electronic device, including: a memory and a processor;

[0083] The memory stores the instructions executed by the computer.

[0084] The processor executes computer execution instructions stored in the memory, causing the processor to perform the lightweight face recognition method based on SqueezeNet in any embodiment of the present invention.

[0085] The processor can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), off-the-shelf programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The processor can be a microprocessor or any conventional processor.

[0086] Memory is used to store computer programs and / or modules. The processor implements various functions of the electronic device by running or executing the computer programs and / or modules stored in the memory, and by accessing data stored in the memory. Memory can mainly include a program storage area and a data storage area. The program storage area can store the operating system, at least one application program required for a function, etc.; the data storage area can store data created based on the use of the terminal, etc. In addition, memory can also include high-speed random access memory, and can also include non-volatile memory, such as hard disks, RAM, plug-in hard disks, smart memory cards (SMC), secure digital cards (SD cards), flash memory cards, at least one disk storage device, flash memory devices, or other volatile solid-state storage devices.

[0087] Example 4:

[0088] This embodiment also provides a computer-readable storage medium storing multiple instructions, which are loaded by a processor to cause the processor to execute the lightweight face recognition method based on SqueezeNet in any embodiment of the present invention. Specifically, a system or apparatus equipped with a storage medium may be provided, on which software program code implementing the functions of any of the above embodiments is stored, and the computer (or CPU or MPU) of the system or apparatus may read and execute the program code stored in the storage medium.

[0089] In this case, the program code read from the storage medium can itself implement the function of any of the above embodiments, and therefore the program code and the storage medium storing the program code constitute part of the present invention.

[0090] Storage media embodiments for providing program code include floppy disks, hard disks, magneto-optical disks, optical disks (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RYM, DVD-RW, DVD+RW), magnetic tapes, non-volatile memory cards, and ROMs. Alternatively, program code can be downloaded from a server computer via a communication network.

[0091] Furthermore, it should be clear that not only can the program code read by the computer be executed, but also the operating system or other components operating on the computer can be instructed based on the program code to perform some or all of the actual operations, thereby realizing the function of any of the embodiments described above.

[0092] Furthermore, it is understood that the program code read from the storage medium is written to the memory set in the expansion board inserted into the computer or to the memory set in the expansion unit connected to the computer. Then, based on the instructions of the program code, the CPU or other components installed on the expansion board or expansion unit execute some and all of the actual operations, thereby realizing the function of any of the embodiments described above.

[0093] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A lightweight face recognition method based on SqueezeNet, characterized in that, The method specifically comprises the following steps: The SqueezeNet network is improved; The improved SqueezeNet network is pre-trained on the MS-Celeb-1M dataset, and 100k rounds of training are completed; 25% of the data on the VGGFace2 training set are randomly extracted to iteratively prune the network; The network after pruning is trained and evaluated using 90% of the data on the VGGFace2 training set, and the obtained network is fine-tuned to recover the potential accuracy loss caused by filter removal; The remaining 10% of the data on the VGGFace2 training set is used for verification, and the pruned network is deployed on a mobile device; The improvement of the SqueezeNet network specifically comprises the following steps: The step size of the first convolutional base layer is set to 1, and the input of the SqueezeNet network is 113x113; meanwhile, batch normalization is added between the convolutional layer and the ReLU layer; The SqueezeNet network adopts a Fire module structure, and one Fire module structure comprises a compression squeeze stage and an expansion expand stage; wherein the compression squeeze stage uses a 1x1 convolutional kernel to reduce the number of input feature channels; in the expansion expand stage, a 1x1 and a 3x3 convolutional kernel are used to expand the number of channels; The iterative pruning of the network specifically comprises the following steps: The VGGFace2 dataset is used as the training set, the VGGFace2 dataset contains more than 3.3 million images of 9131 different persons, and contains various poses, expressions, lighting conditions and occlusions; in each iteration, 25% of the data in the VGGFace2 training set is randomly selected to calculate the importance score of each convolutional filter; the importance score is defined as the squared change in error caused by removing a particular filter from the network; The iterative pruning of the network uses a first-order Taylor approximation to calculate the gradient elements during training, and iteratively removes filters with low importance scores; specifically: Given a parameter W = {w0, w1, ..., w...} M A network of} and a network of inputs (x) i ) and output (y i )right The training set The purpose of network training is to solve To minimize the classification error E; parameter w m The importance of is defined by its impact on error during removal; under the assumption of independent and identically distributed error, the induced error is quantified as the squared difference between the prediction errors E with and without parameters: Each parameter is computed The network needs to be evaluated once; the first order term of the Taylor expansion is used Approximate near W To avoid this, the gradient g of w is used; the gradient g is obtained from backpropagation, so it is easily computed is the gradient g; the gradient g is obtained from backpropagation, so it is easily computed To compute the joint importance of a set of parameters W S , the application of The optimizer is SGDM, the batch size is selected as 128, the learning rate is set to 0.01; gradient calculation is performed on a small batch, the network weights are updated through gradient descent, the importance of each filter is calculated, the importance score of each filter is averaged on a small batch at the end of each round, and 1% of the filters with the lowest scores are removed; the network is iteratively pruned on the training set until 40% of the network is pruned, and the entire pruning task is considered complete; the recognition performance of networks with different pruning degrees is compared, and the network corresponding to the pruning degree with the highest recognition rate is selected as the final network.

2. A lightweight face recognition system based on SqueezeNet, characterized in that, The system comprises: An improvement module for improving the SqueezeNet network; A pre-training module for pre-training the improved SqueezeNet network on the MS-Celeb-1M dataset and completing 100k rounds of training; An iterative pruning module for randomly extracting 25% of the data on the VGGFace2 training set to iteratively prune the network; Fine-tuning module, for training and evaluating the pruned network with 90% data on VGGFace2 training set, and fine-tuning the obtained network to recover the potential accuracy loss caused by filter removal; Verification module, for verifying with the remaining 10% data of VGGFace2 training set, deploying the pruned network on mobile devices; Wherein, the improvement module sets the step size of the first convolutional base layer to 1, and the SqueezeNet network input is 113x113; At the same time, batch normalization is added between the convolutional layer and the ReLU layer; The SqueezeNet network adopts the Fire module structure, and one Fire module structure includes a compression squeeze stage and an expansion expand stage; Wherein, the compression squeeze stage uses a 1x1 convolution kernel to reduce the channel number of the input feature map; In the expansion expand stage, 1x1 and 3x3 convolution kernels are used to expand the channel number; The iterative pruning module is to calculate the gradient elements during training by using first-order Taylor approximation, and iteratively remove filters with small importance scores; Specifically as follows: Given a parameter W = {w0, w1, ..., w...} M A network of} and a network of inputs (x) i ) and output (y i )right The training set The purpose of network training is to solve To minimize the classification error E; parameter w m The importance of is defined by its impact on error during removal; under the assumption of independent and identically distributed error, the induced error is quantified as the squared difference between the prediction errors E with and without parameters: Each parameter is computed The network needs to be evaluated once; the first order term of the Taylor expansion is used Approximate near W To avoid this, the gradient g of w is used; the gradient g is obtained from backpropagation, so it is easily computed is the gradient g; the gradient g is obtained from backpropagation, so it is easily computed To compute the joint importance of a set of parameters W S Apply The optimizer is SGDM, the batch size is selected as 128, the learning rate is set to 0.01; Gradient calculation is performed on small batches, network weights are updated by gradient descent, the importance of each filter is calculated, the importance score of each filter is averaged on small batches at the end of each round, and the filter with the lowest score of 1% is removed; The network is iteratively pruned on the training set until 40% of the network is pruned, and the entire pruning task is recognized to be completed; The recognition performance of networks with different pruning degrees is compared, and the network corresponding to the pruning degree with the highest recognition rate is selected as the final network.

3. An electronic device, comprising: Comprise: a memory and at least one processor; Wherein, the memory has stored a computer program; The at least one processor executes the computer program stored in the memory, so that the at least one processor executes the SqueezeNet-based lightweight face recognition method of claim 1.

4. A computer-readable storage medium, characterized in that, The computer readable storage medium has stored a computer program, and the computer program can be executed by the processor to realize the SqueezeNet-based lightweight face recognition method of claim 1.

Citation Information

Patent Citations

  • Crop leaf disease identification method based on SqueezeNet

    CN112308825A