Real-time skin classification method and application
Through real-time skin classification methods, appropriate pretreatment methods and models are determined, which solves the difficulties of existing skin automatic classification systems in data collection and pretreatment, and achieves high-precision and high-efficiency skin classification, reducing the cost of technology implementation.
Patent Information
- Application Number
- CN202411963040.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-04-29
AI Technical Summary
The existing automatic skin classification system has difficulties in data collection and preprocessing, resulting in low classification accuracy and efficiency, and high technical implementation costs.
Using a real-time skin classification method, the pre-treatment method and the optimal skin classification model that are most suitable for facial skin images are determined through steps S1 to S3. The specific steps include: obtaining the initial data set, dividing the training set, verification set and test set, applying the CLAHE algorithm and random rotation as preprocessing methods, combining models such as MobileNet-V2 for training, and determining the best preprocessing method and the best skin classification model.
Through the integration of the CLAHE algorithm and the EfficientNet-V2 model, high-precision and efficient classification and analysis of skin photos are achieved, reducing the cost of data collection and preprocessing, and improving the overall performance of the classification system.
Smart Images

Figure CN119904681A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of power electronics and intelligent classification, and in particular to a real-time skin classification method and application. Background Art
[0002] Existing automatic skin classification systems rely on a large amount of high-quality data to train models to improve classification accuracy and efficiency. However, in practical applications, it is difficult to collect a sufficient amount of data, and the reliability of different types of data collected varies. Additional computing power is required to screen the collected data, which increases the threshold and cost of technical implementation. Summary of the invention
[0003] In order to solve the above technical problems, the present invention provides a real-time skin classification method and application.
[0004] To achieve the above object, the present invention adopts the following technical solution:
[0005] A real-time skin classification method, characterized in that: according to steps S1 to S3, the most suitable preprocessing method and the optimal skin classification model for facial skin images are determined:
[0006] Step S1, obtaining a preset number of facial skin images of known corresponding real skin types to form an initial data set, dividing the initial data set into a training set, a validation set and a test set according to a preset ratio, and using the training set and the validation set to form an original image data set, and then executing step S2;
[0007] Step S2, using different preprocessing methods to process each facial skin image in the original image data set, respectively, to obtain updated data sets corresponding to each preprocessing method, and combining with the original image data set, respectively using each data set to train a preset decision model whose input is a facial skin image and whose output is a skin type corresponding to the facial skin image, to obtain the skin analysis type corresponding to each facial skin image in the data set, thereby obtaining the accuracy of the data set regarding the skin analysis type, and then determining the preprocessing method that is most suitable for facial skin images, that is, the optimal preprocessing method, and then executing step S3;
[0008] Step S3, using the best preprocessing method to process the original image dataset, for multiple preset candidate models whose input is facial skin images and whose output is skin types corresponding to facial skin images, use the preprocessed original image dataset to train each preset candidate model, and obtain the skin analysis type corresponding to each facial skin image in the preprocessed original image dataset, so as to obtain the measurement index value of the skin analysis type of the dataset under different candidate models, and then determine the classification model that is most suitable for facial skin images, that is, the optimal skin classification model.
[0009] Furthermore, in step S1, the initial data set is divided into a training set, a validation set and a test set according to a ratio of 8:1:1.
[0010] Furthermore, in step S2, the preprocessing method includes utilizing the CLAHE algorithm, random rotation, and a combination of the CLAHE algorithm and random rotation, and the preprocessing method will not change the marked skin type.
[0011] Furthermore, the CLAHE algorithm implements image enhancement in the following steps:
[0012] Step P1, based on a preset block size, segment each facial skin image in the original image data set, and perform distortion correction on each block, and then execute step P2;
[0013] Step P2, based on the preset contrast limit threshold, determine whether each image block exceeds the contrast limit threshold, if yes, cut off the image block that exceeds the contrast limit threshold and accumulate it, after completing the contrast threshold determination for each image block, scale all the accumulated image blocks that exceed the contrast threshold, and after scaling, map them to the image blocks that do not exceed the contrast limit, and then execute step P3;
[0014] Step P3: Merge all tiles using bilinear interpolation algorithm
[0015] Furthermore, in step S2, MobileNet-V2 is used as a decision model.
[0016] Furthermore, in step S3, the preset candidate models include: MobileNet-V2, EfficientNet-V2, Inception-V2 and ResNet-V1.
[0017] Furthermore, in step S3, the candidate model is trained in the following manner:
[0018]
[0019] Among them, η is the learning rate, N is the number of samples, is the loss function, θ k is the current state of the model, θ k+1 An improvement to the next state of the model.
[0020] A real-time skin classification device, characterized in that the device comprises:
[0021] An input module is used to collect facial skin images in real time and transmit them to the recognition module;
[0022] The recognition module is used to receive the facial skin image in real time, determine the skin type corresponding to the facial skin image, calculate the pulse width and period corresponding to the skin type, and transmit the calculation result to the driving module;
[0023] A driving module, used for receiving a pulse width and a period corresponding to the skin type, generating a PWM signal corresponding to the skin type by using a PWM driving chip, and transmitting the PWM signal to an output module;
[0024] The output module is used to connect to the target laser semiconductor and control the power supply of the target laser semiconductor in combination with the L298N H bridge according to the on-off state of the received PWM signal.
[0025] Furthermore, the input module includes an ADC conversion chip (PCF8591), a linear displacement sensor, and a depth camera.
[0026] Furthermore, the recognition module includes Jetson Orin NX and an I2C multiplier, wherein the Jetson Orin NX is used to determine the skin type corresponding to the facial skin image, and the I2C multiplier is used to calculate the pulse width and period corresponding to the skin type.
[0027] Compared with the prior art, the present invention has the following beneficial effects:
[0028] 1. The present invention uses the CLAHE algorithm as the best preprocessing method to improve the overall image quality and increase the amount of image information.
[0029] 2. Based on the comparative analysis of multiple candidate models, this paper selects EfficientNet-V2 as the optimal skin classification model to achieve high-precision and high-efficiency classification and analysis of skin photos.
[0030] 3. The present invention integrates the CLAHE algorithm and the EfficientNet-V2 algorithm on the high-performance Jetson Orin NX platform, and combines the I2C multiplier and PWM driver chip to achieve fine control of the target laser semiconductor output intensity. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 The figure is a logic diagram of a real-time skin classification method of the present invention.
[0032] Figure 2 It is the logic diagram of the CLAHE algorithm in the optimal preprocessing method of the present invention.
[0033] Figure 3 This is a module block diagram of a real-time skin classification device of the present invention. DETAILED DESCRIPTION
[0034] The technical solution of the present invention will be described in detail below with reference to the accompanying drawings.
[0035] refer to Figure 1 , a real-time skin classification method, characterized in that: according to steps S1 to S3, the most suitable preprocessing method and the optimal skin classification model for facial skin images are determined:
[0036] Step S1, obtaining a preset number of facial skin images of known corresponding real skin types to form an initial data set, dividing the initial data set into a training set, a validation set and a test set in a ratio of 8:1:1, and using the training set and the validation set to form an original image data set, and then executing step S2;
[0037] Step S2, using different preprocessing methods to process each facial skin image in the original image data set, that is, using the CLAHE algorithm, random rotation, and the CLAHE algorithm combined with random rotation to process each facial skin image in the original image data set, respectively, to obtain updated data sets corresponding to each preprocessing method, and combining with the original image data set, respectively using each data set to train the MobileNet-V2 model whose input is the facial skin image and output is the skin type corresponding to the facial skin image, to obtain the skin analysis type corresponding to each facial skin image in the data set, thereby obtaining the accuracy of the data set with respect to the skin analysis type, and then determining the preprocessing method that is most suitable for the facial skin image, that is, the optimal preprocessing method. In this embodiment, it is determined that the preprocessing method that is most suitable for the facial skin image is the combination of the CLAHE algorithm and random rotation, and then executing step S3;
[0038] Specifically, refer to Figure 2 , the CLAHE algorithm includes:
[0039] Step P1, based on the block size of 8*8, segment each facial skin image in the original image data set, and perform distortion correction on each block, and then execute step P2;
[0040] Step P2, based on the preset contrast limit threshold, determine whether each image block exceeds the contrast limit threshold, if yes, cut off the image block that exceeds the contrast limit threshold and accumulate it, after completing the contrast threshold determination for each image block, scale all the accumulated image blocks that exceed the contrast threshold, and after scaling, map them to the image blocks that do not exceed the contrast limit, and then execute step P3;
[0041] Step P3, merging all image blocks using a bilinear interpolation algorithm;
[0042] Step S3, using the CLAHE algorithm combined with the random rotation preprocessing method to process the original image data set, for multiple preset candidate models whose input is a facial skin image and whose output is a skin type corresponding to the facial skin image, respectively train each preset candidate model using the preprocessed original image data set to obtain the skin analysis type corresponding to each facial skin image in the preprocessed original image data set, thereby obtaining the measurement index value of the skin analysis type of the data set under different candidate models, see Table 1 for details, and then determine the classification model most suitable for facial skin images, that is, the optimal skin classification model. In this embodiment, the candidate models selected are MobileNet-V2, EfficientNet-V2, Inception-V2 and ResNet-V1; by analyzing the precision, recall rate and loss value of each candidate model, EfficientNet-V2 is selected as the optimal skin classification model;
[0043] Specifically, step S3 trains the candidate model in the following manner:
[0044]
[0045] Among them, η is the learning rate, N is the number of samples, is the loss function, θ k is the current state of the model, θ k+1 Improvements for the next state of the model;
[0046] Table 1
[0047]
[0048]
[0049] Preferably, the Hyperband algorithm and 10-fold cross validation are used to optimize the optimal skin classification model. Table 2 shows the accuracy and loss value of the optimal skin classification model under 10-fold cross validation. After 10-fold cross validation, the average accuracy of the model is 95.27, and the average loss value is 13.45. The recognition accuracy of EfficientNet-V2 is improved through 10-fold cross validation, and the average loss of EfficientNet-V2 is reduced.
[0050] Table 2
[0051] Subset Accuracy (%) Loss value (%) 1 91.89 18.88 2 95.27 13.91 13 93.24 15.68 4 95.94 11.95 5 93.91 15.53 6 95.94 9.49 7 96.62 12.14 8 98.64 4.61 9 95.27 20.01 10 95.94 12.34
[0052] refer to Figure 3 , a real-time skin classification device, characterized in that: the device comprises:
[0053] An input module is used to collect facial skin images in real time and transmit them to the recognition module;
[0054] The recognition module is used to receive the facial skin image in real time, determine the skin type corresponding to the facial skin image, calculate the pulse width and period corresponding to the skin type, and transmit the calculation result to the driving module;
[0055] A driving module, used for receiving a pulse width and a period corresponding to the skin type, generating a PWM signal corresponding to the skin type by using a PWM driving chip, and transmitting the PWM signal to an output module;
[0056] The output module is used to connect to the target laser semiconductor and control the power supply of the target laser semiconductor in combination with the L298N H bridge according to the on-off state of the received PWM signal.
[0057] Furthermore, the input module includes an ADC conversion chip (PCF8591), a linear displacement sensor, and a depth camera.
[0058] Furthermore, the recognition module includes Jetson Orin NX and an I2C multiplier, wherein Jetson Orin NX integrates the CLAHE algorithm and the EfficientNet-V2 algorithm for determining the skin type corresponding to the facial skin image, and the I2C multiplier is used to calculate the pulse width and period corresponding to the skin type.
[0059] The above description is only a preferred embodiment of the present invention and does not limit the present invention in any way. Any simple modification, change and equivalent structural change made to the above embodiment based on the technical essence of the present invention still falls within the protection scope of the technical solution of the present invention.
Claims
1. A real-time skin classification method, characterized in that: Determine the most suitable preprocessing method and optimal skin classification model for facial skin images according to steps S1 to S3: Step S1, obtaining a preset number of facial skin images of known corresponding real skin types to form an initial data set, dividing the initial data set into a training set, a validation set and a test set according to a preset ratio, and using the training set and the validation set to form an original image data set, and then executing step S2; Step S2, using different preprocessing methods to process each facial skin image in the original image data set, respectively, to obtain updated data sets corresponding to each preprocessing method, and combining with the original image data set, respectively using each data set to train a preset decision model whose input is a facial skin image and whose output is a skin type corresponding to the facial skin image, to obtain the skin analysis type corresponding to each facial skin image in the data set, thereby obtaining the accuracy of the data set regarding the skin analysis type, and then determining the preprocessing method that is most suitable for facial skin images, that is, the optimal preprocessing method, and then executing step S3; Step S3, using the best preprocessing method to process the original image dataset, for multiple preset candidate models whose input is facial skin images and whose output is skin types corresponding to facial skin images, use the preprocessed original image dataset to train each preset candidate model, and obtain the skin analysis type corresponding to each facial skin image in the preprocessed original image dataset, so as to obtain the measurement index value of the skin analysis type of the dataset under different candidate models, and then determine the classification model that is most suitable for facial skin images, that is, the optimal skin classification model.
2. A real-time skin classification method according to claim 1, characterized in that: In the step S1, the initial data set is divided into a training set, a validation set and a test set according to a ratio of 8:1:
1.
3. A real-time skin classification method according to claim 1, characterized in that: In step S2, the preprocessing method includes using the CLAHE algorithm, random rotation, and a combination of the CLAHE algorithm and random rotation, and the preprocessing method will not change the marked skin type.
4. A real-time skin classification method according to claim 2, characterized in that: The CLAHE algorithm implements image enhancement in the following steps: Step P1, based on a preset block size, segment each facial skin image in the original image data set, and perform distortion correction on each block, and then execute step P2; Step P2, based on the preset contrast limit threshold, determine whether each image block exceeds the contrast limit threshold, if yes, cut off the image block that exceeds the contrast limit threshold and accumulate it, after completing the contrast threshold determination for each image block, scale all the accumulated image blocks that exceed the contrast threshold, and after scaling, map them to the image blocks that do not exceed the contrast limit, and then execute step P3; Step P3, merge all the blocks using a bilinear interpolation algorithm.
5. A real-time skin classification method according to claim 1, characterized in that: In step S2, MobileNet-V2 is used as a decision model.
6. A real-time skin classification method according to claim 1, characterized in that: In step S3, the preset candidate models include: MobileNet-V2, EfficientNet-V2, Inception-V2 and ResNet-V1.
7. A real-time skin classification method according to claim 1, characterized in that: In step S3, the candidate model is trained as follows: Among them, η is the learning rate, N is the number of samples, is the loss function, θ k is the current state of the model, θ k+1 An improvement to the next state of the model.
8. A real-time skin classification device, characterized in that: The device comprises: An input module is used to collect facial skin images in real time and transmit them to the recognition module; The recognition module is used to receive the facial skin image in real time, determine the skin type corresponding to the facial skin image, calculate the pulse width and period corresponding to the skin type, and transmit the calculation result to the driving module; A driving module, used for receiving a pulse width and a period corresponding to the skin type, generating a PWM signal corresponding to the skin type by using a PWM driving chip, and transmitting the PWM signal to an output module; The output module is used to connect to the target laser semiconductor and control the power supply of the target laser semiconductor in combination with the L298NH bridge according to the on-off state of the received PWM signal.
9. A real-time skin classification device according to claim 8, characterized in that: The input module includes an ADC conversion chip (PCF8591), a linear displacement sensor, and a depth camera.
10. A real-time skin classification device according to claim 8, characterized in that: The recognition module includes Jetson Orin NX and an I2C multiplier, wherein the Jetson Orin NX is used to determine the skin type corresponding to the facial skin image, and the I2C multiplier is used to calculate the pulse width and period corresponding to the skin type.