A method, system, device and medium for intelligent detection of nail health
Patent Information
- Application Number
- CN202611010790.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-08
- Publication Date
- 2026-10-27
AI Technical Summary
第一,现有方案多采用传统图像处理算法进行指甲区域分割,对光照条件、背景复杂度和拍摄角度较为敏感,在自然拍摄条件下容易出现指甲区域定位不准确的问题,导致后续分类识别精度下降
本申请通过YOLOv8n网络与EfficientNet-B0网络的级联配合,实现了指甲区域的自动精准定位与健康状态的智能多分类,用户无需手动框选,使用门槛低,适合非专业人士操作;全部图像采集、检测、分类流程均在树莓派等嵌入式端侧设备本地完成,不联网、不上云,充分保障了用户隐私数据安全,且不受网络环境影响,可随时随地使用;通过以检测框为基准向外扩展裁剪并结合双线性插值保持宽高比的标准化处理,有效保留了指甲边缘、甲床、甲沟等关键分类特征,提升了分类精度;设置检测置信度与分类置信度两级过滤机制,只有当两者均满足预设阈值时才输出结果,否则提示重新拍摄,大幅降低了误检率和误判率,使检测结果更加可靠;采用INT8量化与TensorRT Lite对双模型进行压缩加速,模型整体体积可降至10MB以内,端到端延迟低于110ms,单帧检测速度不低于28FPS,兼顾了轻量化与高效推理;整套方案基于低成本嵌入式硬件搭建,体积小、功耗低、便于携带,适合家庭自检与基层医疗卫生机构普及使用,具有良好的社会推广价值。
Smart Images

Figure CN122989557A_ABST
Abstract
Description
Technical Field
[0001] This document relates to the fields of image processing and health detection technology, and in particular to a method, system, device and medium for intelligent nail health detection. Background Technology
[0002] As an appendage of the skin, the nails' color, shape, and texture can reflect a person's nutritional status and early signs of certain diseases to some extent. For example, onychomycosis (commonly known as fungal nail infection) manifests as thickened, discolored, and cloudy nails; longitudinal melanonychia presents as longitudinal black streaks on the nail surface; psoriatic nail pitting presents as pitted spots on the nail surface; and clubbing presents as swollen fingertips and increased nail curvature. Early detection and timely intervention of these abnormal nail changes are of great significance for the prevention and treatment of related diseases.
[0003] However, traditional nail health testing mainly relies on visual observation by dermatologists or the use of specialized equipment such as dermoscopy. This method not only requires patients to visit medical institutions, which is time-consuming, but also the test results are highly dependent on the doctor's clinical experience and subjective judgment, making it difficult to achieve standardization and large-scale screening. With the rapid development of mobile terminals and embedded devices, some image processing-based nail health testing solutions have been proposed, but these solutions generally suffer from the following problems: First, existing solutions mostly use traditional image processing algorithms for nail region segmentation, which are quite sensitive to lighting conditions, background complexity, and shooting angle. Under natural shooting conditions, the nail region is prone to inaccurate localization, leading to a decrease in the accuracy of subsequent classification and recognition.
[0004] Secondly, most existing nail health classification models are deployed on cloud servers. Users need to upload the nail images they take to the cloud for processing. This not only poses a risk of user privacy data leakage, but also relies on network connections, making it difficult to achieve real-time detection in grassroots communities, homes, and other scenarios.
[0005] Third, the existing scheme lacks an effective confidence verification mechanism between the two stages of nail region detection and health classification. When the input image is blurry or the nail region is not accurately located, it will still output unreliable classification results, which can easily lead to misjudgment.
[0006] Fourth, existing lightweight detection solutions often struggle to achieve a good balance between model accuracy and inference speed. Either the model size is too large to be deployed on resource-constrained embedded devices, or the inference speed is too slow to meet real-time detection requirements.
[0007] Therefore, how to achieve precise positioning of the nail area and accurate classification of nail health status on embedded edge devices, while ensuring the security of user privacy data, reducing the false judgment rate and meeting the needs of real-time detection, has become a technical problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0008] This specification provides one or more embodiments of a method for intelligent nail health detection, including: S1. Acquire the RGB image of the finger or toe to be detected, and preprocess the RGB image; S2. Input the preprocessed image into the target detection network, detect and locate the fingernail region in the image, and output at least one fingernail detection box for locating the fingernail region and its corresponding detection confidence. S3. Based on the nail detection box, crop the nail region image from the preprocessed image, and perform standardization processing on the nail region image to obtain a standardized nail image; S4. Input the standardized nail image into the classification network, identify the nail health status, and output the classification result of the health status and the corresponding classification confidence. S5. Perform a double reset confidence check based on the detection confidence output by the target detection network and the classification confidence output by the classification network. If both the detection confidence and the classification confidence meet the preset threshold conditions, output the classification result; otherwise, output a re-shooting prompt message.
[0009] Furthermore, the preprocessing includes: The RGB image is scaled to a first predetermined size, Gaussian filtering is used to remove image noise, and pixel values are normalized by mapping from 0 to 255 to the 0 to 1 range.
[0010] Furthermore, the target detection network is a YOLOv8n network, which includes a backbone network, a neck multi-scale fusion network, and a detection head; The backbone network consists of multiple C2f modules stacked in series, which extract shallow texture, edge features and deep semantic features of the image by downsampling layer by layer; The neck multi-scale fusion network adopts the PANet bidirectional multi-scale fusion structure, which fuses feature maps of different scales through upsampling, downsampling and feature concatenation operations. The detection head is used to output target classification information, bounding box coordinate information, and detection confidence in parallel.
[0011] Furthermore, after the target detection network outputs the fingernail detection bounding box, it also performs a post-processing filtering step: Non-maximum suppression is used to remove duplicate detection boxes, filter regions with a detection confidence level lower than the first confidence threshold, and filter abnormal detection boxes whose aspect ratio is not within a predetermined range.
[0012] Furthermore, when cropping the nail area image, the nail detection frame is expanded outward by a predetermined proportion to avoid truncating the nail edge features; The standardization process includes: Scale the cropped nail area image to a second predetermined size; To achieve size uniformity, the cropped nail area image is scaled to 224×224 pixels using bilinear interpolation while maintaining the original aspect ratio, and blank areas are filled with black. Pixel normalization is performed on the RGB three channels according to the ImageNet general standard.
[0013] Furthermore, the classification network is an EfficientNet-B0 network, which includes basic convolutional layers, multiple sets of MBConv feature extraction modules, feature fusion layers, and a custom classification head; The custom classification head includes a global average pooling layer, a Dropout layer, and an N-class fully connected layer. The softmax function outputs the multi-class probability of nail health status, and the maximum probability is taken as the classification result. The maximum probability corresponds to the classification confidence. The dropout rate of the Dropout layer is set to 0.5.
[0014] Furthermore, the EfficientNet-B0 network is trained using transfer learning, with a batch size of 16, employing the Adam optimizer, and using multi-class cross-entropy loss as the loss function, specifically including: Initialize all network parameters with ImageNet pre-trained weights, and input dataset consists of labeled multi-class nail images; In the first stage, the parameters of the first N layers of the network are frozen, and only the tail feature layer and the custom classification head are trained. The initial learning rate is set to 0.001, the total number of training iterations is 50, and the learning rate is dynamically decayed using a cosine annealing strategy. In the second stage, all network parameters are unfrozen for global fine-tuning. The initial learning rate is set to 0.0001, and the total number of training iterations is 30. Cosine annealing is used to decay the learning rate, reducing the update amplitude of basic feature weights and avoiding damage to general image features.
[0015] This specification provides one or more embodiments of a nail health intelligent detection system, including: Image processing module: used to acquire RGB images of the fingers or toes to be detected, and to preprocess the RGB images; The target detection module is used to input the preprocessed image into the target detection network, detect and locate the fingernail region in the image, and output at least one fingernail detection box for locating the fingernail region and its corresponding detection confidence score. Image cropping module: used to crop the nail region image from the preprocessed image based on the nail detection box, and to standardize the nail region image to obtain a standardized nail image; Image classification module: used to input the standardized nail image into the classification network, identify the nail health status, and output the classification result of the health status and the corresponding classification confidence; Classification verification module: used to perform double-reset confidence verification based on the detection confidence output by the target detection network and the classification confidence output by the classification network. If both the detection confidence and the classification confidence meet the preset threshold conditions, the classification result is output; otherwise, a re-shooting prompt message is output.
[0016] This specification provides one or more embodiments of an electronic device, including: Processor; and, A memory is configured to store computer-executable instructions, which, when executed, cause the processor to implement the steps of the above-described intelligent nail health detection method.
[0017] This specification provides one or more embodiments of a storage medium for storing computer-executable instructions that, when executed, implement the steps of the above-described intelligent nail health detection method.
[0018] This invention, through the cascaded cooperation of the YOLOv8n network and the EfficientNet-B0 network, achieves automatic and accurate localization of the nail region and intelligent multi-classification of its health status. Users do not need to manually select areas, making it easy to use and suitable for non-professionals. By using the detection box as a reference for outward expansion and cropping, combined with bilinear interpolation to maintain the aspect ratio, key classification features such as the nail edge, nail bed, and nail groove are effectively preserved, improving classification accuracy. A two-level filtering mechanism of detection confidence and classification confidence is set up, outputting results only when both meet preset thresholds; otherwise, a re-shoot is prompted, significantly reducing the false detection and misjudgment rates and making the detection results more reliable. Built on low-cost embedded hardware, it is small in size, low in power consumption, and portable, suitable for home self-testing and widespread use in primary healthcare institutions, possessing significant social promotion value.
[0019] The above description is merely an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention and to implement it in accordance with the contents of the specification, and in order to make the above and other objects, features and advantages of the present invention more apparent and understandable, specific embodiments of the present invention are described below. Attached Figure Description
[0020] To more clearly illustrate the technical solutions in one or more embodiments of this specification or in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this specification. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0021] Figure 1 A flowchart illustrating a smart nail health detection method provided in one or more embodiments of this specification; Figure 2 A schematic diagram illustrating the composition of a nail health intelligent detection system provided in one or more embodiments of this specification; Figure 3 This is a schematic diagram of an electronic device structure provided for one or more embodiments of this specification. Detailed Implementation
[0022] To enable those skilled in the art to better understand the technical solutions in one or more embodiments of this specification, the technical solutions in one or more embodiments of this specification will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this specification, and not all of the embodiments. Based on one or more embodiments of this specification, all other embodiments obtained by those skilled in the art without creative effort should fall within the protection scope of this document.
[0023] Method Implementation Examples According to embodiments of the present invention, a method for intelligent detection of nail health is provided. Figure 1 A flowchart illustrating a smart nail health detection method provided in one or more embodiments of this specification is shown below. Figure 1 As shown, the nail health intelligent detection method according to an embodiment of the present invention specifically includes: S1. Acquire the RGB image of the finger or toe to be detected, and preprocess the RGB image.
[0024] An RGB image refers to a color digital image represented using a three-channel color model of Red, Green, and Blue. In this embodiment, the RGB image is obtained by a USB industrial camera capturing images of a user's fingers or toes in a natural state. The image resolution is set to 1080P, and the frame rate is set to 30FPS. USB (Universal Serial Bus) is a standardized external device connection interface. The industrial camera connects to an embedded processing device (such as a Raspberry Pi) via the USB interface, directly transmitting the captured image data to the embedded processing device for local processing. The entire acquisition and transmission process does not transmit any data to an external network, thus fully protecting the user's privacy and data security.
[0025] After image acquisition, the original RGB image is preprocessed, including: First, scaling the original RGB image to a first predetermined size. In this embodiment, the first predetermined size is preferably 640×640 pixels. Image scaling adjusts the original image to the input size required by the model; in this embodiment, bilinear interpolation is preferably used for scaling. Second, Gaussian filtering is used to remove random noise introduced during image acquisition due to sensor thermal noise, uneven lighting, etc., thereby improving image quality. Finally, pixel value normalization is performed, mapping pixel values from the integer range of 0 to 255 to the floating-point range of 0 to 1 for normalization, improving the stability of subsequent model detection.
[0026] S2. Input the preprocessed image into the target detection network, detect and locate the fingernail region in the image, and output at least one fingernail detection box for locating the fingernail region and its corresponding detection confidence.
[0027] In this embodiment of the application, the target detection network adopts the YOLOv8n network. YOLOv8n is an ultra-lightweight version of the YOLOv8 series. The overall architecture of the network consists of three parts: the backbone network, the neck multi-scale fusion network, and the head.
[0028] The backbone network is the fundamental feature extraction component of the YOLOv8n network, composed of multiple stacked C2f modules across different stages. The C2f module is the core feature extraction unit in YOLOv8n, reducing computational cost while maintaining strong feature representation by segmenting the feature map along the channel dimension, processing each segment separately, and then fusing them. As the network depth increases, the backbone network performs a layer-by-layer downsampling operation; that is, after each C2f module, the spatial size of the feature map is halved while the number of channels is doubled, progressively extracting image features from shallow to deep layers. Shallow features have higher resolution and contain more image details, such as the curved edges of the nail, surface texture, and nail groove contours; deep features have lower resolution but contain richer semantic information, such as the overall shape of the nail and its contrast with the surrounding skin.
[0029] The Neck Multi-Scale Fusion Network (Neck) employs a bidirectional multi-scale fusion structure using the PANet path aggregation network. In real-world images, fingernails vary significantly in size, making it difficult for single-scale feature maps to simultaneously accommodate the detection needs of targets of different sizes. The PANet structure achieves bidirectional fusion of three layers of feature maps at different scales (80×80, 40×40, and 20×20) through upsampling, downsampling, and feature concatenation. Specifically, the top-down path transfers deep semantic information to shallow feature maps, enhancing their semantic expressiveness; the bottom-up path transfers shallow positional information to deep feature maps, enhancing their spatial localization capabilities. Through bidirectional multi-scale fusion, the Neck network effectively enhances the edge features and local texture representation of small fingernails while suppressing interference from irrelevant background features such as palms, knuckles, and clothing, thus improving the detection accuracy of small fingernails.
[0030] The detection head is the output part of the YOLOv8n network, which is used to output three types of prediction information in parallel: target classification information, that is, predicting whether the detection box contains a fingernail; bounding box coordinate information, that is, predicting the center coordinates x and y, width w and height h of the detection box; and detection confidence, that is, predicting the probability that the detection box contains a real target.
[0031] The YOLOv8n network training employs a transfer learning strategy, loading pre-trained weights from the publicly available COCO object detection dataset as initial parameters. Fine-tuning is then performed on a self-built nail image dataset, using Mosaic random stitching, horizontal flipping, and color perturbation for data augmentation. Training is divided into two phases: the first phase freezes all parameters of the backbone network, training only the neck network and the detection head. This phase iterates for 30 epochs, using cosine annealing to decay the learning rate, with an initial learning rate of 0.001. The second phase unfreezes all network parameters for global fine-tuning, also iterating for 30 epochs, using cosine annealing to dynamically decay the learning rate. The loss function is jointly optimized using the Cross-Intersection over Union (CIoU) loss and the classification cross-entropy loss. Based on the traditional CIoU loss, two penalty terms—center distance and aspect ratio consistency—are introduced to more accurately measure the difference between the predicted and ground truth bounding boxes, accelerating the convergence of bounding box regression. The classification cross-entropy loss is used for classification tasks, measuring the difference between the model's predicted class probability distribution and the true class label. The weighted sum of the two loss functions is used as the total loss for backpropagation, achieving end-to-end optimization of the detection task. After the YOLOv8n network outputs the fingernail detection boxes, a post-processing filtering step is performed, including: using non-maximum suppression (NMS) to remove duplicate detection boxes, that is, sorting all detection boxes from high to low detection confidence, selecting the detection box with the highest confidence as the retained box, then calculating the intersection-union ratio (IoU) between the remaining detection boxes and the retained box, and considering detection boxes with an IoU greater than a preset threshold as duplicate boxes and removing them. The above process is repeated for the remaining detection boxes until all detection boxes have been processed. In this embodiment, the IoU threshold for non-maximum suppression is set to 0.5. Regions with detection confidence lower than a first confidence threshold are filtered out. Detection confidence is a value between 0 and 1 output by the YOLOv8n network, representing the probability that the detection box contains a real target. In this embodiment, the first confidence threshold is set to 0.7, that is, only detection boxes with a detection confidence of not less than 0.7 are retained, and regions with a detection confidence lower than 0.7 are filtered out. Third, abnormal detection boxes with aspect ratios outside the predetermined range are filtered out. If the aspect ratio of a certain detection box is too large or too small, the detection box is likely to correspond to the knuckle, the edge of the palm or other non-nail area. In this embodiment, the predetermined range of aspect ratio is set to 0.6 to 1.5.
[0032] S3. Based on the nail detection box, crop the nail region image from the preprocessed image, and perform standardization processing on the nail region image to obtain a standardized nail image.
[0033] In this embodiment, after the target detection network outputs valid nail detection boxes, the corresponding nail region image needs to be cropped from the original image based on these detection boxes. When cropping the nail region image, the nail detection boxes are expanded outward by a predetermined proportion. In actual images, the edge region of the nail, including structures such as the nail bed and nail groove, contains rich pathological feature information. If the cropping is strictly based on the boundary of the detection box, the edge features may be truncated. Therefore, in this embodiment, the width and height are expanded outward by 5% based on the detection box during cropping.
[0034] After cropping, the cropped nail area image needs to be standardized, specifically including: The cropped nail area image is scaled to a second predetermined size. In this embodiment, the second predetermined size is preferably 224×224 pixels. During scaling, a bilinear interpolation algorithm is used, which calculates a weighted average of the grayscale values of the four nearest neighbor pixels surrounding the target pixel to avoid distortions such as jagged edges or blurring. The original aspect ratio is maintained during scaling, meaning the image is scaled proportionally to its original dimensions to ensure the nail shape is not stretched or compressed. Since the image may not perfectly fill the 224×224 pixel rectangular area after scaling while maintaining the original aspect ratio, blank areas are filled with black pixels with a value of 0.
[0035] Pixel normalization is performed on the RGB three channels according to the ImageNet standard. In this embodiment, the mean and standard deviation of the ImageNet dataset are used to normalize the RGB three channels respectively. Specifically, for each pixel value, it is first divided by 255 to map it to the 0~1 range, then the mean of the corresponding channel is subtracted, and finally divided by the standard deviation of the corresponding channel. Through this normalization process, the pixel value distribution of the input image is adjusted to a distribution range similar to that of the ImageNet dataset.
[0036] S4. Input the standardized nail image into the classification network, identify the nail health status, and output the classification result of the health status and the corresponding classification confidence.
[0037] In this embodiment, the classification network uses the EfficientNet-B0 network. The overall structure of the EfficientNet-B0 network includes basic convolutional layers, multiple MBConv feature extraction modules, a feature fusion layer, and a custom classification head. The basic convolutional layers use 3×3 convolutional kernels for downsampling, outputting a 32-channel feature map, coupled with batch normalization and the Swish activation function. Sixteen MBConv feature extraction modules are stacked after the basic convolutional layers. The MBConv module is the core building block of the EfficientNet network. Each MBConv module contains, in sequence: a 1×1 upscaling convolution, a 3×3 depthwise separable convolution, an SE channel attention module, and a 1×1 downscaling convolution. A 1×1 convolution at the end upscales the feature map to 1280 channels, followed by a global average pooling layer to compress the spatial dimension. The custom classification head is sequentially connected to a Dropout layer with a dropout rate of 0.5 and a 5-class fully connected layer. The 5-class fully connected layer maps the 1280-dimensional feature vector to a 5-dimensional output vector, corresponding to five categories: healthy nails, onychomycosis, longitudinal melanonychia, psoriatic nail pitting, and clubbing. The Softmax function transforms the 5-dimensional output vector into a probability distribution, exponentially normalizing the output value for each category so that the sum of the probabilities of all categories is 1, with each category's probability value ranging from 0 to 1. The category with the highest probability is taken as the final classification result; this maximum probability value is the classification confidence score.
[0038] The EfficientNet-B0 network is trained using transfer learning with a batch size of 16. It employs the Adam optimizer and a multi-class cross-entropy loss function. Specifically, the training process includes: initializing all network parameters with ImageNet pre-trained weights, using labeled multi-class nail images as the input dataset; freezing the first N layers of network parameters in the first stage, training only the tail feature layer and a custom classification head, setting an initial learning rate of 0.001, and conducting 50 training iterations, dynamically decaying the learning rate using cosine annealing; and unfreezing all network parameters in the second stage for global fine-tuning, setting an initial learning rate of 0.0001, conducting 30 training iterations, and simultaneously using cosine annealing to decay the learning rate, reducing the update magnitude of basic feature weights and avoiding damage to general image features.
[0039] S5. Perform a double reset confidence check based on the detection confidence output by the target detection network and the classification confidence output by the classification network. If both the detection confidence and the classification confidence meet the preset threshold conditions, output the classification result; otherwise, output a re-shooting prompt message.
[0040] In this embodiment, the preset threshold for detection confidence is set to 0.7, and the preset threshold for classification confidence is set to 0.8, meaning that the detection confidence is required to be no less than 0.7 and the classification confidence is required to be no less than 0.8. When both the detection confidence and classification confidence are at least 0.7 and 0.8, the two threshold conditions are met simultaneously, and the system outputs a classification result, namely, a category among healthy nails, onychomycosis, longitudinal melanonychia, psoriatic nail pitting, or clubbing of the fingers, and its corresponding classification confidence. When either the detection confidence is less than 0.7 or the classification confidence is less than 0.8, neither of the two threshold conditions is met, and a "Blurred Image / Please Retake" message is output, suggesting that the user retake a clearer and more standardized nail image for detection.
[0041] Furthermore, in this embodiment, all the above detection steps can be completed locally on the embedded device, without needing an internet connection or uploading user data to a cloud server. Specifically, the method in this embodiment can be deployed on embedded single-board computers such as Raspberry Pi. To achieve efficient inference on the embedded device, this embodiment uses INT8 quantization and TensorRT Lite to compress the YOLOv8n and EfficientNet-B0 networks. INT8 quantization refers to converting model weights and activation values from 32-bit floating-point numbers (FP32) to 8-bit integers (INT8). Quantization technology reduces the storage width of each value, compressing the model size to about one-quarter of its original size. Simultaneously, since integer operations are faster than floating-point operations, the inference speed of the quantized model is significantly improved. TensorRT Lite is a high-performance deep learning inference optimizer for edge computing devices launched by NVIDIA. It further improves the inference efficiency of models on embedded devices through layer fusion, tensor format optimization, and automatic kernel tuning. After INT8 quantization and TensorRT Lite optimization, the overall model size of the YOLOv8n network and the EfficientNet-B0 network can be reduced to less than 10MB, which fully meets the storage space limitations of embedded devices.
[0042] The beneficial effects of this invention are as follows: This application achieves automatic and accurate localization of the nail region and intelligent multi-classification of its health status through the cascaded cooperation of the YOLOv8n network and the EfficientNet-B0 network. Users do not need to manually select the area, making it easy to use and suitable for non-professionals. All image acquisition, detection, and classification processes are completed locally on embedded edge devices such as Raspberry Pi, without internet or cloud access, fully protecting user privacy and data security, and unaffected by network conditions, allowing for use anytime, anywhere. By using a standardized process that extends and crops the detection box outwards and combines bilinear interpolation to maintain the aspect ratio, key classification features such as the nail edge, nail bed, and nail groove are effectively preserved, improving classification accuracy. A two-level filtering mechanism of detection confidence and classification confidence is implemented, outputting results only when both meet preset thresholds; otherwise, a re-image is prompted, significantly reducing false detection and misjudgment rates and making the detection results more reliable. INT8 quantization and TensorRT are employed. Lite compresses and accelerates the dual models, reducing the overall model size to less than 10MB, with end-to-end latency below 110ms and single-frame detection speed of no less than 28FPS, balancing lightweight design with efficient inference. The entire solution is built on low-cost embedded hardware, is small in size, low in power consumption, and easy to carry, making it suitable for home self-testing and widespread use in primary healthcare institutions, and has good social promotion value.
[0043] System Implementation Examples According to embodiments of the present invention, a nail health intelligent detection system is provided. Figure 2 This is a schematic diagram illustrating the composition of a nail health intelligent detection system provided in one or more embodiments of this specification, such as... Figure 2 As shown, the nail health intelligent detection system according to an embodiment of the present invention specifically includes: Image processing module 20: used to acquire RGB images of the fingers or toes to be detected, and to preprocess the RGB images; Target detection module 22: is used to input the preprocessed image into the target detection network, detect and locate the fingernail region in the image, and output at least one fingernail detection box for locating the fingernail region and its corresponding detection confidence. Image cropping module 24: used to crop the nail region image from the preprocessed image based on the nail detection box, and to perform standardization processing on the nail region image to obtain a standardized nail image; Image classification module 26: used to input the standardized nail image into the classification network, identify the nail health status, and output the classification result of the health status and the corresponding classification confidence. Classification verification module 28: It is used to perform double reset confidence verification based on the detection confidence output by the target detection network and the classification confidence output by the classification network. If both the detection confidence and the classification confidence meet the preset threshold conditions, the classification result is output; otherwise, a re-shooting prompt message is output.
[0044] The embodiments of the present invention are system embodiments corresponding to the above method embodiments. The specific operation of each module can be understood by referring to the description of the method embodiments, and will not be repeated here.
[0045] Device Example 1 This invention provides an electronic device, such as... Figure 3 As shown, it includes: a memory 30, a processor 32, and a computer program stored in the memory 30 and executable on the processor 32. When the computer program is executed by the processor 32, it performs the following method steps: S1. Acquire the RGB image of the finger or toe to be detected, and preprocess the RGB image; S2. Input the preprocessed image into the target detection network, detect and locate the fingernail region in the image, and output at least one fingernail detection box for locating the fingernail region and its corresponding detection confidence. S3. Based on the nail detection box, crop the nail region image from the preprocessed image, and perform standardization processing on the nail region image to obtain a standardized nail image; S4. Input the standardized nail image into the classification network, identify the nail health status, and output the classification result of the health status and the corresponding classification confidence. S5. Perform a double reset confidence check based on the detection confidence output by the target detection network and the classification confidence output by the classification network. If both the detection confidence and the classification confidence meet the preset threshold conditions, output the classification result; otherwise, output a re-shooting prompt message.
[0046] Device Example 2 This invention provides a computer-readable storage medium storing an information transmission implementation program. When executed by a processor 32, the program performs the following method steps: S1. Acquire the RGB image of the finger or toe to be detected, and preprocess the RGB image; S2. Input the preprocessed image into the target detection network, detect and locate the fingernail region in the image, and output at least one fingernail detection box for locating the fingernail region and its corresponding detection confidence. S3. Based on the nail detection box, crop the nail region image from the preprocessed image, and perform standardization processing on the nail region image to obtain a standardized nail image; S4. Input the standardized nail image into the classification network, identify the nail health status, and output the classification result of the health status and the corresponding classification confidence. S5. Perform a double reset confidence check based on the detection confidence output by the target detection network and the classification confidence output by the classification network. If both the detection confidence and the classification confidence meet the preset threshold conditions, output the classification result; otherwise, output a re-shooting prompt message.
[0047] The computer-readable storage media described in this embodiment include, but are not limited to, ROM, RAM, disk, or optical disk.
[0048] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for intelligent detection of nail health, characterized in that, include: S1. Acquire the RGB image of the finger or toe to be detected, and preprocess the RGB image; S2. Input the preprocessed image into the target detection network, detect and locate the fingernail region in the image, and output at least one fingernail detection box for locating the fingernail region and its corresponding detection confidence. S3. Based on the nail detection box, crop the nail region image from the preprocessed image, and perform standardization processing on the nail region image to obtain a standardized nail image; S4. Input the standardized nail image into the classification network, identify the nail health status, and output the classification result of the health status and the corresponding classification confidence. S5. Perform a double reset confidence check based on the detection confidence output by the target detection network and the classification confidence output by the classification network. If both the detection confidence and the classification confidence meet the preset threshold conditions, output the classification result; otherwise, output a re-shooting prompt message.
2. The method according to claim 1, characterized in that, The preprocessing includes: The RGB image is scaled to a first predetermined size, Gaussian filtering is used to remove image noise, and pixel values are normalized by mapping from 0 to 255 to the 0 to 1 range.
3. The method according to claim 1, characterized in that, The target detection network is a YOLOv8n network, which includes a backbone network, a neck multi-scale fusion network, and a detection head. The backbone network consists of multiple C2f modules stacked in series, which extract shallow texture, edge features and deep semantic features of the image by downsampling layer by layer; The neck multi-scale fusion network adopts the PANet bidirectional multi-scale fusion structure, which fuses feature maps of different scales through upsampling, downsampling and feature concatenation operations. The detection head is used to output target classification information, bounding box coordinate information, and detection confidence in parallel.
4. The method according to claim 1, characterized in that, After the target detection network outputs the fingernail detection bounding box, a post-processing filtering step is also performed: Non-maximum suppression is used to remove duplicate detection boxes, filter regions with a detection confidence level lower than the first confidence threshold, and filter abnormal detection boxes whose aspect ratio is not within a predetermined range.
5. The method according to claim 1, characterized in that, When cropping the nail area image, the nail detection frame is expanded outward by a predetermined proportion to avoid truncating the nail edge features. The standardization process includes: Scale the cropped nail area image to a second predetermined size; To achieve size uniformity, the cropped nail area image is scaled to 224×224 pixels using bilinear interpolation while maintaining the original aspect ratio, and blank areas are filled with black. Pixel normalization is performed on the RGB three channels according to the ImageNet general standard.
6. The method according to claim 1, characterized in that, The classification network is the EfficientNet-B0 network, which includes basic convolutional layers, multiple MBConv feature extraction modules, feature fusion layers, and a custom classification head; The custom classification head includes a global average pooling layer, a Dropout layer, and an N-class fully connected layer. The softmax function outputs the multi-class probability of nail health status, and the maximum probability is taken as the classification result. The maximum probability corresponds to the classification confidence. The dropout rate of the Dropout layer is set to 0.
5.
7. The method according to claim 6, characterized in that, The EfficientNet-B0 network is trained using transfer learning with a batch size of 16. It employs the Adam optimizer and uses multi-class cross-entropy loss as the loss function, specifically including: Initialize all network parameters with ImageNet pre-trained weights, and input dataset consists of labeled multi-class nail images; In the first stage, the parameters of the first N layers of the network are frozen, and only the tail feature layer and the custom classification head are trained. The initial learning rate is set to 0.001, the total number of training iterations is 50, and the learning rate is dynamically decayed using a cosine annealing strategy. In the second stage, all network parameters are unfrozen for global fine-tuning. The initial learning rate is set to 0.0001, and the total number of training iterations is 30. Cosine annealing is used to decay the learning rate, reducing the update amplitude of basic feature weights and avoiding damage to general image features.
8. A nail health intelligent detection system, characterized in that, include: Image processing module: used to acquire RGB images of the fingers or toes to be detected, and to preprocess the RGB images; The target detection module is used to input the preprocessed image into the target detection network, detect and locate the fingernail region in the image, and output at least one fingernail detection box for locating the fingernail region and its corresponding detection confidence score. Image cropping module: used to crop the nail region image from the preprocessed image based on the nail detection box, and to perform standardization processing on the nail region image to obtain a standardized nail image; Image classification module: used to input the standardized nail image into the classification network, identify the nail health status, and output the classification result of the health status and the corresponding classification confidence; Classification verification module: used to perform double-reset confidence verification based on the detection confidence output by the target detection network and the classification confidence output by the classification network. If both the detection confidence and the classification confidence meet the preset threshold conditions, the classification result is output; otherwise, a re-shooting prompt message is output.
9. An electronic device, characterized in that, include: processor; as well as, A memory configured to store computer-executable instructions, which, when executed, cause the processor to implement the steps of the nail health intelligent detection method as described in any one of claims 1 to 7.
10. A storage medium, characterized in that, Used to store computer-executable instructions, which, when executed, implement the steps of the nail health intelligent detection method as described in any one of claims 1 to 7.