--- title: ConvNeXt CheXpert Classifier with GradCAM emoji: 🫁 colorFrom: blue colorTo: green sdk: gradio sdk_version: "4.0.0" app_file: app.py pinned: false license: apache-2.0 --- # 🫁 ConvNeXt CheXpert Classifier with GradCAM A web-based chest X-ray analysis tool using ConvNeXt-Base with CBAM attention mechanism. This app provides multi-label classification of 14 thoracic pathologies with GradCAM visualization showing where the model focuses its attention. ## ✨ Features - 🔍 **Multi-label Classification**: Detects 14 different chest conditions - 📊 **Confidence Filtering**: Only shows predictions above 60% confidence - 🎯 **GradCAM Visualization**: See exactly where the model is looking - 🖼️ **Interactive Interface**: Easy-to-use web interface via Gradio - 🏥 **Research Ready**: Optimized for medical imaging research ## 📋 Supported Conditions | # | Pathology | # | Pathology | |---|---|---|---| | 1 | No Finding | 8 | Pneumonia | | 2 | Enlarged Cardiomediastinum | 9 | Atelectasis | | 3 | Cardiomegaly | 10 | Pneumothorax | | 4 | Lung Opacity | 11 | Pleural Effusion | | 5 | Lung Lesion | 12 | Pleural Other | | 6 | Edema | 13 | Fracture | | 7 | Consolidation | 14 | Support Devices | ## 🚀 Quick Start 1. **Upload**: Click "Upload Chest X-ray" and select a chest X-ray image 2. **Analyze**: The model will process the image and show confident predictions 3. **Review**: View GradCAM visualizations showing model attention regions ## 📊 How It Works ### Model Architecture - **Backbone**: ConvNeXt-Base (modern efficient architecture) - **Attention**: CBAM (Convolutional Block Attention Module) - **Input**: 384×384 chest X-rays (automatically resized) - **Output**: 14 pathology probabilities with sigmoid activation ### GradCAM Visualization - **Heatmap**: Shows attention intensity (red = high attention) - **Overlay**: Superimposes attention map on original X-ray - **Confidence**: Only displays findings above 60% confidence threshold ## 🏗️ Technical Details ### Model Performance - **Validation AUC**: 0.81 (multi-label) - **Parameters**: ~88M + CBAM attention - **Training Data**: CheXpert dataset (224K+ chest X-rays) - **Framework**: PyTorch + timm library ### Dependencies ```bash pip install -r requirements.txt ``` ## ⚠️ Important Medical Disclaimer **🚨 FOR RESEARCH & EDUCATION ONLY 🚨** ### ❌ DO NOT USE FOR: - Clinical diagnosis or treatment decisions - Emergency medical situations - Replacing professional radiologist review - Patient care without expert validation ### ⚠️ Limitations: - Not clinically validated or FDA-approved - Trained on historical Stanford data (2002-2017) - Performance may vary on different populations/equipment - Requires qualified radiologist review for any clinical use ### ✅ Appropriate Uses: - Academic research and benchmarking - Algorithm development and comparison - Educational demonstrations - Proof-of-concept prototypes **Always consult qualified healthcare professionals for medical decisions.** ## 📚 Citation If you use this work in publications, please cite: ```bibtex @software{convnext_chexpert_attention_2025, author = {Time}, title = {ConvNeXt-Base CheXpert Classifier with CBAM Attention}, year = {2025}, publisher = {HuggingFace}, url = {https://huggingface.co/spaces/your-username/convnext-chexpert-gradcam} } ``` ## 🔗 Links - **Original Repository**: [GitHub](https://github.com/jikaan/convnext-chexpert-attention) - **CheXpert Dataset**: [Stanford ML Group](https://stanfordmlgroup.github.io/competitions/chexpert/) - **Paper**: [CheXpert: A large chest radiograph dataset](https://arxiv.org/abs/1901.07031) ## 📄 License Apache License 2.0 - See [LICENSE](https://github.com/jikaan/convnext-chexpert-attention/blob/main/LICENSE) for details. --- **Created by Time | October 2025**