Segmentation and Feature Extraction of Fingernail Plate and Lunula Based on Deep Learning

Yu Fan, Mengxiang You, Jieyu Ge, Guangtao Zhai, Sijia WangbioRxiv 2024

Abstract

This paper proposes a novel deep learning method for accurate segmentation of the fingernail plate and lunula. To achieve this, we designed a new network structure called NailNet, which segments the fingernail from images of the whole hand. The results show that NailNet achieved an Intersection over Union (IoU) score of 0.9529 and an accuracy of 0.9725 for fingernail plate segmentation. For lunula segmentation, NailNet achieved an IoU score of 0.7784 and an accuracy of 0.8846. Additionally, NailNet successfully recognized the fingernail index, enabling the extraction of various fingernail phenotypes, including plate color, plate shape, lunula color, and lunula proportion.

Introduction

The appearance of human fingernails serves as a significant indicator of systemic health. Clinical conditions such as anemia, liver cirrhosis, diabetes, and Wilson’s disease often manifest through observable changes in nail color, shape, or the visibility of the lunula (the crescent-shaped white area at the base of the nail). While clinicians have historically utilized these phenotypes for diagnostic purposes, automating their extraction has proven challenging.

Traditional computer vision techniques, such as k-means clustering or watershed segmentation, often struggle with the subtle color gradients and varied lighting conditions inherent in real-world hand photography. Furthermore, most existing models lack the capability to distinguish between specific fingers (e.g., thumb vs. pinky), a requirement for standardized medical records and forensic applications. This paper introduces NailNet to address these limitations through high-precision segmentation and automated finger identification.

Methodology

NailNet is a multi-task deep learning architecture built upon the DeepLabv3+ framework. To optimize the model for the specific task of nail segmentation, several key architectural modifications were implemented:

  1. Backbone Optimization: The standard ResNet101 backbone was replaced with a leaner ResNet50. Given that nail images are less complex than general natural scenes, this change reduced the parameter count without compromising segmentation accuracy.
  2. Depthwise Separable Convolutions: These were integrated into the Atrous Spatial Pyramid Pooling (ASPP) module to significantly decrease computational overhead.
  3. Feature Fusion: A feature pyramid network (FPN) structure was designed to bridge the gap between high-level semantic features and low-level spatial details, which is critical for defining the fine boundaries of the lunula.
  4. Dual-Head Output: NailNet incorporates a parallel classification head alongside the segmentation head. This allows the model to simultaneously predict the "finger index" and generate precise segmentation masks.
NailNet architecture and processing workflow.

The overall workflow follows a two-step process. First, a rough segmentation identifies the general nail area from a full-hand image. Subsequently, this region is cropped to a 300x300 pixel image for refined analysis by the NailNet architecture.

Dataset

A significant contribution of this research is the creation of a large-scale, high-quality fingernail dataset. The dataset comprises 6,250 high-resolution nail photos captured from a natural population using SLR cameras. Each image was manually annotated to mark the precise boundaries of both the nail plate and the lunula. Rigorous quality control was applied to exclude images with motion blur, significant reflections, or those featuring nail polish and physical damage, ensuring a high-fidelity training signal.

Results and Discussion

NailNet demonstrated superior performance compared to several standard convolutional neural network (CNN) architectures.

Performance Metrics

The model achieved an Intersection over Union (IoU) of 0.9529 and an accuracy of 0.9725 for nail plate segmentation. Lunula segmentation, a more challenging task due to low contrast and its position within the nail plate, reached an IoU of 0.7784 and an accuracy of 0.8846. In terms of finger classification, NailNet achieved an accuracy of 98.62%, surpassing larger models like those based on ResNet101.

Comparison of NailNet performance against other standard backbones.

Key Insights

  • Loss Function Balancing: The researchers identified that a weight of $\lambda = 0.75$ in the loss function provided the optimal balance between segmentation and classification tasks.
  • Efficiency: The use of depthwise separable convolutions reduced the model's parameter size by over 40% compared to standard architectures while maintaining or improving performance.
  • Phenotype Extraction: Beyond segmentation, the model enables the automated extraction of quantitative phenotypes, including the lunula-to-plate area ratio, regional color distribution, and geometric shape analysis.

Conclusion

NailNet provides a robust framework for the automated analysis of fingernail phenotypes. While the model performs exceptionally well, future work will address challenges related to finger occlusion in hand images and the extraction of surface textures, such as ridges or pitting. Ultimately, this technology aims to facilitate large-scale studies correlating fingernail phenotypes with genetic markers and systemic health conditions.

Reference: Segmentation and Feature Extraction of Fingernail Plate and Lunula Based on Deep Learning. (2024). bioRxiv preprint.

Summary updated

BibTeX
@misc{fan2024segmentation,
  author = {Yu Fan and Mengxiang You and Jieyu Ge and Guangtao Zhai and Sijia Wang},
  title = {{Segmentation and Feature Extraction of Fingernail Plate and Lunula Based on Deep Learning}},
  year = {2024},
  doi = {10.1101/2024.07.26.605289},
  howpublished = {bioRxiv},
}
Figure