Rapid detection of COVID-19 is essential to prevent disease spread. While numerous machine learning algorithms have been developed to detect COVID-19 using Computerized Tomography (CT) lung scans, current approaches have significant limitations:
- Image-centric instead of patient-centric: Most algorithms prioritize accurate detection on individual images rather than considering all scans from a single patient
- Risk of misdiagnosis: When multiple CT scans exist for one patient, treating each scan independently can lead to incorrect diagnoses if not all images are incorporated into the final decision
- Limited generalization: Using single datasets raises concerns about model robustness across different CT machine environments and image qualities
We address these limitations by developing convolutional neural network (CNN) algorithms that prioritize accurate diagnosis at the patient level using multiple scans. Our methodology includes:
-
Single-input CNN with patient-level aggregation (
finalpredictionmodel.py)- Individual image processing followed by aggregation of predictions by patient ID
-
Multi-input CNN architectures (
4input_alexnet.pyand7input_alexnet.py)- Simultaneous processing of 4 or 7 images from the same patient
Both approaches are validated using patient-based splits across two large COVID-19 CT datasets to demonstrate robustness and real-world applicability.
All models use a simplified AlexNet architecture optimized for medical imaging:
- Conv Layer 1: 96 filters, 11×11 kernel, stride 4, ReLU activation
- Conv Layer 2: 256 filters, 5×5 kernel, ReLU activation
- Conv Layer 3: 384 filters, 3×3 kernel, ReLU activation
- Conv Layer 4: 384 filters, 3×3 kernel, ReLU activation
- Conv Layer 5: 256 filters, 3×3 kernel, ReLU activation
- Fully Connected: 4096 → 4096 → 1000 → 2 neurons with dropout regularization
Architecture: AlexNet CNN processing individual CT images (224×224×3)
Patient-Level Aggregation Methods:
- Averaging: Calculates the final patient-level score by taking the arithmetic mean of the COVID-19 probability scores generated by the model for every individual slice image belonging to that patient. The final diagnosis is determined by thresholding this averaged score at 0.5. (method explored for UROC SOAR poster)
- Majority Voting: Determines the final patient diagnosis by taking the mode (most frequent result) of the individual binary predictions made for each slice image. For example, if 7 out of 10 slices are predicted as 'COVID', the final patient diagnosis is 'COVID'. (method explored for UROC SOAR poster)
-
Entropy-based Weighting: Weights each slice prediction based on the inverse of its Shannon Entropy. Low entropy (high confidence) results in a weight
$w_i$ calculated as$w_i = 1 - H_i$ , where$H_i$ is the entropy. This approach logarithmically penalizes uncertain predictions, ensuring only high-confidence slices significantly influence the final patient score (method explored post UROC SOAR) -
Z-score Normalization: Standardizes the raw probability score of each slice
$x_i$ using the global mean ($\mu_{global}$ ) and standard deviation ($\sigma_{global}$ ) of all slices in the dataset. The final patient prediction is based on the average of these$Z$ -scores,$Z_{avg}$ , where$Z_{avg} > 0$ indicates a positive diagnosis. (method explored post UROC SOAR) -
Bayesian Weighting: Employs a Linear Confidence Weighting method. This approach uses the linear distance of the prediction
$p_i$ from the point of maximum uncertainty (0.5) to assign a weight$w_i$ . The weight is scaled such that$w_i = 1.0$ for a perfectly confident prediction ($p_i=0$ or$p_i=1$ ) and$w_i = 0.0$ for an uncertain prediction ($p_i=0.5$ ). The weight is calculated as$w_i = 2 \cdot |p_{\text{COVID}, i} - 0.5|$ (method explored post UROC SOAR)
Key Features:
- Individual image processing with intelligent patient-level aggregation
- Five different aggregation strategies for robust diagnosis
- SGD optimization with appropriate learning rates
- Comprehensive performance metrics and patient-wise analysis
Architecture: Parallel AlexNet branches processing 4 or 7 CT slices simultaneously
Input Processing:
- 4 or 7 CT scan images (224×224×3) per patient
- Automatic padding with zeros if fewer images available
- Transfer learning with pre-trained weights
Key Features:
- End-to-end patient-centric training
- Cross-dataset transfer learning for improved generalization
- Adam optimization with appropriate learning rates
- Comprehensive training visualization and metrics
Unlike traditional image-by-image approaches, our models ensure:
- All available CT scans from a patient contribute to the final diagnosis
- Single low-quality images cannot lead to misdiagnosis
- Conflicting COVID-19 indicators are properly resolved
- Patient identity is preserved throughout evaluation
- Preprocessing: Image normalization and resizing with aspect ratio preservation
- Data Splitting: Patient-based splits to prevent data leakage
- Cross-Dataset Validation: Testing on independent COVID-19 CT datasets
Models are validated across different datasets to ensure:
- Robustness to varying image quality and acquisition parameters
- Generalizability across different hospital/scanner environments
- Real-world applicability beyond single-dataset performance
Performance comparison on cross-dataset evaluation:
| Method | Accuracy | F1-Score | Precision | Recall |
|---|---|---|---|---|
| Baseline AlexNet Single Input | 0.90 | 0.81 | 0.82 | 0.80 |
| Multi-Input AlexNet (4 images) | 0.58 | 0.48 | 0.55 | 0.58 |
| Multi-Input AlexNet (7 images) | 0.62 | 0.50 | 0.42 | 0.62 |
| Single-Input + Majority Voting | 0.91 | 0.91 | 0.92 | 0.91 |
| Single-Input + Averaging | 0.92 | 0.92 | 0.93 | 0.92 |
| Single-Input + Entropy Weighting | 0.94 | 0.93 | 0.94 | 0.92 |
| Single-Input + Z-Score | 0.89 | 0.89 | 0.90 | 0.88 |
| Single-Input + Bayesian | 0.93 | 0.93 | 0.93 | 0.93 |
- Single-input models with patient-level aggregation significantly outperform multi-input architectures
- All aggregation methods achieve excellent performance
- Patient-level aggregation improved sensitivity by 12% (AVG and Entropy) and 13% (Bayesian) compared to standard image-by-image baselines
- Models minimize false negatives while maintaining high precision
- Cross-dataset generalization demonstrates real-world applicability
- Presentation can be found under old_notebooks, Proof of presenting in symposium in old_notebooks
| Aspect | Multi-Input AlexNet | Single-Input + Aggregation |
|---|---|---|
| Advantages | •Simultaneous cross-image learning •End-to-end optimization •Complex inter-slice relationships •Single model per patient | •Simpler, more stable architecture •Handles variable image counts •Easier interpretation and debugging •Superior cross-dataset robustness |
| Performance | (58-62% accuracy) | (89-94% accuracy) |
| Complexity | High | Low-Medium |
This patient-centered approach addresses critical limitations in COVID-19 detection:
- Reduces misdiagnosis risk by considering all available patient scans
- Improves diagnostic confidence through multiple aggregation strategies
- Ensures cross-dataset robustness for real-world deployment
- Maintains high sensitivity while minimizing false negatives
- Integration with additional imaging modalities
- Real-time clinical deployment testing
- Extension to other respiratory diseases
- Advanced ensemble methods for aggregation