Knowledge distillation-based face beauty evaluation method, apparatus and device, and medium
By using knowledge distillation technology, the knowledge of ResNet-50 is transferred to ShuffleNetV2. By utilizing depthwise separable dilated convolutional layers, the problem of deploying deep convolutional neural networks on mobile devices is solved, and the efficient operation of a lightweight face beauty evaluation model is achieved.
Patent Information
- Application Number
- CN202410427508.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-10
- Publication Date
- 2024-11-15
AI Technical Summary
Existing facial beauty evaluation methods are based on deep convolutional neural networks, which result in a large number of model parameters and high computational requirements, making it difficult to deploy efficiently on low-performance devices such as mobile devices.
By employing knowledge distillation, the knowledge of the complex teacher model ResNet-50 is transferred to the lightweight student model ShuffleNetV2. The complex feature representation of the teacher model is learned through deep separable dilated convolutional layers, which reduces the number of parameters and computational cost and improves model performance.
While maintaining high performance, the number of model parameters and computational cost have been reduced, making the face beauty evaluation model suitable for devices with limited computing resources.
Smart Images

Figure CN118968265A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of image processing, and in particular to a method, device, equipment and medium for evaluating the beauty of a face based on knowledge distillation. Background Art
[0002] Current facial beauty assessment methods are mainly based on deep convolutional neural networks, but these network structures are usually deep, have a large number of parameters, and require high computing power, making them difficult to deploy efficiently on low-performance devices such as mobile terminals. Summary of the invention
[0003] The following is a summary of the subject matter described in detail herein. This summary is not intended to limit the scope of the claims.
[0004] The purpose of the present application is to solve one of the technical problems existing in the related art to at least a certain extent. The embodiments of the present application provide a method, device, equipment and medium for evaluating the beauty of a face based on knowledge distillation.
[0005] An embodiment of the first aspect of the present application is a method for evaluating the beauty of a face, comprising:
[0006] Acquire a training face image, and input the training face image into an initial evaluation model for training to obtain a trained evaluation model;
[0007] Acquire a face image to be processed, input the face image to be processed into a trained evaluation model for prediction, and obtain a prediction evaluation result;
[0008] The step of inputting the training face image into an initial evaluation model for training to obtain a trained evaluation model includes:
[0009] Inputting the training face image into a teacher model in an initial evaluation model for training to obtain a first prediction result;
[0010] Generate a soft label according to the first prediction result;
[0011] Inputting the training face image into a student model in an initial evaluation model for training to obtain a second prediction result, wherein the student model includes a plurality of depth-separable dilated convolutional layers;
[0012] Obtaining a loss function according to the distance between the second prediction result and the soft label;
[0013] Adjusting the parameters of the student model according to the loss function to obtain a trained student model;
[0014] The trained student model is used as the trained evaluation model.
[0015] According to certain embodiments of the first aspect of the present application, inputting the training face image into a student model in an initial evaluation model for training to obtain a second prediction result includes:
[0016] Performing preliminary convolution on the training face image to obtain a preliminary feature map;
[0017] Performing a secondary convolution on the preliminary feature map through the depthwise separable dilated convolution layer to obtain an intermediate feature map;
[0018] Extracting features from the intermediate feature map through a lightweight network to obtain a target feature map;
[0019] Performing global average pooling on the target feature map to obtain a pooled feature vector;
[0020] Fully connecting and transforming the pooled feature vector to obtain a category probability distribution;
[0021] A second prediction result is obtained according to the category probability distribution.
[0022] According to some embodiments of the first aspect of the present application, performing a secondary convolution on the preliminary feature map through the depthwise separable dilated convolution layer to obtain an intermediate feature map includes:
[0023] Performing convolution on the channels of the preliminary feature map to obtain a first feature map;
[0024] Mapping the first feature map by point-by-point convolution to obtain a second feature map;
[0025] The second feature map is sampled and convolved at a preset interval to obtain an intermediate feature map.
[0026] According to certain embodiments of the first aspect of the present application, the number of channels of the first feature map is the same as the number of channels of the preliminary feature map.
[0027] According to certain embodiments of the first aspect of the present application, the loss function is expressed by the following formula: CE(t,p)=-∑ i t i log(p i ), where Loss is the loss function, N is the number of samples, and p is i is the probability of the i-th category in the second prediction result, q i is a soft label, t i is the probability of the i-th category of the true label of the training face image.
[0028] According to certain embodiments of the first aspect of the present application, the teacher model is based on a ResNet-50 network structure.
[0029] According to certain embodiments of the first aspect of the present application, the student model is based on the ShuffleNetV2 network structure.
[0030] According to an embodiment of the second aspect of the present application, a facial beauty evaluation device includes:
[0031] A training unit, used to obtain a training face image, input the training face image into an initial evaluation model for training, and obtain a trained evaluation model;
[0032] An application unit is used to obtain a face image to be processed, input the face image to be processed into a trained evaluation model for prediction, and obtain a prediction evaluation result;
[0033] The step of inputting the training face image into an initial evaluation model for training to obtain a trained evaluation model includes:
[0034] Inputting the training face image into a teacher model in an initial evaluation model for training to obtain a first prediction result;
[0035] Generate a soft label according to the first prediction result;
[0036] Inputting the training face image into a student model in an initial evaluation model for training to obtain a second prediction result, wherein the student model includes a plurality of depth-separable dilated convolutional layers;
[0037] Obtaining a loss function according to the distance between the second prediction result and the soft label;
[0038] Adjusting the parameters of the student model according to the loss function to obtain a trained student model;
[0039] The trained student model is used as the trained evaluation model.
[0040] An embodiment of the third aspect of the present application is an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the facial beauty evaluation method as described above when executing the computer program.
[0041] An embodiment of the fourth aspect of the present application is a computer storage medium storing computer executable instructions, wherein the computer executable instructions are used to execute the facial beauty evaluation method as described above.
[0042] The above scheme has at least the following beneficial effects: providing high-performance prediction capabilities through the teacher model, learning the prediction capabilities of the teacher model through the lightweight student model, and applying the lightweight student model online, so that the face beauty evaluation model running on the device has fewer parameters and calculations, and is suitable for devices with limited computing resources. By introducing the depthwise separable dilated convolutional layer, the complex feature representation of the teacher model can be learned, and the number of parameters and calculations of the model can be reduced, the receptive field is improved, and the performance of the model is further improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] The accompanying drawings are used to provide further understanding of the technical solution of the present application and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the technical solution of the present application and do not constitute a limitation on the technical solution of the present application.
[0044] Figure 1 It is a step diagram of the model training phase;
[0045] Figure 2 It is a step diagram of the model application phase;
[0046] Figure 3 It is a step diagram of inputting the training face image into the initial evaluation model for training to obtain the trained evaluation model.
[0047] Figure 4 It is a step diagram of inputting the training face image into the student model in the initial evaluation model for training to obtain the second prediction result. DETAILED DESCRIPTION
[0048] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0049] It should be noted that, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first", "second", etc. in the specification, claims or the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0050] The embodiments of the present application are further described below in conjunction with the accompanying drawings.
[0051] The embodiment of the present application proposes a method for evaluating the beauty of a face.
[0052] The method for evaluating the beauty of human faces includes: a model training stage and a model application stage.
[0053] Reference Figure 1 The model training stage includes: step S11, obtaining a training face image; step S12, inputting the training face image into the initial evaluation model for training to obtain a trained evaluation model.
[0054] Reference Figure 2 The model application stage includes: step S21, obtaining the face image to be processed; step S22, inputting the face image to be processed into the trained evaluation model for prediction, and obtaining the prediction evaluation result.
[0055] During the model training phase, the training face images used for training can be obtained from large-scale image databases on the Internet, such as a large-scale Asian face beauty database; on the other hand, they can be obtained from photos taken in real time.
[0056] Reference Figure 3 , inputting the training face image into the initial evaluation model for training to obtain the trained evaluation model, including the following steps:
[0057] Step S110, inputting the training face image into the teacher model in the initial evaluation model for training to obtain a first prediction result;
[0058] Step S120, generating a soft label according to the first prediction result;
[0059] Step S130, inputting the training face image into the student model in the initial evaluation model for training to obtain a second prediction result;
[0060] Step S140, obtaining a loss function according to the distance between the second prediction result and the soft label;
[0061] Step S150, adjusting the parameters of the student model according to the loss function to obtain a trained student model;
[0062] The trained student model is used as the trained evaluation model.
[0063] In this embodiment, the teacher model provides high-performance prediction capabilities, and the lightweight student model learns the prediction capabilities of the teacher model, and the lightweight student model is put into use, so that the face beauty evaluation model running on the device has fewer parameters and calculations, and is suitable for devices with limited computing resources. By introducing a depth-separable dilated convolutional layer, the complex feature representation of the teacher model can be learned, and the number of parameters and calculations of the model can be reduced, the receptive field is improved, and the performance of the model is further improved.
[0064] Knowledge distillation is a model compression technique in deep learning that aims to transfer the knowledge of a complex teacher model to a simple student model. The purpose of this is to reduce the number of model parameters and computation while maintaining high performance. The knowledge is usually learned weights and biases, or predicted distributions.
[0065] The teacher model is based on the ResNet-50 network structure.
[0066] The ResNet-50 network structure includes conv1 layer, conv2_x layer, conv3_x layer, conv4_x layer, conv5_x layer, average pooling layer, fully connected layer and softmax layer.
[0067] The conv1 layer includes a convolutional layer of size 7x7, stride 2, and 64 channels.
[0068] The conv2_x layer includes three convolution blocks, including a convolution layer with a size of 1x1 and 64 channels, a convolution layer with a size of 3x3 and 64 channels, and a convolution layer with a size of 1x1 and 256 channels. The first layer of the conv2_x layer is a dotted residual structure.
[0069] The conv3_x layer includes 4 convolution blocks, including a convolution layer with a size of 1x1 and a channel number of 128, a convolution layer with a size of 3x3 and a channel number of 128, and a convolution layer with a size of 1x1 and a channel number of 512. The first layer of the conv3_x layer is a dotted residual structure.
[0070] The Conv4_x layer includes 6 convolution blocks, including a convolution layer with a size of 1x1 and a number of channels of 256, a convolution layer with a size of 3x3 and a number of channels of 256, and a convolution layer with a size of 1x1 and a number of channels of 1024. The first layer of the Conv4_x layer is a dotted residual structure.
[0071] The Conv4_x layer includes three convolution blocks, including a convolution layer with a size of 1x1 and a channel number of 512, a convolution layer with a size of 3x3 and a channel number of 512, and a convolution layer with a size of 1x1 and a channel number of 2048. The first layer of the Conv5_x layer is a dotted residual structure.
[0072] The first layers of the conv2_x layer, conv3_x layer, conv4_x layer, and conv5_x layer are all dotted residual structures, because the height, width, and depth of the output feature matrix of the previous layer need to be adjusted to the height, width, and depth of the input feature matrix required by the current layer.
[0073] Train a complex teacher model. This model has a high accuracy, but also has more parameters and computation. Then, at a high temperature T, use the teacher model to infer the training data and obtain soft labels. High temperature will make the soft labels smoother and improve the robustness of the model.
[0074] Generate a soft label based on the first prediction result. For the input training face image X i , the soft label q of the teacher model i It can be expressed by the following formula: In the formula, Z i Indicates that the teacher model is training face image X i The above is the normalized output (logits), C is the number of categories, and T is the temperature parameter.
[0075] Use the soft labels as target labels to train the student model.
[0076] The student model is based on the ShuffleNetV2 network structure.
[0077] Replace the standard convolutional layer or depthwise separable convolutional layer in ShuffleNetV2 with a depthwise separable dilated convolutional layer to increase the receptive field of the model and reduce the number of parameters and computation.
[0078] The depth-wise separable convolutional layer generates an intermediate feature map with the same number of input channels by applying the convolution kernel to each channel of the input, and then maps the number of channels to the required dimension through point-by-point convolution. The processing process of the depth-wise separable convolutional layer can be expressed by the following formula:
[0079]
[0080] Where, Y i is the output feature map of the depthwise separable convolutional layer, X i+k is the i+kth channel of the input feature map of the depthwise separable convolutional layer, i is the index of the channel dimension of the input feature map, k is the convolution kernel index of the depthwise separable convolutional layer, is the kth convolution kernel of the depthwise separable convolutional layer.
[0081] The dilated convolution layer can increase the receptive field while keeping the size of the convolution kernel unchanged, thereby improving the ability of feature extraction; the depthwise separable dilated convolution layer introduces a dilation operation in the convolution kernel, so that the convolution kernel is sampled at an interval d on the input. The processing process of the dilated convolution layer can be expressed by the following formula:
[0082] The depthwise separable convolution operation and the dilated convolution operation are combined to form a depthwise separable dilated convolution layer. The processing process of the depthwise separable dilated convolution layer can be expressed by the following formula: In the formula, Z j represents the output feature map of the depth-wise separable dilated convolutional layer, j is the index of the channel dimension of the output feature map, is the convolution kernel of point-by-point convolution.
[0083] The training face image is input into the student model in the initial evaluation model for training to obtain a second prediction result; a loss function is obtained according to the distance between the second prediction result and the soft label; and the parameters of the student model are adjusted according to the loss function to obtain a trained student model.
[0084] Reference Figure 4 , inputting the training face image into the student model in the initial evaluation model for training to obtain a second prediction result, comprising the following steps:
[0085] Step S210, perform preliminary convolution on the training face image to obtain a preliminary feature map; step S220, perform secondary convolution on the preliminary feature map through a depthwise separable dilated convolution layer to obtain an intermediate feature map; step S230, perform feature extraction on the intermediate feature map through a lightweight network to obtain a target feature map; step S240, perform global average pooling on the target feature map to obtain a pooled feature vector; step S250, perform full connection and conversion on the pooled feature vector to obtain a category probability distribution; step S260, obtain a second prediction result according to the category probability distribution.
[0086] Perform preprocessing such as normalization and size adjustment on the training face images.
[0087] The training face image is initially convolved through a 3*3 convolutional layer to obtain a preliminary feature map.
[0088] The preliminary feature map is convolved twice through a depth-wise separable dilated convolution layer to obtain an intermediate feature map, including the following steps: convolving on the channels of the preliminary feature map to obtain a first feature map with the same number of channels as the preliminary feature map; mapping the first feature map through point-by-point convolution to obtain a second feature map; sampling and convolving the second feature map at a preset interval to obtain an intermediate feature map.
[0089] The target feature map is obtained by extracting features from the intermediate feature map using the lightweight ShuffleNetV2.
[0090] The target feature map is globally averaged pooled through the global average pooling layer, and the values on each channel of the target feature map are averaged to obtain a feature vector of a fixed size.
[0091] The pooled feature vector is fully connected and transformed through the softmax layer to obtain the category probability distribution.
[0092] The score corresponding to the type with the highest probability in the category probability distribution is used as the second prediction result.
[0093] The distillation loss function is used to optimize the distance between the second prediction result of the student model and the soft label of the teacher model. The distillation loss function is generally the average cross entropy loss. The loss function can be expressed by the following formula: CE(t,p)=-∑ i t i log(p i ), where Loss is the loss function, N is the number of samples, and p is i is the probability of the i-th category in the second prediction result, q i is a soft label, t i is the probability of the i-th category of the true label of the training face image.
[0094] The parameters of the student model are adjusted according to the loss function to obtain a trained student model; when the trained student model converges or the number of training times for the student model reaches a preset threshold, the trained student model is used as a trained evaluation model.
[0095] The trained evaluation model is put online. In the application stage, the face image to be processed is obtained, and the face image to be processed is input into the trained evaluation model for prediction to obtain the predicted evaluation result.
[0096] An embodiment of the present application provides a device for evaluating the beauty of a face.
[0097] The face beauty evaluation device comprises: a training unit and an application unit.
[0098] The training unit is used to obtain training face images, input the training face images into the initial evaluation model for training, and obtain a trained evaluation model.
[0099] The application unit is used to obtain the face image to be processed, input the face image to be processed into the trained evaluation model for prediction, and obtain the prediction evaluation result.
[0100] Among them, the training face image is input into the initial evaluation model for training to obtain the trained evaluation model, including: inputting the training face image into the teacher model in the initial evaluation model for training to obtain a first prediction result; generating a soft label according to the first prediction result; inputting the training face image into the student model in the initial evaluation model for training to obtain a second prediction result, wherein the student model includes multiple deeply separable dilated convolutional layers; obtaining a loss function according to the distance between the second prediction result and the soft label; adjusting the parameters of the student model according to the loss function to obtain a trained student model; and using the trained student model as the trained evaluation model.
[0101] It can be understood that the face beauty evaluation device in this embodiment adopts the above-mentioned face beauty evaluation method, and each unit of the face beauty evaluation device corresponds one by one to each step of the face beauty evaluation method. The face beauty evaluation device and the face beauty evaluation method have the same technical solution, solve the same technical problems, and have the same technical effect.
[0102] An embodiment of the present application provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned method for evaluating the beauty of a face when executing the computer program.
[0103] The electronic device may be any intelligent terminal including a computer.
[0104] In general, for the hardware structure of the electronic device, the processor can be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, etc., to execute related programs to implement the technical solutions provided in the embodiments of the present application.
[0105] The memory can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory can store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program codes are stored in the memory, and the processor is called to execute the methods of the embodiments of this application.
[0106] The input / output interface is used to realize information input and output.
[0107] The communication interface is used to realize the communication interaction between this device and other devices. Communication can be achieved through wired methods (such as USB, network cable, etc.) or wireless methods (such as mobile network, WI FI, Bluetooth, etc.).
[0108] The bus transmits information between the various components of the device (such as the processor, memory, input / output interface, and communication interface). The processor, memory, input / output interface, and communication interface communicate with each other within the device through the bus.
[0109] An embodiment of the present application provides a computer-readable storage medium. The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to execute the above-mentioned face beauty evaluation method.
[0110] It will be appreciated by those skilled in the art that all or some of the steps and systems in the disclosed method above may be implemented as software, firmware, hardware and appropriate combinations thereof. Some physical components or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor or a microprocessor, or may be implemented as hardware, or may be implemented as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or a non-transitory medium) and a communication medium (or a temporary medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, disk storage or other magnetic storage devices, or any other medium that may be used to store desired information and may be accessed by a computer. In addition, it is well known to those of ordinary skill in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium. In the above description of this specification, the description of reference terms "one embodiment / example", "another embodiment / example" or "certain embodiments / examples" and the like means that the specific features, structures, materials or characteristics described in conjunction with the embodiments or examples are included in at least one embodiment or example of the present application. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0111] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.
[0112] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0113] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0114] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store programs.
[0115] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the above-mentioned units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms. Although the embodiments of the present application have been shown and described, it can be understood by those of ordinary skill in the art that various changes, modifications, substitutions and variations can be made to these embodiments without departing from the principles and purposes of the present application, and the scope of the present application is defined by the claims and their equivalents.
[0116] The above is a specific description of the preferred implementation of the present application, but the present application is not limited to the embodiments. Technical personnel familiar with the field can make various equivalent modifications or substitutions without violating the spirit of the present application. These equivalent modifications or substitutions are all included in the scope defined by the claims of the present application.
Claims
1. A method for evaluating facial beauty based on knowledge distillation, characterized in that: include: Acquire a training face image, and input the training face image into an initial evaluation model for training to obtain a trained evaluation model; Acquire a face image to be processed, input the face image to be processed into a trained evaluation model for prediction, and obtain a prediction evaluation result; The step of inputting the training face image into an initial evaluation model for training to obtain a trained evaluation model includes: Inputting the training face image into the teacher model in the initial evaluation model for training to obtain a first prediction result; Generate a soft label according to the first prediction result; Inputting the training face image into a student model in an initial evaluation model for training to obtain a second prediction result, wherein the student model includes a plurality of depth-separable dilated convolutional layers; Obtaining a loss function according to the distance between the second prediction result and the soft label; Adjusting the parameters of the student model according to the loss function to obtain a trained student model; The trained student model is used as the trained evaluation model.
2. A method for evaluating face beauty based on knowledge distillation according to claim 1, characterized in that: The step of inputting the training face image into the student model in the initial evaluation model for training to obtain a second prediction result includes: Performing preliminary convolution on the training face image to obtain a preliminary feature map; Performing a secondary convolution on the preliminary feature map through the depthwise separable dilated convolution layer to obtain an intermediate feature map; Extracting features from the intermediate feature map through a lightweight network to obtain a target feature map; Performing global average pooling on the target feature map to obtain a pooled feature vector; Fully connecting and transforming the pooled feature vector to obtain a category probability distribution; A second prediction result is obtained according to the category probability distribution.
3. A method for evaluating face beauty based on knowledge distillation according to claim 2, characterized in that: The step of performing a secondary convolution on the preliminary feature map through the depthwise separable dilated convolution layer to obtain an intermediate feature map comprises: Performing convolution on the channels of the preliminary feature map to obtain a first feature map; Mapping the first feature map by point-by-point convolution to obtain a second feature map; The second feature map is sampled and convolved at a preset interval to obtain an intermediate feature map.
4. The method for evaluating face beauty based on knowledge distillation according to claim 3, characterized in that: The number of channels of the first feature map is the same as the number of channels of the preliminary feature map.
5. A method for evaluating the beauty of a face according to claim 1, characterized in that: The loss function is expressed by the following formula: Among them, Loss is the loss function, N is the number of samples, p i is the probability of the i-th category in the second prediction result, q i is a soft label, t i is the probability of the i-th category of the true label of the training face image.
6. The method for evaluating face beauty based on knowledge distillation according to claim 1, characterized in that: The teacher model is based on the ResNet-50 network structure.
7. The method for evaluating face beauty based on knowledge distillation according to claim 1, characterized in that: The student model is based on the ShuffleNetV2 network structure.
8. A facial beauty evaluation device, characterized in that: include: A training unit, used to obtain a training face image, input the training face image into an initial evaluation model for training, and obtain a trained evaluation model; An application unit is used to obtain a face image to be processed, input the face image to be processed into a trained evaluation model for prediction, and obtain a prediction evaluation result; The step of inputting the training face image into an initial evaluation model for training to obtain a trained evaluation model includes: Inputting the training face image into a teacher model in an initial evaluation model for training to obtain a first prediction result; Generate a soft label according to the first prediction result; Inputting the training face image into a student model in an initial evaluation model for training to obtain a second prediction result, wherein the student model includes a plurality of depth-separable dilated convolutional layers; Obtaining a loss function according to the distance between the second prediction result and the soft label; Adjusting the parameters of the student model according to the loss function to obtain a trained student model; The trained student model is used as the trained evaluation model.
9. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method for evaluating the beauty of a face based on knowledge distillation as described in any one of claims 1 to 7 is implemented.
10. A computer storage medium, characterized in that: Computer executable instructions are stored, and the computer executable instructions are used to execute the face beauty evaluation method based on knowledge distillation as described in any one of claims 1 to 7.
Citation Information
Cited By
Brain tumor classification method based on deep learning
CN120107703A
