TESL-Net: A Transformer-Enhanced CNN for Accurate Skin Lesion Segmentation

Shahzaib Iqbal, Muhammad Zeeshan, Mehwish Mehmood, Tariq Mahmood Khan, Imran Razzak

Abstract

Early detection of skin cancer relies on precise segmentation of dermoscopic images of skin lesions. However, this task is challenging due to the irregular shape of the lesion, the lack of sharp borders, and the presence of artefacts such as marker colours and hair follicles. Recent methods for melanoma segmentation are U-Nets and fully connected networks (FCNs). As the depth of these neural network models increases, they can face issues like the vanishing gradient problem and parameter redundancy, potentially leading to a decrease in the Jaccard index of the segmentation model. In this study, we introduced a novel network named TESL-Net for the segmentation of skin lesions. The proposed TESL-Net involves a hybrid network that combines the local features of a CNN encoder-decoder architecture with long-range and temporal dependencies using bi-convolutional long-short-term memory (Bi-ConvLSTM) networks and a Swin transformer. This enables the model to account for the uncertainty of segmentation over time and capture contextual channel relationships in the data. We evaluated the efficacy of TESL-Net in three commonly used datasets (ISIC 2016, ISIC 2017, and ISIC 2018) for the segmentation of skin lesions. The proposed TESL-Net achieves state-of-the-art performance, as evidenced by a significantly elevated Jaccard index demonstrated by empirical results.

Introduction

The early detection of melanoma is critical for patient outcomes, as survival rates drop significantly if the disease progresses beyond its initial stages. Automated skin lesion segmentation—the process of accurately delineating lesion boundaries—is a vital step in clinical diagnosis. However, dermoscopic images present significant challenges: they are often cluttered with artifacts like hair follicles, medical marker ink, and uneven lighting. Furthermore, lesions frequently exhibit irregular shapes, low contrast, and fuzzy boundaries.

While standard architectures like U-Net have been widely adopted, they often struggle as network depth increases. Deep models can suffer from vanishing gradients and parameter redundancy, which limits their ability to capture both fine-grained details and global context simultaneously.

Methodology

To address these limitations, we propose TESL-Net, a hybrid encoder-decoder architecture that integrates the strengths of Convolutional Neural Networks (CNNs) and Transformers.

The TESL-Net architecture combines a CNN encoder with Swin Transformer blocks and Bi-ConvLSTM skip connections to capture both local and global features.

The architecture is built upon three core components:

  1. CNN Encoder with Depthwise Separable Convolutions (DWS-Conv): This component extracts fine-grained local textures and patterns. DWS-Conv is utilized to maintain high performance while significantly reducing the number of parameters and computational cost.
  2. Swin Transformer Blocks: These blocks employ a shifted-window multi-head self-attention (SW-MSA) mechanism. Unlike standard CNNs, which have a limited receptive field, the Swin Transformer captures long-range dependencies, allowing the model to understand the global context of the lesion.
  3. Bi-ConvLSTM Skip Connections: Standard U-Nets use simple skip connections to pass features from the encoder to the decoder. TESL-Net replaces these with Bidirectional Convolutional Long Short-Term Memory (Bi-ConvLSTM) units. These units process feature maps as a sequence, capturing spatial dependencies from both directions to refine boundary reconstruction.

Experimental Setup

TESL-Net was evaluated on three benchmark datasets from the International Skin Imaging Collaboration (ISIC):

  • ISIC 2016: 1,279 images.
  • ISIC 2017: 2,750 images.
  • ISIC 2018: 3,594 images.

All images were standardized to a $256 \times 256$ resolution for consistency during training and testing.

Results and Discussion

TESL-Net consistently outperformed ten state-of-the-art (SOTA) methods, including Swin-Unet, U-Net++, and DAGAN, across all evaluated metrics.

Quantitative Performance

  • ISIC 2016: Achieved a Jaccard Index (IoU) of 89.51% and a Dice coefficient of 93.43%, representing an IoU improvement of 2.11% to 8.13% over competing models.
  • ISIC 2017: Reached an IoU of 86.91%, surpassing the next-best model, RA-Net (84.89%).
  • ISIC 2018: Achieved an IoU of 90.56% and an overall accuracy of 96.23%.

Qualitative Analysis

Visual comparisons demonstrate that TESL-Net is remarkably robust against common "distractors" such as thick hair or low-contrast edges. While other models often produce jagged or inaccurate outlines in the presence of artifacts, TESL-Net maintains high fidelity to the ground truth (GT).

Visual performance comparison of TESL-Net against state-of-the-art methods across multiple ISIC datasets.

Conclusion

TESL-Net demonstrates that the integration of CNNs for local feature extraction and Transformers for global context, mediated by advanced skip connections like Bi-ConvLSTMs, significantly advances the state-of-the-art in skin lesion segmentation. Future work will focus on semi-supervised learning strategies to reduce the reliance on large-scale expert-labeled datasets and exploring the generalizability of this architecture to other medical imaging modalities, such as CT and MRI scans.

Summary updated

Abstract

Early detection of skin cancer relies on precise segmentation of dermoscopic images of skin lesions. However, this task is challenging due to the irregular shape of the lesion, the lack of sharp borders, and the presence of artefacts such as marker colours and hair follicles. Recent methods for melanoma segmentation are U-Nets and fully connected networks (FCNs). As the depth of these neural network models increases, they can face issues like the vanishing gradient problem and parameter redundancy, potentially leading to a decrease in the Jaccard index of the segmentation model. In this study, we introduced a novel network named TESL-Net for the segmentation of skin lesions. The proposed TESL-Net involves a hybrid network that combines the local features of a CNN encoder-decoder architecture with long-range and temporal dependencies using bi-convolutional long-short-term memory (Bi-ConvLSTM) networks and a Swin transformer. This enables the model to account for the uncertainty of segmentation over time and capture contextual channel relationships in the data. We evaluated the efficacy of TESL-Net in three commonly used datasets (ISIC 2016, ISIC 2017, and ISIC 2018) for the segmentation of skin lesions. The proposed TESL-Net achieves state-of-the-art performance, as evidenced by a significantly elevated Jaccard index demonstrated by empirical results.
BibTeX
@inproceedings{iqbal2024tesl,
  author = {Shahzaib Iqbal and Muhammad Zeeshan and Mehwish Mehmood and Tariq Mahmood Khan and Imran Razzak},
  title = {{TESL-Net: A Transformer-Enhanced CNN for Accurate Skin Lesion Segmentation}},
  booktitle = {DICTA},
  year = {2024},
  doi = {10.1109/dicta63115.2024.00054},
}
Figure