S-E Pipeline: A Vision Transformer (ViT) based Resilient Classification Pipeline for Medical Imaging Against Adversarial Attacks

Neha A S, Vivek Chaturvedi, Muhammad Shafique · DOI · OpenReview

Abstract

Deep learning models in medical imaging are increasingly vulnerable to adversarial attacks—subtle, often invisible perturbations that can lead to confident misdiagnoses. This paper introduces the Segmentation-Enhancement (S-E) Pipeline, a defensive framework designed to bolster the resilience of Vision Transformers (ViTs). By isolating the Region of Interest (ROI) through segmentation and applying targeted image enhancement, the pipeline reduces adversarial impact by up to 86.58%. Furthermore, the system is optimized for edge-device deployment, demonstrating its feasibility in real-world clinical settings using the NVIDIA Jetson Orin Nano.

1. Introduction

The integration of deep learning into medical diagnostics has significantly improved screening efficiency. However, these models possess a critical vulnerability known as the "glass jaw": adversarial attacks. In a clinical context, an adversary could introduce imperceptible noise into a lung X-ray, causing a model to misclassify a "Normal" scan as "Pneumonia." Such errors pose severe risks, ranging from insurance fraud to life-threatening medical mismanagement.

While Vision Transformers (ViTs) offer inherent advantages over traditional Convolutional Neural Networks (CNNs) due to their global self-attention mechanisms, they remain susceptible to sophisticated attacks. Existing defenses often target "natural" image datasets and are computationally prohibitive for the mobile, edge-based hardware common in modern hospitals. This study proposes the S-E Pipeline, a specialized defense for medical imaging that balances high security with computational efficiency.

2. Methodology: The S-E Pipeline

The S-E Pipeline employs a two-stage pre-processing "shield" before classification, designed to filter out noise and highlight diagnostic features.

2.1 Segmentation (S)

The first stage utilizes a custom U-Net model to perform semantic segmentation. By identifying and cropping the Region of Interest (ROI)—specifically the lungs in chest X-rays—the pipeline discards background pixels. This is a critical defensive step, as adversarial noise is often distributed across the entire image; removing non-essential areas effectively eliminates a significant portion of the attack surface where noise often lurks.

2.2 Image Enhancement (E)

The cropped ROI is then subjected to enhancement techniques designed to sharpen biological features and act as a mathematical filter against noise. The authors evaluated three methods:

  • Contrast Limited Adaptive Histogram Equalization (CLAHE): Improves local contrast to reveal subtle structures.
  • Unsharp Masking (UM): Sharpens edges by subtracting a blurred version of the image from the original.
  • High-Frequency Emphasis (HFE): Utilizes Fourier transforms to highlight fine structural details.

The resulting "cleaned" image is finally processed by a Vision Transformer (ViT-b32 or ViT-l32) for diagnostic classification.

3. Experimental Setup and Deployment

The pipeline was evaluated using a standard Chest X-ray dataset for pneumonia screening. The dataset provided both raw images and the masks necessary for training the U-Net segmentation model. The data was partitioned into an 80:20 training-to-testing ratio.

To validate the pipeline's practical utility, the researchers deployed the entire system on an NVIDIA Jetson Orin Nano. This hardware choice reflects the resource-constrained environments of modern clinics, ensuring the defense is not just theoretically sound but also "edge-ready" for real-time clinical use.

4. Results and Key Insights

The S-E Pipeline demonstrated significant robustness against two prominent white-box attacks: the Fast Gradient Sign Method (FGSM) and Projected Gradient Descent (PGD).

  • Substantial Attack Mitigation: For the ViT-l32 model, the pipeline reduced the impact of FGSM attacks by 86.58% and PGD attacks by 80.26%.
  • Model Capacity and Resilience: Larger models (ViT-l32) exhibited a more pronounced improvement in resilience compared to smaller variants (ViT-b32). This suggests that higher model capacity allows the transformer to more effectively leverage the "cleaned" features provided by the S-E stages.
  • Superiority Over Baselines: The S-E Pipeline outperformed standard defensive techniques like JPEG compression. While JPEG compression often degraded base accuracy below 60%, the S-E Pipeline maintained high performance while providing superior protection.
  • ViT vs. CNN: While the pipeline improved CNN performance, the ViT-based architecture remained more stable under adversarial pressure, confirming the suitability of transformers for secure medical imaging.

5. Conclusion and Future Work

The S-E Pipeline offers a robust, efficient solution for protecting medical AI from adversarial threats. By combining ROI segmentation with feature enhancement, the framework significantly mitigates the risk of misdiagnosis on edge devices.

Future research will focus on testing the pipeline against "adaptive attacks," where the adversary is aware of the defense mechanism and attempts to bypass the segmentation steps. Additionally, the authors plan to expand the study to other imaging modalities, such as MRI and CT scans, to further validate the generalizability of the S-E approach.

Summary updated

BibTeX
@inproceedings{s2024s,
  author = {Neha A S and Vivek Chaturvedi and Muhammad Shafique},
  title = {{S-E Pipeline: A Vision Transformer (ViT) based Resilient Classification Pipeline for Medical Imaging Against Adversarial Attacks}},
  booktitle = {IJCNN},
  year = {2024},
  doi = {10.1109/ijcnn60899.2024.10650591},
}
Figure