LCSD-Net: a light-weight cross-attention-based semantic dual transformer for domain generalization in melanoma detection.
Rishi Agrawal, Neeraj Gupta, Anand Singh Jalal
Abstract
Open AccessPurpose: Research in deep learning has shown a great advancement in the detection of melanoma. However, recent literature has emphasized a tendency of certain models to rely on disease-irrelevant visual artifacts such as dark corners, dense hair, or ruler marks. The dependence on these markers leads to biased models that do well for training but generalize poorly to heterogeneous clinical environments. To address these limitations in developing reliability in skin lesion detection, a lightweight cross-attention-based semantic dual (LCSD) transformer model was proposed. Approach: The LCSD model extracts global-level semantic information, uses feature normalization to improve model accuracy, and employs semantic queries to improve domain generalization. Multihead attention is included with the semantic queries to refine global features. The cross-attention between feature maps and semantic query provides the model with a generalized encoding of the global context. The model improved the computational complexity from O ( n 2 d ) to O ( n m d + m 2 d ) , which makes the model suitable for the development of real-time and mobile applications. Results: Empirical evaluation was conducted on three challenging datasets: Derm7pt-Dermoscopic, Derm7pt-Clinical, and PAD-UFES-20. The proposed model achieved classification accuracies of 82.82%, 72.95%, and 86.21%, respectively. These results demonstrate superior performance compared with conventional transformer-based models, highlighting both improved robustness and reduced computational cost. Conclusion: The LCSD model mitigates the influence of irrelevant visual characteristics, enhances domain generalization, and ensures better adaptability across diverse clinical scenarios. Its lightweight design further supports deployment in mobile applications, making it a reliable and efficient solution for real-world melanoma detection.