# Detecting SARS-CoV-2 in CT Scans Using Vision Transformer and Graph Neural Network
## 4 Results and Discussion
### Computational Cost  
We evaluate the trade-off between model performance and resource usage and consider the computational efficiency of all model variants across three medical imaging datasets: SARS-CoV-2, Tuberculosis, and Pneumonia. The comparison focused on two key metrics: total inference time and computational cost, both measured in seconds see Table 4.  
Computational cost refers to the time required to complete the training of each model. This include forward and backward passes, weight updates and optimizer operations across all training epochs. It reflects the resource demands of the model in term of processor (CPU/GPU) usage, memory consumption and processing latency. Inference time, on the other hand, measures the duration required by a trained model to generate predictions on unseen test data. Specifically, it captures the average time taken for a single forward pass through the network per input sample during the testing phase [51; 52].  
Across all datasets, the **CNN model** consistently exhibited the lowest computational demands. Specifically, it completed inference in 0.72 s on the SARS-CoV-2 dataset with a computational cost of 86.09 s, followed by 2.16 s and 224.33 s for the Tuberculosis dataset and 2.88 s and 295.48 s for the Pneumonia dataset. This efficiency is attributed to its relatively lightweight and straightforward architecture, making it ideal for deployment in real-time or resource-constrained clinical environments.  
In contrast, the **CNN-GNN model** introduced a substantial increase in both inference time and computational cost. On the SARS-CoV-2 dataset, inference required 21.43 s and incurred a computational cost of 967.29 s. Similar patterns were observed for the Tuberculosis (37.43 s, 1703.91 s) and Pneumonia (46.27 s, 2100.16 s) datasets. This increase is due to the added complexity of graph construction and the iterative message-passing operations inherent to Graph Neural Networks (GNNs).  
The most computationally demanding model was the full hybrid **ViTGNN**, see Table 4 which integrates a Vision Transformer (ViT) with both CNN and GNN components. For the SARS-CoV-2 dataset, ViTGNN required 22.10 s for inference and a total computational cost of 8902.39 s. For the Tuberculosis and Pneumonia datasets, the respective values rose to 38.16 s and 11,009.81 s, and 47.60 s and 11,836.54 s. This overhead is attributed to the self-attention mechanisms and the model's deeper and more parameter-intensive architecture.  
\begin{table}
\begin{tabular}{l c c} \hline \hline  & SAR-CoV-2 Dataset & \\ \hline
**Model** & Inference Time (s) & Computational Cost \\ \hline ViTGNN & **22.10** & **8902.39** \\ CNN & 0.72 & 86.09 \\ CNN-GNN & 21.43 & 967.29 \\ \hline \multicolumn{3}{c}{Tuberculosis Dataset} \\ \hline ViTGNN & **38.16** & **11,009.81** \\ CNN & 2.16 & 224.33 \\ CNN-GNN & 37.43 & 1703.91 \\ \hline \multicolumn{3}{c}{Pneumonia Dataset} \\ \hline ViTGNN & **47.60** & **11,836.54** \\ CNN & 2.88 & 295.48 \\ CNN-GNN & 46.27 & 2100.16 \\ \hline \hline \end{tabular}
\end{table}
Table 4: Comparison of inference time and computational cost (in seconds)Overall, while ViTGNN incurs the highest computational burden, its superior diagnostic accuracy and robust generalization performance may justify its use in scenarios where processing time is less critical than predictive precision.