Skip to Content
BioengineeringBioengineering
  • Article
  • Open Access

27 August 2026

20 Pages

MorphoNet: An Interpretable Hierarchical Deep Learning Framework for Multi-Class Skin Lesion Classification Using Dermoscopic Morphology

,
,
and
1
Weston High School, 444 Wellesley St, Weston, MA 02493, USA
2
Phillips Academy, 7 Chapel Ave, Andover, MA 01810, USA
3
School of Advanced Manufacturing and Robotics, Peking University, Beijing 100871, China
*
Author to whom correspondence should be addressed.

Abstract

Accurate and interpretable classification of dermoscopic skin lesions remains challenging because lesion subtypes frequently exhibit overlapping visual characteristics, public datasets are highly imbalanced, and images acquired from different sources may present substantial domain variation. This study proposes MorphoNet, an interpretable two-stage deep learning framework for hierarchical skin lesion classification. A total of 16,845 dermoscopic images from HAM10000, ISIC 2019, and DERM12345 were integrated into eight diagnostic categories. In Stage 1, an EfficientNet-B4-based classifier distinguishes benign from malignant lesions. In Stage 2, separate classifiers identify four malignant and four benign subtypes. Quantitative asymmetry, border, color, and diameter descriptors are incorporated through an attention-guided feature fusion module, while correlation alignment regularization is used to reduce discrepancies in feature distribution across the three data sources. Experiments were repeated using three random seeds. MorphoNet achieved accuracies of 94.01 ± 0.50%, 89.05 ± 0.51%, and 91.84 ± 0.41%, with corresponding F1-scores of 93.70 ± 0.55%, 84.00 ± 1.00%, and 87.97 ± 1.13% for benign–malignant screening, malignant subtype classification, and benign subtype classification, respectively. Ablation analysis showed that the complete framework improved F1-score by 2.52–4.71 percentage points over the visual-only hierarchical EfficientNet-B4 model. MorphoNet also achieved higher numerical performance than ResNet-50, DenseNet-121, and image-only EfficientNet-B4 baselines trained under the same protocol. The learned attention profiles were consistent with clinically relevant morphological characteristics. These findings demonstrate the complementary value of hierarchical classification, ABCD-guided feature fusion, and domain alignment for interpretable multi-source skin lesion analysis, although independent multicenter clinical validation remains necessary.

1. Introduction

Skin cancer is one of the most common malignancies worldwide, with its incidence continuing to increase because of genetic susceptibility and more exposure to ultraviolet radiation [1,2]. Although melanoma represents only a small proportion of all skin cancer cases, it accounts for the majority of skin cancer-related deaths due to its aggressive metastatic potential. Globally, approximately 132,000 new melanoma cases and 2–3 million non-melanoma skin cancer cases are diagnosed annually [3], and both the incidence and mortality of melanoma are projected to increase substantially by 2040 [4]. Early detection is therefore critical. The five-year survival rate exceeds 95% when melanoma is diagnosed at an early stage but falls to below 15% after the disease has progressed to advanced stages [5,6,7]. For example, the early screening program in Schleswig-Holstein, Germany, from 2003 to 2004 reduced roughly 50% of all melanoma-related deaths within the following five years [8], while a similar program at the Lawrence Livermore National Laboratory in the US (1984–1996) led to zero melanomic deaths [9]. These findings have driven continued interest in developing accurate and clinically interpretable computer-aided methods for skin lesion assessment [10].
In clinical practice, dermatologists commonly evaluate lesion morphology using well-established diagnostic criteria, including the ABCD rule, the seven-point checklist, and the Menzies method [11,12,13,14]. Although these criteria provide clinically meaningful guidance, their interpretation remains highly dependent on physician experience and may be influenced by lesion heterogeneity, resulting in observer variability in diagnosis. Recent advances in deep learning, particularly convolutional neural networks (CNNs), have achieved strong performance in automated dermoscopic image classification [15,16,17,18,19]. However, most CNN-based models function largely as black boxes, providing little explanation of the morphological features that support their predictions. This limited interpretability remains a major barrier to clinical acceptance, despite their high classification accuracy.
Another challenge is fine-grained lesion classification. Conventional single-stage models generally perform well in distinguishing benign from malignant lesions but often have difficulty separating visually similar lesion subtypes, especially when class distributions are highly imbalanced. In addition, combining images from multiple public datasets introduces domain shifts caused by differences in imaging devices, acquisition protocols, and patient populations, reducing model robustness across datasets. These limitations indicate the need for a classification strategy that reflects the hierarchical nature of clinical diagnosis, incorporates established dermatologic knowledge, and maintains reliable performance across heterogeneous data sources.
To address these challenges, we propose MorphoNet, a hierarchical diagnostic strategy that combines dermoscopic features with deep neural networks for automated skin lesion classification. The motivation comes from three observations: (1) single-stage models often struggle with the complexity of multi-class categorizations, especially in imbalanced datasets [20]; (2) integrating dermoscopic features with data-driven deep learning can enhance both accuracy and interpretability [19,21], and (3) the inherent complexity and limited interpretability of CNNs render them “black-box” models and make it difficult to understand how they reach a diagnosis based on medical images. The following are the main contributions of this study:
  • A new two-stage identification CNN-based framework that first classifies lesions into benign or malignant, followed by subtype classification for benign and malignant lesions;
  • A novel integration strategy that combines CNN-extracted features with quantitative dermoscopic features at multiple stages, which is compared and validated on benchmark datasets (HAM10000 and ISIC);
  • Attention mechanisms learn interpretable feature weights for selected ABCD descriptors, thereby bridging the gap between established clinical assessment criteria and deep learning while improving the reliability, clinical relevance, and classification performance of the CAD framework.
The remaining parts of the paper are organized as follows: Section 2 discusses the relevant work related to the present research, Section 3 explains the collected data and detailed methodology, Section 4 provides results and discussions, and Section 5 presents the conclusions and important contributions of the work, as well as recommendations for future work and improvement.

3. Materials and Methods

3.1. Dataset Construction

The dataset used in this study was constructed from three publicly available dermoscopic image datasets: HAM10000, ISIC 2019, and DERM12345. HAM10000 is a multi-source dermoscopic dataset containing 10,015 images from seven common pigmented lesion categories. DERM12345 is a multi-source dataset comprising 12,345 high-resolution dermoscopic images from 1627 patients and covering 40 lesion subclasses. In the present study, 503 DERM12345 images corresponding to the unified target categories were retained, including 266 SCC, 58 AKIEC, and 179 DF images. After dataset integration, a total of 16,845 dermoscopic images were included. The final dataset contained eight lesion categories: melanoma (MEL), basal cell carcinoma (BCC), actinic keratoses (AKIEC), squamous cell carcinoma (SCC), melanocytic nevi (NV), benign keratosis-like lesions (BKL), dermatofibroma (DF), and vascular lesions (VASC). The class-wise distribution of the integrated dataset across the three public sources is summarized in Table 1. For benign–malignant classification in Stage 1, NV, BKL, DF, and VASC were assigned to the benign group, while MEL, BCC, AKIEC, and SCC were assigned to the malignant group. Representative dermoscopic images of the eight lesion categories are shown in Figure 1.
Table 1. Class-wise distribution of the images used in this study.
Figure 1. Representative dermoscopic images of malignant and benign lesion subtypes.
Before model development, image identifiers were standardized across datasets, and duplicate records were removed. The integrated dataset was divided into training, validation, and test subsets at the patient level using a stratified 80:10:10 ratio. All images belonging to the same patient were assigned exclusively to one subset, thereby preventing patient-level overlap among the training, validation, and test sets. Stratification was performed according to lesion category as far as possible while preserving patient grouping. After splitting, patient identifiers and image identifiers were cross-checked across the three subsets, and no overlap was detected. Data augmentation, weighted sampling, and other class-balancing procedures were applied only to the training set, whereas the validation and test sets retained their original distributions.
To improve representation consistency across the integrated multi-source dataset, CORAL domain alignment was introduced during training. This regularization encourages the model to learn source-invariant feature representations while preserving diagnostic information for lesion classification.

3.2. Development of MorphoNet Model

The proposed MorphoNet framework is shown in Figure 2. MorphoNet is a two-stage EfficientNet-B4-based model that combines CNN-extracted features with quantitative ABCD dermoscopic descriptors, including asymmetry, border irregularity, color variance, and diameter-related features. In Stage 1, the model performs benign–malignant classification. In Stage 2, two specialized branches further classify malignant lesions into MEL, BCC, AKIEC, and SCC, and benign lesions into NV, BKL, DF, and VASC. An attention mechanism learns specific weights for the ABCD descriptors, and the weighted morphological features are fused with EfficientNet-B4 visual features before classification.
Figure 2. Architecture of the proposed MorphoNet model.

3.2.1. Data Preprocessing and Augmentation

Data preprocessing was applied to improve input consistency, reduce image-level noise, and emphasize regions containing diagnostically relevant lesion details. Together with augmentation and class balancing, preprocessing could reduce overfitting and improve model stability [42,43,44].
Before training the MorphoNet model, the input images underwent the following preprocessing methods:
Resizing: The images were resized to 380 by 380 pixels, the input dimensions required for EfficientNet-B4.
Rescale: Pixel values were converted to PyTorch format and rescaled to the range [0, 1] for numerical stability.
Normalization: Pixel values were normalized using the channel-wise mean and standard deviation.
After preprocessing, two data augmentation techniques, MixUp and CutMix, were employed within the training set to improve generalization and mitigate overfitting. Validation and test images were not augmented. Class-balancing strategies were applied after data splitting and only within the training set. Class imbalance was addressed using inverse-frequency weighted random sampling within the training set, which increased the sampling probability of underrepresented lesion categories. Validation and test samples were not resampled, and standard cross-entropy loss was used for model optimization. MixUp performs global linear interpolation to improve generalization, whereas CutMix maintains spatial structure through localized region replacement and provides strong regularization. MixUp constructs new training samples through random combinations of image-label pairs [45]. Given the batch of image { X i } i = 1 N and its corresponding labels { Y i } i = 1 N , the MixUp algorithm generates augmented samples as X i ~ = λ · X i + ( 1 − λ ) · X π ( i ) and Y i ~ = λ · Y i + ( 1 − λ ) · Y π ( i ) , where π is the random permutation function among samples, and λ is sampled from the Beta distribution β(0.2, 0.2).
For CutMix data augmentation, two random training images were selected, and a random patch was cut from one image and pasted into the other, with the mixed label determined by the area proportions in the final image [46]. CutMix was stochastically applied with 20% probability during training iterations and was not applied to validation or test images.

3.2.2. Feature Fusion Between EfficientNet Features and ABCD Features

To incorporate clinically meaningful dermoscopic information into the deep learning pipeline, each image was processed by both a CNN branch and an ABCD feature branch. The CNN branch extracted visual information from EfficientNet-B4, whereas the ABCD branch extracted features specific to the ABCD rule (Table 2). Different ABCD features were selected at each stage according to the corresponding feature extractor. The attention mechanism was configured accordingly.
Table 2. ABCD features used in Stage 1 and Stage 2 models.
Asymmetrical shape is one of the important indicators for cancerous skin [19]. In this research, asymmetrical features were found using a grayscale image and Otsu’s thresholding. The binary mask of the largest contour was calculated, as well as its area, perimeter, and center coordinates, using a contour approximation and polygon filling algorithm. The lesion was then divided into left, right, top, and bottom halves, and the horizontal and vertical asymmetry features were calculated as normalized absolute differences between the sums of each respective region. The asymmetry ratio between horizontal and vertical quantifies the directional preference of asymmetry, while the asymmetry entropy measures the uncertainty in the overall asymmetrical distribution of the skin lesion.
Border irregularity is a critical diagnostic criterion for melanoma detection. The perimeter-to-area ratio measures the roughness relative to the lesion size, while boundary complexity compares the convex hull perimeter to the actual perimeter to detect jagged edges. Circularity and compactness evaluate the shape regularity by calculating how close the lesion shape is to a perfect circle and how efficiently its area is enclosed within its perimeter. Fractal dimension captures the self-similarity of the border, with higher values indicating more irregular boundaries and lower values indicating regularity.
Color features in this research comprehensively analyze color variation and distribution among both RGB (red, green, and blue) and HSV (hue, saturation, and brightness) color spaces to detect the irregular pigmentation of skin lesions. The color entropy value was further computed for each RGB channel, while a diversity index assessed the overall color heterogeneity by averaging the variance across the RGB channels.
The diameter component was inspired by the clinical D criterion of the ABCD rule. In the implementation, diameter-related features were calculated in image space. The lesion contour was fitted with an ellipse, and the major-axis length was measured in pixels and normalized by the diagonal length of the corresponding image. Therefore, these descriptors quantify relative lesion extent and do not represent an absolute clinical measurement in millimeters.
MorphoNet implements a dual-branch neural network that separately processes visual features through EfficientNet-B4 and dermoscopic descriptors through the ABCD feature branch (Figure 3). EfficientNet-B4 generates a high-dimensional visual embedding that captures lesion morphology, color, and texture patterns from the input image. In parallel, the ABCD branch produces a vector of stage-specific quantitative dermoscopic features. The attention module learns feature-wise weights for the ABCD vector, producing weighted ABCD features that emphasize diagnostically informative descriptors. The weighted ABCD representation is then fused with the EfficientNet-B4 visual embedding and passed through fully connected classification layers with normalization and dropout. The same fusion principle is applied to Stage 1 and both Stage 2 subtype classifiers, while each stage learns its own task-specific ABCD attention weights.
Figure 3. Feature fusion and class prediction in the Stage 1 model using EfficientNetB4.

3.2.3. Attention Mechanism for ABCD Feature Weights

To better interpret the model results, an attention mechanism was deployed to learn which of the ABCD features are diagnostically important. Given all ABCD features f , the attention weights are computed through a two-layer network:
w f = σ ( w 2 × t a n h ( w 1 × f + b 1 ) + b 2 ) ,
w ^ f = 23 × w f ∑ i = 1 23 w f ,
where w 1 and w 2 are learnable weight matrices, b 1 and b 2 are bias vectors, and σ is the sigmoid function ensuring the w f is within [ 0 , 1 ] 23 for ABCD features. The weights w f were normalized by their sum to preserve their relative importance, and the attended features f ′ were obtained through element-wise multiplication:
f ′ = f ⊙ w ^ f ,
where ⊙ is the Hadamard product. Values near 1 in w f indicate important features while values near 0 indicate irrelevant features.
At the start of training, the weight matrices ( w 1 and w s ) were randomly initialized using Kaiming initialization, and bias vector ( b 1 ) was initialized as zeros. During each training iteration, the attention weights w f were calculated in the forward pass by passing input features through learned weight matrices, and then the weight matrices were updated through backpropagation to minimize classification loss, causing the model to automatically learn the attention weights of discriminative features to improve prediction accuracy.

3.2.4. CORAL Domain Alignment

Although HAM10000, ISIC 2019, and DERM12345 were jointly integrated into the training dataset, these public dermoscopic image sources may still differ in imaging conditions, acquisition devices, color distribution, image resolution, and class composition. Such inter-dataset heterogeneity may cause the model to learn dataset-specific feature patterns rather than lesion-related diagnostic features. To reduce this dataset-source bias, CORAL regularization was introduced at the feature embedding level. CORAL encourages feature representations from different data sources to share similar second-order statistics by minimizing the distance between their covariance matrices.
The total training loss was defined as L t o t a l = L c l s + λ L C O R A L , where L c l s denotes the classification loss, L C O R A L denotes the CORAL regularization loss, and λ controls the contribution of domain alignment. The CORAL weight was selected using the validation set from candidate values of 0.01, 0.05, 0.1, and 0.2. A value of ( λ = 0.1) provided the best overall validation macro-F1 across the three classification tasks and was therefore fixed for all final experiments. The test set was not used during this selection process.

3.2.5. Ablation Study Design

To quantify the individual contributions of the ABCD-guided feature fusion module and CORAL-based domain alignment, a component-wise ablation study was conducted using three model configurations. All configurations retained the same two-stage hierarchical classification strategy, EfficientNet-B4 backbone, data partitions, preprocessing procedures, augmentation strategies, class-balancing method, optimization settings, and model selection criteria. Therefore, differences in performance could be attributed primarily to the inclusion of the ABCD and CORAL components rather than to changes in the backbone architecture or experimental protocol.
The first configuration, referred to as the visual-only hierarchical baseline, used only the image features extracted by EfficientNet-B4 and excluded both the ABCD feature branch and CORAL regularization.
The second configuration, denoted as EfficientNet-B4 + ABCD, incorporated the quantitative ABCD descriptors through the same attention-guided feature fusion module used in MorphoNet, but CORAL regularization was disabled by setting its loss weight to zero. This configuration was used to isolate the contribution of clinically informed morphological feature fusion.
The third configuration was the complete MorphoNet model, which combined EfficientNet-B4 visual representations, attention-weighted ABCD descriptors, and CORAL-based domain alignment. The CORAL weight was set to 0.1, consistent with the final model configuration.
Each configuration was independently trained for Stage 1 benign–malignant screening, Stage 2 malignant subtype classification, and Stage 2 benign subtype classification. All experiments were repeated using the same three random seeds. Model selection was based exclusively on validation-set performance, and the sealed test set was evaluated only after the final model checkpoint had been selected. Accuracy, precision, recall, and F1-score were reported as the mean ± standard deviation across the three runs.

3.2.6. Baseline Models and Comparison Protocol

MorphoNet was compared with three representative image-based convolutional neural networks: ResNet-50, DenseNet-121, and EfficientNet-B4. Each backbone was adapted to the same two-stage hierarchical protocol and was trained separately for benign–malignant screening, malignant subtype classification, and benign subtype classification. The baseline models used dermoscopic images only and did not include the ABCD feature branch, attention-guided feature fusion, or CORAL regularization.
All models were evaluated using identical dataset partitions, preprocessing and augmentation procedures, class-balancing strategies, optimization settings, and random seeds. Accuracy, precision, recall, and F1-score are reported as the mean ± standard deviation across three runs.

3.2.7. Accuracy Assessment

To evaluate MorphoNet, the integrated dataset was divided into stratified training, validation, and test subsets using a standard proportional split. Model selection and hyperparameter adjustment were performed without using the sealed test set. The final test set was evaluated only after the model configuration was fixed. Performance was assessed using accuracy, precision, recall, and F1-score. Confusion matrices were additionally generated to visualize class-wise classification performance. All final experiments were repeated using three random seeds, and the four evaluation metrics are reported as the mean ± standard deviation across the three runs.
Accuracy measures the proportion of correctly classified images among all evaluated samples. Precision, recall, and F1-score were calculated for each class to characterize false-positive and false-negative behavior, which is particularly important for rare malignant categories.
A c c u r a c y = T P + T N T P + T N + F P + F N ,
P r e c i s i o n = T P T P + F P ,
R e c a l l = T P T P + F N ,
F 1 = 2 × P r e c i s i o n × R e c a l l P r e c i s i o n + R e c a l l .
Confusion matrices were generated for Stage 1 benign–malignant classification, Stage 2 malignant subtype classification, and Stage 2 benign subtype classification to visualize class-wise misclassification patterns.
Fine-tuning was performed using the AdamW optimizer with an initial learning rate of 1 × 10−4, a batch size of 16, and a weight decay of 1 × 10−4. The learning rate was reduced to 1 × 10−6 using cosine annealing over 30 epochs. All models were implemented using PyTorch version 2.1.0 and trained with CUDA acceleration.

4. Experimental Results and Discussion

The training, validation, and final evaluation of MorphoNet are presented in this section. Because the final framework integrates EfficientNet-B4 visual features, ABCD feature attention, and CORAL domain alignment, the results focus on convergence behavior, attention-based interpretability, and the final Stage 1 and Stage 2 classification performance.

4.1. Ablation Study

A component-wise ablation study was conducted to evaluate the contributions of ABCD-guided feature fusion and CORAL-based domain alignment. Three configurations were compared under identical data splits and training settings: a visual-only hierarchical EfficientNet-B4 model, EfficientNet-B4 with ABCD attention, and the complete MorphoNet model with both ABCD attention and CORAL. The results are summarized in Table 3.
Table 3. Component-wise ablation results of MorphoNet.
Adding ABCD features consistently improved performance across all three tasks. Accuracy increased from 91.84% to 93.08% for benign–malignant screening, from 85.73% to 87.58% for malignant subtype classification, and from 88.93% to 90.47% for benign subtype classification. The corresponding F1-score improvements were 1.47, 2.32, and 2.27 percentage points.
CORAL regularization provided further gains, resulting in final accuracies of 94.01%, 89.05%, and 91.84%, with F1-scores of 93.70%, 84.00%, and 87.97%, respectively. Compared with the visual-only baseline, the complete MorphoNet model improved accuracy by 2.17–3.32 percentage points and F1-score by 2.52–4.71 percentage points. These results indicate that ABCD-guided feature fusion and CORAL regularization make complementary contributions, particularly for fine-grained subtype classification.

4.2. Comparison with Baseline Models

MorphoNet was compared with ResNet-50, DenseNet-121, and EfficientNet-B4 under identical experimental conditions. As shown in Table 4, EfficientNet-B4 achieved the strongest performance among the image-only baselines across all three classification tasks. DenseNet-121 consistently outperformed ResNet-50 but remained below EfficientNet-B4.
Table 4. Comparison of MorphoNet with representative image-based baseline models.
Compared with the image-only EfficientNet-B4 baseline, MorphoNet improved accuracy by 2.17, 3.32, and 2.91 percentage points for benign–malignant screening, malignant subtype classification, and benign subtype classification, respectively. The corresponding F1-score improvements were 2.52, 4.48, and 4.71 percentage points. The larger gains in the two subtype-classification tasks indicate that the integration of ABCD morphological descriptors and CORAL-based domain alignment was particularly beneficial for fine-grained and class-imbalanced lesion recognition.
These results demonstrate that the performance of MorphoNet cannot be attributed solely to the EfficientNet-B4 backbone. Instead, the clinically guided feature-fusion and domain-alignment components provided complementary information beyond image-based CNN representations.

4.3. Attention Weights for ABCD Features

In this study, attention weights were analyzed to evaluate the relative contribution of individual ABCD features to each classification task. These weights provide interpretability signals within the model and indicate which morphological features contributed more strongly to the fused representation. They should therefore be interpreted as model-specific explanatory indicators rather than as independent clinical evidence.
For Stage 1 benign–malignant classification, the attention profile showed that asymmetry-related features (asym_v and asym_score) and color heterogeneity (hist_entropy_r and color_variance_h) descriptors received relatively high weights (Figure 4). This pattern suggests that global morphological imbalance and pigmentation variability provide important discriminative information for separating malignant from benign lesions.
Figure 4. Attention weights of ABCD features in Stage 1 for malignant vs. benign classification.
For Stage 2 malignant subtype classification, the highest-weighted descriptors were mainly related to border complexity, compactness, fractal dimension, diameter-related measurements, and color entropy (Figure 5). This attention pattern suggests that the malignant branch relied more strongly on lesion boundary irregularity, shape complexity, and color heterogeneity when distinguishing MEL, BCC, AKIEC, and SCC. These weights indicate that when classifying specific malignancy types, the model relies primarily on shape complexity and boundary irregularity.
Figure 5. Attention weights of ABCD features in Stage 2 for malignant-type classification.
For Stage 2 benign subtype classification, diameter-related features, compactness, and selected color-variation descriptors received relatively high attention weights (Figure 6). These findings indicate that lesion size, shape regularity, and color distribution contributed to the discrimination of NV, BKL, DF, and VASC within the benign branch.
Figure 6. Attention weights of ABCD features in Stage 2 for benign-type classification.
Overall, the learned attention patterns differed across the three classification tasks. Stage 1 emphasized broad asymmetry and pigmentation heterogeneity for benign–malignant screening, whereas the Stage 2 malignant branch assigned greater importance to border and texture complexity. In contrast, the Stage 2 benign branch placed more emphasis on size and regularity descriptors. These findings support the use of ABCD-guided attention as a clinically interpretable component of MorphoNet.

4.4. Model Training and Validation Accuracy and Loss

Training and validation curves were used to evaluate the convergence behavior of MorphoNet across Stage 1 and the two Stage 2 subtype branches. Across the integrated multi-source dataset, CORAL regularization was used to improve the consistency of feature representations across datasets during training. In Figure 7a, the accuracies of both training and validation increase rapidly at the beginning of training for the first 10 epochs and then gradually converge and remain stable for the other twenty epochs, showing a generally steady training and validation process. The small gap between the training accuracy and validation accuracy indicates good generalization in classifying malignant and benign. In the loss curve for the Stage 1 binary model (Figure 7b), the training loss exhibits a stable downward trend that gradually converges to approximately 0.05 near the end of training, while the validation loss converges to approximately 0.15. Both losses remain lower than those of the other two models. The Stage 1 classifier showed the most stable convergence, which is consistent with the relatively simpler binary classification task. The contrast between the loss and accuracy curves shows that while the Stage 1 binary model had high variability in its confidence in predictions, its classifications remained generally accurate throughout.
Figure 7. Training and validation accuracy and loss curves of MorphoNet: (a) accuracy curves on Stage 1 malignant-benign classification, (b) loss curves on Stage 1 malignant-benign classification, (c) accuracy curves on Stage 2 malignant classification, (d) loss curves on Stage 2 malignant classification, (e) accuracy curves on Stage 2 benign classification, and (f) loss curves on Stage 2 benign classification.
For the Stage 2 malignant classification model, both the loss and accuracy curves are relatively steady and convergent throughout the training process (Figure 7c,d). In the accuracy curve, both the training and validation accuracies increased sharply in the first 15 epochs (from 40% to 85%) and gradually leveled out for the remainder of the training and validation process. In the loss curve, the values stabilize at roughly the 20th epoch and converge to around 0.20 for the training loss and 0.35 for the validation loss. Compared with the Stage 1 model, the Stage 2 malignant branch exhibited higher variability during validation, likely because AKIEC and SCC had smaller sample sizes and shared visual similarities with other malignant subtypes.
The Stage 2 benign classification model displays moderately similar trends in the loss curve, with the training loss and validation loss undergoing rapid decreases in the first 5 to 10 epochs and stabilizing afterward (Figure 7e,f). The benign model achieved accuracies similar to those of the malignant model, with approximately 3–4 percentage points lower than those achieved by the first-stage binary classifier, which could also be caused by the dominance of NV and the limited number of DF and VASC samples.
Overall, the training accuracy increased during the early epochs and gradually stabilized, while the training loss decreased and approached a plateau. All the accuracy and loss curves are smooth and stable with rapid convergence and consistently high accuracy and low losses. Although slight overfitting could still be found between the training-validation gaps, the overall learning behavior supports the reliability and practical use of this two-stage classification framework. The validation curves showed similar trends, indicating that the model reached stable convergence without obvious divergence between training and validation performance. The difference in loss suggests mild overfitting, but taking into consideration the low and consistent values of validation loss, the model should still generalize well to unseen data.

4.5. Classification Performance

The final classification performance of MorphoNet was evaluated separately for Stage 1 benign–malignant screening, Stage 2 malignant subtype classification, and Stage 2 benign subtype classification. Performance was evaluated using accuracy, precision, recall, and F1-score, while confusion matrices were used to visualize class-wise misclassification patterns. Final test results across three random seeds are reported as the mean ± standard deviation.
For Stage 1, MorphoNet achieved 94.01 ± 0.50% accuracy, 93.73 ± 0.56% precision, 93.68 ± 0.55% recall, and 93.70 ± 0.55% F1-score (Table 3). High precision and recall in both the malignant class (92%/95%) and the benign class (92%/95%) indicate that the Stage 1 model minimizes false positives for malignant cases and false negatives for benign cases. The detailed class-wise performance metrics of the Stage 1 classifier are summarized in Table 5. The corresponding confusion matrix (Figure 8) showed the distribution of correctly and incorrectly classified benign and malignant lesions. The numbers of false-negative and false-positive predictions were similar to those of the malignant class, exhibiting a slightly higher misclassification rate. Therefore, the model is highly reliable when labeling true malignancies while simultaneously missing very few benign cases.
Table 5. Final test metrics of the Stage 1 binary model across three random seeds.
Figure 8. Representative test-set confusion matrix of the Stage 1 benign–malignant classifier.
Among the four malignant subtypes, MEL achieved the best precision (94.39%), recall (94.15%), and F1-score (94.27%), and all four classes achieved high accuracies (93.93–95.27%). The detailed classification performance of each malignant subtype is summarized in Table 6. Due to the smaller sample size, the AKIEC and SCC exhibit relatively low precision (70.68% and 82.69%, respectively) and recall (74.53% and 78.20%), demonstrating that the model is still highly effective at detecting AKIEC and SCC but sometimes classifies non-AKIEC or SCC lesions into the two categories. The corresponding confusion matrix of the Stage-2 malignant subtype classifier is shown in Figure 9, illustrating the class-wise prediction distribution among the four malignant subtypes.
Table 6. Final test metrics of the Stage 2 malignant model across three random seeds.
Figure 9. Representative test-set confusion matrix of the Stage 2 malignant subtype classifier.
The benign branch achieved 91.84 ± 0.41% overall accuracy, 86.60 ± 1.37% precision, 89.48 ± 0.89% recall, and 87.97 ± 1.13% F1-score (Table 7). Although the accuracies for BKL, VASC, and DF may be influenced by their relatively small sample sizes, NV exhibits separability with a high volume of correctly classified cases (Figure 10). Both Stage 2 malignant and benign models effectively distinguish among their subtypes, including certain challenging categories such as AKIEC, SCC, VASC, and DF that have much smaller sample sizes and higher intra-class variability.
Table 7. Final test metrics of the Stage 2 benign model across three random seeds.
Figure 10. Representative test-set confusion matrix of the Stage 2 benign subtype classifier.
Taken together, the results demonstrate that MorphoNet provides a hierarchical classification strategy for both benign–malignant screening and fine-grained subtype recognition. The combination of EfficientNet-B4 visual features, ABCD-guided attention, and CORAL regularization supports both predictive performance and model interpretability across the integrated dermoscopic dataset.

5. Conclusions

This study introduced MorphoNet, a hierarchical deep learning model for automated dermoscopic skin lesion classification. The proposed approach combines EfficientNet-B4 with quantitative ABCD morphological descriptors through an attention-guided feature fusion strategy and incorporates CORAL-based domain alignment to improve robustness across multiple datasets. By separating benign–malignant screening from subtype classification, the model follows a diagnostic workflow inspired by routine clinical practice while providing interpretable information through learned attention weights.
Evaluation on a combined dataset of HAM10000, ISIC 2019, and DERM12345 showed that MorphoNet achieved high accuracy for both binary screening and lesion subtype classification. The learned attention patterns were generally consistent with established dermatologic assessment criteria, indicating that the model captures clinically relevant morphological characteristics while maintaining strong classification performance across heterogeneous data sources. These results support the value of integrating domain knowledge with deep learning for more interpretable skin lesion analysis.
Several limitations should be acknowledged. MorphoNet was evaluated only on pooled public datasets and has not yet been validated using an entirely independent clinical cohort. Residual class imbalance, particularly for AKIEC, SCC, DF, and VASC, may affect subtype-classification performance, while the learned attention weights should be interpreted as explanatory signals for the model rather than direct clinical evidence. Future work will focus on independent multicenter validation and improved learning strategies for underrepresented lesion categories.

Author Contributions

B.Y. and A.J. contributed to conceptualization and methodology development. B.Y. and A.J. performed model implementation, experimental evaluation, and preparation of the original manuscript draft. H.L. contributed to data validation and manuscript revision. Q.L. supervised the students on conceptualization and analysis. B.Y., A.J., H.L. and Q.L. reviewed and approved the final manuscript. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Data Availability Statement

Data are contained within the article.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Roky, A.H.; Islam, M.M.; Ahasan, A.M.F.; Mostaq, S.; Mahmud, Z.; Amin, M.N.; Mahmud, A. Overview of skin cancer types and prevalence rates across continents. Cancer Pathog. Ther. 2025, 3, 89–100. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  2. Slaper, H.; Velders, G.J.; Daniel, J.S.; de Gruijl, F.R.; van der Leun, J.C. Estimates of ozone depletion and skin cancer incidence to examine the Vienna Convention achievements. Nature 1996, 21, 256–258. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  3. Noor, M.N.; Haneef, F.; Ashraf, I.; Masud, M. Enhanced skin disease classification via dataset refinement and attention-based vision approach. Bioengineering 2025, 12, 275. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  4. Arnold, M.; Singh, D.; Laversame, M. Global burden of cutaneous melanoma in 2020 and projections to 2040. JAMA Dermatol. 2022, 158, 495–503. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  5. Voss, R.K.; Woods, T.N.; Cromwell, K.D.; Nelson, K.C.; Cormier, J.N. Improving outcomes in patients with melanoma: Strategies to ensure an early diagnosis. Patient Relat. Outcome Meas. 2015, 6, 229–242. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  6. Jerant, A.F.; Johnson, J.T.; Sheridan, C.D.; Caffrey, T.J. Early detection and treatment of skin cancer. Am. Fam. Physician 2000, 62, 357–368. [Google Scholar] [PubMed]
  7. Balch, C.M.; Gershenwald, J.E.; Soong, S.J.; Thompson, J.F.; Atkins, M.B.; Byrd, D.R.; Buzaid, A.C.; Cochran, A.J.; Coit, D.G.; Ding, S.; et al. Final version of 2009 AJCC melanoma staging and classification. J. Clin. Oncol. 2009, 27, 6199. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  8. Breitbart, E.W.; Waldmann, A.; Nolte, S.; Capellaro, M.; Greinert, R.; Volkmer, B.; Katalinic, A. Systematic skin cancer screening in Northern Germany. J. Am. Acad. Dermatol. 2012, 66, 201–211. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  9. Schneider, J.S.; Moore, D.H.; Mendelsohn, M.L. Screening program reduced melanoma mortality at the Lawrence Livermore National Laboratory, 1984 to 1996. J. Am. Acad. Dermatol. 2008, 58, 741–749. [Google Scholar] [CrossRef] [Scilit] [PubMed][Green Version]
  10. Lee, C.S.; Thomas, C.M.; Ng, K.E. An overview of the changing landscape of treatment for advanced melanoma. Pharmacotherapy 2017, 37, 319–333. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  11. Dinnes, J.; Deeks, J.J.; Grainge, M.J.; Chuchu, N.; Ferrante di Ruffano, L.; Matin, R.N.; Thomson, D.R.; Wong, K.Y.; Aldridge, R.B.; Abbott, R.; et al. Visual inspection for diagnosing cutaneous melanoma in adults. Cochrane Database Syst. Rev. 2018, 12, CD013194. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  12. Nachbar, F.; Stolz, W.; Merkle, T.; Cognetta, A.B.; Vogt, T.; Landthaler, M.; Bilek, P.; Braun-Falco, O.; Plewig, G. The ABCD rule of dermatoscopy: High prospective value in the diagnosis of doubtful melanocytic skin lesions. J. Am. Acad. Dermatol. 1994, 30, 551–559. [Google Scholar] [PubMed]
  13. Kawahara, J.; Daneshvar, S.; Argenziano, G.; Hamarneh, G. Seven-point checklist and skin lesion classification using multitask multimodal neural nets. IEEE J. Biomed. Health Inform. 2019, 23, 538–546. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  14. Argenziano, G.; Soyer, H.P.; Chimenti, S.; Talamini, R.; Corona, R.; Sera, F.; Binder, M.; Cerroni, L.; De Rosa, G.; Ferrara, G.; et al. Dermoscopy of pigmented skin lesions: Results of a consensus meeting via the Internet. J. Am. Acad. Dermatol. 2003, 48, 679–693. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  15. Wu, Y.; Chen, B.; Zeng, A.; Pan, D.; Wang, R.; Zhao, S. Skin cancer classification with deep learning: A systematic review. Front. Oncol. 2022, 12, 893972. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  16. Zeiler, M.D.; Fergus, R. Visualizing and understanding convolutional networks. In Computer Vision—ECCV 2014, Proceedings of the 13th European Conference, Zurich, Switzerland, 6–12 September 2014; Springer: Cham, Switzerland, 2014; Volume 13, pp. 818–833. [Google Scholar]
  17. Aboulmira, A.; Hamid, H.; Mohamed, L. Skin diseases classification with machine learning and deep learning techniques: A systematic review. Int. J. Adv. Comput. Sci. Appl. 2024, 15, 1155. [Google Scholar] [CrossRef] [Scilit]
  18. Chatterjee, S.; Dey, D.; Munshi, S.; Gorai, S. Dermatological expert system implementing the ABCD rule of dermoscopy for skin disease identification. Expert Syst. Appl. 2021, 167, 114204. [Google Scholar] [CrossRef] [Scilit]
  19. Kestek, E.; Aktan, M.E.; Akdoğan, E. Skin lesion classification using convolutional neural network and ABCD rule. Turk. J. Math. Comput. Sci. 2023, 15, 365–374. [Google Scholar] [CrossRef] [Scilit]
  20. Bansal, P.; Garg, R.; Soni, P. Detection of melanoma in dermoscopic images by integrating features extracted using handcrafted and deep learning models. Comput. Ind. Eng. 2022, 168, 108060. [Google Scholar] [CrossRef] [Scilit]
  21. Bibi, S.; Khan, M.A.; Shah, J.H.; Damaševičius, R.; Alasiry, A.; Marzougui, M.; Alhaisoni, M.; Masood, A. MSRNet: Multiclass skin lesion recognition using additional residual block based fine-tuned deep models information fusion and best feature selection. Diagnostics 2023, 13, 3063. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  22. Khan, A.; Sajid, M.Z.; Khan, N.A.; Youssef, A.; Abbas, Q. CAD-skin: A hybrid convolutional neural network-autoencoder framework for precise detection and classification of skin lesions and cancer. Bioengineering 2025, 12, 326. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  23. Stanley, R.J.; Stoecker, W.V.; Moss, R.H. A relative color approach to color discrimination for malignant melanoma detection in dermoscopy images. Ski. Res. Technol. 2007, 13, 62–72. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  24. Ballerini, L.; Fisher, P.B.; Aldridge, B.; Rees, J. A color and texture based hierarchical K-NN approach to the classification of non-melanoma skin lesions. In Color Medical Image Analysis; Springer: New York, NY, USA, 2013. [Google Scholar]
  25. Khan, M.Q.; Hussain, A.; Rehman, S.U.; Khan, U.; Maqsood, M.; Mehmood, K.; Khan, M.A. Classification of melanoma and nevus in digital images for diagnosis of skin cancer. IEEE Access 2019, 7, 90132–90144. [Google Scholar] [CrossRef] [Scilit]
  26. Ogundokun, R.O.; Li, A.; Babatunde, R.S.; Umezuruike, C.; Sadiku, P.O.; Abdulahi, A.T.; Babatunde, A.N. Enhancing skin cancer detection and classification in dermoscopic images through concatenated MobileNetV2 and Xception models. Bioengineering 2023, 10, 979. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  27. Codella, N.; Cai, J.; Abedini, M.; Garnavi, R.; Halpern, A.; Smith, J.R. Deep learning, sparse coding, and SVM for melanoma recognition in dermoscopy images. In Machine Learning in Medical Imaging, Proceedings of the MLMI 2015, Munich, Germany, 5 October 2015; Zhou, L., Wang, L., Wang, Q., Shi, Y., Eds.; Springer: Cham, Switzerland, 2015; Volume 9352, pp. 118–126. [Google Scholar]
  28. Kawahara, J.; Hamarneh, G. Multi-resolution-tract CNN with hybrid pretrained and skin-lesion trained layers. In Machine Learning in Medical Imaging, Proceedings of the MLMI 2016, MICCAI Workshop, Athens, Greece, 17 October 2016; Springer: Cham, Switzerland, 2016; Volume 10019, pp. 164–171. [Google Scholar]
  29. Sun, X.; Yang, J.; Sun, M.; Wang, K. A benchmark for automatic visual classification of clinical skin disease images. In Computer Vision–ECCV 2016; Springer: Cham, Switzerland, 2016; Volume 9910, pp. 206–222. [Google Scholar]
  30. Shin, H.C.; Roth, H.R.; Gao, M.; Lu, L.; Xu, Z.; Nogues, I.; Yao, J.; Mollura, D.; Summers, R.M. Deep convolutional neural networks for computer-aided detection: CNN architectures, dataset characteristics and transfer learning. IEEE Trans. Med. Imaging 2016, 35, 1285–1298. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  31. Esteva, A.; Kuprel, B.; Novoa, R.A.; Ko, J.; Swetter, S.M.; Blau, H.M.; Thrun, S. Dermatologist-level classification of skin cancer with deep neural networks. Nature 2017, 542, 115–118. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  32. Tschandl, P.; Rosendahl, C.; Kittler, H. The HAM10000 dataset, a large collection of multi-source dermatoscopic images of common pigmented skin lesions. Sci. Data 2018, 5, 180161. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  33. El-Khatib, H.; Popescu, D.; Ichim, L. Deep learning-based methods for automatic diagnosis of skin lesions. Sensors 2020, 20, 1753. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  34. Al-Masni, M.A.; Kim, D.H.; Kim, T.S. Multiple skin lesions diagnostics via integrated deep convolutional networks for segmentation and classification. Comput. Methods Programs Biomed. 2020, 190, 105351. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  35. Yin, W.; Huang, J.; Chen, J.; Ji, Y. A study on skin tumor classification based on dense convolutional networks with fused metadata. Front. Oncol. 2022, 12, 989894. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  36. Harangi, B. Skin lesion classification with ensembles of deep convolutional neural networks. J. Biomed. Inform. 2018, 86, 25–32. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  37. Mahbod, A.; Schaefer, G.; Wang, C.; Dorffner, G.; Ecker, R.; Ellinger, I. Transfer learning using a multi-scale and multi-network ensemble for skin lesion classification. Comput. Methods Programs Biomed. 2020, 193, 105475. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  38. Chanda, D.; Onim, S.H.; Nyeem, H.; Ovi, T.B.; Naba, S.S. DCENSnet: A new deep convolutional ensemble network for skin cancer classification. Biomed. Signal Process. Control 2024, 89, 105757. [Google Scholar] [CrossRef] [Scilit]
  39. Tan, M.; Le, Q.V. EfficientNet: Rethinking model scaling for convolutional neural networks. In Proceedings of the International Conference on Machine Learning, Long Beach, CA, USA, 9–15 June 2019; Volume 19, p. 11946. [Google Scholar]
  40. Naeem, A.; Malik, H.; Din, M.; Sadeghi-Niaraki, A.; Jeong, D.; Naqvi, R.A. SkinDWNet: A novel deep learning model for multiclass classification of skin cancers using dermoscopic images. Multimed. Syst. 2025, 31, 314. [Google Scholar] [CrossRef] [Scilit]
  41. Reis, H.C.; Turk, V. DSCIMABNet: A novel multi-head attention depthwise separable CNN model for skin cancer detection. Pattern Recognit. 2025, 159, 111182. [Google Scholar] [CrossRef] [Scilit]
  42. Priyeshkumar, A.T.; Shyamala, G.; Vasanth, T.; Ponniyin, S.V. Transforming skin cancer diagnosis: A deep learning approach with the HAM10000 dataset. Cancer Investig. 2024, 42, 801–814. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  43. Shorten, C.; Khoshgoftaar, T.M. A survey on image data augmentation for deep learning. J. Big Data 2019, 6, 60. [Google Scholar] [CrossRef] [Scilit]
  44. Stojnev, D.; Stojnev Ilić, A. Preprocessing image data for deep learning. In Proceedings of the Sinteza 2020—International Scientific Conference on Information Technology and Data Related Research, Belgrade, Serbia, 17 October 2020; Singidunum University: Belgrade, Serbia, 2020; pp. 312–317. [Google Scholar]
  45. Zhang, H.; Cisse, M.; Dauphin, Y.N.; Lopez-Paz, D. Mixup: Beyond empirical risk minimization. arXiv 2018, arXiv:1710.09412. [Google Scholar]
  46. Yun, S.; Han, D.; Oh, S.J.; Chun, S.; Choe, J.; Yoo, Y. CutMix: Regularization strategy to train strong classifiers with localizable features. arXiv 2019, arXiv:1905.04899. [Google Scholar]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Article Metrics

Citations

Article Access Statistics

Multiple requests from the same IP address are counted as one view.