A hybrid quantum-classical convolutional neural network with a quantum attention mechanism for skin cancer.
Authors
Affiliations (2)
Affiliations (2)
- Department Computer Science and Information Technology, Guru Ghasidas Vishwavidyalaya is a Central University in Bilaspur, Bilaspur, Chhattisgarh, India.
- Department Computer Science and Information Technology, Guru Ghasidas Vishwavidyalaya is a Central University in Bilaspur, Bilaspur, Chhattisgarh, India. [email protected].
Abstract
Skin cancer is the most common and fatal illness globally, and therefore, proper early detection is essential for successful treatment and enhanced patient outcomes. Classic deep learning models, especially Convolutional Neural Networks (CNNs), have greatly succeeded in medical image classification. However, classic CNNs also suffer from severe limitations such as computational inefficiency, overfitting on small datasets, and redundant feature extraction, which restrict their utility in clinical settings. To overcome these drawbacks, we introduce QAttn-CNN as a quantum-classical deep learning model combining a Quantum Attention Mechanism (QAttn) to improve feature selection and classification accuracy. Our method utilizes Quantum Convolutional Layers (QConv) and Quantum Image Representation (QIR) with Novel Enhanced Quantum Representation (NEQR) encoding to draw upon quantum parallelism and improve computational efficiency and complexity from O(N<sup>2</sup>) to O(log N). The model is tested on three benchmark datasets: MNIST (70,000 grey-scale handwritten digit images), CIFAR-10 (60,000 RGB object images), and the Kaggle Skin Cancer: Malignant versus Benign dataset (3297 dermoscopic images: 1800 benign and 1497 malignant cases, from the International Skin Imaging Collaboration (ISIC) Archive). The dataset images were processed by converting them to grayscale, resizing them bilinearly to 150 × 150 pixels, and normalizing to [0-1] for quantum encoding. QAttn-CNN is contrasted with standard CNNs, QAttn-ViT (Quantum Attention Vision Transformer), and QAttn-ResNet18. Results indicate that QAttn-CNN attains state-of-the-art accuracy of 91% on the Skin Cancer dataset with a precision of 89%, a recall of 89%, and an F1-score of 91%, surpassing Baseline CNN (89% accuracy), QAttn-ViT (87%), and QAttn-ResNet18 (83%). On CIFAR-10, QAttn-CNN exhibits 10% accuracy enhancement over Baseline CNN with accuracy of 82% and 90% precision. On MNIST, QAttn-CNN performs at the peak of 99% accuracy, comparable to classical benchmarks but with greatly diminished computational overhead due to quantum parallelism. This study demonstrates the revolutionary potential of quantum-assisted deep learning in healthcare applications, especially for real-world binary medical image classification problems that identify malignant vs. benign skin lesions.