Detection of skin wrinkles and quantification of roughness using a novel image processing technique from a dermatoscope device

Abstract Objective Cutaneous relief analysis is crucial in the development of new skincare products, as well as in the evaluation of dermatological treatments. The analysis can be performed by qualitative or quantitative methods. We propose a new algorithm to detect wrinkles and quantify skin roughness by image processing from a dermatoscope. Methods A clinical study was carried out with 33 research participants, and images were collected with the dermatoscope and PRIMOS equipment for wrinkle evaluation at two different times: Day 0 (D0) and 45 days (D45) after the use of a dermocosmetic product. Later, a new algorithm was developed to detect wrinkles in the acquired images by applying filters and image transformations that generate a segmented image highlighting the wrinkles. A roughness calculation method is proposed from the pixels belonging to wrinkles. Results Correlation between the values obtained by the PRIMOS equipment and the proposed system was verified. No correlation was found for data obtained at D0; however, there was correlation at time D45 by Spearman's similarity coefficient. By comparing roughness between times D0 and D45, the treatment was statistically significant for both PRIMOS and the proposed methodology data. Conclusion The wrinkle detection algorithm, in addition to the roughness calculation, demonstrated a sensitivity comparable to the PRIMOS system in evaluating the effectiveness of the dermocosmetic treatment. Significance Considering the simplicity of the dermatoscope design compared to other established devices such as PRIMOS, the proposed system is promising as an alternative for dermatological evaluations.


INTRODUCTION
Wrinkles are important markers of the time effects on human skin.
They are objects of study in clinical research aimed at developing cosmetic products capable of minimizing their effects. Moreover, they are studied in dermatological clinics where medical assistance is desirable to propose treatments aimed at improving the appearance of the skin.
The task of comparing wrinkles can be performed subjectively, for which an experienced professional trained according to consolidated classifications, such as Fritzpatrick or Glogau, is required. 1,2 Another way of assessing wrinkles is by using devices that can quan-  Roughness measurements are important in the analysis of surfaces to verify differences related to relief. The greater the value of the differences between valleys and peaks in a given area, the greater its roughness. 18 ISO 4287 defines roughness parameters such as arithmetic mean roughness (R a ), root mean squared roughness (R q ), and maximum surface roughness (R max ). 19 In industry, these parameters are widely used to evaluate material surfaces' quality.
The primary parameter for calculating these quantities is the depth measurement of the surface under analysis, typically measured in micrometer. 20 As human skin also presents irregularities, several authors adapted these parameters to assess skin roughness. 21 This adaptation includes

Dermatoscope
In the system development, a dermatoscope consisting of a USB camera microscope device was used, which can provide images with an optical magnification of 50 times and a resolution of 1600 × 1200 pixels, covering an area of 7 × 6.5 mm. The device is equipped with high-brightness white LEDs that illuminate the focal point where the image is obtained. Figure 1 shows a representation of the device used.

PRIMOS
The comparative study was carried out using the PRIMOS Lite device.

Image processing
Digital images are essentially three-dimensional matrices that contain information about the colors of pixels obtained from a scene. The most common and widely used standard is RGB (red, green, and blue), which was used in this work, and can represent colors by combining the intensity of the three colors. The values for each component are 16-bit values that range from 0 to 255, where 0 represents the absence of that component and 255 represents the maximum intensity of that color.
By processing this matrix, mainly by examining the variation of these values for each pixel and its neighbors, it is possible to extract various types of information from images. 25 From the images obtained by the dermatoscope, it is possible to observe that the regions representing wrinkles are darker, as they are further from the light source, causing a smaller amount of light to return to the camera as pixels, in comparison to pixels from regions that do not possess wrinkles and are closer to the lens.
The first attempt to determine wrinkle areas was performed by converting the original image to a grayscale image with only a 16-bit color channel, where 0 represents black and 255 represents white, with shades of gray in between these limits. 26 From the grayscale image, a threshold value was established, and values below it were considered valleys, while values above it were considered peaks, which depend on the analyzed skin tone and the amount of light captured by the camera.
Due to the difficulty of directly detecting wrinkles from the grayscale image, the algorithm shown in Figure 2 was developed.

Roughness quantification
In 2D images, such as those obtained by the dermatoscope device used The value of R a is shown in Equation (1).
The w value represents the image's width in number of pixels, h represents the height, and G represents the original image converted into grayscale. For each pixel, its belonging to the group of pixels that make up the detected wrinkle's area is analyzed. This evaluation is performed by the W p (wrinkle pixels) function defined in Equation (2), which returns the pixel's value under analysis in case it belongs to the wrinkle area or 0 otherwise. During the development, a modified way of implementing the R q calculation was emphasized in the wrinkle area and is described in Equation (3). The parameters considered are the same as those used in the R a calculation.
As the total image size obtained by the dermatoscope is displayed in millimeters and considering the maximum resolution of the image being 1600 × 1200 pixels, it is possible to calculate the area corresponding to each pixel, which is 0.203 × 10 −4 mm 2 . This makes it possible to calculate the wrinkle area parameter (W a ), consisting of the multiplication of the pixel area by the number of pixels present in the wrinkle area, as described in Equation (4).
F I G U R E 3 Representation of the periorbital region, in this case highlighted in red next to the right eye.

F I G U R E 4
Selection of the area to be analyzed in the PRIMOS software.

Research subjects
Total 33 research participants, of all genders and with varying degrees of wrinkles, aged between 19 and 75 years, were selected for this clinical study. The objective of the study was to evaluate the conditions of the wrinkles before and after the use of a dermocosmetic, using both PRIMOS and dermatoscope devices. All participants were recruited and instructed on the procedures, and they signed an informed consent form that was submitted and approved by the research ethics committee (52218121.7.0000.5514).
During the first visit to the study center, images were collected using both PRIMOS and dermatoscope devices at the periorbital region, as shown in Figure 3. After the data collection, participants were given a dermocosmetic and were properly instructed on how to use it by a trained technician from the study center. The dermocosmetic was applied to the periorbital region once a day for 45 consecutive days. On the 46th day, participants returned to the study center for new image collection using both PRIMOS and dermatoscope devices.
Images obtained using the PRIMOS system were analyzed using its specific software. Wrinkle demarcation was carried out by drawing a straight line in the region of interest, as shown in Figure 4. From this region, the software calculated various parameters, including R a . This process was performed for images obtained at D0 and D45. Similarly, images obtained using the dermatoscope device were analyzed using the algorithms developed in this study to detect wrinkle regions and calculate R a , R q , and W a for both D0 and D45 measurements.

Statistical analysis
The normality distribution of the obtained parameters was verified using the Shapiro-Wilk test. 31 To determine whether significant statistical differences existed among different groups, the T-test was applied to data with normal distribution, and the Wilcoxon test was applied to nonparametric data. 32,33 In addition, Spearman's correlation analysis was performed, 34  For all statistical analyses, a significance level of 95% was adopted.

RESULTS
The result of the wrinkle detection algorithm can be viewed in Figure 5, where the original image is presented on the left, the gray-scaled features are amplified in the middle, and the segmented features are on the right.
To verify the points identified by the segmentation algorithm, the segmented image was superimposed onto the original image, as can be seen in Figure 6.
From the clinical study that was carried out, images of the periorbital region were obtained using two devices, the PRIMOS and the dermatoscope, as shown in Figure 7.
In order to compare differences in wrinkles, Figure    images, resulting in a p-value of 0.0229, which also detected statistically significant differences after using the dermocosmetic, assuming a significance level of 95%. By analyzing the R a parameters from PRIMOS and dermatoscopy, it was found that the dermocosmetic was efficient in improving skin relief. Finally, the difference between the R q values obtained at D0 and D45 was verified. As this dataset was the only one that presented normal distribution, T-test was used for comparison. It resulted in a p-value of 0.102, which, considering a 95% significance level, was unable to detect statistically significant differences between treatments.

CONCLUSION
In summary, data were collected using a dermatoscope device that provided maximized images focused on wrinkles, which were then compared to the gold standard device, PRIMOS. Along with the developed wrinkle detection algorithm and the new approach for roughness calculation, this becomes an interesting alternative for the analysis of skin relief, including the ability to detect significant statis-F I G U R E 1 1 Parameter R q obtained by the dermatoscope at times D0 and D45.
tical differences in the analysis of a dermatological treatment using a dermocosmetic. It is important to emphasize that in the analysis carried out with the PRIMOS system, a region of interest was demarcated, whereas in the proposed system, the analysis is carried out automatically. One of the great advantages of the proposed system is the low cost of the device, compared to established systems such as PRIMOS, VISIA, and VISIOSCAN. Thus, the proposed system becomes a viable option that provides quantitative values of skin quality to be used in dermatological clinics or clinical research institutions for evaluating the effectiveness of cosmetics or treatments.

FUNDING INFORMATION
Coordination for the Improvement of Higher Level Personnel (CAPES), Grant Number: 88882.365434/2019-01

DATA AVAILABILITY STATEMENT
The data that support the findings of this study are available on request from the corresponding author.