Facial pigment spot classification method and device based on pooling orthogonal fusion
Through a method based on pooling orthogonal fusion, the deep backbone network and pooling branches are used to extract the spatial information of facial pigment spots, which solves the problem of insufficient spatial global information perception in facial pigment spot classification and improves classification accuracy and detection efficiency. , suitable for medical and beauty fields.
Patent Information
- Application Number
- CN202410757576.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-13
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2044-06-13
AI Technical Summary
The existing technology has the problems of insufficient spatial global information perception and low classification accuracy in classifying facial pigment spots. In particular, it is difficult to accurately classify spots with scattering distribution, and the operation is cumbersome.
A facial pigment spot classification method based on pooling orthogonal fusion is used to extract feature mapping through a deep backbone network, and use a priori average pooling branch and a posteriori learnable pooling branch to capture spatial global information and spatial distribution information, and perform orthogonal Fusion to improve classification accuracy.
It improves the accuracy and detection efficiency of facial pigment spot classification, reduces the number of multi-point tests, and enhances the ability to identify features. It is suitable for medical auxiliary diagnosis and beauty and skin care fields.
Smart Images

Figure 00000000_0000
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image recognition, and in particular to a facial pigment spot classification method and device based on pooling orthogonal fusion. Background Art
[0002] The human face produces various pigment spots, such as moles, chloasma, freckles, etc., due to the excessive deposition of melanin under the skin, which affects the appearance. However, spots such as chloasma and freckles are usually scattered and lighter in color than concentrated spots such as moles, so they are difficult to classify accurately. In clinical medicine, pigment spots are mainly analyzed by colorimeter, but colorimeter can only measure the color value of local skin area. It is difficult to fully evaluate the distribution of widely scattered spots. Therefore, there is a problem of insufficient perception of spatial global information. In addition, multi-point testing is usually required to summarize the overall situation. The operation is cumbersome, resulting in the problem of difficulty in classifying scattered spots in facial pigment spots and low accuracy. Summary of the invention
[0003] The purpose of this application is to propose a facial pigmentation spot classification method and device based on pooling orthogonal fusion to address the above-mentioned technical problems.
[0004] In a first aspect, the present invention provides a facial pigment spot classification method based on pooling orthogonal fusion, comprising the following steps:
[0005] A facial pigment spot classification model is constructed and trained to obtain a trained facial pigment spot classification model, which includes a deep backbone network, a pooling orthogonal fusion module, a first fully connected layer and a Softmax function layer; the deep backbone network is used to extract features of the pigment spot image to obtain a feature map, and the pooling orthogonal fusion module includes a priori average pooling branch, a posterior learnable pooling branch and an orthogonal fusion module. The priori average pooling branch is used to extract spatial global information in the feature map to obtain a priori pooling feature with spatial stability, and the posterior learnable pooling branch uses learnable weights to mine the spatial distribution information in the feature map to obtain a posterior learnable pooling feature with spatial sensitivity. The orthogonal fusion module is used to orthogonally fuse the priori pooling feature and the posterior learnable pooling feature to obtain an orthogonal fusion feature, which is then input into the first fully connected layer and the Softmax function layer to output the predicted category probability;
[0006] Obtain the pigmentation spot image to be classified, input the pigmentation spot image to be classified into the trained facial pigmentation spot classification model, obtain the predicted category probability, and pass the predicted category probability through the argmax(•) function to obtain the category corresponding to the maximum probability value in the predicted category probability, which is used as the facial pigmentation spot classification result.
[0007] Preferably, a deep backbone network is used to extract features from the pigment spot image to obtain a feature map, specifically including:
[0008] The following formula is used to describe the calculation process of feature mapping:
[0009] ;
[0010] in, Represents a pigment spot image; Represents the function corresponding to the deep backbone network, Represents the parameters of the deep backbone network; Represents a feature map.
[0011] Preferably, the deep backbone network includes a RegNetY-Drop network, a ResNet network, a DenseNet network or an EfficientNet network.
[0012] Preferably, the prior average pooling branch is used to extract spatial global information in the feature map to obtain a priori pooling features with spatial stability, specifically including:
[0013] The following formula is used to describe the calculation process of the prior pooling feature:
[0014] ;
[0015] in, represents the feature map value on the kth channel of the feature map f; H and W represent the height and width of the feature map f, respectively, and C represents the number of channels of the feature map f; express The value of the element at (l,v) on the right, where l is the height index and v is the width index; represents the global average pooling operation; represents the prior pooling feature, where Represents the prior pooling feature The feature map value on the kth channel of .
[0016] Preferably, the posterior learnable pooling branch mines the spatial distribution information in the feature map with the help of learnable weights to obtain spatially sensitive posterior learnable pooling features, specifically including:
[0017] The posterior learnable pooling branch includes a dimensionality reduction processing module, a spatial orientation perception module, and a dimensionality increase processing module;
[0018] The dimensionality reduction processing module includes the first convolution layer, the first batch of normalization layers and the first ReLU activation function layer connected in sequence. The formula is shown as follows:
[0019] ;
[0020] in, represents feature mapping; o represents the dimension reduction feature obtained after dimensionality reduction processing; is the operation corresponding to the first convolutional layer, and its convolution kernel is , represents the real number domain, C represents the number of channels of the feature map f, C / r represents the number of channels of the dimension reduction feature o, and 1×1 represents the convolution kernel The spatial receptive field of , r represents the channel compression parameter, which is greater than 1 and divisible by C; Represents batch normalization operation; ReLU activation function.
[0021] The spatial orientation perception module uses the convolution kernel of the H×W receptive field as the learnable weight to perform convolution processing on the dimensionality reduction features, mines the orientation-sensitive spatial distribution information, and obtains the spatial orientation perception features. The formula is shown below:
[0022] ;
[0023] in, Represents the element value of the eigenvalue on the cth channel of the dimension reduction feature o at the spatial position (i, j), i and j are the height and width serial numbers of the eigenvalue, H and W are the height and width of the dimension reduction feature o, respectively, and feature mapping The height and width are the same, C / r represents the number of channels of the dimension reduction feature o; is the convolution kernel with H×W receptive field The cth output channel of the tth input channel is the element value at the spatial position (i, j), ; p is the spatial orientation perception feature, Represents the feature value of the spatial orientation perception feature p on the tth channel;
[0024] The dimension-increasing processing module includes the second convolutional layer, the second batch normalization layer and the second ReLU activation function layer connected in sequence, which is used to align the feature dimensions of the spatial orientation perception features and the feature map to obtain the posterior learnable pooling features. The formula is shown below:
[0025] ;
[0026] Among them, q represents the posterior learnable pooling feature obtained after dimensionality increase processing; is the operation corresponding to the second convolutional layer, and its convolution kernel is , C / r is the number of channels of the spatial orientation perception feature, which is the same as the number of channels of the dimension reduction feature o, C is the number of channels of the posterior learnable pooling feature q, which is the same as the number of channels of the feature map f, and 1×1 represents The spatial receptive field of ; r represents the channel compression parameter, which is greater than 1 and divisible by C; Represents batch normalization operation; Represents the ReLU activation function.
[0027] Preferably, an orthogonal fusion module is used to orthogonally fuse the prior pooling features and the posterior learnable pooling features to obtain orthogonal fusion features, specifically including:
[0028] The posterior learnable pooling features are orthogonally decomposed to extract feature components orthogonal to the prior pooling features from the posterior learnable pooling features. The formula is shown below:
[0029] ;
[0030] ;
[0031] in, and They represent the prior pooling features and the posterior learnable pooling features after feature reorganization, namely , ; T represents transpose operation; express The square of the 2-norm of ; and They respectively represent the projection component of the posterior learnable pooling feature on the prior pooling feature and the orthogonal component of the posterior learnable pooling feature relative to the prior pooling feature;
[0032] The orthogonal components are concatenated with the prior pooling features after feature reorganization, and then the feature dimension is squeezed. The formula is as follows:
[0033] ;
[0034] in, Represents a feature concatenation operation, which is used to and Series Characteristics of dimensions; Represents the feature dimension squeezing operation, which and Get in series The features are arranged into 2C-dimensional features; FC represents the second fully connected layer, which squeezes the feature dimension to obtain the 2C-dimensional feature projection as The orthogonal fusion feature of dimension is recorded as .
[0035] In a second aspect, the present invention provides a facial pigment spot classification device based on pooling orthogonal fusion, comprising:
[0036] A model building module is configured to build and train a facial pigment spot classification model to obtain a trained facial pigment spot classification model, wherein the facial pigment spot classification model includes a deep backbone network, a pooling orthogonal fusion module, a first fully connected layer, and a Softmax function layer; the deep backbone network is used to extract features of the pigment spot image to obtain a feature map, and the pooling orthogonal fusion module includes a priori average pooling branch, a posterior learnable pooling branch, and an orthogonal fusion module, wherein the priori average pooling branch is used to extract spatial global information in the feature map to obtain a priori pooling feature with spatial stability, and the posterior learnable pooling branch uses learnable weights to mine spatial distribution information in the feature map to obtain a posterior learnable pooling feature with spatial sensitivity, and the orthogonal fusion module is used to orthogonally fuse the priori pooling feature and the posterior learnable pooling feature to obtain an orthogonal fusion feature, and the orthogonal fusion feature is then input into the first fully connected layer and the Softmax function layer to output a predicted category probability;
[0037] The prediction module is configured to obtain the pigmentation spot image to be classified, input the pigmentation spot image to be classified into the trained facial pigmentation spot classification model, obtain the predicted category probability, and the predicted category probability is passed through the argmax(•) function to obtain the category corresponding to the maximum probability value in the predicted category probability, and use it as the facial pigmentation spot classification result.
[0038] In a third aspect, the present invention provides an electronic device comprising one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any implementation manner in the first aspect.
[0039] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in any implementation manner in the first aspect.
[0040] In a fifth aspect, the present invention provides a computer program product, comprising a computer program, which, when executed by a processor, implements the method described in any implementation manner in the first aspect.
[0041] Compared with the prior art, the present invention has the following beneficial effects:
[0042] (1) The facial pigment spot classification method based on pooling orthogonal fusion proposed in the present invention utilizes the spatial stability information captured by the prior pooling branch to make up for the problem of insufficient spatial global information perception of the colorimeter. At the same time, the spatial orientation information of the scattered spots is mined by the posterior learnable pooling branch to reduce the number of multi-point tests and improve the detection efficiency. It comprehensively considers the overall spatial distribution information of the pigment spots and the local spatial high-frequency details, thereby improving the accuracy of pigment spot classification, which has important applications in the fields of medical auxiliary diagnosis, beauty and skin care.
[0043] (2) The facial pigment spot classification method based on pooling orthogonal fusion proposed in the present invention performs orthogonal fusion of the prior pooling features and the posterior learnable pooling features, reduces the redundant information of the two pooling features, enhances their complementarity, improves the feature fusion effect, and thus improves the accuracy of facial pigment spot classification and the robustness of the pigment spot detection task. This feature fusion method fully exploits the unique information extracted by different pooling methods, enhances the feature identification ability, and has more advantages in dealing with complex pigment spot problems with light coloring and overlapping of multiple types of spots. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0045] Figure 1 A schematic diagram of the process of a facial pigment spot classification method based on pooling orthogonal fusion according to an embodiment of the present application;
[0046] Figure 2 A schematic diagram of a facial pigment spot classification model in a training phase of a facial pigment spot classification method based on pooling orthogonal fusion according to an embodiment of the present application;
[0047] Figure 3 A schematic diagram of a facial pigment spot classification model using a RegNetY-Drop network in the training stage and the inference stage of a deep backbone network of a facial pigment spot classification method based on pooling orthogonal fusion according to an embodiment of the present application;
[0048] Figure 4 Schematic diagram of a facial pigment spot classification device based on pooling orthogonal fusion according to an embodiment of the present application;
[0049] Figure 5 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0050] In order to make the purpose, technical scheme and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0051] Figure 1 A facial pigment spot classification method based on pooling orthogonal fusion provided in an embodiment of the present application is shown, comprising the following steps:
[0052] S1, construct a facial pigment spot classification model and train it to obtain a trained facial pigment spot classification model, the facial pigment spot classification model includes a deep backbone network, a pooling orthogonal fusion module, a first fully connected layer and a Softmax function layer; use the deep backbone network to extract features of the pigment spot image to obtain a feature map, the pooling orthogonal fusion module includes a priori average pooling branch, a posterior learnable pooling branch and an orthogonal fusion module, the priori average pooling branch is used to extract spatial global information in the feature map to obtain a priori pooling features with spatial stability, the posterior learnable pooling branch uses learnable weights to mine the spatial distribution information in the feature map to obtain a posterior learnable pooling features with spatial sensitivity, and the orthogonal fusion module is used to orthogonally fuse the priori pooling features and the posterior learnable pooling features to obtain orthogonal fusion features, which are then input into the first fully connected layer and the Softmax function layer to output the predicted category probability.
[0053] Specifically, facial pigmentation spot images are collected, each of which has label information. The pigmentation spot images are randomly cropped and randomly rotated to obtain training data. The formula is as follows:
[0054] ;
[0055] ;
[0056] in, is the initial facial pigmentation spot image; represents the image after random cropping; represents a random cropping operation; β = [ β x , β y , β h , β w ] Indicates the range of the clipping area; Indicates the ordinate of the upper left corner of the cropping area; Indicates the horizontal coordinate of the upper left corner of the cropping area; Indicates the height of the clipping area; Indicates the width of the cropping area. represents a random rotation operation; Indicates the rotation angle; Represents the preprocessed facial pigmentation images in the training data.
[0057] In a specific embodiment, reference Figure 2 , the deep backbone network is used to extract features from the pigment spot image and obtain feature mapping, which specifically includes:
[0058] The following formula is used to describe the calculation process of feature mapping:
[0059] ;
[0060] in, Represents a pigment spot image; Represents the function corresponding to the deep backbone network, Represents the parameters of the deep backbone network; Represents a feature map.
[0061] In a specific embodiment, the deep backbone network includes a RegNetY-Drop network, a ResNet network, a DenseNet network, or an EfficientNet network.
[0062] In a specific embodiment, the prior average pooling branch is used to extract spatial global information in the feature map to obtain a priori pooling features with spatial stability, specifically including:
[0063] The following formula is used to describe the calculation process of the prior pooling feature:
[0064] ;
[0065] in, represents the feature map value on the kth channel of the feature map f; H and W represent the height and width of the feature map f, respectively, and C represents the number of channels of the feature map f; express The value of the element at (l,v) on the right, where l is the height index and v is the width index; represents the global average pooling operation; represents the prior pooling feature, where Represents the prior pooling feature The feature map value on the kth channel of .
[0066] In a specific embodiment, the posterior learnable pooling branch mines the spatial distribution information in the feature map with the help of learnable weights to obtain the posterior learnable pooling features of spatial sensitivity, specifically including:
[0067] The posterior learnable pooling branch includes a dimensionality reduction processing module, a spatial orientation perception module, and a dimensionality increase processing module;
[0068] The dimensionality reduction processing module includes the first convolution layer, the first batch of normalization layers and the first ReLU activation function layer connected in sequence. The formula is shown as follows:
[0069] ;
[0070] in, represents feature mapping; o represents the dimension reduction feature obtained after dimensionality reduction processing; is the operation corresponding to the first convolutional layer, and its convolution kernel is , represents the real number domain, C represents the number of channels of the feature map f, C / r represents the number of channels of the dimension reduction feature o, and 1×1 represents the convolution kernel The spatial receptive field of , r represents the channel compression parameter, which is greater than 1 and divisible by C; Represents batch normalization operation; ReLU activation function.
[0071] The spatial orientation perception module uses the convolution kernel of the H×W receptive field as the learnable weight to perform convolution processing on the dimensionality reduction features, mines the orientation-sensitive spatial distribution information, and obtains the spatial orientation perception features. The formula is shown below:
[0072] ;
[0073] in, Represents the element value of the eigenvalue on the cth channel of the dimension reduction feature o at the spatial position (i, j), i and j are the height and width serial numbers of the eigenvalue, H and W are the height and width of the dimension reduction feature o, respectively, and feature mapping The height and width are the same, C / r represents the number of channels of the dimension reduction feature o; is the convolution kernel with H×W receptive field The cth output channel of the tth input channel is the element value at the spatial position (i, j), ; p is the spatial orientation perception feature, Represents the feature value of the spatial orientation perception feature p on the tth channel;
[0074] The dimension-increasing processing module includes the second convolutional layer, the second batch normalization layer and the second ReLU activation function layer connected in sequence, which is used to align the feature dimensions of the spatial orientation perception features and the feature map to obtain the posterior learnable pooling features. The formula is shown below:
[0075] ;
[0076] Among them, q represents the posterior learnable pooling feature obtained after dimensionality increase processing; is the operation corresponding to the second convolutional layer, and its convolution kernel is , C / r is the number of channels of the spatial orientation perception feature, which is the same as the number of channels of the dimension reduction feature o, C is the number of channels of the posterior learnable pooling feature q, which is the same as the number of channels of the feature map f, and 1×1 represents The spatial receptive field of ; r represents the channel compression parameter, which is greater than 1 and divisible by C; Represents batch normalization operation; Represents the ReLU activation function.
[0077] In a specific embodiment, an orthogonal fusion module is used to perform orthogonal fusion on the prior pooling features and the posterior learnable pooling features to obtain orthogonal fusion features, which specifically includes:
[0078] The posterior learnable pooling features are orthogonally decomposed to extract feature components orthogonal to the prior pooling features from the posterior learnable pooling features. The formula is shown below:
[0079] ;
[0080] ;
[0081] in, and They represent the prior pooling features and the posterior learnable pooling features after feature reorganization, namely , ; T represents transpose operation; express The square of the 2-norm of ; and They respectively represent the projection component of the posterior learnable pooling feature on the prior pooling feature and the orthogonal component of the posterior learnable pooling feature relative to the prior pooling feature;
[0082] The orthogonal components are concatenated with the prior pooling features after feature reorganization, and then the feature dimension is squeezed. The formula is as follows:
[0083] ;
[0084] in, Represents a feature concatenation operation, which is used to and Series Characteristics of dimensions; Represents the feature dimension squeezing operation, which and Get in series The features are arranged into 2C-dimensional features; FC represents the second fully connected layer, which squeezes the feature dimension to obtain the 2C-dimensional feature projection as The orthogonal fusion feature of dimension is recorded as .
[0085] Specifically, refer to Figure 3 In one preferred embodiment, the deep backbone network adopts the RegNetY-Drop network, and the RegNetY-Drop network includes a stem layer (Stem), a first residual group (stage1), a second residual group (stage2), a third residual group (stage3), a first neuron random inactivation layer (DropBlock1), a fourth residual group (stage4), and a second neuron random inactivation layer (DropBlock2) connected in sequence. In other optional embodiments, the deep backbone network can adopt other networks such as ResNet network, DenseNet network or EfficientNet network, which will not be repeated here. During the training process, each preprocessed facial pigmentation image in the same batch of training data is input into the RegNetY-Drop network. After feature extraction, a feature map is obtained. Then each feature map is input into the prior average pooling branch to extract the spatial global information of the feature map, which is used to learn the prior pooling features with spatial stability. At the same time, each feature map is input into the posterior learnable pooling branch, and the orientation-sensitive spatial distribution information is mined with the help of learnable weights to learn the posterior learnable pooling features with spatial sensitivity. The obtained prior pooling features and posterior learnable pooling features are orthogonally fused to obtain orthogonal fusion features, which are used to reduce the redundant information of the two pooling features and enhance their complementarity. The orthogonal fusion features are sequentially sent to the first fully connected layer and the Softmax layer to obtain the predicted category probability, and the label smoothed cross entropy is used to optimize the feature discriminability of the predicted category probability, and the gradient descent method is used to optimize the discriminability of the facial pigmentation classification model to obtain the trained facial pigmentation classification model. The formula is shown below:
[0086] ;
[0087] ;
[0088] ;
[0089] in, represents the label smoothed cross entropy loss function; represents the orthogonal fusion feature; FC represents the first fully connected layer, which combines the orthogonal fusion features The projection is the predicted category logical value of B dimension; Soft(•) represents the Softmax function, which maps the predicted category logical value of B dimension to the probability space of [0,1]; N and B represent the number of samples and the number of categories respectively; z represents the predicted category probability output by the Softmax function layer; where, Indicates the image of pigment spots The predicted probability of belonging to the jth category; represents the jth category; represents the category label smooth indicator function, is a manually set class label smoothing parameter, typically set to 0.1.
[0090] S2, obtain the pigmentation spot image to be classified, input the pigmentation spot image to be classified into the trained facial pigmentation spot classification model, obtain the predicted category probability, and the predicted category probability is passed through the argmax(•) function to obtain the category corresponding to the maximum probability value in the predicted category probability, and use it as the facial pigmentation spot classification result.
[0091] Specifically, refer to Figure 3 , the obtained pigment spot image to be classified is input into the trained facial pigment spot classification model network, and after passing through the Softmax function layer, a set of predicted category probabilities is output. The predicted category probabilities are Function, get the category corresponding to the maximum probability value in the predicted category probability, and use it as the facial pigment spot classification result. The formula is as follows:
[0092] ;
[0093] Among them, z represents a set of predicted category probabilities output after passing through the Softmax function layer; represents the conditional maximum function; b represents the category corresponding to the maximum probability value in the predicted category probability, that is, the facial pigmentation spot classification result.
[0094] The key of the present invention is to provide a facial pigment spot classification method based on pooling orthogonal fusion, including: extracting feature mapping from pigment spot images using a deep backbone network, designing a pooling orthogonal fusion module, including a priori average pooling branch, a posteriori learnable pooling branch and an orthogonal fusion module, the priori average pooling branch is used to extract spatial global information of feature mapping, learn a priori pooling features with spatial stability, the posterior learnable pooling branch uses learnable weights to mine orientation-sensitive spatial distribution information, and learns a posteriori learnable pooling features with spatial sensitivity; orthogonally fuse the obtained priori pooling features and the posterior learnable pooling features to obtain orthogonal fusion features, reduce the redundant information of the two pooling features, and enhance the complementarity of the two. The orthogonal fusion module is used to orthogonally fuse the obtained priori pooling features and the posterior learnable pooling features, improve the fusion effect of the pigment spot feature mapping, and then improve the accuracy of facial pigment spot classification. Therefore, the present invention can be widely used in the fields of medical auxiliary diagnosis and artificial intelligence.
[0095] Further references Figure 4 As an implementation of the methods shown in the above figures, the present application provides an embodiment of a facial pigment spot classification device based on pooling orthogonal fusion, and the device embodiment is similar to Figure 1 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.
[0096] The embodiment of the present application provides a facial pigment spot classification device based on pooling orthogonal fusion, comprising:
[0097] The model building module 1 is configured to build and train a facial pigment spot classification model to obtain a trained facial pigment spot classification model, wherein the facial pigment spot classification model includes a deep backbone network, a pooling orthogonal fusion module, a fully connected layer, and a Softmax function layer; the deep backbone network is used to extract features of the pigment spot image to obtain a feature map, and the pooling orthogonal fusion module includes a priori average pooling branch, a posterior learnable pooling branch, and an orthogonal fusion module, wherein the priori average pooling branch is used to extract spatial global information in the feature map to obtain a priori pooling feature with spatial stability, and the posterior learnable pooling branch uses learnable weights to mine the spatial distribution information in the feature map to obtain a posterior learnable pooling feature with spatial sensitivity, and the orthogonal fusion module is used to orthogonally fuse the priori pooling feature and the posterior learnable pooling feature to obtain an orthogonal fusion feature, and the orthogonal fusion feature is then input into the fully connected layer and the Softmax function layer to output the predicted category probability;
[0098] Prediction module 2 is configured to obtain the pigmentation spot image to be classified, input the pigmentation spot image to be classified into the trained facial pigmentation spot classification model, obtain the predicted category probability, and the predicted category probability is passed through the argmax(•) function to obtain the category corresponding to the maximum probability value in the predicted category probability, and use it as the facial pigmentation spot classification result.
[0099] Figure 5 Schematic diagram of the hardware structure of the electronic device provided by the embodiment of the present invention. Figure 5 As shown, the electronic device of this embodiment includes: a processor 501 and a memory 502; wherein the memory 502 is used to store computer-executable instructions; the processor 501 is used to execute the computer-executable instructions stored in the memory to implement the various steps performed by the electronic device in the above embodiment. For details, please refer to the relevant description in the above method embodiment.
[0100] Optionally, the memory 502 may be independent or integrated with the processor 501 .
[0101] When the memory 502 is independently provided, the electronic device further includes a bus 503 for connecting the memory 502 and the processor 501 .
[0102] An embodiment of the present invention further provides a computer storage medium, in which computer execution instructions are stored. When a processor executes the computer execution instructions, the above method is implemented.
[0103] An embodiment of the present invention further provides a computer program product, including a computer program. When the computer program is executed by a processor, the above method is implemented.
[0104] In the embodiments provided by the present invention, 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 modules is only a logical function division, and there may be other division methods in actual implementation, such as multiple modules can be combined or integrated into another system, or some features can be ignored or not executed. Another point, the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or modules, which can be electrical, mechanical or other forms.
[0105] The modules described as separate components may or may not be physically separated, and the components shown as modules 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 modules may be selected according to actual needs to implement the solution of this embodiment.
[0106] In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, or each module may exist physically separately, or two or more modules may be integrated into one unit. The above-mentioned module-composed unit may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0107] The above-mentioned integrated module implemented in the form of a software function module can be stored in a computer-readable storage medium. The above-mentioned software function module is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform some steps of the methods of various embodiments of the present application.
[0108] It should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the invention may be directly implemented as being executed by a hardware processor, or may be implemented by a combination of hardware and software modules in the processor.
[0109] The memory may include a high-speed RAM memory, and may also include a non-volatile storage NVM, such as at least one disk memory, and may also be a USB flash drive, a mobile hard disk, a read-only memory, a magnetic disk or an optical disk, etc.
[0110] The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of the present application is not limited to only one bus or one type of bus.
[0111] The above storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The storage medium can be any available medium that can be accessed by a general or special purpose computer.
[0112] An exemplary storage medium is coupled to a processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an application specific integrated circuit (ASIC). Of course, the processor and the storage medium can also exist as discrete components in an electronic device or a main control device.
[0113] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.
[0114] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention 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 replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A facial pigment spot classification method based on pooling orthogonal fusion, It is characterized in that The following steps are involved: A facial pigment spot classification model is constructed and trained to obtain a trained facial pigment spot classification model, wherein the facial pigment spot classification model includes a deep backbone network, a pooling orthogonal fusion module, a first fully connected layer, and a Softmax function layer; the deep backbone network is used to extract features of the pigment spot image to obtain a feature map, and the pooling orthogonal fusion module includes a priori average pooling branch, a posterior learnable pooling branch, and an orthogonal fusion module, wherein the priori average pooling branch is used to extract spatial global information in the feature map to obtain a priori pooling features with spatial stability, and the posterior learnable pooling branch mines the spatial distribution information in the feature map with the help of learnable weights to obtain a posterior learnable pooling features with spatial sensitivity, specifically including: The posterior learnable pooling branch includes a dimensionality reduction processing module, a spatial orientation perception module and a dimensionality increase processing module; The dimension reduction processing module includes a first convolutional layer, a first batch of normalization layers and a first ReLU activation function layer connected in sequence, and the formula is shown as follows: Wherein, f represents the feature map; o represents the dimension reduction feature obtained after the dimension reduction process; Conv(·,φ) is the operation corresponding to the first convolutional layer, and its convolution kernel is represents the real number domain, C represents the number of channels of the feature map f, C / r represents the number of channels of the dimension reduction feature o, 1×1 represents the spatial receptive field of the convolution kernel φ, r represents the channel compression parameter, which is greater than 1 and divisible by C; BN(·) represents the batch normalization operation; ReLU(·) represents the ReLU activation function; The spatial orientation perception module uses the convolution kernel of the H×W receptive field as the learnable weight to perform convolution processing on the dimensionality reduction features, mines the orientation-sensitive spatial distribution information, and obtains the spatial orientation perception features. The formula is shown in the following formula: Among them, c,i,j Represents the element value of the eigenvalue on the cth channel of the dimension reduction feature o at the spatial position (i, j), i and j are the height and width numbers of the eigenvalue respectively, H and W represent the height and width of the dimension reduction feature o respectively, which are the same as the height and width of the feature map f, and C / r represents the number of channels of the dimension reduction feature o; is the convolution kernel with H×W receptive field The c-th output channel of the t-th input channel is the element value at the spatial position (i, j), ; p is the spatial orientation perception feature, p t Represents the feature value of the spatial orientation perception feature p on the tth channel; The dimension-increasing processing module includes a second convolutional layer, a second batch normalization layer, and a second ReLU activation function layer connected in sequence, which are used to align the spatial orientation perception features with the feature map to obtain a posterior learnable pooling feature, and the formula is shown below: Among them, q represents the posterior learnable pooling feature obtained after dimensionality increase processing; Conv(·,λ) is the operation corresponding to the second convolutional layer, and its convolution kernel is C' / r is the number of channels of the spatial orientation perception feature, which is the same as the number of channels of the dimension reduction feature o, C' is the number of channels of the posterior learnable pooling feature q, which is the same as the number of channels of the feature map f, 1×1 represents the spatial receptive field of λ; r represents the channel compression parameter, which is greater than 1 and can be divided by C'; BN(·) represents the batch normalization operation; ReLU(·) represents the ReLU activation function, and the orthogonal fusion module is used to orthogonally fuse the prior pooling feature and the posterior learnable pooling feature to obtain the orthogonal fusion feature, which is then input into the first fully connected layer and the Softmax function layer to output the predicted category probability; Obtain a pigment spot image to be classified, input the pigment spot image to be classified into the trained facial pigment spot classification model to obtain a predicted category probability, and the predicted category probability is subjected to an argmax(·) function to obtain a category corresponding to the maximum probability value in the predicted category probability, and use it as the facial pigment spot classification result.
2. The facial pigment spot classification method based on pooling orthogonal fusion according to claim 1, It is characterized in that The method of extracting features from the pigment spot image using a deep backbone network to obtain a feature map specifically includes: The calculation process of the feature map is described by the following formula: f = FENet(x,θ); Wherein, x represents the pigment spot image; FENet(·) represents the function corresponding to the deep backbone network, θ represents the parameter of the deep backbone network; and f represents the feature map.
3. The facial pigment spot classification method based on pooling orthogonal fusion according to claim 1, It is characterized in that The deep backbone network includes a RegNetY-Drop network, a ResNet network, a DenseNet network or an EfficientNet network.
4. The facial pigment spot classification method based on pooling orthogonal fusion according to claim 1, It is characterized in that The prior average pooling branch is used to extract the spatial global information in the feature map to obtain a priori pooling features with spatial stability, specifically including: The following formula is used to describe the calculation process of the prior pooling feature: Among them, f k represents the feature map value on the kth channel of the feature map f; H and W represent the height and width of the feature map f, respectively, and C represents the number of channels of the feature map f; f k,l,v represents f k The element value at (l,v) on the left is the height index and v is the width index; GAP(·) represents the global average pooling operation; g represents the prior pooling feature, where g k Represents the feature map value on the kth channel of the prior pooling feature g.
5. The facial pigment spot classification method based on pooling orthogonal fusion according to claim 1, It is characterized in that The orthogonal fusion module is used to orthogonally fuse the prior pooling features and the posterior learnable pooling features to obtain the orthogonal fusion features, specifically including: The posterior learnable pooling feature is orthogonally decomposed, and feature components orthogonal to the prior pooling feature are extracted from the posterior learnable pooling feature. The formula is shown in the following formula: f orth =q'-f proj ; Among them, g' and q' respectively represent the prior pooling features and the posterior learnable pooling features after feature reorganization, that is, T represents the transpose operation; represents the square of the 2-norm of g'; f proj and f orth They respectively represent the projection component of the posterior learnable pooling feature on the prior pooling feature and the orthogonal component of the posterior learnable pooling feature relative to the prior pooling feature; The orthogonal component is concatenated with the prior pooling feature after feature reorganization, and then subjected to feature dimension squeezing operation. The formula is as follows: Among them, Cat(·) represents the feature concatenation operation, which is used to and g' are concatenated into 2C×1 dimension features; Squeeze(·) represents the feature dimension squeezing operation, which and g' in series to obtain 2C×1 features arranged as 2C-dimensional features; FC represents the second fully connected layer, which squeezes the feature dimension to obtain 2C-dimensional features and projects them into D-dimensional orthogonal fusion features. The orthogonal fusion features are recorded as 6. A facial pigment spot classification device based on pooling orthogonal fusion, It is characterized in that include: The model building module is configured to build and train a facial pigment spot classification model to obtain a trained facial pigment spot classification model, wherein the facial pigment spot classification model includes a deep backbone network, a pooling orthogonal fusion module, a first fully connected layer, and a Softmax function layer; the deep backbone network is used to extract features of the pigment spot image to obtain a feature map, and the pooling orthogonal fusion module includes a priori average pooling branch, a posterior learnable pooling branch, and an orthogonal fusion module, wherein the priori average pooling branch is used to extract spatial global information in the feature map to obtain a priori pooling features with spatial stability, and the posterior learnable pooling branch mines the spatial distribution information in the feature map with the help of learnable weights to obtain a posterior learnable pooling features with spatial sensitivity, specifically including: The posterior learnable pooling branch includes a dimensionality reduction processing module, a spatial orientation perception module and a dimensionality increase processing module; The dimension reduction processing module includes a first convolutional layer, a first batch of normalization layers and a first ReLU activation function layer connected in sequence, and the formula is shown as follows: Wherein, f represents the feature map; o represents the dimension reduction feature obtained after the dimension reduction process; Conv(·,φ) is the operation corresponding to the first convolutional layer, and its convolution kernel is represents the real number domain, C represents the number of channels of the feature map f, C / r represents the number of channels of the dimension reduction feature o, 1×1 represents the spatial receptive field of the convolution kernel φ, r represents the channel compression parameter, which is greater than 1 and divisible by C; BN(·) represents the batch normalization operation; ReLU(·) represents the ReLU activation function; The spatial orientation perception module uses the convolution kernel of the H×W receptive field as the learnable weight to perform convolution processing on the dimensionality reduction features, mines the orientation-sensitive spatial distribution information, and obtains the spatial orientation perception features. The formula is shown in the following formula: Among them, c,i,j Represents the element value of the eigenvalue on the cth channel of the dimension reduction feature o at the spatial position (i, j), i and j are the height and width numbers of the eigenvalue respectively, H and W represent the height and width of the dimension reduction feature o respectively, which are the same as the height and width of the feature map f, and C / r represents the number of channels of the dimension reduction feature o; is the convolution kernel with H×W receptive field The c-th output channel of the t-th input channel is the element value at the spatial position (i, j), ; p is the spatial orientation perception feature, p t Represents the feature value of the spatial orientation perception feature p on the tth channel; The dimension-increasing processing module includes a second convolutional layer, a second batch normalization layer, and a second ReLU activation function layer connected in sequence, which are used to align the spatial orientation perception features with the feature map to obtain a posterior learnable pooling feature, and the formula is shown below: Among them, q represents the posterior learnable pooling feature obtained after dimensionality increase processing; Conv(·,λ) is the operation corresponding to the second convolutional layer, and its convolution kernel is C' / r is the number of channels of the spatial orientation perception feature, which is the same as the number of channels of the dimension reduction feature o, C' is the number of channels of the posterior learnable pooling feature q, which is the same as the number of channels of the feature map f, 1×1 represents the spatial receptive field of λ; r represents the channel compression parameter, which is greater than 1 and can be divided by C'; BN(·) represents the batch normalization operation; ReLU(·) represents the ReLU activation function, and the orthogonal fusion module is used to orthogonally fuse the prior pooling feature and the posterior learnable pooling feature to obtain the orthogonal fusion feature, which is then input into the first fully connected layer and the Softmax function layer to output the predicted category probability; The prediction module is configured to obtain a pigment spot image to be classified, input the pigment spot image to be classified into the trained facial pigment spot classification model, obtain a predicted category probability, and the predicted category probability is subjected to an argmax(·) function to obtain a category corresponding to the maximum probability value in the predicted category probability, and use it as the facial pigment spot classification result.
7. An electronic device, include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 5.
8. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.
9. A computer program product comprising a computer program, It is characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.
