GERD Lightweight Vision Transformer π¬
This is a lightweight Vision Transformer (ViT) model trained to classify gastroesophageal images into 4 categories:
- Esophagitis: Inflammation of the esophagus
- GERD: Gastroesophageal Reflux Disease
- Normal: Healthy esophagus
- Ulcer: Esophageal ulceration
Model Details
Architecture
- Model Type: Lightweight Vision Transformer (ViT)
- Input Size: 224x224x3 (RGB)
- Patch Size: 8x8
- Projection Dimension: 64
- Transformer Layers: 4
- Attention Heads: 4
- MLP Head Units: [128, 64]
- Output Classes: 4
Training
- Trained using 5-Fold Cross-Validation
- Optimizer: Adam (lr=1e-4)
- Loss: Categorical Crossentropy with Label Smoothing (0.1)
- Early Stopping with patience=20
- Data Augmentation applied
Performance
- High accuracy on GERD classification tasks
- Optimized for medical image analysis
- Efficient inference with reduced parameters
Intended Use
This model is designed for research and educational purposes in medical image analysis. It should NOT be used as the sole diagnostic tool in clinical settings.
Direct Use
import tensorflow as tf
from PIL import Image
import numpy as np
# Load model
model = tf.keras.models.load_model('model.keras')
# Prepare image
image = Image.open('your_image.jpg').resize((224, 224))
image_array = np.array(image) / 255.0
image_array = np.expand_dims(image_array, axis=0)
# Predict
predictions = model.predict(image_array)
class_names = ['Esophagitis', 'GERD', 'Normal', 'Ulcer']
predicted_class = class_names[np.argmax(predictions)]
confidence = np.max(predictions)
print(f"Predicted: {predicted_class} (Confidence: {confidence:.2%})")
Limitations and Bias
β οΈ Important Disclaimers:
- This model is trained on a specific dataset and may not generalize to all populations
- Medical imaging interpretation requires clinical expertise
- Always consult healthcare professionals for medical decisions
- The model may have biases based on the training data distribution
Training Data
The model was trained on an augmented GERD dataset containing gastroesophageal images across 4 categories.
Citation
If you use this model, please cite appropriately and acknowledge the original dataset sources.
Contact
For questions or issues, please open an issue in the model repository.
Developed for medical image classification research
- Downloads last month
- 15
Evaluation results
- Accuracy on GERD Augmented Datasetself-reported0.950