Double chin detection model training method, double chin detection method and related device
Through the neural network reconstruction of the chin area image training, the accuracy and efficiency of the existing double chin detection method are solved, and efficient double chin detection is achieved.
Patent Information
- Application Number
- CN202111341931.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-12
- Publication Date
- 2025-08-22
- Estimated Expiration
- 2041-11-12
AI Technical Summary
The existing double chin detection methods rely on human eye judgment or complex methods, with cumbersome steps and poor results, making it difficult to achieve accurate and efficient detection.
By obtaining the chin area images in the image sample set as the training set, the neural network is trained, the network parameters and structure are adjusted, and the neural network is reconstructed using the number of feature extraction modules to reduce interference with other feature and improve detection accuracy and efficiency.
The accuracy and efficiency of the double chin detection model are improved, and the severity of the double chin can be quickly identified. It is suitable for fitness face slimming, micro plastic surgery and photo editing scenarios.
Smart Images

Figure CN114170650B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of intelligent recognition and detection technology, and in particular to a double chin detection model training method, a double chin detection method, and related devices. Background Art
[0002] With the rapid development of mobile communications technology and the improvement of people's living standards, various smart devices have become widely used in people's daily work and life. This has made people increasingly accustomed to using apps and other software, leading to an increasing demand for apps with features such as face shape detection, aging, or obesity detection. Furthermore, the face is an absolute core component of the beauty industry, and the chin plays a crucial role in the face, making chin detection extremely important. Therefore, many users hope that such apps can automatically analyze the presence and severity of a double chin.
[0003] During the process of implementing the embodiments of the present application, the inventors of the present application discovered that currently, double chins are mainly determined by the human eye. Among the few double chin detection methods, most rely on relatively complex methods to obtain facial information to obtain double chin detection results. The steps are cumbersome and the results are unsatisfactory. Summary of the Invention
[0004] The main technical problem solved by the embodiments of the present application is to provide a double chin detection model training method, double chin detection method and related devices. The double chin detection model trained using this training method can improve the accuracy and efficiency of detection.
[0005] To solve the above technical problems, in a first aspect, embodiments of the present application provide a method for training a double chin detection model, comprising:
[0006] Acquire an image sample set, wherein the image sample set includes a plurality of face images;
[0007] Obtaining, based on each face image in the image sample set, a chin region image corresponding to each face image, wherein the chin region image is annotated with a true label;
[0008] Using the chin area images as training sets, training a neural network, iteratively adjusting network parameters and network structure until the neural network converges, thereby obtaining the double chin detection model;
[0009] The neural network includes a plurality of feature extraction modules connected in sequence, and adjusting the network structure includes adjusting the number of the plurality of feature extraction modules according to the image features of the chin area image to reconstruct the neural network.
[0010] In some embodiments, one of the feature extraction modules is configured with an input resolution, a number of output channels, and a number of layers, and the neural network is configured with a resolution scaling factor, a width scaling factor, and a depth scaling factor;
[0011] The adjusting the network parameters includes adjusting the resolution scaling factor, the width scaling factor, and the depth scaling factor.
[0012] In some embodiments, the feature extraction module includes a feature extraction submodule, a compression excitation submodule, a connection abandonment submodule, and a fusion submodule.
[0013] The feature extraction submodule is used to extract features from the input first feature map and output a second feature map;
[0014] The compression excitation submodule is used to perform weighted processing on the second feature map to obtain a third feature map;
[0015] The connection abandonment submodule is used to perform feature extraction on the third feature map, abandon some neurons during the feature extraction process, and output a fourth feature map;
[0016] The fusion submodule is used to fuse the first feature map and the fourth feature map to output a fifth feature map.
[0017] In some embodiments, the compression excitation submodule includes a global average pooling layer, two fully connected layers and a weighted layer arranged in sequence.
[0018] The global average pooling layer is used to perform dimensionality reduction processing on the second feature map and output a first feature vector;
[0019] The two fully connected layers are used to perform nonlinear transformation on the first eigenvector and output a second eigenvector;
[0020] The weighted layer is used to perform a multiplication operation on the second feature map and the second feature vector, and output the third feature map.
[0021] In some embodiments, the abandonment connection submodule is configured with an abandonment rate parameter, which reflects the proportion of abandoned neurons, and the abandonment rate parameter is greater than or equal to 50%.
[0022] To solve the above technical problems, in a second aspect, embodiments of the present application provide a double chin detection method, comprising:
[0023] Get the face image to be detected;
[0024] Acquire a chin area image of the face image to be detected;
[0025] The chin area image is input into a double chin detection model to obtain a double chin detection result of the face image to be detected, wherein the double chin detection model is trained using the method of the first aspect.
[0026] To solve the above technical problems, in a third aspect, the present application provides a training device, comprising:
[0027] A first acquisition module is used to acquire an image sample set, wherein the image sample set includes a plurality of face images;
[0028] a second acquisition module, configured to acquire, based on each face image in the image sample set, a chin region image corresponding to each face image, wherein the chin region image is annotated with a true label;
[0029] A training module is configured to train a neural network using each of the chin area images as a training set, iteratively adjusting network parameters and network structure until the neural network converges, thereby obtaining the double chin detection model; wherein the neural network includes a plurality of feature extraction modules connected in sequence, and adjusting the network structure includes adjusting the number of the plurality of feature extraction modules.
[0030] To solve the above technical problems, in a fourth aspect, an embodiment of the present application provides a detection device, comprising:
[0031] The third acquisition module is used to acquire the face image to be detected;
[0032] a fourth acquisition module, configured to acquire an image of the chin region of the face image to be detected;
[0033] The detection module is configured to input the chin area image into a double chin detection model to obtain a double chin detection result of the face image to be detected, wherein the double chin detection model is trained using the method of the first aspect.
[0034] To solve the above technical problems, in the fifth aspect, an embodiment of the present application provides a computer device, comprising a memory and one or more processors, wherein the one or more processors are used to execute one or more computer programs stored in the memory, and when the one or more processors execute the one or more computer programs, the computer device implements the method of the first aspect or the second aspect.
[0035] In order to solve the above technical problems, in the sixth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program includes program instructions, which, when executed by a processor, enable the processor to execute the method of the first aspect or the second aspect.
[0036] Beneficial effects of the embodiments of the present application: Different from the prior art, the training method of the double chin detection model provided in the embodiments of the present application crops each facial image in the image sample set to obtain the chin area image corresponding to each facial image, and then uses each chin area image as a training set to train the neural network. This can reduce the interference of other features (such as facial features, etc.) on the chin feature, which is beneficial to accelerating model convergence.
[0037] Furthermore, the neural network includes multiple feature extraction modules connected in sequence. During the iterative training process, not only are the network parameters adjusted each time, but the number of feature extraction modules in the neural network is also adjusted based on the image features of the chin area image to reconstruct the neural network. Specifically, based on the image characteristics of the chin area image, such as single, clean features and small feature size, by adjusting the number of feature extraction modules in the neural network, the neural network is structurally pruned and reconstructed. This can effectively alleviate the overfitting and computational loss caused by feature extraction module redundancy relative to the training set (i.e., excessive network depth). Therefore, the double chin detection model trained using this training method can improve detection accuracy and efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] One or more embodiments are exemplarily illustrated by pictures in the corresponding drawings. These exemplifications do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings are represented as similar elements. Unless otherwise stated, the figures in the drawings do not constitute proportional limitations.
[0039] Figure 1 A schematic diagram of a flow chart of a method for training a double chin detection model provided in some embodiments of the present application;
[0040] Figure 2 A schematic diagram of facial key points provided in some embodiments of the present application;
[0041] Figure 3 A schematic diagram of face selection provided for some embodiments of the present application;
[0042] Figure 4 A schematic diagram of the structure of a neural network provided in some embodiments of the present application;
[0043] Figure 5 A schematic diagram of the structure of a feature extraction module provided in some embodiments of the present application;
[0044] Figure 6 for Figure 5 A schematic diagram of the structure of the feature extraction submodule in the feature extraction module shown;
[0045] Figure 7 for Figure 5Schematic diagram of the structure of the compression excitation submodule in the feature extraction module shown;
[0046] Figure 8 This is a schematic diagram of the processing process of the compression excitation submodule in some embodiments of the present application;
[0047] Figure 9 This is a schematic diagram of a structure in which a connection submodule is abandoned in some embodiments of the present application;
[0048] Figure 10 This is a schematic diagram of the process of discarding a layer in some embodiments of the present application;
[0049] Figure 11 This is a flowchart of a double chin detection method in some embodiments of the present application;
[0050] Figure 12 A schematic diagram of the structure of a training device provided in an embodiment of the present application;
[0051] Figure 13 A schematic structural diagram of a detection device provided in some embodiments of the present application;
[0052] Figure 14 A hardware structure diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0053] The present application is described in detail below with reference to specific embodiments. The following embodiments will help those skilled in the art to further understand the present application, but are not intended to limit the present application in any form. It should be noted that those skilled in the art may make several variations and improvements without departing from the scope of the present application. These all fall within the scope of protection of the present application.
[0054] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0055] It should be noted that, if there is no conflict, the various features in the embodiments of the present application can be combined with each other and are all within the scope of protection of the present application. In addition, although the functional modules are divided in the device schematic and the logical order is shown in the flow chart, in some cases, the steps shown or described can be performed in a different order than the module division in the device or the order in the flow chart. In addition, the words "first", "second", "third", etc. used herein do not limit the data and execution order, but only distinguish between the same items or similar items with basically the same functions and effects.
[0056] Unless otherwise defined, all technical and scientific terms used in this specification have the same meanings as those commonly understood by those skilled in the art to which this application belongs. The terms used in this specification and in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application. The term "and / or" as used in this specification includes any and all combinations of one or more of the relevant listed items.
[0057] In addition, the technical features involved in each embodiment of the present application described below can be combined with each other as long as they do not conflict with each other.
[0058] The technical solution of the present application can be applied to various scenarios of double chin detection. Specifically, the technical solution of the present application can be used to detect the severity of the double chin in the scenario of double chin detection. For example, in one possible application scenario, a user who is doing face slimming fitness needs to regularly detect the severity of the double chin to track the effect of the face slimming fitness. In one possible application scenario, a user who is undergoing micro-plastic surgery needs to detect the severity of the double chin to help determine the micro-plastic surgery plan, etc. In one possible application scenario, a user who is retouching a photo needs to perform double chin detection on the original image to determine the modification plan for the double chin, or needs to perform double chin detection on the modified image to evaluate the effect of the modification plan.
[0059] It is understandable that in some implementations, a facial image is identified using a double chin detection model having a double chin grade category recognition function, thereby determining the double chin grade category corresponding to the facial image, that is, the severity of the double chin, wherein the double chin detection model is pre-trained.
[0060] During the double chin detection model training process, a large number of facial images are acquired and each image is labeled with a corresponding true double chin severity category (e.g., none, mild, moderate, or severe). Each facial image and its corresponding double chin severity category are then fed into an untrained neural network for training. This allows the trained double chin detection model to produce detection results (equivalent to predicted labels during the training process) that closely approximate the true double chin label for each facial image. During training, the double chin detection model learns the double chin characteristics of these facial images, enabling it to distinguish between facial images with different double chin severity categories. This allows the double chin detection module to be applied to identify the severity of a double chin in a facial image.
[0061] To facilitate understanding of the technical solution of this application, we will first use an example to specifically describe the training process of a double chin detection model known to the inventors. For example, the double chin detection model is trained using N facial images as a training set, assuming the double chin levels to be identified are none, mild, moderate, and severe. The training process is as follows:
[0062] (1) Each face image is labeled with a true label. Specifically, a hot coding label can be used. It is understood that the hot coding labeling method is a common method used by those skilled in the art and will not be described in detail here.
[0063] (2) Each face image is input into the neural network. For each face image, the neural network (here the neural network can be understood as the double chin detection model in the training process) will output a double chin detection result. Each double chin detection result includes the probability of the face image corresponding to the four categories: none, mild, medium, and severe.
[0064] (3) Calculating the difference between the output of the neural network and the true label to determine the loss of the neural network, wherein the loss of the neural network represents the accuracy of double chin detection. The smaller the loss, the higher the accuracy of the neural network and the closer it is to the true label. Specifically, a loss function can be used to calculate the loss between the output of the neural network and the true label. It is understood that the use of a loss function for backpropagation to train a model is well known to those skilled in the art, and its principle will not be described in detail here.
[0065] (4) Adjust the network parameters of the neural network according to the loss.
[0066] The above is the single-stage training and parameter adjustment process for a neural network as known to the inventors. During actual training, a large number of facial images covering four categories of double chins (no, mild, moderate, and severe) are acquired. Multiple iterations of parameter adjustment training are performed until the neural network converges, resulting in a double chin detection model. Convergence of the neural network can include achieving a minimum loss, fluctuating within a range of losses, or achieving a certain number of training cycles.
[0067] It is understandable that the characteristics of a double chin are mainly reflected in the chin area, which occupies a relatively small proportion of the face image. Features such as facial features, forehead, cheeks, or background with large proportions will interfere with the learning of chin features, affecting the accuracy and convergence speed of the model.
[0068] Even if only chin area images are retained for training, additional technical challenges remain: the input resolution of chin area images is low, the image background is relatively clean, and relatively little information is available. Chin area images are also relatively concentrated and similar, with the vast majority sharing the same outline and very similar colors and textures, resulting in single, clean features. While this approach simplifies training somewhat by reducing the interference of irrelevant background areas, it also reduces relevant feature information. For example, the overall facial contour may contribute to the feature classification of double chins, which can easily lead to overfitting.
[0069] In light of this, some embodiments of the present application propose a novel training method for a double chin detection model. First, an image sample set comprising multiple facial images is obtained. Based on each facial image in the image sample set, a corresponding chin region image is obtained, wherein the chin region image is annotated with a ground-truth label. Then, each chin region image is used as a training set to train a neural network. This reduces interference from other features (e.g., facial features) on the chin features, helps accelerate model convergence, and ultimately results in a double chin detection model. The neural network structure comprises a plurality of sequentially connected feature extraction modules, and adjusting the network structure includes adjusting the number of feature extraction modules based on the image features of the chin region image to reconstruct the neural network. Specifically, based on the image characteristics of the chin region image, such as single, clean features and small feature size, by adjusting the number of feature extraction modules in the neural network, the neural network is structurally pruned and reconstructed. This effectively mitigates overfitting and computational loss caused by feature extraction modules being redundant relative to the training set (i.e., excessive network depth). Therefore, the double chin detection model trained using this training method can improve detection accuracy and efficiency.
[0070] The technical solution of this application is described in detail below.
[0071] See first Figure 1 , Figure 1 A flow chart of the training method for the double chin detection model provided in the embodiment of the present application is shown as follows: Figure 1 As shown, the method S20 includes but is not limited to the following steps:
[0072] S21: Acquire an image sample set, where the image sample set includes multiple face images.
[0073] The image sample set includes a large number of facial images, each of which includes a human face. It is understood that in the image sample set, each facial image corresponds to a double chin severity category, such as any one of "none, mild, moderate, or severe." In the image sample set, the number of facial images corresponding to these four double chin severity categories is balanced. For example, if the image sample set contains 1,000 facial images, approximately 250 facial images have "none" double chin, approximately 250 facial images have "mild" double chin, approximately 250 facial images have "moderate" double chin, and approximately 250 facial images have "severe" double chin.
[0074] Here, the severity categories of a double chin are divided into four categories for example. In other embodiments, the severity categories of a double chin can be set by those skilled in the art according to actual conditions.
[0075] In order to eliminate the influence of noise on the double chin feature extraction, before training, the facial images in the image sample set can be filtered and denoised. For example, the Gaussian filtering method can be used to filter and denoise the facial images in the image sample set to reduce the interference of image noise on feature extraction.
[0076] On the other hand, considering that the facial part in the face image may be skewed, in order to maintain the robustness of the facial skew during the model training process, the face image can be rotated so that the facial part in the face image is as straight as possible.
[0077] S22: Obtain a chin region image corresponding to each face image in the image sample set, wherein the chin region image is annotated with a true label.
[0078] It is understandable that the characteristics of a double chin are mainly reflected in the chin area, which occupies a relatively small proportion of the face image. Features such as facial features, forehead, cheeks, or background with large proportions will interfere with the learning of chin features, affecting the accuracy and convergence speed of the model.
[0079] Here, the chin region is cropped from the face image to obtain a chin region image. To obtain the chin region image from a face image, the face must first be identified. This can be done using a facial keypoint algorithm to identify the face in the face image and obtain the facial keypoints. Examples of such algorithms include active appearance models (AAMs), constrained local models (CLMs), explicit shape regression (ESR), and supervised descent methods (SDM).
[0080] like Figure 2 As shown, the facial key point algorithm locates several key points of the face, including points in the eyebrows, eyes, nose, mouth, facial contour, etc. Thus, based on these key points, the chin area can be determined and the chin area image can be captured.
[0081] Considering that a face image may contain one or more faces, in order to obtain the complete face outline, the face with the largest area is selected as the target face, and the rest are regarded as non-faces. Figure 3 As shown in the figure, the image includes two faces. The area of the area formed by the four endpoints of the left and right faces is calculated respectively. The face area with the largest area is selected as the target face. Figure 3 In the image above, the right face area is selected as the target face. Thus, the chin area image is captured from the target face.
[0082] The above is merely an example of an implementation method of capturing a chin area image from a human face image. It is understandable that a chin area image can be captured from each face image in the image sample set according to the above implementation method.
[0083] Each chin area image is annotated with a true label. For example, for the four double chin severity categories mentioned above, "none, mild, moderate, and severe", one-hot encoding can be used for labeling. Some chin area images with "no" double chin are annotated with the label [1, 0, 0, 0], some chin area images with "mild" double chin are annotated with the label [0, 1, 0, 0], some chin area images with "moderate" double chin are annotated with the label [0, 0, 1, 0], and some chin area images with "severe" double chin are annotated with the label [0, 0, 0, 1].
[0084] Here, the severity categories of a double chin are divided into four categories for example. In other embodiments, the severity categories of a double chin can be set by those skilled in the art according to actual conditions.
[0085] S23: Using the chin area images as training sets, the neural network is trained, and the network parameters and network structure are iteratively adjusted until the neural network converges to obtain a double chin detection model.
[0086] Each chin area image is used as a training set. That is, after obtaining the training set, a neural network can be set up to learn the aforementioned training set. Through loss backpropagation, the network parameters and network structure are continuously adjusted until the neural network converges. The neural network with the converged network parameters and network structure is the trained double chin detection model.
[0087] In this embodiment, firstly, by cropping each facial image in the image sample set to obtain the chin area image corresponding to each facial image, and then using each chin area image as a training set to train the neural network, the interference of other features (such as facial features, etc.) on the chin features can be reduced, which is beneficial to accelerating the convergence of the model.
[0088] Secondly, here, in addition to the training process in (1)-(4) above, the neural network training process also includes adjusting the network structure of the neural network in step (4) to reconstruct the neural network. Specifically, the neural network includes multiple feature extraction modules connected in sequence. The aforementioned "adjusting the network structure" includes adjusting the number of multiple feature extraction modules based on the image features of the chin area image to reconstruct the neural network. In other words, during the iterative training process, not only the network parameters are adjusted each time, but also the number of feature extraction modules in the neural network is adjusted based on the image features of the chin area image to reconstruct the neural network.
[0089] Understandably, the input resolution of chin region images is low, the image background is relatively clean, and the information is relatively sparse. Images in this region are also relatively concentrated and similar, with the vast majority sharing the same outline and very similar colors and textures, resulting in single, clean features. For a training set with these image characteristics, using too many feature extraction modules (i.e., too deep a network) can lead to overfitting, redundant computation, and a sluggish training process, compromising accuracy and efficiency.
[0090] In some embodiments, a feature extraction module is configured with an input resolution, a number of output channels, and a number of layers, and the neural network is configured with a resolution scaling factor, a width scaling factor, and a depth scaling factor. The resolution scaling factor is used to adjust the input resolution corresponding to each feature extraction module, the width scaling factor is used to adjust the number of output channels corresponding to each feature extraction module, and the depth scaling factor is used to adjust the number of layers corresponding to each feature extraction module.
[0091] As shown in Table 1 below, Table 1 shows the structure of a neural network. The first feature extraction module has an input resolution of 112*112, 16 output channels, and 1 layer. The second feature extraction module has an input resolution of 112*112, 24 output channels, and 2 layers. The number of layers represents the number of repetitions of the corresponding feature extraction module. For example, if the first feature extraction module has 1 layer, the first feature extraction module is repeated once. If the second feature extraction module has 2 layers, the second feature extraction module is repeated twice.
[0092] Table 1 Structure of the neural network
[0093] serial number structure Input resolution Number of output channels Number of layers 1 Convolutional layer 224*224 32 1 2 Feature extraction module 112*112 16 1 3 Feature extraction module 112*112 24 2 4 Feature extraction module 56*56 40 2 5 Feature extraction module 28*28 80 3 6 Feature extraction module 14*14 112 3 7 Feature extraction module 14*14 192 4 8 Feature extraction module 7*7 320 1 9 Convolutional layer & pooling layer & fully connected layer 7*7 1280 1
[0094] It is understood that the input resolution corresponding to each feature extraction block can be adjusted by the resolution scaling factor. For example, the input resolution corresponding to the second feature extraction module should be (112 * resolution scaling factor) * (112 * resolution scaling factor), the number of output channels corresponding to the second feature extraction module should be 24 * width scaling factor, and the number of repetitions (i.e., number) corresponding to the second feature extraction module should be 2 * depth scaling factor. It is understood that decimal points are rounded up.
[0095] The aforementioned adjustment of network parameters includes adjusting the resolution scaling factor, the width scaling factor and the depth scaling factor, so that the neural network structure can be adjusted simultaneously in terms of resolution, width and depth to obtain the optimal network structure.
[0096] It's understandable that the depth of the neural network can be adjusted using a depth scaling factor, but this overall adjustment doesn't allow for fine-grained adjustments for chin area images, which have clean, single features and small size. Therefore, in addition to adjusting network parameters, we also fine-tune the network structure to balance accuracy and efficiency.
[0097] In some embodiments, based on the structure of the neural network shown in Table 1, it is assumed that the resolution scaling factor, width scaling factor, and depth scaling factor are all 1, which provides the best network parameters. Figure 4 As shown in the figure, the neural network includes 1 convolutional layer, 16 feature extraction modules, 1 convolutional layer, 1 pooling layer and 1 fully connected layer connected in sequence.
[0098] Taking into account the image features and computational efficiency of the chin area image, the number of feature extraction modules is continuously adjusted during the training process, for example, one or more feature extraction modules are selectively deleted from the 16 feature extraction modules. Figure 4 As shown in FIG, after multiple adjustments and deletions, the feature extraction module in the dotted box is deleted, and the double chin detection module is obtained with relatively high accuracy and computational efficiency.
[0099] Specifically, the location of the feature extraction module outlined by the dashed line requires more network parameters to support the corresponding features. Otherwise, the features extracted by these feature extraction modules and helpful for subsequent classification will be lost. However, given the relatively concentrated and clean chin area images in the training set, the feature extraction process for the double chin area does not require more feature extraction modules to supplement the image features at this location. Furthermore, the resolution of the chin area images is relatively low, so too many feature extraction modules will not only fail to achieve better feature extraction results, but will also increase the computational load.
[0100] This was verified from two perspectives: First, the output feature maps of the feature extraction modules with and without the dotted block were obtained, and their similarity was calculated to determine whether the feature extraction modules were redundant. The results showed that the feature maps output by the two scenarios with and without the feature extraction modules were highly similar, indicating that the feature extraction modules at these locations were redundant. For example, the feature map output by feature extraction module 8# was highly similar to the feature map output by feature extraction module 7#, indicating that feature extraction module 8# was redundant.
[0101] On the other hand, based on the classification results output by the final fully connected layer, the presence or absence of the feature extraction module has a negligible impact on the final classification results. Therefore, we say that the feature extraction module is redundant at this location. For example, if the classification results with feature extraction module 11# are the same as those without it, then feature extraction module 11# is redundant.
[0102] It is understandable that Figure 4 The structure of the neural network in the figure is merely an example. When the resolution scaling factor, width scaling factor, and depth scaling factor are other values, various structures can be evolved based on Table 1.
[0103] In this embodiment, based on the image characteristics of the chin region, such as clean, simple features and small size, the number of feature extraction modules in the neural network is adjusted to achieve structural pruning and reconstruction of the neural network. This effectively alleviates the overfitting and computational loss caused by feature extraction modules being redundant with the training set (i.e., the network is too deep). Therefore, the double chin detection model trained using this training method can improve detection accuracy and efficiency.
[0104] In some embodiments, as Figure 5 As shown, a feature extraction module includes a feature extraction submodule, a compression excitation submodule, a connection abandonment submodule and a fusion submodule.
[0105] Among them, the feature extraction submodule extracts features from the input first feature map and outputs a second feature map. It is understandable that the first feature map here can be the image output by the previous feature extraction module. The feature extraction submodule mainly plays the role of extracting features. In some embodiments, its structure can be a feature extraction block in mobileNetV1, VGG or Resnet. For example, Figure 6As shown, the feature extraction submodule includes a convolutional layer, a normalization layer, an activation function layer, a depthwise separable convolutional layer, a normalization layer, and an activation function layer, which are connected in sequence. The first feature map is sequentially subjected to convolution, normalization, activation, depthwise convolution, normalization, and activation to obtain the second feature map. The activation function can be a switch activation function.
[0106] The compression-excitation submodule then performs weighted processing on the second feature map to produce a third feature map. For example, each channel in the second feature map is multiplied by a weight to achieve weighted processing. Specifically, after network learning, important channels are given larger weights, which attracts more attention and allows for the extraction of more features. Compression and excitation of the second feature map by the compression-excitation submodule increases the attention paid to important channels in the feature map, which helps improve model accuracy.
[0107] In some embodiments, as Figure 7 As shown, the compression excitation submodule includes a global average pooling layer, two fully connected layers and a weighted layer arranged in sequence.
[0108] The global average pooling layer performs dimensionality reduction on the input second feature map and outputs the first feature vector.
[0109] The two fully connected layers perform a nonlinear transformation on the first eigenvector, outputting a second eigenvector. That is, the first eigenvector undergoes two nonlinear transformations through the two fully connected layers to produce the second eigenvector. It is understood that to increase the nonlinearity of the vector, activation functions are placed after each of the two fully connected layers. For example, a switch activation function is placed after the first fully connected layer, and a sigmoid activation function is placed after the second fully connected layer.
[0110] The weighted layer multiplies the second feature map by the second feature vector and outputs the third feature map. That is, a channel of the second feature map is multiplied by the corresponding value in the second feature vector to obtain the third feature map.
[0111] like Figure 8 As shown in the figure, if the dimension of the input second feature map A is W*H*C, after compression processing by the global average pooling layer, the first eigenvector with the dimension of 1*1*C is obtained. However, after nonlinear transformation processing by two fully connected layers, the second eigenvector is obtained. It can be understood that the dimension of the second eigenvector is 1*1*C. The weighted layer performs a weighted multiplication on the second feature map A and the second eigenvector to obtain the third feature map. For example, the first channel of the second feature map A is multiplied by the first digit of the second eigenvector, the second channel is multiplied by the second digit, and so on. The Cth channel is multiplied by the Cth digit to obtain the third feature map.
[0112] It will be understood that the above-mentioned global average pooling layer is a term known in the art, and the structure and function of the global average pooling layer will not be explained here.
[0113] In the above embodiment, the second feature map output by the feature extraction submodule is first compressed by the global average pooling layer to compress the second feature map into a first feature vector, thereby reducing its size and realizing downsampling. Then, two fully connected layers are used for nonlinear changes, so that the compression excitation module has a stronger learning ability, which is conducive to outputting a second feature vector with appropriate weights. Finally, the weighted layer multiplies each channel of the second feature map by the weight in the second feature vector, so that channels with large weights receive more attention in the training of the model and more feature information is learned, that is, it can increase the attention of important channels of the feature map, which is beneficial to improving the accuracy of the model.
[0114] Please continue reading Figure 5 , abandon the connection submodule to extract features from the third feature map, abandon some neurons in the process of feature extraction, and output the fourth feature map.
[0115] like Figure 9 As shown in the figure, the dropout submodule includes a convolutional layer, a normalization layer, and a dropout layer connected in sequence. The third feature map is first input into the convolutional layer for convolution processing, then normalized based on the normalization layer. Finally, the dropout layer randomly drops some parameters of the inter-layer connections (i.e., some neuron parameters) so that they do not contribute to the calculation of the summation, thus preventing overfitting.
[0116] Specifically, the dropout layer performs random dropout parameter processing on the neuron input side, so that only a part of the parameters are updated in each iterative calculation, such as Figure 10 As shown, the dotted arrows are discarded input neurons. For example, for neuron Ym1, only neurons Xn1 and Xn5 participate in the calculation of its input side, and other neurons do not participate in the calculation of Ym1. It can be understood that Figure 10 What is shown is only a partial schematic diagram of the neural network. In fact, the input connections of the entire feature extraction module have neurons with more discarded parameters.
[0117] Given the image features of the chin area images in the training set, if some parameters are not discarded, it may be difficult to update the parameters. Each update, while searching for the local optimal solution, results in small gains, low efficiency, and significant computational resource consumption, which can also lead to overfitting. Understandably, discarding too many parameters can cause network oscillation and difficulty converging.
[0118] In some embodiments, the discard connection submodule is configured with a discard rate parameter, which reflects the proportion of discarded neurons, and the discard rate parameter is greater than or equal to 50%. For example, if the discard rate parameter is 60%, 60% of the neurons in the discard layer do not participate in the calculation.
[0119] In this embodiment, by abandoning the parameters of neurons with a larger proportion, the network convergence can be accelerated, and the oscillation situation is alleviated, so that the loss gradually decreases.
[0120] Finally, please refer again to Figure 5 The fusion submodule performs a fusion process on the first feature map and the fourth feature map to output a fifth feature map. Specifically, the fusion submodule performs an addition fusion process on the first feature map and the fourth feature map to output a fifth feature map.
[0121] In this embodiment, the feature extraction module includes a feature extraction submodule, a compression excitation submodule, a connection abandonment submodule and a fusion submodule. By setting the above-mentioned feature extraction submodule and fusion submodule, the fifth feature map will not be distorted during feature extraction. By setting the above-mentioned compression excitation submodule, the attention of important channels of the feature map can be increased, which is beneficial to improving the accuracy of the model. By setting the above-mentioned connection abandonment submodule, the network convergence can be accelerated and the model can be made lightweight.
[0122] After the double chin detection model training method provided in this application is used, the double chin model can be used for double chin detection. Figure 11 , Figure 11 A schematic diagram of the process of double chin detection method provided in an embodiment of the present application is shown as follows: Figure 11 As shown, the method S30 includes but is not limited to the following steps:
[0123] S31: Obtain a face image to be detected.
[0124] S32: Obtain a chin area image of the face image to be detected.
[0125] S33: Inputting the chin area image into a double chin detection model to obtain a double chin detection result of the face image to be detected, wherein the double chin detection model is trained using the above-mentioned double chin detection model training method.
[0126] Here, the facial image to be detected is an image used to input a double chin detection model, and can also be understood as a facial image for which the severity category of the double chin needs to be identified.
[0127] First, a facial key point algorithm is used to obtain facial key points of the face image to be detected. Then, based on the facial key points, the chin area image is cut out. It is understood that the specific implementation of this step can be the same as that in step S22, and will not be repeated here.
[0128] The double chin detection model is trained using the aforementioned training method embodiment. It will be appreciated that the double chin detection model extracts features from the chin area image corresponding to the facial image to be detected and, based on these features, identifies the probability that the chin in the facial image to be detected belongs to each severity category. Because the double chin detection model is derived from the aforementioned neural network and has the same structure and functionality as the neural network, the specific processing of the chin area image by the double chin detection model is the same as that performed by the neural network in the aforementioned embodiment and will not be further elaborated here.
[0129] In this embodiment, inputting chin area images into the model reduces interference from other features (such as facial features), facilitating accurate recognition. Furthermore, the structure and parameters of the double chin detection model are trained based on the image features of chin area images, improving detection accuracy and efficiency.
[0130] The above describes the methods of the present application. In order to better implement the methods of the present application, the following describes the devices of the present application.
[0131] See also Figure 12 , Figure 12 This is a structural diagram of a training device provided in an embodiment of the present application. Figure 12 As shown, the device 40 includes:
[0132] The first acquisition module 41 is configured to acquire an image sample set, where the image sample set includes a plurality of face images.
[0133] The second acquisition module 42 is configured to acquire a chin region image corresponding to each face image in the image sample set, wherein the chin region image is annotated with a true label.
[0134] Training module 43 is configured to train a neural network using each chin area image as a training set, iteratively adjusting network parameters and network structure until the neural network converges to obtain a double chin detection model. The neural network includes multiple feature extraction modules connected in sequence, and adjusting the network structure includes adjusting the number of feature extraction modules.
[0135] The above-mentioned device crops each facial image in the image sample set through the second acquisition module 42 to obtain the chin area image corresponding to each facial image. Then, the training module 43 uses each chin area image as a training set to train the neural network. This can reduce the interference of other features (such as facial features, etc.) on the chin features, which is beneficial to accelerate model convergence.
[0136] Furthermore, the neural network includes multiple feature extraction modules connected in sequence. During iterative training, not only are network parameters adjusted each time, but the number of feature extraction modules in the neural network is also adjusted based on the image features of the chin area image to reconstruct the neural network. Specifically, based on the image characteristics of the chin area image, such as single, clean features and small feature size, by adjusting the number of feature extraction modules in the neural network, the neural network is structurally pruned and reconstructed. This effectively mitigates overfitting and computational loss caused by feature extraction module redundancy relative to the training set (i.e., excessive network depth). Therefore, the double chin detection model trained using this training device can improve detection accuracy and efficiency.
[0137] See also Figure 13 , Figure 13 is a schematic diagram of the structure of a detection device provided in some embodiments of the present application, such as Figure 13 As shown, the device 50 includes:
[0138] The third acquisition module 51 is used to acquire the face image to be detected.
[0139] The fourth acquisition module 52 is used to acquire the chin area image of the face image to be detected.
[0140] The detection module 53 is configured to input the chin area image into a double chin detection model to obtain a double chin detection result for the face image to be detected, wherein the double chin detection model is trained using the double chin detection model training method in the above method embodiment.
[0141] In this device, the fourth acquisition module 52 captures an image of the chin area of the face to be detected, and the detection module 53 inputs this image into the model. This reduces interference from other features (such as facial features), facilitating accurate model recognition. Furthermore, the structure and parameters of the double chin detection model are trained based on the image features of the chin area image, improving detection accuracy and efficiency.
[0142] See also Figure 14 , is a hardware structure diagram of a computer device 60 provided in an embodiment of the present application, specifically, Figure 14 As shown, the computer device 60 includes at least one processor 61 and a memory 62 ( Figure 14 (a bus connection and a processor are used as an example).
[0143] The processor 61 is used to provide computing and control capabilities to control the computer device 60 to perform corresponding tasks, and to control the computer device 60 to perform any one of the double chin detection model training methods or double chin detection methods provided in the above embodiments.
[0144] It is understandable that the processor 61 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0145] Memory 62, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs, non-transitory computer-executable programs, and modules, such as program instructions / modules corresponding to the double chin detection model training method or the double chin detection method in the embodiments of the present invention. Processor 61 can implement any of the double chin detection model training methods or double chin detection methods provided in the above embodiments by running the non-transitory software programs, instructions, and modules stored in memory 62. Specifically, memory 62 can include high-speed random access memory and non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state memory device. In some embodiments, memory 62 can also include memory remotely located from the processor, which can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0146] An embodiment of the present application further provides a computer-readable storage medium storing a computer program. The computer program includes program instructions. When executed by a computer, the program instructions cause the computer to execute the aforementioned double chin detection model training method and double chin detection method.
[0147] It should be noted that the device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of this embodiment.
[0148] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a general hardware platform, or of course by hardware. Those skilled in the art can understand that all or part of the processes in the above embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above methods. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.
[0149] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Based on the concept of the present application, the technical features in the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other variations in different aspects of the present application as described above. For the sake of simplicity, they are not provided in detail. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A double chin detection model training method, characterized in that: include: Acquire an image sample set, wherein the image sample set includes a plurality of face images; Obtaining, based on each face image in the image sample set, a chin region image corresponding to each face image, wherein the chin region image is annotated with a true label; Using the chin area images as training sets, training a neural network, iteratively adjusting network parameters and network structure until the neural network converges, thereby obtaining the double chin detection model; The neural network includes a plurality of feature extraction modules connected in sequence, and adjusting the network structure includes adjusting the number of the plurality of feature extraction modules according to the image features of the chin area image to reconstruct the neural network; The feature extraction module includes a feature extraction submodule, a compression excitation submodule, a connection abandonment submodule and a fusion submodule; The feature extraction submodule is used to extract features from the input first feature map and output a second feature map; The compression excitation submodule is used to perform weighted processing on the second feature map to obtain a third feature map; The connection abandonment submodule is used to perform feature extraction on the third feature map, abandon some neurons during the feature extraction process, and output a fourth feature map; The fusion submodule is used to fuse the first feature map and the fourth feature map to output a fifth feature map; The compression excitation submodule includes a global average pooling layer, two fully connected layers and a weighted layer arranged in sequence; The global average pooling layer is used to perform dimensionality reduction processing on the second feature map and output a first feature vector; The two fully connected layers are used to perform nonlinear transformation on the first eigenvector and output a second eigenvector; The weighted layer is used to perform a multiplication operation on the second feature map and the second feature vector, and output the third feature map.
2. The method according to claim 1, characterized in that One of the feature extraction modules is configured with an input resolution, a number of output channels, and a number of layers, and the neural network is configured with a resolution scaling factor, a width scaling factor, and a depth scaling factor; The adjusting the network parameters includes adjusting the resolution scaling factor, the width scaling factor, and the depth scaling factor.
3. The method according to claim 1, characterized in that The abandon connection submodule is configured with an abandon rate parameter, which reflects the proportion of abandoned neurons, and the abandon rate parameter is greater than or equal to 50%.
4. A double chin detection method, characterized in that: include: Get the face image to be detected; Acquire a chin area image of the face image to be detected; The chin area image is input into a double chin detection model to obtain a double chin detection result of the face image to be detected, wherein the double chin detection model is trained using the method according to any one of claims 1 to 3.
5. A training device, characterized in that: include: A first acquisition module is used to acquire an image sample set, wherein the image sample set includes a plurality of face images; a second acquisition module, configured to acquire, based on each face image in the image sample set, a chin region image corresponding to each face image, wherein the chin region image is annotated with a true label; A training module is configured to use each of the chin area images as a training set to train a neural network, iteratively adjust network parameters and network structure until the neural network converges, and obtain the double chin detection model, wherein the neural network includes multiple feature extraction modules connected in sequence, and adjusting the network structure includes adjusting the number of the multiple feature extraction modules. The feature extraction module includes a feature extraction submodule, a compression excitation submodule, a connection abandonment submodule, and a fusion submodule, wherein the feature extraction submodule is configured to extract features from the input first feature map and output a second feature map, the compression excitation submodule is configured to perform weighted processing on the second feature map to obtain a third feature map, and the connection abandonment submodule is configured to perform weighted processing on the second feature map to obtain a third feature map. The submodule is used to extract features from the third feature map, and abandon some neurons in the process of feature extraction to output a fourth feature map. The fusion submodule is used to fuse the first feature map and the fourth feature map to output a fifth feature map. The compression excitation submodule includes a global average pooling layer, two fully connected layers and a weighted layer arranged in sequence, wherein the global average pooling layer is used to perform dimensionality reduction processing on the second feature map and output a first feature vector. The two fully connected layers are used to perform nonlinear changes on the first feature vector and output a second feature vector. The weighted layer is used to perform multiplication processing on the second feature map and the second feature vector to output the third feature map.
6. A detection device, characterized in that: include: The third acquisition module is used to acquire the face image to be detected; a fourth acquisition module, configured to acquire an image of the chin region of the face image to be detected; a detection module, configured to input the chin area image into a double chin detection model to obtain a double chin detection result for the face image to be detected, wherein the double chin detection model is trained using the method according to any one of claims 1 to 3.
7. A computer device, characterized in that: The computer device comprises a memory and one or more processors, wherein the one or more processors are used to execute one or more computer programs stored in the memory, and when the one or more processors execute the one or more computer programs, the computer device implements the method according to any one of claims 1 to 4.
8. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, wherein the computer program includes program instructions. When the program instructions are executed by a processor, the processor is caused to perform the method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Image recognition method, image recognition device, electronic equipment and computer readable storage medium
CN110363159A
Fire extinguisher position detection method and device, equipment and storage medium
CN112949494A