A Method to Extract a Nail Half Moon for Accumulation Stress Evaluation

In this paper, we propose a method to extract a nail half moon for accumulation stress evaluation. The proposed method consists of three phases; nail half moon area extraction, HSV color system conversion and nail half moon outline detection. Trimming of the nail half moon area is carried out with fixed parameters because the shooting environment of the nail is fixed. In the HSV color system conversion, the value of hue is used to binarize the nail half moon part and the nail plate part. The outline of the nail half moon is detected using labeling a region that has the maximum value in the nail image. In order to show the effectiveness of the proposed method, we conduct experiments.


Introduction
In recent years, the number of mental illnesses has been on an increasing trend year by year, including depression, schizophrenia, anxiety disorder etc.In Japan, many people commit suicide.However, there is no way to measure accumulated stress on a daily basis.Therefore, a new stress measurement system that can easily detect accumulated stress is needed to solve social problems caused by accumulation stress.In previous studies, there are any attempts to measure long-term stress by measuring the value of cortisol contained in the hair and the nails.In our previous research, we collected nails for 2 weeks to extract cortisol by assaying enzyme-linked immune sorbent (1) .In this method, we evaluated accumulation stress.However routine measurement was required.In order to evaluate stress on a daily basis, we propose an accumulation stress measurement system by analyzing nail images.The state of nail surface can change during human feels stress for a long term (2)(3)(4)(5) .If change of the nail state is extracted by image processing, we can evaluate daily accumulation stress.Therefore, this paper proposes a method to evaluate stress by analyzing the nail image.The proposed method extracts the change of the nail half moon because the shape of the nail half moon can change when he/she feels stress for a long term.

Proposed Method
The proposed method consists of three phases; nail half moon area extraction, HSV color system conversion, and nail half moon outline detection.Fig. 1 shows the flowchart of the proposed method.Fig. 1.Flowchart of the proposed method.

Nail Half Moon Area Extraction
This paper trims an image around the nail half moon to extract it as follows: where  ! and  ! are x and y coordinate of a starting point of cutting, respectively. and  are the cut sizes.

HSV Color System Conversion
Since the nail half moon area is white and there is a difference in hue from the other part of the nail, it can be extracted by binarization using the hue value.Therefore, we convert the RGB color space into the HSV color space as follows:

Outline Detection of Nail Half Moon
The outline of the nail half moon is detected on the basis of the difference in hue value between the nail half moon and the other parts.The threshold value of hue for extracting the contour of the half moon portion is The threshold is calculated using the hue value  with the maximum frequency value in hue histogram and equations 7 and 8.There are noises in the nail half moon part.On the one hand, treatment for subjects who do not have a nail half moon part is necessary.Therefore, a labeling process is carried out to reduce the noises.The proposed method detects the nail half moon on the basis of the labeling results.We regard a labeled area that has the maximum number of pixels as the nail half moon.In this paper, a labeling process by the 8 neighbor method is employed.Fig. 4 shows a sample of the binarized image, its labeling result

Experiments
The number of subjects was 7 males(average age 22 years).All subjects consented to take pictures of the nails.The standard camera with iphone 6 was used when taking pictures.The image size was  !"#$! × !!"#!! .The color of the background was fixed in green.Furthermore a table lamp was set directly above.The nail half moon area that can be visually confirmed using GIMP(GNU Image Manipulation Program) was manually selected (see Fig. 5).Then, the number of pixels  !"#$ included in the selected range was calculated on the basis of manually selected results as follows: where  !"#$ and  !"#!#$%& are correct answer data and data obtained by the proposed method, respectively.Furthermore extraction accuracy was calculated for each subject.The extraction accuracy  !"#$%&#'() was calculated as follows: where  and  !"#$%&#'() is the number of data of all subjects and the number of data where the nail half moon is correctly extracted.

Results and Discussions
Table 2 shows the experimental results for detection of the nail half moon.The numbers of data were 10 (subjects A to C) and 8 (subjects D to G), respectively.The number of successful nail half moon extraction was 35 sheets.(subject A: 8, subject C, F: 7, subject B: 6, subject G: 5, subject A: 2, subject G: 0).The number of failed nail half moon extraction was 27 sheets.We confirmed that extraction accuracy of the subjects A, B, C, E and F were 60% or more, and that of the subjects D and G were 50% or less.Then, Table 3 shows the error rates by calculating the differences between manually selected results and the results by the proposed method.The error rates of the subject B, C, E and F were 5% or less.In the subjects A and D, the error rates were 9% or more.Furthermore, Figs. 6  and 7 show the successful and failure example results of the nail half moon extractions, respectively.In the subjects A-D, the skin region adjacent to the nail half moon was included in the nail half moon area.Since the skin region adjacent to the nail was often a white color, its hue value was similar to the nail half moon color.In the subjects B, C, D, E and G, nail half moon is extracted as a nail half moon in Fig. 7.These results can be caused by the problem due to trimming around the nail half moon.Since the maximum number of pixels of a binarized image was detected as a nail half moon, the non-nail half moon was detected as the nail half moon.Furthermore, the nail half moon was not detected, because the nail and skin region around the nail are similar in color.
Table 3. Error rates by caluculationg the differences between manually selected results and the results obtained by proposed method.

Conclusion
In this paper, we proposed the method to extract nail half moon for accumulation stress measurement.The proposed method consisted of nail half moon cutting, HSV color system conversion, and contour extraction.In the nail half moon cutting, images were clipped around the nail half moon automatically by fixing the photographic environment.In the HSV color system conversion, conversion to the HSV color system was carried out in order to binarize the clipped images by the hue value.In the outline detection of nail half moon, the nail half moon area was specified.The threshold values were automatically calculated on the basis of the histogram of the trimmed image.From the binary image, the part with the largest area was calculated by labeling and it was identified as the nail half moon part.Furthermore, the presence or absence of nail half moon was judged from the size of the confirmed nail half moon.In order to show the effectiveness of the proposed method, we conducted the experiments.In the experimental results, the extraction accuracy of the subjects A, B, C, E and F was 60% or more, that of the subjects D and G was 50% or less.In particular, the extraction accuracy of the subjects A and F was 80% or more.These results were relatively good.However, the extraction accuracy of the subjects D and G was 25% or less.These results suggested that it is necessary to further improve the trimming process around the nail half moon to improve the precision of nail half moon extraction．

Fig. 3 .
Fig. 3. HSV color system conversion.(a)-(d) are an input image, a hue image, a saturation image and a value image, respectively.

Table 2 .
Experimental results for detection of the nail half moon.