Skip to main content
Scientific Reports logoLink to Scientific Reports
. 2026 May 22;16:24185. doi: 10.1038/s41598-026-53742-7

Research on multi-stage deep learning based intelligent diagnosis of skin diseases and skin medicine diagnosis community construction concept

Junzhang Chen 1, Fapeng Cai 2,✉, Weizhe Ding 3, Dong Liang 4
PMCID: PMC13442873  PMID: 42168500

Abstract

Accurate diagnosis and assessment of the severity of skin diseases are essential for appropriate clinical treatment. This paper proposes a multi-stage intelligent diagnosis framework based on deep learning to assist dermatologists in decision-making in the early stage. It also puts forward a conceptual feasible model for developing an integrated self-service diagnosis and medication dispensing community in the future mature stage. The framework firstly adopts LeNet-5 convolutional neural network for preliminary classification of common skin diseases, and then performs secondary classification of disease severity and progression for selected representative conditions. Through manual annotation, clinical prior knowledge, including the predilectable location of the lesion, is incorporated into the framework to improve the reliability of the diagnosis. All images were preprocessed with grayscale conversion to reduce visual variability. Experimental results show that the performance of the proposed framework is stable and reliable, especially in the recognition tasks of disease severity and stage with obvious clinical manifestations. This hierarchical diagnostic strategy conforms to routine clinical workflows and holds potential as a tool for precise diagnosis and treatment planning in dermatology.

Keywords: Diagnosis of skin diseases, Deep learning, Grading of severity, Clinical decision support, Diagnosis-medication service community

Subject terms: Computational biology and bioinformatics, Diseases, Health care, Mathematics and computing, Medical research

Introduction

Human civilization is transitioning from a basic digital era into a new intelligent phase. The “AI+” paradigm is rapidly permeating and empowering virtually every aspect of social production and daily life. In particular, artificial intelligence (AI) has demonstrated remarkable potential in healthcare—especially in medical image analysis1–3, diagnostic assistance4–6, and clinical decision support7–10. However, the development and training of highly sophisticated deep learning models often entail substantial resource consumption, including high computational demands, extensive costs associated with large-scale data annotation and preprocessing, and significant requirements for electricity, specialized hardware, and human expertise. Consequently, as AI continues to integrate more deeply with medicine, achieving a balanced trade-off between technological advancement and socioeconomic efficiency remains a critical challenge that warrants careful consideration at the policy and design levels. In this context, AI applications characterized by high cost-effectiveness and relatively straightforward implementation pathways are better positioned as priority directions for development, enabling broader public benefit and optimal allocation of limited resources. With continuous advances in image recognition technologies11,12, and from a clinical perspective, cutaneous diseases—being superficial conditions—offer a natural entry point for AI deployment compared to high-risk, complex procedures such as open abdominal or cranial surgeries. Diagnosis of skin disorders heavily relies on visual features, making them particularly amenable to computer vision–based approaches.

Indeed, early-stage AI-assisted diagnosis systems based on dermoscopic or clinical skin images have already achieved promising accuracy. Recent studies have further demonstrated that convolutional neural networks (CNNs) can attain high diagnostic precision for specific skin cancers or individual dermatological conditions. Nevertheless, most existing methods remain limited to one or only a few disease types, lacking comprehensive modeling across the broad and heterogeneous spectrum of skin diseases. As a result, they fall short of meeting the real-world clinical demand for broad-spectrum intelligent diagnosis coupled with severity grading.

To address these limitations, this paper proposes a multi-stage deep learning framework for intelligent diagnosis and severity assessment of skin diseases. Our approach aims to develop a clinically interpretable and engineering-feasible model that aligns with actual medical workflows. The framework first performs coarse-grained classification across multiple disease categories; upon successful identification, it proceeds to a secondary stage that evaluates disease severity and progression—thereby emulating the standard clinical logic of “diagnose first, assess severity second, then guide treatment.” By integrating foundational principles from Dermatology and Venereology with expert clinical knowledge, we attempt to systematically model a wide range of common skin conditions, offering a computer-aided diagnostic solution that closely mirrors real-world practice.

During model development, we observed that diagnosing skin diseases is inherently complex: accurate judgment depends not only on lesion morphology but also on factors such as anatomical location, patient age and sex, and subjective symptoms like itching, pain, erythema, and swelling. Moreover, many dermatoses exhibit polymorphic manifestations across different stages of progression. This complexity fundamentally distinguishes skin disease diagnosis from tasks involving structural imaging modalities like CT13,14 or MRI, where pathologies (e.g., bone lesions) appear consistently against a stable background regardless of imaging distance or angle. Consequently, relying solely on image-derived features is often insufficient for reliable diagnosis.

To overcome this challenge, our framework incorporates human-in-the-loop annotation and leverages clinical prior knowledge—such as typical predilection sites for specific diseases—within a multi-stage recognition strategy. This stepwise refinement progressively narrows the differential diagnosis space, thereby enhancing both classification accuracy and severity stratification performance.

In summary, grounded in real clinical needs, this paper explores a resource-efficient, scalable, and clinically viable approach to intelligent skin disease diagnosis. It offers a novel methodological pathway and technical foundation for advancing the practical deployment of AI in dermatology and supporting the broader vision of precision medicine.

Diagnosis, identification, grading, and medication administration of skin diseases

With the continuous advancement of dermatological research, more than 2,000 distinct skin diseases have been identified to date. Their clinical differentiation relies on a rich set of visual and symptomatic cues: morphological features such as erythema, papules, vesicles, erosions, and scales; spatial attributes including lesion size, border clarity, distribution pattern, and anatomical location; color characteristics like redness, hyperpigmentation, or yellowish discoloration; and patient-reported subjective sensations such as heat, swelling, itching, or pain. In developing our diagnostic framework, we explicitly integrated these multidimensional clinical indicators. As an initial demonstration, we selected ten common skin conditions to illustrate the model’s design, aiming to establish a practical blueprint for future intelligent dermatological diagnosis systems. Notably, severe dermatoses and malignancies—including skin cancers—are deliberately excluded from this paper, as they typically require invasive procedures such as biopsies or laboratory tests and do not align with the envisioned scenario of a simple, pharmacy-based triage tool. Therefore, all diseases included in our framework are those that can be reasonably diagnosed based solely on non-invasive visual inspection and symptom reporting, without the need for further medical investigations.

The images in this study were diagnosed through joint evaluation by basic researchers and clinical dermatologists, with reference to authoritative books such as Dermatology and Venereology (8th Edition) and Atlas of Dermatology. The medication regimens summarized in this article are commonly used by local clinicians according to disease classification and severity.

Psoriasis

Diagnosis: psoriasis is a chronic autoimmune skin disorder characterized by well-demarcated erythematous plaques covered with silvery-white scales. Upon gentle scraping of the scales, a translucent (film) may appear, followed by pinpoint bleeding—known as the Auspitz sign—giving the lesions a “candle-drop” or waxy appearance. Lesions typically occur symmetrically on extensor surfaces such as the elbows, knees, and scalp, and may be accompanied by symptoms including pruritus, dryness, and nail changes (e.g., pitting or thickening).

Severity Grading: clinical management of psoriasis is often stratified according to disease severity and duration. Mild cases present with thin plaques, minimal erythema, and scant or absent scaling. Moderate cases feature thicker plaques with prominent redness and abundant scaling. Severe cases involve markedly thickened, sometimes exudative lesions, often associated with intense itching or pain.

Treatment Recommendations:for mild psoriasis, topical calcipotriol is recommended. If moderate disease shows significant improvement and transitions toward a mild state, treatment may be downgraded accordingly. Patients with mild-to-moderate psoriasis may also receive oral medications: loratadine (10 mg once daily), epiestin hydrochloride capsules (10–20 mg once daily, i.e., 1–2 tablets), and compound glycyrrhizin tablets (2–3 tablets three times daily). These may be combined with tripterygium glycosides tablets to suppress T-cell activation.For moderate psoriasis, a short-course “pulse” therapy with potent topical corticosteroids is advised—select one from: halometasone cream, clobetasol propionate ointment, or fluticasone propionate cream. In cases identified as severe, the system immediately issues a clinical alert and strongly advises the patient to seek prompt in-person evaluation at a hospital, as these cases fall beyond the scope of primary or pharmacy-level care.

Folliculitis

Diagnosis: folliculitis refers to an inflammatory response centered on the hair follicle and is broadly categorized into infectious and non-infectious types. It can occur at any site with hair follicles, most commonly on the scalp, face, buttocks, and thighs. Infectious folliculitis is typically caused by pathogenic microorganisms such as bacteria, fungi, or viruses, with Staphylococcus aureus being the most frequent bacterial culprit. Non-infectious forms may arise from follicular trauma, structural or metabolic abnormalities, or underlying immune dysregulation, all of which can predispose individuals to inflammation.

Severity Grading: given its variable clinical presentation, folliculitis warrants a tiered diagnostic and therapeutic approach based on severity. Mild cases involve one or a few inflamed follicles, presenting as small erythematous papules (diameter less than 5 mm) with or without a visible white or yellow pustule. Patients typically report only mild tenderness upon palpation, with no ulceration or exudate. Moderate cases affect multiple follicles, occasionally accompanied by low-grade fever. Individual pustules exceed 5 mm in diameter but remain under 5 cm, with clearly visible purulent content. Severe cases are characterized by extensive erythema (greater than 5 cm), confluent or densely clustered pustules, persistent purulent discharge, and potential progression to deep abscess formation or cellulitis, often associated with significant pain.

Treatment Recommendations:for mild folliculitis, empirical therapy is guided by anatomical location: lesions on the face or scalp are initially managed as bacterial and treated with roxithromycin ointment; those on the chest, back, or inguinal regions are presumed fungal and treated with ketoconazole shampoo. Adjunctive oral therapy includes Zhenhuang tablets (two tablets three times daily), amikacin wash solution, and recombinant bovine basic fibroblast growth factor (bFGF) gel—applied topically to stimulate fibroblast proliferation and accelerate epidermal regeneration around affected follicles. Moderate cases are treated with fusidic acid cream topically, combined with oral cefixime (100 mg twice daily). Ultraviolet phototherapy is recommended, and patients should be advised to seek clinical evaluation. In severe cases, the system immediately triggers a clinical alert. Initial topical management includes ichthyol (ammonium bituminosulfonate) ointment; however, if symptoms cannot be controlled, patients must be urgently referred to a hospital for further care, as incision and drainage may be necessary.

Atopic dermatitis/eczema

Diagnosis: eczema is a chronic inflammatory skin condition commonly presenting with dryness, erythema, intense pruritus, scaling, and occasionally vesicular eruptions. The persistent and often severe itching frequently leads to scratching, which can cause excoriation, sleep disruption, reduced work productivity, and significant discomfort. Affected skin typically sheds fine white or yellowish-brown scales, further exacerbating the patient’s distress.

Severity Classification and Staging: given its variable course—ranging from acute flares to chronic persistence—eczema requires stage-specific management. Subacute eczema is characterized by well-demarcated erythematous patches covered with dense papules, crusts, and scales. Repeated scratching often results in lichenification (skin thickening due to chronic inflammation). Acute eczema presents with prominent exudation, erosion, fissuring, and intense, unrelenting pruritus. Scratching may lead to bleeding or secondary bacterial infection, significantly worsening the clinical picture.

Treatment Recommendations:for subacute eczema with lichenification, a short-course “pulse” therapy using a potent topical corticosteroid is recommended to reduce epidermal thickening. Corticosteroids exert their effect by suppressing collagen synthesis, inhibiting keratinocyte proliferation, and modulating local metabolism—thereby promoting thinning of hyperplastic skin. Specifically, halometasone/triclosan cream is applied thickly for a limited duration, followed by transition to milder therapy: triamcinolone acetonide–isoconazole cream for maintenance. In acute eczema with oozing or exposed erosions, initial management includes wet compresses with 3% boric acid solution (applied for 15 minutes, two to three times daily) to dry lesions and reduce inflammation, combined with oral loratadine (10 mg once daily) to control pruritus. Once exudation subsides and the condition stabilizes, treatment shifts to the subacute regimen described above.

Flat wart

Diagnosis: this skin condition is caused by infection with human papillomavirus (HPV) and represents a type of common wart—specifically, flat warts (verruca plana). It is a benign, proliferative epidermal lesion. The hallmark clinical feature is the appearance of multiple small, flat-topped papules on the skin surface. These lesions are slightly elevated, smooth, and typically flesh-colored, light brown, or pale pink. They most commonly occur on the face (especially the cheeks and forehead), dorsum of the hands, and forearms. Transmission occurs through direct or indirect skin-to-skin contact, and the lesions are contagious.

Treatment Recommendations:first-line topical therapy includes tretinoin cream combined with compound neomycin B ointment. Oral lentinan polysaccharide tablets (10 mg twice daily, one tablet per dose) may be used as an immunomodulatory adjunct. In more persistent or extensive cases, imiquimod cream can be added; due to its immunostimulatory effect and the contagious nature of the lesions, patients should wear disposable gloves during application and discard them immediately afterward to prevent autoinoculation or transmission. For lesions located on the hands or legs—where rapid clearance is often desired—cryotherapy with liquid nitrogen is recommended as a highly effective physical treatment.

Simple alopecia

Diagnosis:the condition is characterized by reduced hair density without a history of trauma or other external causes, manifesting as widening of the part line, localized or diffuse thinning, finer and softer hair texture, increased scalp visibility, excessive sebum production, and often accompanied by scalp pruritus or increased dandruff.

Treatment Recommendations:oral therapy includes compound glycyrrhizin tablets (25 mg per tablet), taken 1–2 tablets three times daily, along with either compound vitamin B complex (2 tablets three times daily) or vitamin B6 alone (10 mg per tablet, 1–2 tablets three times daily). In cases of significant hair loss, topical 2% minoxidil solution may be added—applied twice daily (morning and evening), 1 mL per application (approximately 6 sprays), directly to the affected scalp areas.

Herpes simplex virus

Diagnosis: the condition presents as clusters of small, raised vesicles (1–3 mm in diameter) on the skin surface, often accompanied by a burning or stabbing pain. Depending on the viral subtype, herpes simplex virus type 1 (HSV-1) typically affects the lips or perioral region, whereas HSV-2 is predominantly associated with genital lesions.

Treatment Recommendations:oral valacyclovir hydrochloride: 300 mg twice daily for 7 consecutive days. Topical acyclovir cream: applied directly to the affected area 3–4 times per day.

Nodules and acne

Diagnosis: this condition involves deep inflammatory reactions within the skin, manifesting as subcutaneous nodules and cysts. It is often accompanied by erythema, tenderness, and post-inflammatory scarring. The pathogenesis is closely linked to abnormalities in sebaceous lipid metabolism, which explains its frequent occurrence in individuals with oily skin. Lesions typically appear on the face—especially the cheeks, forehead, and jawline—and may extend to the trunk, including the anterior chest, upper back, and scapular regions. The condition most commonly arises during adolescence.

Severity Classification:mild to moderate cases are characterized by comedones (blackheads and whiteheads), minor follicular plugging, and localized subcutaneous firm nodules. Inflammatory papules with surrounding erythema, swelling, and occasional small amounts of purulent discharge may be present. Lesions are typically hard on palpation and tender to pressure. Severe cases involve numerous nodules and cysts (greater than 5 mm in diameter) filled with pus; some exhibit visible yellowish pustular heads. Inflammation may extend deep into the dermis or subcutis, leading to interconnected, indurated plaques. These lesions frequently result in permanent scarring after resolution.

Treatment Recommendations:for mild-to-moderate acne, Oral isotretinoin capsules (10 mg per capsule): 1 capsule twice daily (total 20 mg/day)—this dosage is appropriate for a female patient weighing approximately 40 kg; dosing should be adjusted based on body weight for other patients. Contraindicated in pregnancy; patients must avoid conception for at least six months after treatment and have no history of liver disease. Roxithromycin sustained-release capsules (150 mg per capsule): 2 capsules once daily to suppress excessive collagen deposition and minimize scar formation. Zhenhuang tablets: 2 tablets three times daily. Vitamin B6 tablets (10 mg each): 1–2 tablets three times daily to help regulate sebum production and metabolic balance. Amikacin wash solution: used to cleanse the affected area before applying topical medication. Fusidic acid cream: applied topically as directed.

Rosacea

Diagnosis: This condition primarily affects the central face—most prominently the nasal tip and alae, followed by the cheeks, chin, and forehead—and typically presents with symmetrical distribution. Key clinical features include persistent central erythema, visible telangiectasia (prominent facial blood vessels), and inflammatory lesions such as papules, pustules, and, in advanced cases, tissue hypertrophy. Patients often report recurrent flares and chronicity.

Treatment Recommendations:oral isotretinoin capsules: Dosed according to body weight at approximately 25 mg per 50 kg of body weight, divided into two daily doses and administered over a course of 6–8 weeks. Note: This medication is contraindicated in pregnancy; patients must avoid conception for at least six months after treatment. A suitable dose is indicated by mild lip dryness without fissuring—exceeding the recommended dosage must be strictly avoided due to risk of toxicity. Roxithromycin capsules: 2 capsules (150 mg each) once daily to modulate inflammation and reduce the risk of fibrosis or scarring. Topical vitamin B6 ointment: applied as needed for skin barrier support and sebum regulation. Zhenhuang tablets: 2 tablets three times daily. Amikacin wash solution: used to cleanse the affected area prior to topical medication application.

Pityriasis rosea

Diagnosis: The condition presents with 2–4 cm oval or round “herald patches” that are pink to rose-colored, often slightly raised, and covered with fine, bran-like (pityriasiform) scaling. These lesions typically appear on the trunk and proximal extremities. Mild pruritus may accompany the rash in some cases.

Treatment Recommendations:Oral cetirizine hydrochloride: 10 mg once daily. Oral loratadine (formulated with goji berry extract): 10 mg once daily. Topical povidone-iodine solution: applied thickly to affected areas twice daily (morning and evening). Use of a dampness-dispelling and anti-itch herbal wash (e.g., Chushi Zhiyang Wash) to cleanse the skin prior to applying topical medication. Fluticasone propionate cream: applied topically as directed to reduce inflammation and scaling.

Contact dermatitis

Diagnosis: The condition presents as localized inflammatory skin reactions—including erythema, edema with swelling, and eruption of papules—occurring at the site of contact with an external substance. In some cases, the inflammation may extend beyond the immediate contact area to involve surrounding skin.

Treatment Recommendations:Oral loratadine tablets: 10 mg once daily. Recombinant bovine basic fibroblast growth factor (bFGF) gel: applied once daily at a dose of 300 IU per cm² of affected area. Prior to application, the lesion should be gently cleansed; an appropriate amount of gel is then spread evenly over the area and covered with a sterile dressing for simple occlusion. Mometasone furoate cream: applied topically as directed to reduce inflammation and itching.

Learning methods for computer image recognition

Convolutional neural network LeNet-5

LeNet-515–19 is a pioneering convolutional neural network (CNN) architecture inspired by the biological visual system. Its core principle lies in sparse connectivity through local receptive fields, enabling efficient extraction of local spatial features from input data—such as images. Unlike fully connected networks, LeNet-5 connects each neuron only to a small local region of the preceding layer, significantly reducing the total number of parameters. The model comprises three fundamental components: convolutional layers, pooling layers, and fully connected layers. Convolutional layers apply learnable filters that slide across the input to produce feature maps capturing specific local patterns—such as edges or textures. Pooling layers (e.g., max pooling) downsample these feature maps, lowering spatial dimensions, decreasing computational load, and enhancing translation invariance. Finally, fully connected layers integrate high-level features for classification. The original LeNet-5 design features two alternating convolution-pooling blocks followed by two fully connected layers, and it achieved early success in handwritten character recognition with minimal preprocessing.

Experimental setup

Dataset acquisition: 400 case images provided by the First People’s Hospital of Neijiang are used, covering various health states and lesion types. Preprocessing: All case images are uniformly resized to 64 × 64 pixel grayscale images, and the pixel values are normalized to the [0,1] range. Network parameter settings: An improved LeNet-5 structure is adopted, consisting of four convolutional layers and four max-pooling layers (arranged alternately), followed by two fully connected layers. The convolutional kernel sizes are 5 × 5 (32 channels), 3 × 3 (64 channels), 3 × 3 (128 channels), and 3 × 3 (256 channels), respectively. All pooling layers are 2 × 2 with a stride of 1, and zero‑padding is used to preserve the feature map size. Before the fully connected layers, a Squeeze‑and‑Excitation (SE) module is embedded: global average pooling produces a channel descriptor, which then passes through two fully connected layers (reduction ratio r=16, ReLU activation) and a sigmoid function to generate channel weights, performing weighted calibration on the convolutional outputs. The numbers of neurons in the two fully connected layers are 2560 and 768, respectively.

Datasets

Ten datasets were used in this study, which included images of local patients and follow-up records of clinical medication prescriptions by local dermatologists in Neijiang. All methods were carried out in accordance with relevant guidelines and regulations. All experimental protocols were approved by the First People’s Hospital of Neijiang . Informed consent was obtained from all subjects prior to their inclusion in the study.

During the data preprocessing stage, all original dermatological images were converted to grayscale to mitigate the adverse effects of illumination variations and color inconsistencies on model training. This grayscale transformation helps emphasize structural details and textural patterns of skin lesions while simultaneously reducing input dimensionality, thereby enhancing training stability and accelerating convergence. Additionally, all images were resized to a uniform dimension to meet the input requirements of the LeNet-5 architecture. Through these preprocessing steps, the model’s capacity to learn discriminative features from skin lesion images was effectively improved—preserving essential diagnostic information while laying a solid foundation for subsequent primary classification and secondary recognition experiments. The skin intelligent diagnosis mode is shown in Fig. 1.

Fig. 1.

Fig. 1

The skin intelligent diagnosis mode.

Results and analysis

Experimental results on one-level classification of cases

In the first level of recognition according to disease category, we used LeNet-5, EfficientNet, MobileNetV4 and VGG to classify and identify 10 common skin diseases respectively. Figures 2, 3, and 4 show that the recognition accuracy of the proposed LeNet-5 model is the highest, reaching 86.67%, which is significantly better than the other three comparison methods.

Fig. 2.

Fig. 2

LeNet-5 results for identifying skin diseases.

Fig. 3.

Fig. 3

EfficientNet results for identifying skin diseases.

Fig. 4.

Fig. 4

VGG results for identifying skin diseases.

In the first recognition experiment, 24 images of each type of disease are used for training and 6 images are used for validation. The results of the confusion matrix of LeNet-5 show that the self-recognition probabilities of most categories are more than 0.86, and Atopic Dermatitis, Flat Warts reached 1.00, indicating that the model could completely classify the samples of this category correctly. Categories such as Contact Dermatitis, Flat Warts, and Folliculitis also showed high classification confidence, with generally low off-diagonal elements and little confusion between categories. Finally, LeNet-5 achieves an overall accuracy of 86.67% in the recognition of 10 common skin diseases, which is significantly better than EfficientNet (61.67%), VGG (51.67%) and MobileNetV4 (21.67%, since this result belows 50% is completely meaningless, relevant figure is omitted from the main text.), which fully verifies the effectiveness and superiority of the proposed network structure.

Figure 5 presents the confusion matrix results of the proposed model based on LeNet‑5 with manual annotation (MA) on the 10‑class skin disease classification task. Specifically, flat warts, simple alopecia, contact dermatitis, atopic dermatitis, and psoriasis achieved a classification accuracy of 100%, indicating that the model can effectively learn the key features of these diseases. Furthermore, contact dermatitis (83%), folliculitis (86.84%), pityriasis rosea (83.87%), and rosacea nose (86.84%) also obtained relatively high and stable recognition results. However, for the category such as herpes simplex (75%) and nodular acne (67%), the overall accuracy is relatively low, likely due to certain ambiguities in manual annotation, reflecting the impact of class imbalance on model performance. The manual annotation (MA) achieved a high accuracy of 89.57%, implying that with a larger future data volume, more case uploads from participating physicians, and the involvement of computer vision experts in image recognition, the intelligent diagnosis system holds great promise for translation and deployment in skin care pharmaceutical consortium stores, thereby providing round‑the‑clock intelligent convenience for patients with mild‑to‑moderate skin conditions to seek medical consultation and obtain medication.

Fig. 5.

Fig. 5

Results of LeNet-5+MA skin disease classification.

Experimental results on two-level classification of cases

In order to achieve precision medicine and intelligent diagnosis and treatment of skin diseases, we carried out the second-level identification and classification of the disease degree. By entering the next identification process in the first-level identification, the diagnosis rate of four common skin diseases (psoriasis, nodule and acne, folliculitis, atopic dermatitis and eczema) with large differences in each degree representation (Figs. 6, 7, 8, and 9). The results show that the effect is significant.

Fig. 6.

Fig. 6

Results of psoriasis classification.

Fig. 7.

Fig. 7

Results of nodules and acne classification.

Fig. 8.

Fig. 8

Results of folliculitis classification.

Fig. 9.

Fig. 9

Results of grading of atopic dermatitis and eczema classification.

Figure 6 illustrates the performance of the LeNet-5 model on a three-class severity classification task for psoriasis (low, mid, and high). Both the low and high severity categories achieved 100% classification accuracy, demonstrating the model’s strong ability to discern distinct clinical features associated with more pronounced disease states. In contrast, the mid-severity class exhibited minor misclassifications, with a few samples incorrectly assigned to the mid category, slightly reducing its individual accuracy—though it remained relatively high overall. The model attained a total accuracy of 83.3% across all severity levels, underscoring its reliability and feasibility within a multi-stage intelligent diagnostic pipeline and highlighting its potential to support precise, severity-based assessment of skin diseases.

The confusion matrices in Figs. 7, 8, and 9 present the LeNet-5 model’s performance on secondary severity and stage classification tasks across various skin diseases. In the binary classification task distinguishing high severity from the combined mid and low categories, all predictions fall precisely on the main diagonal, achieving 100% accuracy for both classes (Fig. 7). This indicates that the model effectively captures the pronounced morphological and textural differences between severe lesions and milder forms. When extended to a more challenging three-class severity task (high, mid, low), overall accuracy decreased to 66.7% (Fig. 8). While the model maintained perfect recognition (100%) for the high severity class, some confusion emerged between mid and low categories—reflecting their visual similarity and clinical continuity, which is consistent with real-world diagnostic challenges where mild and moderate lesions often exhibit overlapping features. Finally, in the binary classification of disease phases—acute versus subacute—the model achieved flawless performance with 100% accuracy and no cross-category errors (Fig. 9). This demonstrates its strong capacity to discern the distinct inflammatory patterns and lesion characteristics associated with different stages of disease progression.

Conclusion

In this paper, we propose a multi-stage intelligent skin disease diagnosis framework based on the LeNet-5 model. The experimental results show that this method can effectively perform the preliminary classification of diseases and the recognition of disease severity and degree. By combining deep learning-based image features with manual annotations containing clinical prior knowledge, the overall diagnostic accuracy was improved. Especially in the secondary classification experiments of representative skin diseases such as psoriasis, acne nodosa, folliculitis, and atopic dermatitis with eczema, the method showed reliable performance in distinguishing disease severity and progression stage. This hierarchical diagnostic strategy is highly consistent with the actual clinical workflow and provides meaningful support for accurate diagnosis and treatment decision-making in dermatology.

Future work will continue to follow up on disease color, including patients’ complaints of disease sensory radio, and expand the dataset to include larger scale and more diverse clinical cases to further improve the covariates, diagnosis rate, and generalization ability of the model. We will explore more advanced deep learning architectures and multimodal information, such as clinical metadata and time course data, to enhance the robustness of diagnosis. In addition, we will work on translating the proposed framework into a practical clinical decision support system that can be applied in actual dermatology clinical practice and contribute to the development of intelligent precision medicine.

Application transformation

The development and training of highly sophisticated, deep artificial intelligence systems entail substantial computational, financial, and human resources. From an economic perspective, AI applications with high cost-effectiveness and clear public benefit are more likely to be prioritized for real-world deployment. In medicine, for instance, compared to high-risk, complex surgical interventions such as laparotomy or craniotomy20, cutaneous diseases—being superficial and visually assessable—represent an ideal frontier for early AI integration21.

Building on this rationale, we propose a novel integrated dermatological diagnosis-and-dispensing pharmacy model—a smart, community-oriented “dermatology-pharmacy co-clinic.” Early studies on online image-based skin disease diagnosis have already reported accuracy rates of up to 76%. Our enhanced system goes further by incorporating manual annotations, structured patient interviews, symptom descriptions (including self-reported sensations), and real-world treatment patterns from clinicians across disease severity levels. This multimodal approach is expected to significantly improve both diagnostic accuracy and the appropriateness of therapeutic recommendations.

We acknowledge that our current computer-vision–based skin diagnosis prototype remains preliminary. However, our primary aim is not merely algorithmic performance but the introduction of a broader conceptual framework: the dermatology-pharmacy integrated care unit—a transformative model for retail pharmacy evolution. This physical entity merges AI-assisted diagnosis with automated medication dispensing, translating theoretical advances into tangible healthcare access.

To operationalize this vision, we present a schematic layout (Fig. 10) and workflow as follows:Upon arrival at the smart dermatology-pharmacy co-clinic, the patient enters the ground-floor consultation room on the left and closes the door. Automated louvers immediately shut for privacy. The patient then stands before a vertically mounted, height-adjustable camera column and presses a wall-mounted diagnostic button to expose the affected skin area. A voice-controlled camera captures high-resolution images from optimal angles. Leveraging a deep learning model trained on annotated clinical data, the system analyzes the lesion, identifies the condition and its severity, and generates a tailored treatment and medication recommendation. The patient can review the suggestion on a touchscreen, choose to accept part or all of the proposed regimen, or opt for immediate referral if severe disease is detected. If medication is selected, the patient dresses, proceeds to the right-side dispensing window on the ground floor, and waits. On the second floor, an automated drug storage compartment—equipped with a robotic arm under centralized control—retrieves the prescribed items, loads them into a pneumatic tube, and dispatches them downward. Upon hearing the audio cue “Medication ready,” the patient completes payment and collects the package, concluding the visit. For non-dermatological over-the-counter (OTC) needs, patients may directly use the touchscreen above the dispensing window (non-critical components omitted in the diagram), functioning like a standard self-service kiosk.

Fig. 10.

Fig. 10

Skin medicine diagnosis to the community pharmacy model.

In practical implementation, site selection will be critical to ensure accessibility and convenience. We will strategically locate these units based on foot traffic, demographic profiles, and proximity to hospitals or clinics22. The facility is designed as a two-story (or high-ceiling) space: the upper level houses the automated drug storage and robotic dispensing system23, while the lower level contains the unstaffed diagnostic booth and medication pickup zone. Interior configuration includes:One diagnostic computer, a custom-built vertical camera with motorized height adjustment, ten volumes of dermatologist interview notes documenting symptomatology and treatment experiences24, three authoritative textbooks on dermatology and venereology25,26, all textual and visual knowledge has been digitized and integrated into the AI system. The workflow proceeds as: patient information input (via voice or touchscreen) → image capture → AI diagnosis → prescription generation. Patients may also customize their orders—adding non-OTC items or removing specific medications from the suggested list—before finalizing. Post-launch, inventory management will be data-driven: monthly and weekly sales trends will inform restocking, product selection, and procurement planning, gradually building a dynamic demand database. Considering both clinical needs and energy efficiency, the unit will operate autonomously during daytime hours from 7:00 AM to 8:00 PM automatically powering on and unlocking at opening time. This schedule specifically addresses a critical gap: enabling working individuals to access dermatological assessment and medication conveniently during morning commutes or after work, thereby filling the void left by limited hospital dermatology emergency services. At the same time, it offers a viable, future-ready business model for the transformation of traditional retail pharmacies into intelligent, health-focused community hubs.

Acknowledgements

This study was especially grateful to engineer Xinyu Li for his assistance in revising the manuscript, to Dr. Yuliang Hu (Dermatology) for his diagnostic suggestions and patient imaging data, and to Dr. Liu, an anonymous physician from a clinic in Neijiang, Sichuan for his support.

Author contributions

J.C. and F.C. wrote the main manuscript text and W.D. and D.L. prepared figures 1-3. All authors reviewed the manuscript.

Funding

This work was no funding.

Data availability

The datasets used during the current study available from the corresponding author on reasonable request.

Declarations

Conflict of interest

The authors declared that we have no conflicts of interest to this work.

Ethical approval

The study protocol was approved by the Institutional Ethics Committee (approval number: NJYY-LL-2026-0228). Patient-related image data were anonymized to protect personal privacy.

Footnotes

Publisher’s note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

References

  • 1.Wang, J., Wang, S. & Zhang, Y. Deep learning on medical image analysis. CAAI Trans. Intell. Technol.10(1), 1–35 (2025). [Google Scholar]
  • 2.Bouslimi, R., Akaichi, J., Ayadi, M. G. & Hedhli, H. A medical collaboration network for medical image analysis. Netw. Model. Anal. Health Inform. Bioinform.5(1), 10 (2025). [Google Scholar]
  • 3.Guan, H., Yap, P. T., Bozoki, A. & Liu, M. Federated learning for medical image analysis: A survey. Pattern Recogn.151(000), 17 (2024). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 4.Tang, C. et al. Potential clinical significance of aldh3b1 in auxiliary diagnosis of gastric cancer. Biomark. Med.18(1), 15–23 (2024). [DOI] [PubMed] [Google Scholar]
  • 5.Wang, J. et al. Application of image enhancement in the auxiliary diagnosis of oral potentially malignant disorders. Clin. Oral Investigations29(5), 270 (2025). [DOI] [PubMed] [Google Scholar]
  • 6.Wang, X. et al. Author correction: Thyronet-x4 genesis: An advanced deep learning model for auxiliary diagnosis of thyroid nodules’ malignancy. Sci. Rep.15(1), 4214 (2025). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 7.Quinn, C. Ai and clinical decision support. Artif. Intell. Med. 255–284 (2024).
  • 8.Gershov, S., Raz, A., Karpas, E. & Laufer, S. Towards an autonomous clinical decision support system. Eng. Appl. Artif. Intell.127(PartA), 9 (2024). [Google Scholar]
  • 9.Karthik, K., Sowmya, K. S., Supreetha, R. & Katlam, A. Content-based medical retrieval systems with evidence-based diagnosis for enhanced clinical decision support. Expert Sys. Appl.272, 126678 (2025). [Google Scholar]
  • 10.Cuzzocrea, A., Folino, F., Pontieri, L., Sabatino, P. & Samami, M. Toward trustworthy and sustainable clinical decision support by training ensembles of specialized logistic regressors. Neural Comput. Appl.37(22), 18233–18274 (2025). [Google Scholar]
  • 11.Drgulinescu, A. Optical correlators for cryptosystems and image recognition: A review. Sensors23(2), 907 (2023). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 12.Feighelstein, M., Shimshoni, I., Finka, L.R., Luna, S.P.L., Mills, D.S., Zamansky, A.: Automated recognition of pain in cats. Scientific Reports [DOI] [PMC free article] [PubMed]
  • 13.Dayarathna, S. et al. Deep learning based synthesis of MRI, CT and pet: Review and analysis. Med. Image Anal.92, 103046 (2024). [DOI] [PubMed] [Google Scholar]
  • 14.Kwak, D., Choi, J. & Lee, S. Rethinking breast cancer diagnosis through deep learning based image recognition. Sensors23(4), 2307 (2023). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 15.Dong, X. et al. Convolutional neural network models of structural MRI for discriminating categories of cognitive impairment: a systematic review and meta-analysis. BMC Neurol.25(1), 400 (2025). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 16.Chen, X., Zhou, C., Zhu, Y., Luo, M., Hu, L., Han, W., Zuo, C., Li, Z., Xiao, H., Huang, S., et al.: Detecting glaucoma in highly myopic eyes from fundus photographs using deep convolutional neural networks. Clinical & Experimental Ophthalmology (2025). [DOI] [PMC free article] [PubMed]
  • 17.Maganti, S. et al. A novel hybrid deep learning model for segmentation and uzzy res-lenet based classification for Alzheimer’s disease. Neurogenetics26(1), 1–24 (2025). [DOI] [PubMed] [Google Scholar]
  • 18.Queiroz, I., Defante, M.L., Barbosa, L.M., Tavares, A.H., Pimentel, T., Mendes, B.X.: A systematic review and meta-analysis on the performance of convolutional neural networks ECGS in the diagnosis of hypertrophic cardiomyopathy. Journal of Electrocardiology, 153888 (2025) [DOI] [PubMed]
  • 19.Raza, A., Ali, A., Ullah, S., Anjum, Y. N. & Rehman, B. Optimizing skin cancer screening with convolutional neural networks in smart healthcare systems. PLoS One20(3), 0317181 (2025). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 20.Rassweiler, J. J. et al. Future of robotic surgery in urology. BJU Int.120(6), 822–841 (2017). [DOI] [PubMed] [Google Scholar]
  • 21.Li, X., Zhao, X., Ma, H. & Xie, B. Image analysis and diagnosis of skin diseases-a review. Curr. Med. Imaging Rev.19(3), 199–242 (2023). [DOI] [PubMed] [Google Scholar]
  • 22.Grootendorst, P. Pharmacy location and medical need: regional evidence from Canada. BMC Health Serv. Res.22(1), 1309 (2022). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 23.Flesher, S. N. et al. A brain-computer interface that evokes tactile sensations improves robotic arm control. Science372(6544), 831–836 (2021). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 24.Bolognia, J.L.: Pioneers in dermatology and venereology: An interview with professor jean l. Bolognia. Journal of the European Academy of Dermatology & Venereology 36(12) (2022). [DOI] [PubMed]
  • 25.Habif, T.: Clinical dermatology: A color guide to diagnosis and therapy. Mosby (1990).
  • 26.Mccoll, I. Rook’s textbook of dermatology. Australas. J. Dermatol.46(3), 206–206 (2005). [Google Scholar]

Associated Data

This section collects any data citations, data availability statements, or supplementary materials included in this article.

Data Availability Statement

The datasets used during the current study available from the corresponding author on reasonable request.


Articles from Scientific Reports are provided here courtesy of Nature Publishing Group

RESOURCES