This repository presents a Hybrid Quantum-Classical Convolutional Neural Network (Q-CNN) for automated finding of chest diseases from medical images. By combining the feature extraction strength of classical deep learning with the high-dimensional expressivity of Quantum Machine Learning (QML), the project demonstrates a scalable pipeline for real-world datasets such as CheXpert.
- Integrate PennyLane quantum computing with high-performance JAX / PyTorch workflows.
- Build an efficient data pipeline for large-scale medical imaging datasets.
- Design a hybrid architecture that improves diagnostic performance while reducing computational overhead.
The system follows a Parallel Residual Hybrid Design to stabilise training and mitigate the Barren Plateau issue common in quantum circuits.
- Uses a pre-trained ResNet18 to extract 512-dimensional feature vectors from 224×224 X-ray images.
- Pre-computes image features to decouple heavy processing.
- Accelerates hybrid training by ~50×.
- Compresses classical features into 10 qubits using dense layers.
- Applies AngleEmbedding and StronglyEntanglingLayers.
- Explores correlations in a 2¹⁰ Hilbert space to enhance classification.
- Runs a parallel dense network to match baseline neural performance.
- Merges outputs using a residual connection:
[ \text{Final Output} = \text{Classical Output} + \text{Quantum Output} ]
- High-Performance Computing: JAX JIT compilation with XLA optimization for faster quantum simulation.
- Uncertainty Handling: Recall optimization by mapping uncertain labels to potentially diseased states.
- Class Imbalance Handling: Focal Loss (γ = 2.0) to prioritize hard minority classes.
- Clinical Tuning: Dynamic decision thresholding to maximize F1-Score per disease risk.
| Metric | Result |
|---|---|
| Best Validation Accuracy | 86.85% |
| Macro AUROC | 0.7035 |
| Recall (Atelectasis) | 91% |
| Recall (Edema) | 95% |
Note: Designed as a high-sensitivity first-pass screening model, prioritizing Recall to minimize missed pathologies.
- Scale to more qubits and deeper quantum layers.
- Deploy on real Quantum Processing Units (QPUs).
- Extend to 3D CT scan data processing.
- Dataset available at https://www.kaggle.com/datasets/ashery/chexpert