WO2023029233A1 - Face pigment detection model training method and apparatus, device, and storage medium - Google Patents

Face pigment detection model training method and apparatus, device, and storage medium Download PDF

Info

Publication number
WO2023029233A1
WO2023029233A1 PCT/CN2021/132558 CN2021132558W WO2023029233A1 WO 2023029233 A1 WO2023029233 A1 WO 2023029233A1 CN 2021132558 W CN2021132558 W CN 2021132558W WO 2023029233 A1 WO2023029233 A1 WO 2023029233A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
melanin
pigment
detection model
red pigment
Prior art date
Application number
PCT/CN2021/132558
Other languages
French (fr)
Chinese (zh)
Inventor
李启东
李志阳
王喆
杨小栋
Original Assignee
厦门美图宜肤科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 厦门美图宜肤科技有限公司 filed Critical 厦门美图宜肤科技有限公司
Priority to KR1020227037680A priority Critical patent/KR20230035225A/en
Priority to JP2022566607A priority patent/JP7455234B2/en
Publication of WO2023029233A1 publication Critical patent/WO2023029233A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T9/00Image coding
    • G06T9/002Image coding using neural networks

Definitions

  • the present application relates to the technical field of image processing, in particular, to a human face pigment detection model training method, device, equipment and storage medium.
  • the skin color of the human face is mainly composed of two pigments: melanin and heme. These two pigments have relatively fixed spectra for the absorption and reflection of light. Therefore, they have relatively fixed colors in the image imaging, and the final human face
  • the overall color of the skin is determined by the content of the two pigments; in turn, according to the image imaging results, the content of melanin (the result is a brown image, Brown) and hemoglobin (the result is a red image, Red) is calculated. Therefore, the color of the obtained face image can be analyzed to obtain the distribution of different pigments in the face image.
  • image analysis and processing methods are often only applicable to images with high image quality, such as images collected by professional digital cameras or SLR cameras, etc., but when applied to image processing with low image quality, such as mobile phone camera Due to the fact that such low-quality images have more color noise, the denoising process in the mobile phone imaging algorithm will cause the colors of adjacent pixels in the image to tend to be consistent, which in turn affects the difference between different pigments in the face image. recognition separation effect.
  • This application provides a human face pigment detection model training method, device, equipment and storage medium, which solves the problem that low-cost cameras (cameras) have poor image quality, which causes the colors of adjacent pixels in the image to tend to be consistent, which makes the human face image The problem of low quality decomposition of different pigments.
  • Some embodiments of the present application provide a human face pigment detection model training method, the method may include:
  • the resolution of the original sample image may be higher than the resolution of the target sample image
  • the target sample image is input into the initial human face pigment detection model to obtain the actual melanin high-definition detail image and the actual red pigment high-definition detail image output by the initial human face pigment detection model;
  • the original sample image is decomposed and processed to obtain a supervised melanin high-definition detail image and a supervised red pigment high-definition detail image;
  • the initial human face pigment The detection model is iteratively corrected to obtain the target face pigment detection model, which can include:
  • the brightness information of the supervised melanin high-definition detail image and the brightness information of the supervised red pigment high-definition detail image are used as supervision parameters, and according to the brightness information of the actual melanin high-definition detail image and the brightness information of the actual red pigment high-definition detail image, the The above initial face pigment detection model is iteratively corrected to obtain the target face pigment detection model.
  • the initial human face pigment detection model may include: an encoder, a first decoder and a second decoder;
  • the color decoding of the encoded features by the second decoder to obtain a melanin color image and a red pigment color image may include:
  • the initial human face pigment detection model is used to superimpose the melanin detail image and the melanin color image to obtain the actual melanin high-definition detail image, and the red pigment detail image and the The red pigment color image is superimposed to obtain the actual red pigment high-definition detail image, which may include:
  • the gain processing may include at least one of the following: compression processing, color format conversion processing, and pigment region color adjustment processing.
  • the color adjustment processing of the pigment area may include: detecting a melanin area and a red pigment area from the original sample image, removing the melanin area and red pigment area from the original sample image, and removing The image after the melanin area and the red area is fused with the original sample image.
  • inventions of the present application also provide a method for detecting human face pigment, the method may include:
  • the target sample image may be an image captured by a low-resolution pixel camera
  • the target sample image is input into the target human face pigment detection model to obtain the actual melanin high-definition detail image and the actual red pigment high-definition detail image output by the target human face pigment detection model;
  • the melanin distribution information and the red pigment distribution information in the target sample image are determined.
  • Some other embodiments of the present application also provide a human face pigment detection model training device, the device may include:
  • the gain module may be configured to perform gain processing on the original sample image to obtain a target sample image, and the resolution of the original sample image may be higher than the resolution of the target sample image;
  • the processing module can be configured to input the target sample image into the initial human face pigment detection model to obtain the actual melanin high-definition detail image and the actual red pigment high-definition detail image output by the initial human face pigment detection model;
  • the original sample image is decomposed and processed to obtain a supervised melanin high-definition detail image and a supervised red pigment high-definition detail image;
  • the correction module may be configured to use the supervised melanin high-definition detail image and the supervised red pigment high-definition detail image as supervisory parameters, according to the actual melanin high-definition detail image and the actual red pigment high-definition detail image, for the initial human
  • the face pigment detection model is iteratively corrected to obtain the target human face pigment detection model.
  • correction module can also be configured to:
  • the brightness information of the supervised melanin high-definition detail image and the brightness information of the supervised red pigment high-definition detail image are used as supervision parameters, and according to the brightness information of the actual melanin high-definition detail image and the brightness information of the actual red pigment high-definition detail image, the The above initial face pigment detection model is iteratively corrected to obtain the target face pigment detection model.
  • the initial human face pigment detection model may include: an encoder, a first decoder and a second decoder;
  • the processing module can also be configured to:
  • processing module may also be configured to:
  • processing module may also be configured to:
  • the gain processing may include at least one of the following: compression processing, color format conversion processing, and pigment region color adjustment processing.
  • the color adjustment processing of the pigment area may include: detecting a melanin area and a red pigment area from the original sample image, removing the melanin area and red pigment area from the original sample image, and removing The image after the melanin area and the red area is fused with the original sample image.
  • a human face pigment detection device which may include:
  • the acquisition module can be configured to acquire a target sample image, the target sample image is an image captured by a low-resolution pixel camera;
  • the processing module can be configured to input the target sample image into the target human face pigment detection model to obtain the actual melanin high-definition detail image and the actual red pigment high-definition detail image output by the target human face pigment detection model;
  • the determination module can be configured to determine the melanin distribution information and the red pigment distribution information in the target sample image according to the actual melanin high-definition detailed image and the actual red pigment high-definition detailed image.
  • the electronic device may include: a processor, a storage medium, and a bus.
  • the storage medium stores machine-readable instructions executable by the processor. When the electronic device runs When, the processor communicates with the storage medium through a bus, and the processor executes the machine-readable instructions to perform the steps of the method provided in the first aspect or the second aspect above.
  • Another embodiment of the present application also provides a computer storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the method provided in the above-mentioned embodiments are executed.
  • the embodiment of the present application provides a human face pigment detection model training method, device, equipment and storage medium
  • the method may include: performing gain processing on the original sample image to obtain the target sample image, the resolution of the original sample image is higher than that of the target sample The resolution of the image; the target sample image is input into the initial face pigment detection model, and the actual melanin high-definition detail image and the actual red pigment high-definition detail image output by the initial face pigment detection model are obtained; the original sample image is decomposed and processed to obtain supervision Melanin high-definition detail images and supervised red pigment high-definition detail images; with supervised melanin high-definition detail images and supervised red pigment high-definition detail images as supervision parameters, according to the actual melanin high-definition detail images and actual red pigment high-definition detail images, the initial face pigment detection model Perform iterative correction to obtain the target face pigment detection model.
  • the gain processing is mainly performed on the original sample image collected by a professional digital camera or SLR camera to obtain the target sample image, so as to realize the effect of simulating the face image captured by the camera of a mobile phone, and then, the target sample image Input the image into the initial face pigment detection model to obtain the HB image and HR image, and use the original sample image to decompose the TB image and TR image to iteratively correct the initial face pigment detection model to obtain the target face pigment detection model, It makes it possible to input the target sample image captured by the low-cost camera (camera) into the target face pigment detection model obtained from the above training, and obtain the HB image and HR image output by the target face pigment detection model.
  • the accurate detection of melanin and red pigment in the face image collected by the low-cost camera (camera) solves the problem that the poor image quality of the low-cost camera (camera) causes the colors of adjacent pixels of the image to tend to be consistent, which makes different pigments in the face image
  • the problem of low decomposition quality better restore the detail information in the actual melanin high-definition detail image and the actual red pigment high-definition detail image.
  • FIG. 1 is a schematic structural diagram of an electronic device provided in an embodiment of the present application.
  • Fig. 2 is a schematic flow chart of a human face pigment detection model training method provided by the embodiment of the present application
  • Fig. 3 is the frame diagram of the initial human face pigment detection model in a kind of human face pigment detection model training method that the embodiment of the application provides;
  • Fig. 4 is a schematic flow chart of another human face pigment detection model training method provided by the embodiment of the present application.
  • FIG. 5 is a schematic structural diagram of a human face pigment detection model training device provided in an embodiment of the present application.
  • FIG. 1 is a schematic structural diagram of an electronic device provided in an embodiment of the present application; the electronic device may be a processing device such as a computer or a server, and is used to implement the human face pigment detection model training method provided in the present application. As shown in FIG. 1 , an electronic device may include: a processor 101 and a memory 102 .
  • the processor 101 and the memory 102 may be directly or indirectly electrically connected to realize data transmission or interaction.
  • electrical connections may be made through one or more communication buses or signal lines.
  • the processor 101 may be an integrated circuit chip, which has a signal processing capability.
  • the above-mentioned processor 101 may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU), a network processor (Network Processor, NP) and the like.
  • CPU Central Processing Unit
  • NP Network Processor
  • Various methods, steps, and logic block diagrams disclosed in the embodiments of the present application may be implemented or executed.
  • a general-purpose processor may be a microprocessor, or the processor may be any conventional processor, or the like.
  • Memory 102 can be, but not limited to, random access memory (Random Access Memory, RAM), read-only memory (Read Only Memory, ROM), programmable read-only memory (Programmable Read-Only Memory, PROM), erasable Read-only memory (Erasable Programmable Read-Only Memory, EPROM), Electric Erasable Programmable Read-Only Memory (EEPROM), etc.
  • RAM Random Access Memory
  • ROM read-only memory
  • PROM programmable read-only memory
  • PROM Programmable Read-Only Memory
  • EPROM Erasable Programmable Read-Only Memory
  • EEPROM Electric Erasable Programmable Read-Only Memory
  • FIG. 1 is only for illustration, and the electronic device 100 may also include more or less components than those shown in FIG. 1 , or have a configuration different from that shown in FIG. 1 .
  • Each component shown in Fig. 1 may be implemented by hardware, software or a combination thereof.
  • the memory 102 is used to store programs, and the processor 101 invokes the programs stored in the memory 102 to execute the human face pigment detection model training method provided in the following embodiments.
  • a kind of face pigment detection model training method provided by the embodiment of the present application will be introduced in detail as follows through multiple embodiments.
  • Fig. 2 is a schematic flow chart of a human face pigment detection model training method provided by the embodiment of the present application.
  • the execution subject of the method may be an electronic device such as a server or a computer, which has a data processing function. It should be understood that in other embodiments, the order of some steps in the face pigment detection model training method can be exchanged according to actual needs, or some steps can also be omitted or deleted. As shown in Figure 2, the method may include:
  • S201 Perform gain processing on the original sample image to obtain a target sample image.
  • the resolution of the original sample image may be higher than the resolution of the target sample image.
  • the original sample image refers to a face image collected by a professional digital camera or a single-lens reflex camera or the like.
  • a suitable light source usually cross-polarized light
  • enough original face sample images are taken by a SLR camera.
  • brown map denoted as a Brown map
  • red map denoted as a Red map
  • this application proposes to perform gain processing on the original sample image.
  • the compression principle of jpg can be used to compress the quality of the original sample image with random quality, so as to reduce the quality of the original sample image, and then achieve the effect of simulating the real mobile phone camera. 3-channel face color image effect.
  • S202 Input the target sample image into the initial face pigment detection model, and obtain the actual melanin high-definition detail image and the actual red pigment high-definition detail image output by the initial human face pigment detection model.
  • the initial human face pigment detection model can be selected from an encoding-decoding (Encoder-Decoder) network model, a deep learning network model (Deep Neural Networks, DNN for short), or other network training models, etc.
  • Encoder-Decoder encoding-decoding
  • DNN Deep Neural Networks
  • the “initial human “Face Pigment Detection Model” is not specifically limited.
  • the "actual melanin high-definition detailed image” refers to the melanin image containing high-definition details (referred to as HB image)
  • the "actual red pigment high-definition detailed image” refers to the red pigment image containing high-definition details (referred to as HR image).
  • the target sample image obtained in step S202 is input into the initial human face pigment detection model, and processed by the Encoder-Decoder network model , to get the HB image and HR image output by the Encoder-Decoder network model.
  • the supervised melanin high-definition detail image and the supervised red pigment high-definition detail image can be used for the above-mentioned "initial face pigment detection model” for supervised training and learning.
  • the supervised melanin high-definition detail image is obtained by decomposing the original sample image using a traditional decomposition algorithm, and the "supervised melanin high-definition detail image" is used as the real target image supervised during the initial face pigment detection model training and learning, which is recorded as a TB image (Brown diagram).
  • the supervised red pigment high-definition detail image is also obtained by decomposing the original sample image using the traditional decomposition algorithm, and the "supervised red pigment high-definition detail image" is used as the real target image supervised during the initial face pigment detection model training and learning.
  • the following decomposition method may be used to decompose the original sample image to obtain a TB image and a TR image.
  • t transpose
  • log( ⁇ ) means taking natural logarithm
  • Brown map Brown Brown:
  • D -1 represents the inverse matrix of D
  • E i ⁇ B and E i ⁇ R both represent the dot product of two 3 ⁇ 1 column vectors, and still get a 3 ⁇ 1 column vector
  • the meaning of the exponential operation is (x1, x2, x3) t represents a 3 ⁇ 1 column vector.
  • the brown map Brown is the TB image in this application; the red image Red: is the TR image in this application.
  • the above-mentioned decomposition method is mainly used to obtain the supervised melanin high-definition detail image and the supervised red pigment high-definition detail image for deep learning training, and the above-mentioned method will not be used again after the network model training process or network training is completed. decomposition method.
  • the above-mentioned TB image to supervise the HB image output by the initial human face pigment detection model
  • use the above-mentioned TR image to supervise the HR image output by the initial human face pigment detection model, and perform multiple times on the initial human face pigment detection model. Iterative training and learning until the difference between the HB image and the TB image output by the trained face pigment detection model, and the difference between the HR image and the TR image is reduced to below the preset value, it can be considered that the network training is completed, after the training is completed A target human face pigment detection model is obtained. At this time, the target human face pigment detection model can be used to detect the distribution of different pigments in the human face image captured by a low-cost camera (camera).
  • a low-cost camera camera
  • the target sample image captured by a low-cost camera is obtained, and the target sample image is input into the target human face pigment detection model obtained through the above training, and the actual output of the target human facial pigment detection model is obtained.
  • the high-definition detailed images of melanin and the high-definition detailed images of actual red pigments realize the accurate detection of melanin and red pigments in face images collected by low-cost cameras (cameras), and solve the problem of poor image quality of low-cost cameras (cameras)
  • the color of adjacent pixels in the image tends to be consistent, which makes the decomposition quality of different pigments in the face image low, and the detailed information in the actual melanin high-definition detail image and the actual red pigment high-definition detail image is better restored.
  • the embodiment of the present application provides a human face pigment detection model training method, which may include: performing gain processing on the original sample image to obtain the target sample image, and the resolution of the original sample image may be higher than that of the target sample image
  • with supervised melanin high-definition detail image and supervised red pigment high-definition detail image as supervisory parameters the initial face pigment detection model is iteratively corrected according to the actual melanin high-definition detail image and actual red pigment high-definition detail image , to get the target face pigment detection model.
  • the gain processing is mainly performed on the original sample image collected by a professional digital camera or SLR camera to obtain the target sample image, so as to realize the effect of simulating the face image captured by the camera of a mobile phone, and then, the target sample image Input the image into the initial face pigment detection model to obtain the HB image and HR image, and use the original sample image to decompose the TB image and TR image to iteratively correct the initial face pigment detection model to obtain the target face pigment detection model, It makes it possible to input the target sample image captured by the low-cost camera (camera) into the target face pigment detection model obtained from the above training, and obtain the HB image and HR image output by the target face pigment detection model.
  • the accurate detection of melanin and red pigment in the face image collected by the low-cost camera (camera) solves the problem that the poor image quality of the low-cost camera (camera) causes the colors of adjacent pixels of the image to tend to be consistent, which makes different pigments in the face image Decompose the problem of low quality, and better restore the detail information in the actual melanin high-definition detail image and the actual red pigment high-definition detail image.
  • the brightness information of the supervised melanin high-definition detail image and the brightness information of the supervised red pigment high-definition detail image are used as supervision parameters, and the initial human face color is calculated according to the brightness information of the actual melanin high-definition detail image and the actual red pigment high-definition detail image.
  • the pixel detection model is iteratively corrected to obtain the target face pigment detection model.
  • This application in order to make the detailed information in the HB image and HR image output by the "initial face pigment detection model" clearer, in addition to using conventional loss function supervision, such as L1, etc.
  • This application also proposes to additionally use the "aligned brightness details" in the TB image and the TR image as a supervisory parameter to conduct supervised training and learning on the initial face pigment detection model, and continuously update the temporary face pigment detection model until a certain cycle After the error between the HB image and the TB image output by the obtained temporary face pigment detection model, and the error between the HR image and the TR image all meet the preset conditions, the iterative cycle process is ended, and the temporary face pigment detection model obtained at this time is As a target face pigment detection model.
  • HB L [c ⁇ max(HB)+min(HB))]/(1+c)
  • TB L [c ⁇ max(TB)+min(TB)]/(1+c)
  • Fig. 3 is a frame diagram of an initial human face pigment detection model provided by the embodiment of the present application, as shown in Fig. 3 , the initial human face pigment detection model may include: an encoder (Encoder), a first decoder (Decoder1 ) and the second decoder (Decoder2).
  • Encoder an encoder
  • Decoder1 a first decoder
  • Decoder2 the second decoder
  • the network model of Encoder-Decoder was selected as the initial human face pigment detection model, in this embodiment, the specific network layer composition in the network model of Encoder-Decoder is not considered, and the encoder is used to input to the initial human face pigment detection model
  • the target sample image in is encoded to obtain the encoded features; decoding has two branches, Decoder1 and Decoder2, where Decoder1 is used to generate image detail information, and Decoder2 is used to generate image color information, adding detail information and color information
  • the final HB image (brown image) and HR image (red image) with high-definition detail information are obtained.
  • Fig. 4 is a schematic flow chart of another human face pigment detection model training method provided by the embodiment of the present application.
  • the above step S202 input the target sample image into the initial human face pigment detection model to obtain the initial human face color
  • the actual melanin high-definition detail image and the actual red pigment high-definition detail image output by the pigment detection model can include:
  • the encoder encodes the target sample image to obtain encoded features.
  • the target sample image can be a 3-channel color image LI captured by a simulated real mobile phone, and the size of LI is 3xHxW, where H refers to the height information of the image, and W refers to the width information of the image.
  • the encoder may encode the target sample image to convert the target sample image into a fixed-length vector and obtain encoded features.
  • the first decoder performs detail decoding on the encoded features to obtain a melanin detail image and a red pigment detail image.
  • the first decoder Decoder1 performs detailed decoding on the encoded features, gradually restores the spatial detail information of the target sample image, and obtains the DB image and the DB image.
  • the size of the DB image and the DB image can both be the same as the target sample image, both are 3 channels, and the size is HxW.
  • the second decoder performs color decoding on the encoded features to obtain a melanin color image and a red pigment color image.
  • the encoded features are color-decoded by the second decoder to obtain a melanin color image and a red pigment color image, including:
  • the encoded features are color-decoded by the second decoder to obtain the intermediate melanin coefficient map matrix and the intermediate red pigment coefficient map matrix, and the intermediate melanin coefficient map matrix is multiplied by the pixel vector of each pixel position in the target sample image to obtain the melanin A color image, and multiplying the intermediate red pigment coefficient map matrix by the pixel vector of each pixel position in the target sample image to obtain a red pigment color image.
  • the middle melanin coefficient map matrix and the middle red pixel coefficient map matrix refer to the 12-channel Brown coefficient map KB matrix and Red coefficient map obtained by color decoding the encoded features by the second decoder Decoder2, which are consistent with the size of the target sample image KR matrix.
  • the size of the Brown coefficient map KB matrix and the Red coefficient map KR matrix are both 12xHxW, 12 actually means that each pixel position i has 12 coefficients, in order to construct a coefficient matrix 3x4 for each position i, the matrix contains 12 coefficients .
  • the corresponding pixel value is recorded as I i (IP i1 , IP i2 , IP i3 ), corresponding to the 12 coefficients at position i of the coefficient map, which can be converted into a matrix K i34 of size 3x4, for the pixel value I i (IP i1 , IP i2 , IP i3 ) at position i, add 1 to form a uniform Sub-pixel value I i (IP i1 , IP i2 , IP i3 , 1), and align sub-pixel value I i (IP i1 , IP i2 , IP i3 , 1) to transpose, and homogeneous pixel value I i (IP i1 , IP i2 , IP i3 , 1) becomes a 4x1 homogeneous vector
  • both the melanin color image OB and the red pigment color image OR can be calculated.
  • This application proposes a black pigment coefficient map matrix and a red pigment coefficient map matrix. The method avoids the problem of uneven transition, and restores the detailed information of the decomposition map through the process of detail learning, so that the results of the human face pigment detection results highlight the special areas of the skin, such as spots, acne, pores, etc.
  • S404 Perform superposition processing on the melanin detail image and the melanin color image by the initial face pigment detection model to obtain an actual melanin high-definition detail image, and perform superposition processing on the red pigment detail image and the red pigment color image to obtain the actual red pigment high-definition detail image image.
  • the melanin detail image and the melanin color image are superimposed by the initial human face pigment detection model to obtain the actual melanin high-definition detail image, and the red pigment detail image and the red pigment color image are superimposed to obtain the actual red pigment High-resolution detailed images, which can include:
  • the size of the detail image and the color image are exactly the same, and both are 3 channels, it means adding pixel by pixel to superimpose the melanin detail image and the melanin color image to obtain the actual melanin high-definition detail image, and , superimpose the red pigment detail image and the red pigment color image.
  • the pixel value corresponding to HR is recorded as HR i (HR i1 , HR i2 , HR i3 ), and the pixel value corresponding to OR is recorded as OR i (OR i1 , OR i2 , OR i3 ), the pixel value corresponding to DR is recorded as DR i (DR i1 , DR i2 , DR i3 ), then:
  • the HB image can be obtained by using the above superposition method.
  • the gain processing includes at least one of the following: compression processing, color format conversion processing, and pigment region color adjustment processing.
  • the data captured by the SLR camera is a high-definition image
  • the Brown and Red images corresponding to each image are kept unchanged.
  • the gain processing may include at least one item: compression processing, color format conversion processing, and pigment area color adjustment processing, in order to solve the problems used in the actual application process. Face pigment detection for relatively low-quality images captured by mobile phone cameras or other devices.
  • the color adjustment processing of the pigmented area may include: detecting a melanin area and a red pigmented area from the original sample image, removing the melanin area and the red pigmented area from the original sample image, and removing the melanin area and the red pigmented area The image is fused with the original sample image.
  • the desaturation method generally uniformly converts the original sample image into the HSL format, where H represents hue, S represents saturation, and L represents brightness. By adjusting the S channel, the saturation of the original sample image is reduced. In order to adapt to the task of decomposing channels during training, a new desaturation method is adopted.
  • the general calculation process for calculating the S channel can be: convert any 3-channel color image into a color image represented by RGB, and convert the value to 0.0-1.0;
  • smin1 min(2 ⁇ L-smax1, smax1)
  • max( ⁇ ) means to take the maximum value
  • min( ⁇ ) means to take the minimum value
  • red pimples and stains belong to areas with high saturation, and the corresponding Diff value is also large.
  • the above formula is also sufficient to reduce the saturation of the area with large Diff value, and keep the saturation of the smaller area as much as possible. The intensity remains the same, thereby reducing the color difference of acne breakouts, pigmentation spots and normal skin areas.
  • FIG. 5 is a schematic structural diagram of a face pigment detection model training device provided by an embodiment of the present application; as shown in FIG. 5 , the device may include: a gain module 501 , a processing module 502 and a correction module 503 .
  • the gain module 501 may be configured to perform gain processing on the original sample image to obtain a target sample image, and the resolution of the original sample image is higher than the resolution of the target sample image;
  • the processing module 502 can be configured to input the target sample image into the initial human face pigment detection model to obtain the actual melanin high-definition detail image and the actual red pigment high-definition detail image output by the initial human face pigment detection model; decompose the original sample image Processing to obtain a supervised melanin high-definition detail image and a supervised red pigment high-definition detail image;
  • the correction module 503 can be configured to use the supervised melanin high-definition detail image and the supervised red pigment high-definition detail image as supervision parameters, and iteratively correct the initial human face pigment detection model according to the actual melanin high-definition detail image and the actual red pigment high-definition detail image , to get the target face pigment detection model.
  • correction module 503 may also be configured to:
  • the brightness information of the supervised melanin high-definition detail image and the brightness information of the supervised red pigment high-definition detail image are used as supervision parameters. According to the brightness information of the actual melanin high-definition detail image and the brightness information of the actual red pigment high-definition detail image, the initial face pigment detection model Through iterative correction, the target face pigment detection model is obtained.
  • the initial human face pigment detection model may include: an encoder, a first decoder and a second decoder;
  • the processing module 502 may also be configured to:
  • Color decoding is performed on the encoded features by the second decoder to obtain a melanin color image and a red pigment color image;
  • the melanin detail image and the melanin color image are superimposed by the initial face pigment detection model to obtain the actual melanin high-definition detail image, and the red pigment detail image and the red pigment color image are superimposed to obtain the actual red pigment high-definition detail image.
  • processing module 502 may also be configured to:
  • the encoded features are color-decoded by the second decoder to obtain the intermediate melanin coefficient map matrix and the intermediate red pigment coefficient map matrix, and the intermediate melanin coefficient map matrix is multiplied by the pixel vector of each pixel position in the target sample image to obtain the melanin A color image, and multiplying the intermediate red pigment coefficient map matrix by the pixel vector of each pixel position in the target sample image to obtain a red pigment color image.
  • processing module 502 may also be configured to:
  • the gain processing may include at least one of the following: compression processing, color format conversion processing, and pigment region color adjustment processing.
  • the color adjustment processing of the pigmented area may include: detecting a melanin area and a red pigmented area from the original sample image, removing the melanin area and the red pigmented area from the original sample image, and removing the melanin area and the red pigmented area The image is fused with the original sample image.
  • the above modules may be one or more integrated circuits configured to implement the above method, for example: one or more specific integrated circuits (Application Specific Integrated Circuit, referred to as ASIC), or, one or more microprocessors (digital singnal processor, DSP for short), or, one or more Field Programmable Gate Arrays (Field Programmable Gate Array, FPGA for short), etc.
  • ASIC Application Specific Integrated Circuit
  • DSP digital singnal processor
  • FPGA Field Programmable Gate Array
  • the processing element may be a general-purpose processor, such as a central processing unit (Central Processing Unit, referred to as CPU) or other processors that can call program codes.
  • CPU central processing unit
  • these modules can be integrated together and implemented in the form of a system-on-a-chip (SOC for short).
  • the present application further provides a program product, such as a computer-readable storage medium, including a program, and the program is used to execute the foregoing method embodiments when executed by a processor.
  • a program product such as a computer-readable storage medium, including a program
  • the disclosed devices and methods may be implemented in other ways.
  • the device embodiments described above are only illustrative.
  • the division of the units is only a logical function division. In actual implementation, there may be other division methods.
  • multiple units or components can be combined or May be integrated into another system, or some features may be ignored, or not implemented.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated units can be implemented in the form of hardware, or in the form of hardware plus software functional units.
  • the above-mentioned integrated units implemented in the form of software functional units may be stored in a computer-readable storage medium.
  • the above-mentioned software functional units are stored in a storage medium, and include several instructions to enable a computer device (which may be a personal computer, server, or network device, etc.) or a processor (English: processor) to execute the functions described in various embodiments of the present application. part of the method.
  • the aforementioned storage media include: U disk, mobile hard disk, read-only memory (English: Read-Only Memory, abbreviated: ROM), random access memory (English: Random Access Memory, abbreviated: RAM), magnetic disk or optical disc, etc.
  • ROM Read-Only Memory
  • RAM Random Access Memory
  • magnetic disk or optical disc etc.
  • the present application provides a human face pigment detection model training method, device, equipment and storage medium.
  • the method includes: performing gain processing on the original sample image to obtain a target sample image; inputting the target sample image into an initial face pigment detection model to obtain an actual melanin high-definition detail image and an actual red pigment high-definition detail image; decomposing the original sample image processing to obtain the supervised melanin high-definition detail image and the supervised red pigment high-definition detail image; with the supervised melanin high-definition detail image and the supervised red pigment high-definition detail image as supervision parameters, according to the actual melanin high-definition detail image and the actual red pigment high-definition detail image, the initial human The face pigment detection model is iteratively corrected to obtain the target human face pigment detection model.
  • This solution solves the problem that the low-cost camera’s shooting quality is poor, resulting in the color of adjacent pixels of the image tending to be consistent, and the problem of low decomposition quality of different pigments in the
  • the face pigment detection model training method, device, equipment and storage medium of the present application are reproducible and can be used in various industrial applications.
  • the human face pigment detection model training method, device, equipment and storage medium of the present application can be used in the technical field of image processing.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • Evolutionary Computation (AREA)
  • Biophysics (AREA)
  • General Engineering & Computer Science (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Biomedical Technology (AREA)
  • Software Systems (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • General Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Mathematical Physics (AREA)
  • Multimedia (AREA)
  • Image Processing (AREA)
  • Image Analysis (AREA)
  • Measuring And Recording Apparatus For Diagnosis (AREA)

Abstract

The present application relates to the technical field of image processing, and provides a face pigment detection model training method and apparatus, a device, and a storage medium. The method comprises: performing gain processing on an original sample image to obtain a target sample image; inputting the target sample image into an initial face pigment detection model to obtain an actual black-pigment high-definition detail image and an actual red-pigment high-definition detail image; decomposing the original sample image to obtain a supervised black-pigment high-definition detail image and a supervised red-pigment high-definition detail image; and by using the supervised black-pigment high-definition detail image and the supervised red-pigment high-definition detail image as supervision parameters, iteratively correcting the initial face pigment detection model according to the actual black-pigment high-definition detail image and the actual red-pigment high-definition detail image, to obtain a target face pigment detection model. The present solution solves the problem that since the quality of image captured by a low-cost camera is poor, colors of adjacent pixels of the image tend to be consistent, resulting in low decomposition quality of different pigments in the face image.

Description

人脸色素检测模型训练方法、装置、设备及存储介质Human face pigment detection model training method, device, equipment and storage medium
相关申请的交叉引用Cross References to Related Applications
本申请要求于2021年08月30日提交中国专利局的申请号为2021110024638、名称为“人脸色素检测模型训练方法、装置、设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application with the application number 2021110024638 and titled "Human face pigment detection model training method, device, equipment and storage medium" submitted to the Chinese Patent Office on August 30, 2021, the entire content of which is passed References are incorporated in this application.
技术领域technical field
本申请涉及图像处理技术领域,具体而言,涉及一种人脸色素检测模型训练方法、装置、设备及存储介质。The present application relates to the technical field of image processing, in particular, to a human face pigment detection model training method, device, equipment and storage medium.
背景技术Background technique
人脸肤色主要是由两种色素构成:黑色素和血红素,这两种色素对光线的吸收和反射有着相对固定的光谱,因此,在图像成像上有着相对固定的颜色,最终呈现出的人脸皮肤的整体颜色则由该两种色素的含量决定;反过来,根据图像成像的结果,计算得到黑色素(结果为棕色图,Brown)和血红素(结果为红色图,Red)的含量。所以,可以对得到的人脸图像的颜色进行分析,从而得到人脸图像中不同色素的分布。The skin color of the human face is mainly composed of two pigments: melanin and heme. These two pigments have relatively fixed spectra for the absorption and reflection of light. Therefore, they have relatively fixed colors in the image imaging, and the final human face The overall color of the skin is determined by the content of the two pigments; in turn, according to the image imaging results, the content of melanin (the result is a brown image, Brown) and hemoglobin (the result is a red image, Red) is calculated. Therefore, the color of the obtained face image can be analyzed to obtain the distribution of different pigments in the face image.
目前,对于图像的分析处理方法往往只适用于图像质量较高的图像,例如由专业的数码相机或单反相机等所采集的图像,而应用于图像质量较低的图像处理时,如手机摄像头拍摄的图像,由于这类质量较低的图像中具有较多的彩色噪声,手机成像算法中的去噪过程,会导致图像相邻像素的颜色趋于一致,进而影响人脸图像中不同色素之间的识别分离效果。At present, image analysis and processing methods are often only applicable to images with high image quality, such as images collected by professional digital cameras or SLR cameras, etc., but when applied to image processing with low image quality, such as mobile phone camera Due to the fact that such low-quality images have more color noise, the denoising process in the mobile phone imaging algorithm will cause the colors of adjacent pixels in the image to tend to be consistent, which in turn affects the difference between different pigments in the face image. recognition separation effect.
因此,如何解决低成本相机(摄像头)拍摄画质较差导致图像相邻像素的颜色趋于一致使人脸图像中不同色素分解质量低下的问题,是亟待解决的技术问题。Therefore, how to solve the problem that the low-cost camera (camera) has poor image quality and causes the colors of adjacent pixels of the image to tend to be consistent, so that the decomposition quality of different pigments in the face image is low, is a technical problem to be solved urgently.
发明内容Contents of the invention
本申请提供了一种人脸色素检测模型训练方法、装置、设备及存储介质,解决了低成本相机(摄像头)拍摄画质较差,导致图像相邻像素的颜色趋于一致使人脸图像中不同色素分解质量低下的问题。This application provides a human face pigment detection model training method, device, equipment and storage medium, which solves the problem that low-cost cameras (cameras) have poor image quality, which causes the colors of adjacent pixels in the image to tend to be consistent, which makes the human face image The problem of low quality decomposition of different pigments.
本申请的一些实施例提供了一种人脸色素检测模型训练方法,该方法可以包括:Some embodiments of the present application provide a human face pigment detection model training method, the method may include:
对原始样本图像进行增益处理,得到目标样本图像,所述原始样本图像的分辨率可以高于所述目标样本图像的分辨率;performing gain processing on the original sample image to obtain a target sample image, the resolution of the original sample image may be higher than the resolution of the target sample image;
将所述目标样本图像输入初始人脸色素检测模型中,得到所述初始人脸色素检测模型输出的实际黑色素高清细节图像和实际红色素高清细节图像;The target sample image is input into the initial human face pigment detection model to obtain the actual melanin high-definition detail image and the actual red pigment high-definition detail image output by the initial human face pigment detection model;
对所述原始样本图像进行分解处理,得到监督黑色素高清细节图像和监督红色素高清 细节图像;The original sample image is decomposed and processed to obtain a supervised melanin high-definition detail image and a supervised red pigment high-definition detail image;
以所述监督黑色素高清细节图像和监督红色素高清细节图像作为监督参数,根据所述实际黑色素高清细节图像和所述实际红色素高清细节图像,对所述初始人脸色素检测模型进行迭代修正,得到目标人脸色素检测模型。Using the supervised melanin high-definition detail image and the supervised red pigment high-definition detail image as supervisory parameters, according to the actual melanin high-definition detail image and the actual red pigment high-definition detail image, iteratively correcting the initial human face pigment detection model, Obtain the target face pigment detection model.
可选地,所述以所述监督黑色素高清细节图像和监督红色素高清细节图像作为监督参数,根据所述实际黑色素高清细节图像和所述实际红色素高清细节图像,对所述初始人脸色素检测模型进行迭代修正,得到目标人脸色素检测模型,可以包括:Optionally, using the supervised melanin high-definition detail image and the supervised red pigment high-definition detail image as supervisory parameters, according to the actual melanin high-definition detail image and the actual red pigment high-definition detail image, the initial human face pigment The detection model is iteratively corrected to obtain the target face pigment detection model, which can include:
所述监督黑色素高清细节图像的亮度信息和监督红色素高清细节图像的亮度信息作为监督参数,根据所述实际黑色素高清细节图像的亮度信息和所述实际红色素高清细节图像的亮度信息,对所述初始人脸色素检测模型进行迭代修正,得到目标人脸色素检测模型。The brightness information of the supervised melanin high-definition detail image and the brightness information of the supervised red pigment high-definition detail image are used as supervision parameters, and according to the brightness information of the actual melanin high-definition detail image and the brightness information of the actual red pigment high-definition detail image, the The above initial face pigment detection model is iteratively corrected to obtain the target face pigment detection model.
可选地,所述初始人脸色素检测模型可以包括:编码器、第一解码器以及第二解码器;Optionally, the initial human face pigment detection model may include: an encoder, a first decoder and a second decoder;
所述将所述目标样本图像输入初始人脸色素检测模型中,得到所述初始人脸色素检测模型输出的实际黑色素高清细节图像和实际红色素高清细节图像,可以包括:Said inputting the target sample image into the initial human face pigment detection model to obtain the actual melanin high-definition detail image and actual red pigment high-definition detail image output by the initial human face pigment detection model may include:
由所述编码器对所述目标样本图像进行编码,得到编码后特征;Encoding the target sample image by the encoder to obtain encoded features;
由所述第一解码器对所述编码后特征进行细节解码,得到黑色素细节图像和红色素细节图像;performing detail decoding on the encoded features by the first decoder to obtain a melanin detail image and a red pigment detail image;
由所述第二解码器对所述编码后特征进行颜色解码,得到黑色素颜色图像和红色素颜色图像;performing color decoding on the encoded features by the second decoder to obtain a melanin color image and a red pigment color image;
由所述初始人脸色素检测模型对所述黑色素细节图像和所述黑色素颜色图像进行叠加处理,得到所述实际黑色素高清细节图像,以及,对所述红色素细节图像和所述红色素颜色图像进行叠加处理,得到所述实际红色素高清细节图像。Superimposing the melanin detail image and the melanin color image by the initial human face pigment detection model to obtain the actual melanin high-definition detail image, and the red pigment detail image and the red pigment color image Superposition processing is performed to obtain the actual red pigment high-definition detail image.
可选地,所述由所述第二解码器对所述编码后特征进行颜色解码,得到黑色素颜色图像和红色素颜色图像,可以包括:Optionally, the color decoding of the encoded features by the second decoder to obtain a melanin color image and a red pigment color image may include:
由所述第二解码器对所述编码后特征进行颜色解码,得到中间黑色素系数图矩阵和中间红色素系数图矩阵,并将所述中间黑色素系数图矩阵与所述目标样本图像中各像素位置的像素向量相乘,得到所述黑色素颜色图像,以及,将所述中间红色素系数图矩阵与所述目标样本图像中各像素位置的像素向量相乘,得到所述红色素颜色图像。Perform color decoding on the encoded features by the second decoder to obtain an intermediate melanin coefficient map matrix and an intermediate red pigment coefficient map matrix, and compare the intermediate melanin coefficient map matrix with the position of each pixel in the target sample image Multiply the pixel vectors of the melanin color image to obtain the melanin color image, and multiply the intermediate red pigment coefficient map matrix with the pixel vectors of each pixel position in the target sample image to obtain the red pigment color image.
可选地,所述由所述初始人脸色素检测模型对所述黑色素细节图像和所述黑色素颜色图像进行叠加处理,得到所述实际黑色素高清细节图像,以及,对所述红色素细节图像和所述红色素颜色图像进行叠加处理,得到所述实际红色素高清细节图像,可以包括:Optionally, the initial human face pigment detection model is used to superimpose the melanin detail image and the melanin color image to obtain the actual melanin high-definition detail image, and the red pigment detail image and the The red pigment color image is superimposed to obtain the actual red pigment high-definition detail image, which may include:
由所述初始人脸色素检测模型对所述黑色素细节图像和所述黑色素颜色图像中相同位置相同通道的各像素值分别相加,得到所述实际黑色素高清细节图像,以及,对所述红色 素细节图像和所述红色素颜色图像中相同位置相同通道的各像素值分别相加,得到所述实际红色素高清细节图像。Adding the pixel values of the same position and the same channel in the melanin detail image and the melanin color image respectively by the initial human face pigment detection model to obtain the actual melanin high-definition detail image, and for the red pigment The detail image and the pixel values of the same position and the same channel in the red pigment color image are respectively added to obtain the actual red pigment high-definition detail image.
可选地,所述增益处理可以包括如下至少一项:压缩处理、颜色格式转换处理、色素区域颜色调整处理。Optionally, the gain processing may include at least one of the following: compression processing, color format conversion processing, and pigment region color adjustment processing.
可选地,所述色素区域颜色调整处理可以包括:从所述原始样本图像中检测出黑色素区域和红色素区域,从所述原始样本图像中剔除所述黑色素区域和红色素区域,并将剔除所述黑色素区域和红色素区域后的图像与所述原始样本图像进行融合处理。Optionally, the color adjustment processing of the pigment area may include: detecting a melanin area and a red pigment area from the original sample image, removing the melanin area and red pigment area from the original sample image, and removing The image after the melanin area and the red area is fused with the original sample image.
本申请的另一些实施例还提供了一种人脸色素检测方法,所述方法可以包括:Other embodiments of the present application also provide a method for detecting human face pigment, the method may include:
获取目标样本图像,所述目标样本图像可以是由低分率像素相机拍摄到的图像;Acquiring a target sample image, the target sample image may be an image captured by a low-resolution pixel camera;
将所述目标样本图像输入至目标人脸色素检测模型中,得到所述目标人脸色素检测模型输出的实际黑色素高清细节图像和实际红色素高清细节图像;The target sample image is input into the target human face pigment detection model to obtain the actual melanin high-definition detail image and the actual red pigment high-definition detail image output by the target human face pigment detection model;
根据实际黑色素高清细节图像和实际红色素高清细节图像,确定目标样本图像中黑色素分布信息和红色素分布信息。According to the actual melanin high-definition detail image and the actual red pigment high-definition detail image, the melanin distribution information and the red pigment distribution information in the target sample image are determined.
本申请的又一些实施例还提供了一种人脸色素检测模型训练装置,所述装置可以包括:Some other embodiments of the present application also provide a human face pigment detection model training device, the device may include:
增益模块,可以配置成用于对原始样本图像进行增益处理,得到目标样本图像,所述原始样本图像的分辨率可以高于所述目标样本图像的分辨率;The gain module may be configured to perform gain processing on the original sample image to obtain a target sample image, and the resolution of the original sample image may be higher than the resolution of the target sample image;
处理模块,可以配置成用于将所述目标样本图像输入初始人脸色素检测模型中,得到所述初始人脸色素检测模型输出的实际黑色素高清细节图像和实际红色素高清细节图像;对所述原始样本图像进行分解处理,得到监督黑色素高清细节图像和监督红色素高清细节图像;The processing module can be configured to input the target sample image into the initial human face pigment detection model to obtain the actual melanin high-definition detail image and the actual red pigment high-definition detail image output by the initial human face pigment detection model; The original sample image is decomposed and processed to obtain a supervised melanin high-definition detail image and a supervised red pigment high-definition detail image;
修正模块,可以配置成用于以所述监督黑色素高清细节图像和监督红色素高清细节图像作为监督参数,根据所述实际黑色素高清细节图像和所述实际红色素高清细节图像,对所述初始人脸色素检测模型进行迭代修正,得到目标人脸色素检测模型。The correction module may be configured to use the supervised melanin high-definition detail image and the supervised red pigment high-definition detail image as supervisory parameters, according to the actual melanin high-definition detail image and the actual red pigment high-definition detail image, for the initial human The face pigment detection model is iteratively corrected to obtain the target human face pigment detection model.
可选地,所述修正模块,还可以配置成用于:Optionally, the correction module can also be configured to:
所述监督黑色素高清细节图像的亮度信息和监督红色素高清细节图像的亮度信息作为监督参数,根据所述实际黑色素高清细节图像的亮度信息和所述实际红色素高清细节图像的亮度信息,对所述初始人脸色素检测模型进行迭代修正,得到目标人脸色素检测模型。The brightness information of the supervised melanin high-definition detail image and the brightness information of the supervised red pigment high-definition detail image are used as supervision parameters, and according to the brightness information of the actual melanin high-definition detail image and the brightness information of the actual red pigment high-definition detail image, the The above initial face pigment detection model is iteratively corrected to obtain the target face pigment detection model.
可选地,所述初始人脸色素检测模型可以包括:编码器、第一解码器以及第二解码器;Optionally, the initial human face pigment detection model may include: an encoder, a first decoder and a second decoder;
所述处理模块,还可以配置成用于:The processing module can also be configured to:
由所述编码器对所述目标样本图像进行编码,得到编码后特征;Encoding the target sample image by the encoder to obtain encoded features;
由所述第一解码器对所述编码后特征进行细节解码,得到黑色素细节图像和红色素细节图像;performing detail decoding on the encoded features by the first decoder to obtain a melanin detail image and a red pigment detail image;
由所述第二解码器对所述编码后特征进行颜色解码,得到黑色素颜色图像和红色素颜色图像;performing color decoding on the encoded features by the second decoder to obtain a melanin color image and a red pigment color image;
由所述初始人脸色素检测模型对所述黑色素细节图像和所述黑色素颜色图像进行叠加处理,得到所述实际黑色素高清细节图像,以及,对所述红色素细节图像和所述红色素颜色图像进行叠加处理,得到所述实际红色素高清细节图像。Superimposing the melanin detail image and the melanin color image by the initial human face pigment detection model to obtain the actual melanin high-definition detail image, and the red pigment detail image and the red pigment color image Superposition processing is performed to obtain the actual red pigment high-definition detail image.
可选地,所述处理模块,还可以配置成用于:Optionally, the processing module may also be configured to:
由所述第二解码器对所述编码后特征进行颜色解码,得到中间黑色素系数图矩阵和中间红色素系数图矩阵,并将所述中间黑色素系数图矩阵与所述目标样本图像中各像素位置的像素向量相乘,得到所述黑色素颜色图像,以及,将所述中间红色素系数图矩阵与所述目标样本图像中各像素位置的像素向量相乘,得到所述红色素颜色图像。Perform color decoding on the encoded features by the second decoder to obtain an intermediate melanin coefficient map matrix and an intermediate red pigment coefficient map matrix, and compare the intermediate melanin coefficient map matrix with the position of each pixel in the target sample image Multiply the pixel vectors of the melanin color image to obtain the melanin color image, and multiply the intermediate red pigment coefficient map matrix with the pixel vectors of each pixel position in the target sample image to obtain the red pigment color image.
可选地,所述处理模块,还可以配置成用于:Optionally, the processing module may also be configured to:
由所述初始人脸色素检测模型对所述黑色素细节图像和所述黑色素颜色图像中相同位置相同通道的各像素值分别相加,得到所述实际黑色素高清细节图像,以及,对所述红色素细节图像和所述红色素颜色图像中相同位置相同通道的各像素值分别相加,得到所述实际红色素高清细节图像。Adding the pixel values of the same position and the same channel in the melanin detail image and the melanin color image respectively by the initial human face pigment detection model to obtain the actual melanin high-definition detail image, and for the red pigment The detail image and the pixel values of the same position and the same channel in the red pigment color image are respectively added to obtain the actual red pigment high-definition detail image.
可选地,所述增益处理可以包括如下至少一项:压缩处理、颜色格式转换处理、色素区域颜色调整处理。Optionally, the gain processing may include at least one of the following: compression processing, color format conversion processing, and pigment region color adjustment processing.
可选地,所述色素区域颜色调整处理可以包括:从所述原始样本图像中检测出黑色素区域和红色素区域,从所述原始样本图像中剔除所述黑色素区域和红色素区域,并将剔除所述黑色素区域和红色素区域后的图像与所述原始样本图像进行融合处理。Optionally, the color adjustment processing of the pigment area may include: detecting a melanin area and a red pigment area from the original sample image, removing the melanin area and red pigment area from the original sample image, and removing The image after the melanin area and the red area is fused with the original sample image.
本申请的再一些实施例还提供了一种人脸色素检测装置,所述装置可以包括:Further embodiments of the present application also provide a human face pigment detection device, which may include:
获取模块,可以配置成用于获取目标样本图像,所述目标样本图像是由低分率像素相机拍摄到的图像;The acquisition module can be configured to acquire a target sample image, the target sample image is an image captured by a low-resolution pixel camera;
处理模块,可以配置成用于将所述目标样本图像输入至目标人脸色素检测模型中,得到所述目标人脸色素检测模型输出的实际黑色素高清细节图像和实际红色素高清细节图像;The processing module can be configured to input the target sample image into the target human face pigment detection model to obtain the actual melanin high-definition detail image and the actual red pigment high-definition detail image output by the target human face pigment detection model;
确定模块,可以配置成用于根据实际黑色素高清细节图像和实际红色素高清细节图像,确定目标样本图像中黑色素分布信息和红色素分布信息。The determination module can be configured to determine the melanin distribution information and the red pigment distribution information in the target sample image according to the actual melanin high-definition detailed image and the actual red pigment high-definition detailed image.
本申请其他的实施例还提供了一种电子设备,该电子设备可以包括:处理器、存储介质和总线,所述存储介质存储有所述处理器可执行的机器可读指令,当电子设备运行时,所述处理器与所述存储介质之间通过总线通信,所述处理器执行所述机器可读指令,以执行如上述第一方面或第二方面提供的所述方法的步骤。Other embodiments of the present application also provide an electronic device. The electronic device may include: a processor, a storage medium, and a bus. The storage medium stores machine-readable instructions executable by the processor. When the electronic device runs When, the processor communicates with the storage medium through a bus, and the processor executes the machine-readable instructions to perform the steps of the method provided in the first aspect or the second aspect above.
本申请的另外实施例还提供了一种计算机存储介质,所述存储介质上存储有计算机程 序,所述计算机程序被处理器运行时执行如上述实施例提供的所述方法的步骤。Another embodiment of the present application also provides a computer storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the method provided in the above-mentioned embodiments are executed.
本申请的有益效果至少是:The beneficial effects of the application are at least:
本申请实施例提供一种人脸色素检测模型训练方法、装置、设备及存储介质,该方法可以包括:对原始样本图像进行增益处理,得到目标样本图像,原始样本图像的分辨率高于目标样本图像的分辨率;将目标样本图像输入初始人脸色素检测模型中,得到初始人脸色素检测模型输出的实际黑色素高清细节图像和实际红色素高清细节图像;对原始样本图像进行分解处理,得到监督黑色素高清细节图像和监督红色素高清细节图像;以监督黑色素高清细节图像和监督红色素高清细节图像作为监督参数,根据实际黑色素高清细节图像和实际红色素高清细节图像,对初始人脸色素检测模型进行迭代修正,得到目标人脸色素检测模型。在本方案中,主要是对由专业的数码相机或单反相机等所采集的原始样本图像进行增益处理,得到目标样本图像,以实现模拟手机摄像头拍摄的人脸图像的效果,然后,将目标样本图像输入至初始人脸色素检测模型中,得到HB图像和HR图像,并使用原始样本图像分解得到TB图像和TR图像对初始人脸色素检测模型进行迭代修正,以得到目标人脸色素检测模型,使得后续可以将由低成本相机(摄像头)拍摄到的目标样本图像输入至上述训练得到的目标人脸色素检测模型中,得到目标人脸色素检测模型输出的HB图像和HR图像,实现了对由低成本相机(摄像头)采集到的人脸图像中黑色素和红色素的准确检测,解决了低成本相机(摄像头)拍摄画质较差导致图像相邻像素的颜色趋于一致使人脸图像中不同色素的分解质量低下的问题,较好地还原了实际黑色素高清细节图像和实际红色素高清细节图像中的细节信息。The embodiment of the present application provides a human face pigment detection model training method, device, equipment and storage medium, the method may include: performing gain processing on the original sample image to obtain the target sample image, the resolution of the original sample image is higher than that of the target sample The resolution of the image; the target sample image is input into the initial face pigment detection model, and the actual melanin high-definition detail image and the actual red pigment high-definition detail image output by the initial face pigment detection model are obtained; the original sample image is decomposed and processed to obtain supervision Melanin high-definition detail images and supervised red pigment high-definition detail images; with supervised melanin high-definition detail images and supervised red pigment high-definition detail images as supervision parameters, according to the actual melanin high-definition detail images and actual red pigment high-definition detail images, the initial face pigment detection model Perform iterative correction to obtain the target face pigment detection model. In this scheme, the gain processing is mainly performed on the original sample image collected by a professional digital camera or SLR camera to obtain the target sample image, so as to realize the effect of simulating the face image captured by the camera of a mobile phone, and then, the target sample image Input the image into the initial face pigment detection model to obtain the HB image and HR image, and use the original sample image to decompose the TB image and TR image to iteratively correct the initial face pigment detection model to obtain the target face pigment detection model, It makes it possible to input the target sample image captured by the low-cost camera (camera) into the target face pigment detection model obtained from the above training, and obtain the HB image and HR image output by the target face pigment detection model. The accurate detection of melanin and red pigment in the face image collected by the low-cost camera (camera) solves the problem that the poor image quality of the low-cost camera (camera) causes the colors of adjacent pixels of the image to tend to be consistent, which makes different pigments in the face image The problem of low decomposition quality, better restore the detail information in the actual melanin high-definition detail image and the actual red pigment high-definition detail image.
附图说明Description of drawings
为了更清楚地说明本申请实施例的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,应当理解,以下附图仅示出了本申请的某些实施例,因此不应被看作是对范围的限定,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他相关的附图。In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the accompanying drawings used in the embodiments. It should be understood that the following drawings only show some embodiments of the present application, so It should be regarded as a limitation on the scope, and those skilled in the art can also obtain other related drawings based on these drawings without creative work.
图1为本申请实施例提供的一种电子设备的结构示意图;FIG. 1 is a schematic structural diagram of an electronic device provided in an embodiment of the present application;
图2为本申请实施例提供的一种人脸色素检测模型训练方法的流程示意图;Fig. 2 is a schematic flow chart of a human face pigment detection model training method provided by the embodiment of the present application;
图3为本申请实施例提供的一种人脸色素检测模型训练方法中初始人脸色素检测模型的框架图;Fig. 3 is the frame diagram of the initial human face pigment detection model in a kind of human face pigment detection model training method that the embodiment of the application provides;
图4为本申请实施例提供的又一种人脸色素检测模型训练方法的流程示意图;Fig. 4 is a schematic flow chart of another human face pigment detection model training method provided by the embodiment of the present application;
图5为本申请实施例提供的一种人脸色素检测模型训练装置的结构示意图。FIG. 5 is a schematic structural diagram of a human face pigment detection model training device provided in an embodiment of the present application.
具体实施方式Detailed ways
为使本申请实施例的目的、技术方案和优点更加清楚,下面将结合本申请实施例中的 附图,对本申请实施例中的技术方案进行清楚、完整地描述,应当理解,本申请中附图仅起到说明和描述的目的,并不用于限定本申请的保护范围。另外,应当理解,示意性的附图并未按实物比例绘制。本申请中使用的流程图示出了根据本申请的一些实施例实现的操作。应该理解,流程图的操作可以不按顺序实现,没有逻辑的上下文关系的步骤可以反转顺序或者同时实施。此外,本领域技术人员在本申请内容的指引下,可以向流程图添加一个或多个其他操作,也可以从流程图中移除一个或多个操作。In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It should be understood that the appended The figures are only for the purpose of illustration and description, and are not used to limit the protection scope of the present application. Additionally, it should be understood that the schematic drawings are not drawn to scale. The flowcharts used in this application illustrate operations implemented in accordance with some embodiments of the application. It should be understood that the operations of the flowcharts may be performed out of order, and steps that have no logical context may be performed in reverse order or concurrently. In addition, those skilled in the art may add one or more other operations to the flowchart or remove one or more operations from the flowchart under the guidance of the content of the present application.
另外,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。通常在此处附图中描述和示出的本申请实施例的组件可以以各种不同的配置来布置和设计。因此,以下对在附图中提供的本申请的实施例的详细描述并非旨在限制要求保护的本申请的范围,而是仅仅表示本申请的选定实施例。基于本申请的实施例,本领域技术人员在没有做出创造性劳动的前提下所获得的所有其他实施例,都属于本申请保护的范围。In addition, the described embodiments are only some of the embodiments of the application, not all of the embodiments. The components of the embodiments of the application generally described and illustrated in the figures herein may be arranged and designed in a variety of different configurations. Accordingly, the following detailed description of the embodiments of the application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely represents selected embodiments of the application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative efforts belong to the scope of protection of the present application.
需要说明的是,本申请实施例中将会用到术语“包括”,用于指出其后所声明的特征的存在,但并不排除增加其它的特征。It should be noted that the term "comprising" will be used in the embodiments of the present application to indicate the existence of the features stated later, but does not exclude the addition of other features.
图1为本申请实施例提供的一种电子设备的结构示意图;该电子设备如可以是计算机或者服务器等处理设备,以用于实现本申请提供的人脸色素检测模型训练方法。如图1所示,电子设备可以包括:处理器101、存储器102。FIG. 1 is a schematic structural diagram of an electronic device provided in an embodiment of the present application; the electronic device may be a processing device such as a computer or a server, and is used to implement the human face pigment detection model training method provided in the present application. As shown in FIG. 1 , an electronic device may include: a processor 101 and a memory 102 .
处理器101、存储器102之间可以直接或间接地电性连接,以实现数据的传输或交互。例如,可通过一条或多条通信总线或信号线实现电性连接。The processor 101 and the memory 102 may be directly or indirectly electrically connected to realize data transmission or interaction. For example, electrical connections may be made through one or more communication buses or signal lines.
其中,处理器101可以是一种集成电路芯片,具有信号的处理能力。上述的处理器101可以是通用处理器,包括中央处理器(Central Processing Unit,CPU)、网络处理器(Network Processor,NP)等。可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。Wherein, the processor 101 may be an integrated circuit chip, which has a signal processing capability. The above-mentioned processor 101 may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU), a network processor (Network Processor, NP) and the like. Various methods, steps, and logic block diagrams disclosed in the embodiments of the present application may be implemented or executed. A general-purpose processor may be a microprocessor, or the processor may be any conventional processor, or the like.
存储器102可以是,但不限于,随机存取存储器(Random Access Memory,RAM),只读存储器(Read Only Memory,ROM),可编程只读存储器(Programmable Read-Only Memory,PROM),可擦除只读存储器(Erasable Programmable Read-Only Memory,EPROM),电可擦除只读存储器(Electric Erasable Programmable Read-Only Memory,EEPROM)等。 Memory 102 can be, but not limited to, random access memory (Random Access Memory, RAM), read-only memory (Read Only Memory, ROM), programmable read-only memory (Programmable Read-Only Memory, PROM), erasable Read-only memory (Erasable Programmable Read-Only Memory, EPROM), Electric Erasable Programmable Read-Only Memory (EEPROM), etc.
可以理解,图1所述的结构仅为示意,电子设备100还可包括比图1中所示更多或者更少的组件,或者具有与图1所示不同的配置。图1中所示的各组件可以采用硬件、软件或其组合实现。It can be understood that the structure shown in FIG. 1 is only for illustration, and the electronic device 100 may also include more or less components than those shown in FIG. 1 , or have a configuration different from that shown in FIG. 1 . Each component shown in Fig. 1 may be implemented by hardware, software or a combination thereof.
存储器102用于存储程序,处理器101调用存储器102存储的程序,以执行下面实施例提供的人脸色素检测模型训练方法。The memory 102 is used to store programs, and the processor 101 invokes the programs stored in the memory 102 to execute the human face pigment detection model training method provided in the following embodiments.
如下将通过多个实施例对本申请实施例提供的一种人脸色素检测模型训练方法进行详 细介绍。A kind of face pigment detection model training method provided by the embodiment of the present application will be introduced in detail as follows through multiple embodiments.
图2为本申请实施例提供的一种人脸色素检测模型训练方法的流程示意图,可选地,该方法的执行主体可以是服务器、计算机等电子设备,具有数据处理功能。应当理解,在其它实施例中人脸色素检测模型训练方法其中部分步骤的顺序可以根据实际需要相互交换,或者其中的部分步骤也可以省略或删除。如图2所示,该方法可以包括:Fig. 2 is a schematic flow chart of a human face pigment detection model training method provided by the embodiment of the present application. Optionally, the execution subject of the method may be an electronic device such as a server or a computer, which has a data processing function. It should be understood that in other embodiments, the order of some steps in the face pigment detection model training method can be exchanged according to actual needs, or some steps can also be omitted or deleted. As shown in Figure 2, the method may include:
S201、对原始样本图像进行增益处理,得到目标样本图像,原始样本图像的分辨率可以高于目标样本图像的分辨率。S201. Perform gain processing on the original sample image to obtain a target sample image. The resolution of the original sample image may be higher than the resolution of the target sample image.
其中,原始样本图像是指由专业的数码相机或单反相机等所采集的人脸图像。例如,在合适的光源下(一般是交叉偏振光),利用单反相机拍摄足够多的原始人脸样本图像,单反相机拍摄的原始人脸样本图像的画质高清,可以从原始人脸样本图像中高度区分人脸的棕色区域(如色斑、毛孔)和红色区域(痘痘、敏感肌、眼皮红色血丝)等,区别于正常皮肤区域。其中,黑色素对应的区域最终呈现为棕色图(记为Brown图),血红素对应的区域呈现为红色图(记为Red图)。Wherein, the original sample image refers to a face image collected by a professional digital camera or a single-lens reflex camera or the like. For example, under a suitable light source (usually cross-polarized light), enough original face sample images are taken by a SLR camera. Highly distinguish brown areas (such as spots, pores) and red areas (acne, sensitive muscles, red bloodshot eyelids) of the face, which are different from normal skin areas. Among them, the area corresponding to melanin finally appears as a brown map (denoted as a Brown map), and the area corresponding to hemoglobin appears as a red map (denoted as a Red map).
由于专业的数码相机或单反相机等所采集的人脸图像属于高清图像,在本实施例中,为了使后续训练得到的“目标人脸色素检测模型”可以更好地适用于手机拍摄的低分辨率画质,维持每张人脸图像对应的棕色图和红色图不变。因此,本申请提出对原始样本图像进行增益处理,比如,可以利用jpg的压缩原理对原始样本图像进行质量随机的画质压缩,以降低原始样本图像的画质,进而达到模拟真实手机摄像头拍摄的3通道人脸彩色图像的效果。Since the face images collected by professional digital cameras or SLR cameras belong to high-definition images, in this embodiment, in order to make the "target face pigment detection model" obtained by subsequent training better applicable to low-resolution images taken by mobile phones Ratio image quality, maintaining the brown image and red image corresponding to each face image unchanged. Therefore, this application proposes to perform gain processing on the original sample image. For example, the compression principle of jpg can be used to compress the quality of the original sample image with random quality, so as to reduce the quality of the original sample image, and then achieve the effect of simulating the real mobile phone camera. 3-channel face color image effect.
S202、将目标样本图像输入初始人脸色素检测模型中,得到初始人脸色素检测模型输出的实际黑色素高清细节图像和实际红色素高清细节图像。S202. Input the target sample image into the initial face pigment detection model, and obtain the actual melanin high-definition detail image and the actual red pigment high-definition detail image output by the initial human face pigment detection model.
可选地,初始人脸色素检测模型可以选择编码-解码(Encoder-Decoder)网络模型、深度学习网络模型(Deep Neural Networks,简称DNN)、或者其他网络训练模型等,在此,对“初始人脸色素检测模型”不做具体限定。Optionally, the initial human face pigment detection model can be selected from an encoding-decoding (Encoder-Decoder) network model, a deep learning network model (Deep Neural Networks, DNN for short), or other network training models, etc. Here, the "initial human "Face Pigment Detection Model" is not specifically limited.
其中,“实际黑色素高清细节图像”是指含有高清细节的黑色素图像(记为HB图),“实际红色素高清细节图像”是指含有高清细节的红色素图像(记为HR图)。Among them, the "actual melanin high-definition detailed image" refers to the melanin image containing high-definition details (referred to as HB image), and the "actual red pigment high-definition detailed image" refers to the red pigment image containing high-definition details (referred to as HR image).
在本实施例中,以“初始人脸色素检测模型”是Encoder-Decoder网络模型为例,将步骤S202中得到的目标样本图像输入至初始人脸色素检测模型中,经过Encoder-Decoder网络模型处理,得到Encoder-Decoder网络模型输出的HB图像和HR图像。In this embodiment, taking the "initial human face pigment detection model" as an example of an Encoder-Decoder network model, the target sample image obtained in step S202 is input into the initial human face pigment detection model, and processed by the Encoder-Decoder network model , to get the HB image and HR image output by the Encoder-Decoder network model.
S203、对原始样本图像进行分解处理,得到监督黑色素高清细节图像和监督红色素高清细节图像。S203. Decompose the original sample image to obtain a supervised melanin high-definition detail image and a supervised red pigment high-definition detail image.
在本实施例中,为了使初始人脸色素检测模型输出的HB图和HR图的细节更清晰,提 出可以使用监督黑色素高清细节图像和监督红色素高清细节图像,对上述“初始人脸色素检测模型”进行监督训练学习。In this embodiment, in order to make the details of the HB map and HR map output by the initial human face pigment detection model clearer, it is proposed that the supervised melanin high-definition detail image and the supervised red pigment high-definition detail image can be used for the above-mentioned "initial face pigment detection model” for supervised training and learning.
其中,监督黑色素高清细节图像是使用传统分解算法对原始样本图像进行分解后得到,并将“监督黑色素高清细节图像”作为初始人脸色素检测模型训练学习时监督的真实目标图,记为TB图像(Brown图)。Among them, the supervised melanin high-definition detail image is obtained by decomposing the original sample image using a traditional decomposition algorithm, and the "supervised melanin high-definition detail image" is used as the real target image supervised during the initial face pigment detection model training and learning, which is recorded as a TB image (Brown diagram).
同样,监督红色素高清细节图像也是使用传统分解算法对原始样本图像进行分解后得到的,并将“监督红色素高清细节图像”作为初始人脸色素检测模型训练学习时监督的真实目标图,记为TR图像(Red图)。Similarly, the supervised red pigment high-definition detail image is also obtained by decomposing the original sample image using the traditional decomposition algorithm, and the "supervised red pigment high-definition detail image" is used as the real target image supervised during the initial face pigment detection model training and learning. is a TR image (Red image).
在本实施例中,可以采用如下分解方法,对原始样本图像进行分解处理,以得到TB图像和TR图像。In this embodiment, the following decomposition method may be used to decompose the original sample image to obtain a TB image and a TR image.
通过人工筛选方法,从原始样本图像中筛选得到Brown和Red通道分解向量,各标记为σ B=[σ B1,σ B2,σ B3] t(Brown分解向量)和σ R=[σ R1,σ R2,σ R3] t(Red分解向量),从而通过从原始样本图像中提取黑色素-棕色图、红色素-红色图。 By manual screening method, Brown and Red channel decomposition vectors are screened from the original sample image, each marked as σ B =[σ B1 , σ B2 , σ B3 ] t (Brown decomposition vector) and σ R =[σ R1 , σ R2 , σ R3 ] t (Red decomposition vector), so as to extract the melanin-brown map and red pigment-red map from the original sample image.
对于RGB格式表示的图像C,位置i的像素值C i=[R i,G i,B i] t,表示3×1的列向量,定义向量: For an image C expressed in RGB format, the pixel value C i at position i = [R i , G i , B i ] t , representing a 3×1 column vector, defining the vector:
LC i=-log(C i)=-[log(R i),log(G i),log(B i)] tLC i =-log(C i )=-[log(R i ), log(G i ), log(B i )] t .
其中,t表示转置,log(·)表示取自然对数。Among them, t means transpose, and log(·) means taking natural logarithm.
构造2个分解向量,构造如下矩阵:Construct 2 decomposition vectors and construct the following matrix:
Figure PCTCN2021132558-appb-000001
Figure PCTCN2021132558-appb-000001
计算2个分解图如下:Calculate the 2 exploded diagrams as follows:
(1)确定大小为3×1的固定常数偏移向量E0,一般取E0=[0,0,0] t(1) Determine the fixed constant offset vector E0 whose size is 3×1, generally get E0=[0,0,0] t ;
(2)计算新的3通道图E,E i=D -1×[LC i-E0]; (2) Calculate a new 3-channel map E, E i =D -1 ×[LC i -E0];
(3)计算E对2分解向量的投影得到棕色图和红色图,即:(3) Calculate the projection of E to the 2-decomposition vector to obtain the brown map and the red map, namely:
棕色图Brown:
Figure PCTCN2021132558-appb-000002
Brown map Brown:
Figure PCTCN2021132558-appb-000002
红色图Red:
Figure PCTCN2021132558-appb-000003
Red map Red:
Figure PCTCN2021132558-appb-000003
其中,D -1表示D的逆矩阵,E i·σ B和E i·σ R都表示两个3×1的列向量的点积,仍然得到3×1的列向量,指数运算的含义为
Figure PCTCN2021132558-appb-000004
(x1,x2,x3) t表示一个3×1的列向量。
Among them, D -1 represents the inverse matrix of D, E i ·σ B and E i ·σ R both represent the dot product of two 3×1 column vectors, and still get a 3×1 column vector, the meaning of the exponential operation is
Figure PCTCN2021132558-appb-000004
(x1, x2, x3) t represents a 3×1 column vector.
其中,棕色图Brown:
Figure PCTCN2021132558-appb-000005
是本申请中的TB图像;红色图Red:
Figure PCTCN2021132558-appb-000006
是本申请中的TR图像。
Among them, the brown map Brown:
Figure PCTCN2021132558-appb-000005
is the TB image in this application; the red image Red:
Figure PCTCN2021132558-appb-000006
is the TR image in this application.
值得说明的是,在本申请中,上述分解方法主要用于得到深度学习训练的监督黑色素 高清细节图像和监督红色素高清细节图像,在网络模型训练过程或者网络训练完成后,不会再使用上述分解方法。It is worth noting that in this application, the above-mentioned decomposition method is mainly used to obtain the supervised melanin high-definition detail image and the supervised red pigment high-definition detail image for deep learning training, and the above-mentioned method will not be used again after the network model training process or network training is completed. decomposition method.
S204、以监督黑色素高清细节图像和监督红色素高清细节图像作为监督参数,根据实际黑色素高清细节图像和实际红色素高清细节图像,对初始人脸色素检测模型进行迭代修正,得到目标人脸色素检测模型。S204. Using the supervised melanin high-definition detail image and the supervised red pigment high-definition detail image as supervision parameters, according to the actual melanin high-definition detail image and the actual red pigment high-definition detail image, iteratively correct the initial human face pigment detection model to obtain the target human face pigment detection Model.
例如,使用上述TB图像对初始人脸色素检测模型输出的HB图像进行监督,以及,使用上述TR图像对初始人脸色素检测模型输出的HR图像进行监督,对初始人脸色素检测模型进行多次迭代训练学习,直至训练得到的人脸色素检测模型输出的HB图像与TB图像的差值、以及HR图像与TR图像的差值降低到预设值以下,即可认为网络训练完成,训练完成后得到目标人脸色素检测模型,此时,该目标人脸色素检测模型可以用于检测低成本相机(摄像头)拍摄到的人脸图像中不同色素的分布情况。For example, use the above-mentioned TB image to supervise the HB image output by the initial human face pigment detection model, and use the above-mentioned TR image to supervise the HR image output by the initial human face pigment detection model, and perform multiple times on the initial human face pigment detection model. Iterative training and learning until the difference between the HB image and the TB image output by the trained face pigment detection model, and the difference between the HR image and the TR image is reduced to below the preset value, it can be considered that the network training is completed, after the training is completed A target human face pigment detection model is obtained. At this time, the target human face pigment detection model can be used to detect the distribution of different pigments in the human face image captured by a low-cost camera (camera).
如下对训练得到的目标人脸色素检测模型的应用进行简单说明。The following is a brief description of the application of the trained target face pigment detection model.
在本实施例中,获取由低成本相机(摄像头)拍摄到的目标样本图像,并将目标样本图像输入至上述训练得到的目标人脸色素检测模型中,得到目标人脸色素检测模型输出的实际黑色素高清细节图像和实际红色素高清细节图像,实现了对由低成本相机(摄像头)采集到的人脸图像中黑色素和红色素的准确检测,解决了低成本相机(摄像头)拍摄画质较差导致图像相邻像素的颜色趋于一致使人脸图像中不同色素分解质量低下的问题,较好地还原了实际黑色素高清细节图像和实际红色素高清细节图像中的细节信息。In this embodiment, the target sample image captured by a low-cost camera (camera) is obtained, and the target sample image is input into the target human face pigment detection model obtained through the above training, and the actual output of the target human facial pigment detection model is obtained. The high-definition detailed images of melanin and the high-definition detailed images of actual red pigments realize the accurate detection of melanin and red pigments in face images collected by low-cost cameras (cameras), and solve the problem of poor image quality of low-cost cameras (cameras) The color of adjacent pixels in the image tends to be consistent, which makes the decomposition quality of different pigments in the face image low, and the detailed information in the actual melanin high-definition detail image and the actual red pigment high-definition detail image is better restored.
综上所述,本申请实施例提供一种人脸色素检测模型训练方法,可以包括:对原始样本图像进行增益处理,得到目标样本图像,原始样本图像的分辨率可以高于目标样本图像的分辨率;将目标样本图像输入初始人脸色素检测模型中,得到初始人脸色素检测模型输出的实际黑色素高清细节图像和实际红色素高清细节图像;对原始样本图像进行分解处理,得到监督黑色素高清细节图像和监督红色素高清细节图像;以监督黑色素高清细节图像和监督红色素高清细节图像作为监督参数,根据实际黑色素高清细节图像和实际红色素高清细节图像,对初始人脸色素检测模型进行迭代修正,得到目标人脸色素检测模型。在本方案中,主要是对由专业的数码相机或单反相机等所采集的原始样本图像进行增益处理,得到目标样本图像,以实现模拟手机摄像头拍摄的人脸图像的效果,然后,将目标样本图像输入至初始人脸色素检测模型中,得到HB图像和HR图像,并使用原始样本图像分解得到TB图像和TR图像对初始人脸色素检测模型进行迭代修正,以得到目标人脸色素检测模型,使得后续可以将由低成本相机(摄像头)拍摄到的目标样本图像输入至上述训练得到的目标人脸色素检测模型中,得到目标人脸色素检测模型输出的HB图像和HR图像,实现了对由低成本相机(摄像头)采集到的人脸图像中黑色素和红色素的准确检测,解决了 低成本相机(摄像头)拍摄画质较差导致图像相邻像素的颜色趋于一致使人脸图像中不同色素分解质量低下的问题,较好地还原了实际黑色素高清细节图像和实际红色素高清细节图像中的细节信息。To sum up, the embodiment of the present application provides a human face pigment detection model training method, which may include: performing gain processing on the original sample image to obtain the target sample image, and the resolution of the original sample image may be higher than that of the target sample image Input the target sample image into the initial face pigment detection model to obtain the actual melanin high-definition detail image and the actual red pigment high-definition detail image output by the initial face pigment detection model; decompose the original sample image to obtain the supervised melanin high-definition detail Image and supervised red pigment high-definition detail image; with supervised melanin high-definition detail image and supervised red pigment high-definition detail image as supervisory parameters, the initial face pigment detection model is iteratively corrected according to the actual melanin high-definition detail image and actual red pigment high-definition detail image , to get the target face pigment detection model. In this scheme, the gain processing is mainly performed on the original sample image collected by a professional digital camera or SLR camera to obtain the target sample image, so as to realize the effect of simulating the face image captured by the camera of a mobile phone, and then, the target sample image Input the image into the initial face pigment detection model to obtain the HB image and HR image, and use the original sample image to decompose the TB image and TR image to iteratively correct the initial face pigment detection model to obtain the target face pigment detection model, It makes it possible to input the target sample image captured by the low-cost camera (camera) into the target face pigment detection model obtained from the above training, and obtain the HB image and HR image output by the target face pigment detection model. The accurate detection of melanin and red pigment in the face image collected by the low-cost camera (camera) solves the problem that the poor image quality of the low-cost camera (camera) causes the colors of adjacent pixels of the image to tend to be consistent, which makes different pigments in the face image Decompose the problem of low quality, and better restore the detail information in the actual melanin high-definition detail image and the actual red pigment high-definition detail image.
将通过如下实施例,具体讲解上述S204:如何以监督黑色素高清细节图像和监督红色素高清细节图像作为监督参数,根据实际黑色素高清细节图像的亮度信息和实际红色素高清细节图像的亮度信息,对初始人脸色素检测模型进行迭代修正,得到目标人脸色素检测模型。The above S204 will be specifically explained through the following embodiment: how to use the supervised melanin high-definition detail image and the supervised red pigment high-definition detail image as supervisory parameters, according to the brightness information of the actual melanin high-definition detail image and the brightness information of the actual red pigment high-definition detail image, for The initial face pigment detection model is iteratively corrected to obtain the target face pigment detection model.
可选地,监督黑色素高清细节图像的亮度信息和监督红色素高清细节图像的亮度信息作为监督参数,根据实际黑色素高清细节图像的亮度信息和实际红色素高清细节图像的亮度信息,对初始人脸色素检测模型进行迭代修正,得到目标人脸色素检测模型。Optionally, the brightness information of the supervised melanin high-definition detail image and the brightness information of the supervised red pigment high-definition detail image are used as supervision parameters, and the initial human face color is calculated according to the brightness information of the actual melanin high-definition detail image and the actual red pigment high-definition detail image. The pixel detection model is iteratively corrected to obtain the target face pigment detection model.
在本实施例中,为了使“初始人脸色素检测模型”输出的HB图像和HR图像中的细节信息更清晰,除了采用常规的损失函数监督,如L1等。本申请还提出额外使用TB图像和TR图像中的“对齐亮度细节信息”作为监督参数,对初始人脸色素检测模型进行监督训练学习,并不断循环更新临时人脸色素检测模型,直至某次循环得到的临时人脸色素检测模型输出的HB图像与TB图像的误差、以及HR图像与TR图像的误差均满足预设条件后,结束迭代循环过程,并将此时得到的临时人脸色素检测模型作为目标人脸色素检测模型。In this embodiment, in order to make the detailed information in the HB image and HR image output by the "initial face pigment detection model" clearer, in addition to using conventional loss function supervision, such as L1, etc. This application also proposes to additionally use the "aligned brightness details" in the TB image and the TR image as a supervisory parameter to conduct supervised training and learning on the initial face pigment detection model, and continuously update the temporary face pigment detection model until a certain cycle After the error between the HB image and the TB image output by the obtained temporary face pigment detection model, and the error between the HR image and the TR image all meet the preset conditions, the iterative cycle process is ended, and the temporary face pigment detection model obtained at this time is As a target face pigment detection model.
以HB图像和TB图像为例,对于3通道的HB图像和TB图像,可以取其3通道的最大值(用max表示)和最小值(用min表示),通过c调节max的比例,以提取亮度细节信息,如下:Taking the HB image and TB image as an example, for the 3-channel HB image and TB image, you can take the maximum value (expressed by max) and minimum value (expressed by min) of the 3 channels, and adjust the ratio of max by c to extract Brightness details information, as follows:
HB L=[c×max(HB)+min(HB))]/(1+c) HB L =[c×max(HB)+min(HB))]/(1+c)
TB L=[c×max(TB)+min(TB)]/(1+c) TB L =[c×max(TB)+min(TB)]/(1+c)
用TB L来监督HB L,训练学习时更好地还原HB图像的细节信息,同理,对HR和TR进行同样的监督。经实验在训练学习对比时,c取1.5-2.0的范围内时的训练结果相对较好。 Use TBL to supervise HBL to better restore the detailed information of HB images during training and learning. Similarly, HR and TR are supervised the same way. According to the experiment, in the training and learning comparison, the training result is relatively good when c is in the range of 1.5-2.0.
将通过如下实施例,具体讲解S202:如何将目标样本图像输入初始人脸色素检测模型中,得到初始人脸色素检测模型输出的实际黑色素高清细节图像和实际红色素高清细节图像本申请所使用的初始人脸色素检测模型。The following example will be used to explain S202 in detail: how to input the target sample image into the initial face pigment detection model to obtain the actual melanin high-definition detailed image and the actual red pigment high-definition detailed image output by the initial human face pigment detection model used in this application Initial face pigment detection model.
其中,图3为本申请实施例提供的一种初始人脸色素检测模型的框架图,如图3所示,初始人脸色素检测模型可以包括:编码器(Encoder)、第一解码器(Decoder1)以及第二解码器(Decoder2)。Wherein, Fig. 3 is a frame diagram of an initial human face pigment detection model provided by the embodiment of the present application, as shown in Fig. 3 , the initial human face pigment detection model may include: an encoder (Encoder), a first decoder (Decoder1 ) and the second decoder (Decoder2).
其中,初始人脸色素检测模型选取的是Encoder-Decoder的网络模型,在本实施例中不 考虑Encoder-Decoder的网络模型中具体的网络层构成,编码器用于对输入至初始人脸色素检测模型中的目标样本图像进行编码,得到编码后特征;解码有2个分支Decoder1和Decoder2,其中,Decoder1用来生成图像的细节信息,Decoder2用来生成图像的颜色信息,将细节信息和颜色信息相加得到最终的含高清细节信息的HB图像(棕色图)和HR图像(Red图)。Wherein, the network model of Encoder-Decoder was selected as the initial human face pigment detection model, in this embodiment, the specific network layer composition in the network model of Encoder-Decoder is not considered, and the encoder is used to input to the initial human face pigment detection model The target sample image in is encoded to obtain the encoded features; decoding has two branches, Decoder1 and Decoder2, where Decoder1 is used to generate image detail information, and Decoder2 is used to generate image color information, adding detail information and color information The final HB image (brown image) and HR image (red image) with high-definition detail information are obtained.
如下将结合图3-图4对如何得到初始人脸色素检测模型输出的实际黑色素高清细节图像HB和实际红色素高清细节图像HR进行具体介绍。How to obtain the actual melanin high-definition detailed image HB and the actual red pigment high-definition detailed image HR output by the initial face pigment detection model will be described in detail below in conjunction with Figures 3-4.
图4为本申请实施例提供的又一种人脸色素检测模型训练方法的流程示意图,如图4所示,上述步骤S202:将目标样本图像输入初始人脸色素检测模型中,得到初始人脸色素检测模型输出的实际黑色素高清细节图像和实际红色素高清细节图像,可以包括:Fig. 4 is a schematic flow chart of another human face pigment detection model training method provided by the embodiment of the present application. As shown in Fig. 4, the above step S202: input the target sample image into the initial human face pigment detection model to obtain the initial human face color The actual melanin high-definition detail image and the actual red pigment high-definition detail image output by the pigment detection model can include:
S401、由编码器对目标样本图像进行编码,得到编码后特征。S401. The encoder encodes the target sample image to obtain encoded features.
其中,目标样本图像可以是模拟真实手机拍摄到的3通道彩色图LI,LI的大小为3xHxW,其中,H是指图像的高度信息,W是指图像的宽度信息。Wherein, the target sample image can be a 3-channel color image LI captured by a simulated real mobile phone, and the size of LI is 3xHxW, where H refers to the height information of the image, and W refers to the width information of the image.
可选地,编码器可以对目标样本图像进行编码,以将目标样本图像转化成一个固定长度的向量,并得到编码后特征。Optionally, the encoder may encode the target sample image to convert the target sample image into a fixed-length vector and obtain encoded features.
S402、由第一解码器对编码后特征进行细节解码,得到黑色素细节图像和红色素细节图像。S402. The first decoder performs detail decoding on the encoded features to obtain a melanin detail image and a red pigment detail image.
可选地,通过第一解码器Decoder1对编码后特征进行细节解码,逐渐恢复目标样本图像的空间细节信息,并得到DB图像和DB图像。Optionally, the first decoder Decoder1 performs detailed decoding on the encoded features, gradually restores the spatial detail information of the target sample image, and obtains the DB image and the DB image.
值得注意的是,DB图像和DB图像的大小可以均与目标样本图像相同,都是3通道,大小为HxW。It is worth noting that the size of the DB image and the DB image can both be the same as the target sample image, both are 3 channels, and the size is HxW.
S403、由第二解码器对编码后特征进行颜色解码,得到黑色素颜色图像和红色素颜色图像。S403. The second decoder performs color decoding on the encoded features to obtain a melanin color image and a red pigment color image.
可选地,由第二解码器对编码后特征进行颜色解码,得到黑色素颜色图像和红色素颜色图像,包括:Optionally, the encoded features are color-decoded by the second decoder to obtain a melanin color image and a red pigment color image, including:
由第二解码器对编码后特征进行颜色解码,得到中间黑色素系数图矩阵和中间红色素系数图矩阵,并将中间黑色素系数图矩阵与目标样本图像中各像素位置的像素向量相乘,得到黑色素颜色图像,以及,将中间红色素系数图矩阵与目标样本图像中各像素位置的像素向量相乘,得到红色素颜色图像。The encoded features are color-decoded by the second decoder to obtain the intermediate melanin coefficient map matrix and the intermediate red pigment coefficient map matrix, and the intermediate melanin coefficient map matrix is multiplied by the pixel vector of each pixel position in the target sample image to obtain the melanin A color image, and multiplying the intermediate red pigment coefficient map matrix by the pixel vector of each pixel position in the target sample image to obtain a red pigment color image.
其中,中间黑色素系数图矩阵和中间红色素系数图矩阵是指由第二解码器Decoder2对编码后特征进行颜色解码,得到的与目标样本图像大小一致的12通道Brown系数图KB矩阵和Red系数图KR矩阵。Among them, the middle melanin coefficient map matrix and the middle red pixel coefficient map matrix refer to the 12-channel Brown coefficient map KB matrix and Red coefficient map obtained by color decoding the encoded features by the second decoder Decoder2, which are consistent with the size of the target sample image KR matrix.
其中,Brown系数图KB矩阵和Red系数图KR矩阵的大小均为12xHxW,12实际上代表每个像素位置i有12个系数,为了后续构建每个位置i的系数矩阵3x4,矩阵包含12个系数。Among them, the size of the Brown coefficient map KB matrix and the Red coefficient map KR matrix are both 12xHxW, 12 actually means that each pixel position i has 12 coefficients, in order to construct a coefficient matrix 3x4 for each position i, the matrix contains 12 coefficients .
在本实施例中,对于大小为12xHxW的系数图矩阵以及大小为3xHxW的目标样本图像LI,对于LI的每个像素位置i,对应的像素值记为I i(IP i1,IP i2,IP i3),对应于系数图位置i上的12个系数,可以转换成大小为3x4的矩阵K i34,对于位置i的像素值I i(IP i1,IP i2,IP i3),加上1,组成齐次像素值I i(IP i1,IP i2,IP i3,1),并对齐次像素值I i(IP i1,IP i2,IP i3,1)转置,将齐次像素值I i(IP i1,IP i2,IP i3,1)变为4x1的齐次向量,从而转为矩阵和向量相乘的方式,得到对应位置i的颜色结果O i(OP i1,OP i2OP i3),即: In this embodiment, for a coefficient map matrix with a size of 12xHxW and a target sample image LI with a size of 3xHxW, for each pixel position i of LI, the corresponding pixel value is recorded as I i (IP i1 , IP i2 , IP i3 ), corresponding to the 12 coefficients at position i of the coefficient map, which can be converted into a matrix K i34 of size 3x4, for the pixel value I i (IP i1 , IP i2 , IP i3 ) at position i, add 1 to form a uniform Sub-pixel value I i (IP i1 , IP i2 , IP i3 , 1), and align sub-pixel value I i (IP i1 , IP i2 , IP i3 , 1) to transpose, and homogeneous pixel value I i (IP i1 , IP i2 , IP i3 , 1) becomes a 4x1 homogeneous vector, and thus turns into a matrix-vector multiplication method to obtain the color result O i (OP i1 , OP i2 OP i3 ) corresponding to position i, namely:
O i=K i34×I i(IP i1,IP i2,IP i3) O i =K i34 ×I i (IP i1 , IP i2 , IP i3 )
通过上式计算方法,均可以计算得到黑色素颜色图像OB和红色素颜色图像OR。Through the calculation method of the above formula, both the melanin color image OB and the red pigment color image OR can be calculated.
在本实施例中,针对不同类型摄像头拍摄到的图像画质,需要不断重复分析筛选,同时分解结果容易导致色块等过渡不均匀的问题,本申请提出黑色素系数图矩阵和红色素系数图矩阵方式来避免过渡不均匀的问题,并且通过细节学习的过程来还原分解图的细节信息,使人脸色素检测结果的结果突出皮肤特殊区域,如色斑、痘痘、毛孔等。In this embodiment, in view of the quality of images captured by different types of cameras, repeated analysis and screening are required, and at the same time, the decomposition results are likely to cause uneven transitions such as color blocks. This application proposes a black pigment coefficient map matrix and a red pigment coefficient map matrix. The method avoids the problem of uneven transition, and restores the detailed information of the decomposition map through the process of detail learning, so that the results of the human face pigment detection results highlight the special areas of the skin, such as spots, acne, pores, etc.
S404、由初始人脸色素检测模型对黑色素细节图像和黑色素颜色图像进行叠加处理,得到实际黑色素高清细节图像,以及,对红色素细节图像和红色素颜色图像进行叠加处理,得到实际红色素高清细节图像。S404. Perform superposition processing on the melanin detail image and the melanin color image by the initial face pigment detection model to obtain an actual melanin high-definition detail image, and perform superposition processing on the red pigment detail image and the red pigment color image to obtain the actual red pigment high-definition detail image image.
在本实施例中,将上述得到最终的含有高清细节的DB图像与含有黑色素颜色的OB图像进行叠加,得到HB图像。也即,HB=OB+DB。In this embodiment, the above obtained final DB image containing high-definition details and the OB image containing melanin color are superimposed to obtain an HB image. That is, HB=OB+DB.
同理,将上述得到最终的含有高清细节的DR图像与含有红色素颜色的OR图像进行叠加,得到HR图像。也即,HR=OR+DR。Similarly, the final DR image containing high-definition details obtained above is superimposed with the OR image containing red pigment color to obtain an HR image. That is, HR=OR+DR.
可选地,由初始人脸色素检测模型对黑色素细节图像和黑色素颜色图像进行叠加处理,得到实际黑色素高清细节图像,以及,对红色素细节图像和红色素颜色图像进行叠加处理,得到实际红色素高清细节图像,可以包括:Optionally, the melanin detail image and the melanin color image are superimposed by the initial human face pigment detection model to obtain the actual melanin high-definition detail image, and the red pigment detail image and the red pigment color image are superimposed to obtain the actual red pigment High-resolution detailed images, which can include:
由初始人脸色素检测模型对黑色素细节图像和黑色素颜色图像中相同位置相同通道的各像素值分别相加,得到实际黑色素高清细节图像,以及,对红色素细节图像和红色素颜色图像中相同位置相同通道的各像素值分别相加,得到实际红色素高清细节图像。Add the pixel values of the same channel in the same position in the melanin detail image and the melanin color image by the initial face pigment detection model to obtain the actual melanin high-definition detail image, and, for the same position in the red pigment detail image and the red pigment color image The pixel values of the same channel are added separately to obtain the actual red pigment high-definition detail image.
在本实施例中,由于细节图像和颜色图像的大小一模一样,且都是3通道,故代表逐像素相加,以对黑色素细节图像和黑色素颜色图像进行叠加处理,得到实际黑色素高清细节图像,以及,对红色素细节图像和红色素颜色图像进行叠加处理。In this embodiment, since the size of the detail image and the color image are exactly the same, and both are 3 channels, it means adding pixel by pixel to superimpose the melanin detail image and the melanin color image to obtain the actual melanin high-definition detail image, and , superimpose the red pigment detail image and the red pigment color image.
例如,以HR图像为例,每个像素位置i,HR对应的像素值记为HR i(HR i1,HR i2,HR i3), OR对应的像素值记为OR i(OR i1,OR i2,OR i3),DR对应的像素值记为DR i(DR i1,DR i2,DR i3)则有: For example, taking the HR image as an example, for each pixel position i, the pixel value corresponding to HR is recorded as HR i (HR i1 , HR i2 , HR i3 ), and the pixel value corresponding to OR is recorded as OR i (OR i1 , OR i2 , OR i3 ), the pixel value corresponding to DR is recorded as DR i (DR i1 , DR i2 , DR i3 ), then:
HR i=OR i+DR i=(OR i1+DR i1,OR i2+DR i2,OR i3+DR i3) HR i =OR i +DR i =(OR i1 +DR i1 , OR i2 +DR i2 , OR i3 +DR i3 )
同理,采用上述叠加方式可以得到HB图像。Similarly, the HB image can be obtained by using the above superposition method.
将通过如下实施例,具体讲解上述S202中提到的增益处理包括哪些处理。What processing is included in the gain processing mentioned in the above S202 will be specifically explained through the following embodiments.
可选地,增益处理包括如下至少一项:压缩处理、颜色格式转换处理、色素区域颜色调整处理。Optionally, the gain processing includes at least one of the following: compression processing, color format conversion processing, and pigment region color adjustment processing.
由于单反相机拍摄得到的数据属于高清图像,在本实施例中,为了使目标人脸色素检测模型能够更好地适用于手机拍摄的画质,维持每张图对应的Brown图和Red图不变,需要降低单反相机拍摄到的原始样本图像的画质。因此,本申请提出对单反相机拍摄得到的原始样本图像还需要额外进行增益处理,增益处理可以包括至少一项:压缩处理、颜色格式转换处理、色素区域颜色调整处理,以为解决实际应用过程中使用手机摄像头或其他设备拍摄的相对低画质的图像进行人脸色素检测的问题。Since the data captured by the SLR camera is a high-definition image, in this embodiment, in order to make the target face pigment detection model more suitable for the quality of the mobile phone, the Brown and Red images corresponding to each image are kept unchanged. , it is necessary to reduce the quality of the original sample image captured by the SLR camera. Therefore, this application proposes that additional gain processing is required for the original sample image captured by the SLR camera, and the gain processing may include at least one item: compression processing, color format conversion processing, and pigment area color adjustment processing, in order to solve the problems used in the actual application process. Face pigment detection for relatively low-quality images captured by mobile phone cameras or other devices.
可选地,色素区域颜色调整处理可以包括:从原始样本图像中检测出黑色素区域和红色素区域,从原始样本图像中剔除黑色素区域和红色素区域,并将剔除黑色素区域和红色素区域后的图像与原始样本图像进行融合处理。Optionally, the color adjustment processing of the pigmented area may include: detecting a melanin area and a red pigmented area from the original sample image, removing the melanin area and the red pigmented area from the original sample image, and removing the melanin area and the red pigmented area The image is fused with the original sample image.
(1)压缩处理,对于每张输入的原始样本图像利用jpg的压缩原理对其进行质量随机的画质压缩,训练时设定为80-99的随机画质压缩,让卷积神经网络(Convolutional Neural Network,简称CNN)在学习的过程中消除不同压缩画质的影响。(1) Compression processing. For each input original sample image, use the compression principle of jpg to compress the image quality with random quality. During training, it is set to 80-99 random image quality compression, so that the convolutional neural network (Convolutional Neural Network) Neural Network (CNN for short) eliminates the influence of different compression quality during the learning process.
(2)颜色格式转换处理,主要是利用饱和度的算法降低原始样本图像的饱和度,削弱棕色区域(如色斑、毛孔)、红色区域(痘痘、敏感肌、红色血丝)和其他正常区域的色差,手机拍摄的图像的色差会弱于单反拍摄的色差。(2) Color format conversion processing, mainly using the saturation algorithm to reduce the saturation of the original sample image, weakening brown areas (such as spots, pores), red areas (acne, sensitive skin, red bloodshot) and other normal areas The chromatic aberration of the image taken by the mobile phone will be weaker than the chromatic aberration of the image taken by the SLR.
其中,降饱和度的方法,一般统一将原始样本图像统一转换为HSL格式,其中H代表色相,S代表饱和度,L代表亮度,通过调整S通道,以降低原始样本图像的饱和度。在训练中为适应分解通道的任务,采用新的降低饱和度的方式。Among them, the desaturation method generally uniformly converts the original sample image into the HSL format, where H represents hue, S represents saturation, and L represents brightness. By adjusting the S channel, the saturation of the original sample image is reduced. In order to adapt to the task of decomposing channels during training, a new desaturation method is adopted.
一般计算S通道的计算流程可以为:将任意3通道的彩色图像转换为RGB表示的彩色图,并将数值转化为0.0-1.0;The general calculation process for calculating the S channel can be: convert any 3-channel color image into a color image represented by RGB, and convert the value to 0.0-1.0;
计算RGB的最大值smax=max(R,G,B)和最小值smin=min(R,G,B);计算亮度通道为L=(smax+smin)/2,两者之差为Diff=(smax-smin),则饱和度的计算公式为:Calculate the maximum value smax=max(R, G, B) and minimum value smin=min(R, G, B) of RGB; calculate the brightness channel as L=(smax+smin)/2, and the difference between the two is Diff= (smax-smin), the calculation formula of saturation is:
Figure PCTCN2021132558-appb-000007
Figure PCTCN2021132558-appb-000007
根据上述饱和度的计算流程,提出降低饱和度S的具体方式,保持L大小不变,减小最大值smax,增大最小值smin,即可降低饱和度,饱和度降低程度的系数为cs(0.0≤cs≤1.0),其降低的方式计算得到新的smax1和smin1为:According to the calculation process of the above saturation, a specific way to reduce the saturation S is proposed. Keeping the size of L unchanged, reducing the maximum value smax and increasing the minimum value smin, the saturation can be reduced. The coefficient of the degree of saturation reduction is cs( 0.0≤cs≤1.0), the new smax1 and smin1 are calculated in a reduced way as:
smax1=(1.0f-0.5×cs×Diff 2)×smax smax1=(1.0f-0.5×cs×Diff 2 )×smax
smin1=min(2×L-smax1,smax1)smin1=min(2×L-smax1, smax1)
其中,max(·)表示取最大值,min(·)表示取最小值。Among them, max(·) means to take the maximum value, and min(·) means to take the minimum value.
新的差值Diff1为Diff1=smax1-smin1,替换饱和度的计算公式,得到新的饱和度S,即:The new difference Diff1 is Diff1=smax1-smin1, replace the calculation formula of saturation to obtain a new saturation S, namely:
Figure PCTCN2021132558-appb-000008
Figure PCTCN2021132558-appb-000008
一般,红色痘痘、色斑等属于饱和度较高的区域,对应的Diff值也较大,上述公式也满足把Diff值较大的区域的饱和度给降下来,较小的区域尽量维持饱和度不变,从而削弱痘痘、色斑和正常皮肤区域的色差。Generally, red pimples and stains belong to areas with high saturation, and the corresponding Diff value is also large. The above formula is also sufficient to reduce the saturation of the area with large Diff value, and keep the saturation of the smaller area as much as possible. The intensity remains the same, thereby reducing the color difference of acne breakouts, pigmentation spots and normal skin areas.
(3)色素区域颜色调整处理,对于手机拍摄的图像画质,人脸上比较浅的棕色/红色区域相比于其他皮肤区域无法凸出显示,为了使原始样本图像更好地模拟手机拍摄的图像画质,使Brown图更好地突出棕色斑、毛孔等,Red图更好地突出红色痘痘、红色血丝、红色敏感区域,因此,在本实施例中,提出利用检测算法识别原始样本图像Origin中的这些Brown区域、Red区域,并使用inpainting算法对这些Brown区域、Red区域予以祛除,得到一张干净的结果图,记为Clean图,然后,再用alpha融合的方式进行融合,即Clean*(alpha)+Origin*(1.0-alpha),其中,*表示乘法,alpha取值在0.0-0.5范围内,这样可以更好地将脸上比较浅的棕色/红色区域相比于其他皮肤区域凸显出来。(3) Color adjustment processing of pigmented areas. For the image quality captured by mobile phones, the lighter brown/red areas on the face cannot be highlighted compared to other skin areas. In order to make the original sample image better simulate the image captured by mobile phones Image quality, so that the Brown image can better highlight brown spots, pores, etc., and the Red image can better highlight red acne, red blood streaks, and red sensitive areas. Therefore, in this embodiment, it is proposed to use a detection algorithm to identify the original sample image These Brown areas and Red areas in Origin, and use the inpainting algorithm to remove these Brown areas and Red areas to obtain a clean result map, which is recorded as a Clean map, and then merged with alpha fusion, that is, Clean *(alpha)+Origin*(1.0-alpha), where * means multiplication, and the alpha value is in the range of 0.0-0.5, which can better compare the lighter brown/red areas on the face to other skin areas stand out.
值得说明的是,对原始样本图像进行增益处理时,只选取压缩处理、颜色格式转换处 理、色素区域颜色调整处理中的任一项、或者任意两项组合,还可以是全部组合,以模拟真实手机摄像头拍摄到的图像,使得后续训练得到的目标人脸色素检测模型可以适用于低成本相机(摄像头)拍摄的低画质图像,降低了皮肤测试仪一类的设备的生产成本,也提升了人脸色素检测方法在手机拍摄上的应用效果。It is worth noting that when performing gain processing on the original sample image, only one of compression processing, color format conversion processing, and pigment area color adjustment processing, or a combination of any two, or all combinations can be selected to simulate the real The images captured by the mobile phone camera make the target face pigment detection model obtained after subsequent training applicable to low-quality images captured by low-cost cameras (cameras), which reduces the production cost of equipment such as skin testers and improves The application effect of face pigment detection method in mobile phone photography.
下述对用以执行本申请所提供的人脸色素检测模型训练装置及存储介质等进行说明,其具体的实现过程以及技术效果参见上述,下述不再赘述。The following describes the human face pigment detection model training device and storage media provided by this application. The specific implementation process and technical effects refer to the above, and will not be repeated below.
图5为本申请实施例提供的一种人脸色素检测模型训练装置的结构示意图;如图5所示,该装置可以包括:增益模块501、处理模块502及修正模块503。FIG. 5 is a schematic structural diagram of a face pigment detection model training device provided by an embodiment of the present application; as shown in FIG. 5 , the device may include: a gain module 501 , a processing module 502 and a correction module 503 .
增益模块501,可以配置成用于对原始样本图像进行增益处理,得到目标样本图像,原始样本图像的分辨率高于目标样本图像的分辨率;The gain module 501 may be configured to perform gain processing on the original sample image to obtain a target sample image, and the resolution of the original sample image is higher than the resolution of the target sample image;
处理模块502,可以配置成用于将目标样本图像输入初始人脸色素检测模型中,得到初始人脸色素检测模型输出的实际黑色素高清细节图像和实际红色素高清细节图像;对原始样本图像进行分解处理,得到监督黑色素高清细节图像和监督红色素高清细节图像;The processing module 502 can be configured to input the target sample image into the initial human face pigment detection model to obtain the actual melanin high-definition detail image and the actual red pigment high-definition detail image output by the initial human face pigment detection model; decompose the original sample image Processing to obtain a supervised melanin high-definition detail image and a supervised red pigment high-definition detail image;
修正模块503,可以配置成用于以监督黑色素高清细节图像和监督红色素高清细节图像作为监督参数,根据实际黑色素高清细节图像和实际红色素高清细节图像,对初始人脸色素检测模型进行迭代修正,得到目标人脸色素检测模型。The correction module 503 can be configured to use the supervised melanin high-definition detail image and the supervised red pigment high-definition detail image as supervision parameters, and iteratively correct the initial human face pigment detection model according to the actual melanin high-definition detail image and the actual red pigment high-definition detail image , to get the target face pigment detection model.
可选地,修正模块503,还可以配置成用于:Optionally, the correction module 503 may also be configured to:
监督黑色素高清细节图像的亮度信息和监督红色素高清细节图像的亮度信息作为监督参数,根据实际黑色素高清细节图像的亮度信息和实际红色素高清细节图像的亮度信息,对初始人脸色素检测模型进行迭代修正,得到目标人脸色素检测模型。The brightness information of the supervised melanin high-definition detail image and the brightness information of the supervised red pigment high-definition detail image are used as supervision parameters. According to the brightness information of the actual melanin high-definition detail image and the brightness information of the actual red pigment high-definition detail image, the initial face pigment detection model Through iterative correction, the target face pigment detection model is obtained.
可选地,初始人脸色素检测模型可以包括:编码器、第一解码器以及第二解码器;Optionally, the initial human face pigment detection model may include: an encoder, a first decoder and a second decoder;
处理模块502,还可以配置成用于:The processing module 502 may also be configured to:
由编码器对目标样本图像进行编码,得到编码后特征;Encode the target sample image by the encoder to obtain the encoded features;
由第一解码器对编码后特征进行细节解码,得到黑色素细节图像和红色素细节图像;performing detail decoding on the encoded features by the first decoder to obtain a melanin detail image and a red pigment detail image;
由第二解码器对编码后特征进行颜色解码,得到黑色素颜色图像和红色素颜色图像;Color decoding is performed on the encoded features by the second decoder to obtain a melanin color image and a red pigment color image;
由初始人脸色素检测模型对黑色素细节图像和黑色素颜色图像进行叠加处理,得到实际黑色素高清细节图像,以及,对红色素细节图像和红色素颜色图像进行叠加处理,得到实际红色素高清细节图像。The melanin detail image and the melanin color image are superimposed by the initial face pigment detection model to obtain the actual melanin high-definition detail image, and the red pigment detail image and the red pigment color image are superimposed to obtain the actual red pigment high-definition detail image.
可选地,处理模块502,还可以配置成用于:Optionally, the processing module 502 may also be configured to:
由第二解码器对编码后特征进行颜色解码,得到中间黑色素系数图矩阵和中间红色素系数图矩阵,并将中间黑色素系数图矩阵与目标样本图像中各像素位置的像素向量相乘,得到黑色素颜色图像,以及,将中间红色素系数图矩阵与目标样本图像中各像素位置的像 素向量相乘,得到红色素颜色图像。The encoded features are color-decoded by the second decoder to obtain the intermediate melanin coefficient map matrix and the intermediate red pigment coefficient map matrix, and the intermediate melanin coefficient map matrix is multiplied by the pixel vector of each pixel position in the target sample image to obtain the melanin A color image, and multiplying the intermediate red pigment coefficient map matrix by the pixel vector of each pixel position in the target sample image to obtain a red pigment color image.
可选地,处理模块502,还可以配置成用于:Optionally, the processing module 502 may also be configured to:
由初始人脸色素检测模型对黑色素细节图像和黑色素颜色图像中相同位置相同通道的各像素值分别相加,得到实际黑色素高清细节图像,以及,对红色素细节图像和红色素颜色图像中相同位置相同通道的各像素值分别相加,得到实际红色素高清细节图像。Add the pixel values of the same channel in the same position in the melanin detail image and the melanin color image by the initial face pigment detection model to obtain the actual melanin high-definition detail image, and, for the same position in the red pigment detail image and the red pigment color image The pixel values of the same channel are added separately to obtain the actual red pigment high-definition detail image.
可选地,增益处理可以包括如下至少一项:压缩处理、颜色格式转换处理、色素区域颜色调整处理。Optionally, the gain processing may include at least one of the following: compression processing, color format conversion processing, and pigment region color adjustment processing.
可选地,色素区域颜色调整处理可以包括:从原始样本图像中检测出黑色素区域和红色素区域,从原始样本图像中剔除黑色素区域和红色素区域,并将剔除黑色素区域和红色素区域后的图像与原始样本图像进行融合处理。Optionally, the color adjustment processing of the pigmented area may include: detecting a melanin area and a red pigmented area from the original sample image, removing the melanin area and the red pigmented area from the original sample image, and removing the melanin area and the red pigmented area The image is fused with the original sample image.
上述装置用于执行前述实施例提供的方法,其实现原理和技术效果类似,在此不再赘述。The above-mentioned apparatus is used to execute the methods provided in the foregoing embodiments, and its implementation principles and technical effects are similar, and details are not repeated here.
以上这些模块可以是被配置成实施以上方法的一个或多个集成电路,例如:一个或多个特定集成电路(Application Specific Integrated Circuit,简称ASIC),或,一个或多个微处理器(digital singnal processor,简称DSP),或,一个或者多个现场可编程门阵列(Field Programmable Gate Array,简称FPGA)等。再如,当以上某个模块通过处理元件调度程序代码的形式实现时,该处理元件可以是通用处理器,例如中央处理器(Central Processing Unit,简称CPU)或其它可以调用程序代码的处理器。再如,这些模块可以集成在一起,以片上系统(system-on-a-chip,简称SOC)的形式实现。The above modules may be one or more integrated circuits configured to implement the above method, for example: one or more specific integrated circuits (Application Specific Integrated Circuit, referred to as ASIC), or, one or more microprocessors (digital singnal processor, DSP for short), or, one or more Field Programmable Gate Arrays (Field Programmable Gate Array, FPGA for short), etc. For another example, when one of the above modules is implemented in the form of a processing element scheduler code, the processing element may be a general-purpose processor, such as a central processing unit (Central Processing Unit, referred to as CPU) or other processors that can call program codes. For another example, these modules can be integrated together and implemented in the form of a system-on-a-chip (SOC for short).
可选地,本申请还提供一种程序产品,例如计算机可读存储介质,包括程序,该程序在被处理器执行时用于执行上述方法实施例。Optionally, the present application further provides a program product, such as a computer-readable storage medium, including a program, and the program is used to execute the foregoing method embodiments when executed by a processor.
在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦·合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed devices and methods may be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or May be integrated into another system, or some features may be ignored, or not implemented. In another point, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既 可以采用硬件的形式实现,也可以采用硬件加软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware, or in the form of hardware plus software functional units.
上述以软件功能单元的形式实现的集成的单元,可以存储在一个计算机可读取存储介质中。上述软件功能单元存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或处理器(英文:processor)执行本申请各个实施例所述方法的部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(英文:Read-Only Memory,简称:ROM)、随机存取存储器(英文:Random Access Memory,简称:RAM)、磁碟或者光盘等各种可以存储程序代码的介质。The above-mentioned integrated units implemented in the form of software functional units may be stored in a computer-readable storage medium. The above-mentioned software functional units are stored in a storage medium, and include several instructions to enable a computer device (which may be a personal computer, server, or network device, etc.) or a processor (English: processor) to execute the functions described in various embodiments of the present application. part of the method. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (English: Read-Only Memory, abbreviated: ROM), random access memory (English: Random Access Memory, abbreviated: RAM), magnetic disk or optical disc, etc. Various media that can store program code.
工业实用性Industrial Applicability
本申请提供了一种人脸色素检测模型训练方法、装置、设备及存储介质。该方法包括:对原始样本图像进行增益处理,得到目标样本图像;将目标样本图像输入初始人脸色素检测模型中,得到实际黑色素高清细节图像和实际红色素高清细节图像;对原始样本图像进行分解处理,得到监督黑色素高清细节图像和监督红色素高清细节图像;以监督黑色素高清细节图像和监督红色素高清细节图像作为监督参数,根据实际黑色素高清细节图像和实际红色素高清细节图像,对初始人脸色素检测模型进行迭代修正,得到目标人脸色素检测模型。本方案解决了低成本相机拍摄画质较差,导致图像相邻像素的颜色趋于一致使人脸图像中不同色素分解质量低的问题。The present application provides a human face pigment detection model training method, device, equipment and storage medium. The method includes: performing gain processing on the original sample image to obtain a target sample image; inputting the target sample image into an initial face pigment detection model to obtain an actual melanin high-definition detail image and an actual red pigment high-definition detail image; decomposing the original sample image processing to obtain the supervised melanin high-definition detail image and the supervised red pigment high-definition detail image; with the supervised melanin high-definition detail image and the supervised red pigment high-definition detail image as supervision parameters, according to the actual melanin high-definition detail image and the actual red pigment high-definition detail image, the initial human The face pigment detection model is iteratively corrected to obtain the target human face pigment detection model. This solution solves the problem that the low-cost camera’s shooting quality is poor, resulting in the color of adjacent pixels of the image tending to be consistent, and the problem of low decomposition quality of different pigments in the face image.
此外,可以理解的是,本申请的人脸色素检测模型训练方法、装置、设备及存储介质是可以重现的,并且可以用在多种工业应用中。例如,本申请的人脸色素检测模型训练方法、装置、设备及存储介质可以用于图像处理技术领域。In addition, it can be understood that the face pigment detection model training method, device, equipment and storage medium of the present application are reproducible and can be used in various industrial applications. For example, the human face pigment detection model training method, device, equipment and storage medium of the present application can be used in the technical field of image processing.

Claims (14)

  1. 一种人脸色素检测模型训练方法,其特征在于,包括:A human face pigment detection model training method is characterized in that, comprising:
    对原始样本图像进行增益处理,得到目标样本图像,所述原始样本图像的分辨率高于所述目标样本图像的分辨率;performing gain processing on the original sample image to obtain a target sample image, where the resolution of the original sample image is higher than the resolution of the target sample image;
    将所述目标样本图像输入初始人脸色素检测模型中,得到所述初始人脸色素检测模型输出的实际黑色素高清细节图像和实际红色素高清细节图像;The target sample image is input into the initial human face pigment detection model to obtain the actual melanin high-definition detail image and the actual red pigment high-definition detail image output by the initial human face pigment detection model;
    对所述原始样本图像进行分解处理,得到监督黑色素高清细节图像和监督红色素高清细节图像;Decomposing the original sample image to obtain a supervised melanin high-definition detail image and a supervised red pigment high-definition detail image;
    以所述监督黑色素高清细节图像和监督红色素高清细节图像作为监督参数,根据所述实际黑色素高清细节图像和所述实际红色素高清细节图像,对所述初始人脸色素检测模型进行迭代修正,得到目标人脸色素检测模型。Using the supervised melanin high-definition detail image and the supervised red pigment high-definition detail image as supervisory parameters, according to the actual melanin high-definition detail image and the actual red pigment high-definition detail image, iteratively correcting the initial human face pigment detection model, Obtain the target face pigment detection model.
  2. 根据权利要求1所述的方法,其特征在于,所述以所述监督黑色素高清细节图像和监督红色素高清细节图像作为监督参数,根据所述实际黑色素高清细节图像和所述实际红色素高清细节图像,对所述初始人脸色素检测模型进行迭代修正,得到目标人脸色素检测模型,包括:The method according to claim 1, characterized in that, using the supervised melanin high-definition detail image and the supervised red pigment high-definition detail image as supervisory parameters, according to the actual melanin high-definition detail image and the actual red pigment high-definition detail image, iteratively correcting the initial human face pigment detection model to obtain the target human face pigment detection model, including:
    所述监督黑色素高清细节图像的亮度信息和监督红色素高清细节图像的亮度信息作为监督参数,根据所述实际黑色素高清细节图像的亮度信息和所述实际红色素高清细节图像的亮度信息,对所述初始人脸色素检测模型进行迭代修正,得到目标人脸色素检测模型。The brightness information of the supervised melanin high-definition detail image and the brightness information of the supervised red pigment high-definition detail image are used as supervision parameters, and according to the brightness information of the actual melanin high-definition detail image and the brightness information of the actual red pigment high-definition detail image, the The above initial face pigment detection model is iteratively corrected to obtain the target face pigment detection model.
  3. 根据权利要求1或2所述的方法,其特征在于,所述初始人脸色素检测模型包括:编码器、第一解码器以及第二解码器;The method according to claim 1 or 2, wherein the initial human face pigment detection model comprises: an encoder, a first decoder and a second decoder;
    所述将所述目标样本图像输入初始人脸色素检测模型中,得到所述初始人脸色素检测模型输出的实际黑色素高清细节图像和实际红色素高清细节图像,包括:Said inputting said target sample image into the initial human face pigment detection model to obtain the actual melanin high-definition detail image and actual red pigment high-definition detail image output by said initial human face pigment detection model, including:
    由所述编码器对所述目标样本图像进行编码,得到编码后特征;Encoding the target sample image by the encoder to obtain encoded features;
    由所述第一解码器对所述编码后特征进行细节解码,得到黑色素细节图像和红色素细节图像;performing detail decoding on the encoded features by the first decoder to obtain a melanin detail image and a red pigment detail image;
    由所述第二解码器对所述编码后特征进行颜色解码,得到黑色素颜色图像和红色素颜色图像;performing color decoding on the encoded features by the second decoder to obtain a melanin color image and a red pigment color image;
    由所述初始人脸色素检测模型对所述黑色素细节图像和所述黑色素颜色图像进行叠加处理,得到所述实际黑色素高清细节图像,以及,对所述红色素细节图像和所述红色素颜色图像进行叠加处理,得到所述实际红色素高清细节图像。Superimposing the melanin detail image and the melanin color image by the initial human face pigment detection model to obtain the actual melanin high-definition detail image, and the red pigment detail image and the red pigment color image Superposition processing is performed to obtain the actual red pigment high-definition detail image.
  4. 根据权利要求3所述的方法,其特征在于,所述由所述第二解码器对所述编码后特 征进行颜色解码,得到黑色素颜色图像和红色素颜色图像,包括:The method according to claim 3, wherein the second decoder performs color decoding on the encoded features to obtain a melanin color image and a red pigment color image, including:
    由所述第二解码器对所述编码后特征进行颜色解码,得到中间黑色素系数图矩阵和中间红色素系数图矩阵,并将所述中间黑色素系数图矩阵与所述目标样本图像中各像素位置的像素向量相乘,得到所述黑色素颜色图像,以及,将所述中间红色素系数图矩阵与所述目标样本图像中各像素位置的像素向量相乘,得到所述红色素颜色图像。Perform color decoding on the encoded features by the second decoder to obtain an intermediate melanin coefficient map matrix and an intermediate red pigment coefficient map matrix, and compare the intermediate melanin coefficient map matrix with the position of each pixel in the target sample image Multiply the pixel vectors of the melanin color image to obtain the melanin color image, and multiply the intermediate red pigment coefficient map matrix with the pixel vectors of each pixel position in the target sample image to obtain the red pigment color image.
  5. 根据权利要求3或4所述的方法,其特征在于,所述由所述初始人脸色素检测模型对所述黑色素细节图像和所述黑色素颜色图像进行叠加处理,得到所述实际黑色素高清细节图像,以及,对所述红色素细节图像和所述红色素颜色图像进行叠加处理,得到所述实际红色素高清细节图像,包括:The method according to claim 3 or 4, wherein the initial human face pigment detection model is used to superimpose the melanin detail image and the melanin color image to obtain the actual melanin high-definition detail image , and, superimposing the red pigment detail image and the red pigment color image to obtain the actual red pigment high-definition detail image, including:
    由所述初始人脸色素检测模型对所述黑色素细节图像和所述黑色素颜色图像中相同位置相同通道的各像素值分别相加,得到所述实际黑色素高清细节图像,以及,对所述红色素细节图像和所述红色素颜色图像中相同位置相同通道的各像素值分别相加,得到所述实际红色素高清细节图像。Adding the pixel values of the same position and the same channel in the melanin detail image and the melanin color image respectively by the initial human face pigment detection model to obtain the actual melanin high-definition detail image, and for the red pigment The detail image and the pixel values of the same position and the same channel in the red pigment color image are respectively added to obtain the actual red pigment high-definition detail image.
  6. 根据权利要求1-5任一项所述的方法,其特征在于,所述增益处理包括如下至少一项:压缩处理、颜色格式转换处理、色素区域颜色调整处理。The method according to any one of claims 1-5, wherein the gain processing includes at least one of the following: compression processing, color format conversion processing, and pigment region color adjustment processing.
  7. 根据权利要求6所述的方法,其特征在于,所述色素区域颜色调整处理包括:从所述原始样本图像中检测出黑色素区域和红色素区域,从所述原始样本图像中剔除所述黑色素区域和红色素区域,并将剔除所述黑色素区域和红色素区域后的图像与所述原始样本图像进行融合处理。The method according to claim 6, wherein the color adjustment process of the pigment region comprises: detecting a melanin region and a red pigment region from the original sample image, and removing the melanin region from the original sample image and the red pigment area, and performing fusion processing on the image after removing the melanin area and the red pigment area and the original sample image.
  8. 一种人脸色素检测模型训练装置,其特征在于,所述装置包括:A human face pigment detection model training device is characterized in that said device comprises:
    增益模块,配置成用于对原始样本图像进行增益处理,得到目标样本图像,所述原始样本图像的分辨率高于所述目标样本图像的分辨率;A gain module configured to perform gain processing on the original sample image to obtain a target sample image, the resolution of the original sample image being higher than the resolution of the target sample image;
    处理模块,配置成用于将所述目标样本图像输入初始人脸色素检测模型中,得到所述初始人脸色素检测模型输出的实际黑色素高清细节图像和实际红色素高清细节图像;对所述原始样本图像进行分解处理,得到监督黑色素高清细节图像和监督红色素高清细节图像;The processing module is configured to input the target sample image into the initial human face pigment detection model to obtain the actual melanin high-definition detail image and the actual red pigment high-definition detail image output by the initial human face pigment detection model; The sample image is decomposed and processed to obtain a supervised melanin high-definition detail image and a supervised red pigment high-definition detail image;
    修正模块,配置成用于以所述监督黑色素高清细节图像和监督红色素高清细节图像作为监督参数,根据所述实际黑色素高清细节图像和所述实际红色素高清细节图像,对所述初始人脸色素检测模型进行迭代修正,得到目标人脸色素检测模型。The correction module is configured to use the supervised melanin high-definition detail image and the supervised red pigment high-definition detail image as supervisory parameters, according to the actual melanin high-definition detail image and the actual red pigment high-definition detail image, to correct the initial human face color The pixel detection model is iteratively corrected to obtain the target face pigment detection model.
  9. 根据权利要求8所述的人脸色素检测模型训练装置,其特征在于,所述修正模块还配置成用于:Facial pigment detection model training device according to claim 8, is characterized in that, described correction module is also configured to:
    所述监督黑色素高清细节图像的亮度信息和监督红色素高清细节图像的亮度信息作为监督参数,根据所述实际黑色素高清细节图像的亮度信息和所述实际红色素高清细节图像 的亮度信息,对所述初始人脸色素检测模型进行迭代修正,得到目标人脸色素检测模型。The brightness information of the supervised melanin high-definition detail image and the brightness information of the supervised red pigment high-definition detail image are used as supervision parameters, and according to the brightness information of the actual melanin high-definition detail image and the brightness information of the actual red pigment high-definition detail image, the The above initial face pigment detection model is iteratively corrected to obtain the target face pigment detection model.
  10. 根据权利要求8或9所述的人脸色素检测模型训练装置,其特征在于,所述初始人脸色素检测模型包括:编码器、第一解码器以及第二解码器,The face pigment detection model training device according to claim 8 or 9, wherein the initial human face pigment detection model comprises: an encoder, a first decoder and a second decoder,
    其中,所述处理模块还配置成用于:由所述编码器对所述目标样本图像进行编码,得到编码后特征;Wherein, the processing module is further configured to: encode the target sample image by the encoder to obtain encoded features;
    由所述第一解码器对所述编码后特征进行细节解码,得到黑色素细节图像和红色素细节图像;performing detail decoding on the encoded features by the first decoder to obtain a melanin detail image and a red pigment detail image;
    由所述第二解码器对所述编码后特征进行颜色解码,得到黑色素颜色图像和红色素颜色图像;performing color decoding on the encoded features by the second decoder to obtain a melanin color image and a red pigment color image;
    由所述初始人脸色素检测模型对所述黑色素细节图像和所述黑色素颜色图像进行叠加处理,得到所述实际黑色素高清细节图像,以及,对所述红色素细节图像和所述红色素颜色图像进行叠加处理,得到所述实际红色素高清细节图像。Superimposing the melanin detail image and the melanin color image by the initial human face pigment detection model to obtain the actual melanin high-definition detail image, and the red pigment detail image and the red pigment color image Superposition processing is performed to obtain the actual red pigment high-definition detail image.
  11. 根据权利要求10所述的人脸色素检测模型训练装置,其特征在于,所述处理模块还配置成用于:Facial pigment detection model training device according to claim 10, is characterized in that, described processing module is also configured to:
    由所述第二解码器对所述编码后特征进行颜色解码,得到中间黑色素系数图矩阵和中间红色素系数图矩阵,并将所述中间黑色素系数图矩阵与所述目标样本图像中各像素位置的像素向量相乘,得到黑色素颜色图像,以及,将所述中间红色素系数图矩阵与所述目标样本图像中各像素位置的像素向量相乘,得到所述红色素颜色图像。Perform color decoding on the encoded features by the second decoder to obtain an intermediate melanin coefficient map matrix and an intermediate red pigment coefficient map matrix, and compare the intermediate melanin coefficient map matrix with the position of each pixel in the target sample image Multiplying the pixel vectors of the melanin color image to obtain the melanin color image, and multiplying the intermediate red pigment coefficient map matrix with the pixel vectors of each pixel position in the target sample image to obtain the red pigment color image.
  12. 根据权利要求10或11所述的人脸色素检测模型训练装置,其特征在于,所述处理模块还配置成用于:The face pigment detection model training device according to claim 10 or 11, wherein the processing module is also configured to:
    由所述初始人脸色素检测模型对所述黑色素细节图像和所述黑色素颜色图像中相同位置相同通道的各像素值分别相加,得到所述实际黑色素高清细节图像,以及,对所述红色素细节图像和所述红色素颜色图像中相同位置相同通道的各像素值分别相加,得到所述实际红色素高清细节图像。Adding the pixel values of the same position and the same channel in the melanin detail image and the melanin color image respectively by the initial human face pigment detection model to obtain the actual melanin high-definition detail image, and for the red pigment The detail image and the pixel values of the same position and the same channel in the red pigment color image are respectively added to obtain the actual red pigment high-definition detail image.
  13. 一种电子设备,其特征在于,包括:处理器、存储介质和总线,所述存储介质存储有所述处理器可执行的机器可读指令,当电子设备运行时,所述处理器与所述存储介质之间通过总线通信,所述处理器执行所述机器可读指令,以执行如权利要求1-7任一所述方法的步骤。An electronic device, characterized in that it includes: a processor, a storage medium and a bus, the storage medium stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the The storage media communicate with each other through a bus, and the processor executes the machine-readable instructions to perform the steps of the method according to any one of claims 1-7.
  14. 一种计算机存储介质,其特征在于,所述存储介质上存储有计算机程序,所述计算机程序被处理器运行时执行如权利要求1-7任一所述方法的步骤。A computer storage medium, wherein a computer program is stored on the storage medium, and when the computer program is run by a processor, the steps of the method according to any one of claims 1-7 are executed.
PCT/CN2021/132558 2021-08-30 2021-11-23 Face pigment detection model training method and apparatus, device, and storage medium WO2023029233A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
KR1020227037680A KR20230035225A (en) 2021-08-30 2021-11-23 Facial pigment detection model training method, apparatus, equipment and storage medium
JP2022566607A JP7455234B2 (en) 2021-08-30 2021-11-23 Methods, devices, equipment and storage medium for facial pigment detection model training

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111002463.8A CN113688752B (en) 2021-08-30 2021-08-30 Training method, device, equipment and storage medium for face color detection model
CN202111002463.8 2021-08-30

Publications (1)

Publication Number Publication Date
WO2023029233A1 true WO2023029233A1 (en) 2023-03-09

Family

ID=78584130

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/132558 WO2023029233A1 (en) 2021-08-30 2021-11-23 Face pigment detection model training method and apparatus, device, and storage medium

Country Status (4)

Country Link
JP (1) JP7455234B2 (en)
KR (1) KR20230035225A (en)
CN (1) CN113688752B (en)
WO (1) WO2023029233A1 (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110206254A1 (en) * 2010-02-22 2011-08-25 Canfield Scientific, Incorporated Reflectance imaging and analysis for evaluating tissue pigmentation
CN109325928A (en) * 2018-10-12 2019-02-12 北京奇艺世纪科技有限公司 A kind of image rebuilding method, device and equipment
CN111507914A (en) * 2020-04-10 2020-08-07 北京百度网讯科技有限公司 Training method, repairing method, device, equipment and medium of face repairing model
CN111768354A (en) * 2020-08-05 2020-10-13 哈尔滨工业大学 Face image restoration system based on multi-scale face part feature dictionary
CN112070848A (en) * 2020-09-18 2020-12-11 厦门美图之家科技有限公司 Image pigment separation method, device, electronic equipment and readable storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP7130839B2 (en) * 2018-07-16 2022-09-05 オーナー・デヴァイス・カンパニー・リミテッド Dye detection method and electronics
CN113076685B (en) * 2021-03-04 2024-09-10 华为技术有限公司 Training method of image reconstruction model, image reconstruction method and device thereof

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110206254A1 (en) * 2010-02-22 2011-08-25 Canfield Scientific, Incorporated Reflectance imaging and analysis for evaluating tissue pigmentation
CN109325928A (en) * 2018-10-12 2019-02-12 北京奇艺世纪科技有限公司 A kind of image rebuilding method, device and equipment
CN111507914A (en) * 2020-04-10 2020-08-07 北京百度网讯科技有限公司 Training method, repairing method, device, equipment and medium of face repairing model
CN111768354A (en) * 2020-08-05 2020-10-13 哈尔滨工业大学 Face image restoration system based on multi-scale face part feature dictionary
CN112070848A (en) * 2020-09-18 2020-12-11 厦门美图之家科技有限公司 Image pigment separation method, device, electronic equipment and readable storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
GAO, XINBO; LU, WEN; ZHA, LIN; HUI, ZHENG; QI, TONGSHUAI: "Quality Elevation Technique for UHD Video and Its VLSI Solution", JOURNAL OF CHONGQING UNIVERSITY OF POSTS AND TELECOMMUNICATIONS(NATURAL SCIENCE EDITION), vol. 32, no. 5, 15 October 2020 (2020-10-15), pages 681 - 697, XP009544218, ISSN: 1673-825X, DOI: 10.3979/j.issn.1673-825X.2020.05.001 *

Also Published As

Publication number Publication date
JP2023546307A (en) 2023-11-02
CN113688752B (en) 2024-02-02
JP7455234B2 (en) 2024-03-25
KR20230035225A (en) 2023-03-13
CN113688752A (en) 2021-11-23

Similar Documents

Publication Publication Date Title
Zhou et al. Cross-view enhancement network for underwater images
Peng et al. U-shape transformer for underwater image enhancement
CN107911625A (en) Light measuring method, device, readable storage medium storing program for executing and computer equipment
Lu et al. Progressive joint low-light enhancement and noise removal for raw images
Wang et al. Low-light image enhancement based on virtual exposure
Shao et al. No-reference view synthesis quality prediction for 3-D videos based on color–depth interactions
WO2023231535A1 (en) Monochrome image-guided joint denoising and demosaicing method for color raw image
WO2024164694A9 (en) Image compression method and apparatus, electronic device, computer program product, and storage medium
US10552876B2 (en) Method and apparatus for chroma reconstruction
Zhang et al. A real-time semi-supervised deep tone mapping network
CN110473177B (en) Skin pigment distribution prediction method, image processing system, and storage medium
Thomas et al. Dehazing underwater images using encoder decoder based generic model-agnostic convolutional neural network
Wang et al. Low-light image enhancement by deep learning network for improved illumination map
WO2017101347A1 (en) Method and device for identifying and encoding animation video
Huang et al. Underwater image enhancement via LBP‐based attention residual network
Sheng et al. Guided colorization using mono-color image pairs
Feng et al. You only need one color space: An efficient network for low-light image enhancement
CN113781326A (en) Demosaicing method and device, electronic equipment and storage medium
WO2023029233A1 (en) Face pigment detection model training method and apparatus, device, and storage medium
CN107392870A (en) Image processing method, device, mobile terminal and computer-readable recording medium
CN114666571B (en) Video sensitive content detection method and system
CN116208812A (en) Video frame inserting method and system based on stereo event and intensity camera
CN115496819A (en) Rapid coding spectral imaging method based on energy concentration characteristic
US11483577B2 (en) Processing of chroma-subsampled video using convolutional neural networks
Hu et al. Texture-aware and color-consistent learning for underwater image enhancement

Legal Events

Date Code Title Description
ENP Entry into the national phase

Ref document number: 2022566607

Country of ref document: JP

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21955761

Country of ref document: EP

Kind code of ref document: A1