CoolFace
Apppublic

Mr0Diablo/Dental-Pathology-Classifier

sourceHugging Facemitupdated 1y agoView on Hugging Face
1likes
App README

๐Ÿฆท Dental Pathology Classification System

<div align="center"> <img src="https://img.shields.io/badge/TensorFlow-FF6F00?style=for-the-badge&logo=tensorflow&logoColor=white" alt="TensorFlow"> <img src="https://img.shields.io/badge/Python-3776AB?style=for-the-badge&logo=python&logoColor=white" alt="Python"> <img src="https://img.shields.io/badge/Streamlit-FF4B4B?style=for-the-badge&logo=streamlit&logoColor=white" alt="Streamlit"> <img src="https://img.shields.io/badge/OpenCV-27338e?style=for-the-badge&logo=OpenCV&logoColor=white" alt="OpenCV"> </div>


๐ŸŽฏ Overview

Advanced AI-powered oral health diagnosis using EfficientNetB0 deep learning for automated dental pathology classification. This system identifies 7 different oral conditions from uploaded images with 95.2% accuracy.

Key Features

  • โ€”7-class dental image classification using EfficientNetB0 transfer learning
  • โ€”Web interface built with Streamlit for easy image upload and prediction
  • โ€”Medical information included for each condition with risk levels
  • โ€”Prediction confidence and top-3 results display
  • โ€”Real-time analysis with progress tracking

๐Ÿ“Š Dataset & Performance

The dataset contains 5,624 high-resolution dental images across 7 pathological categories:

CategoryFull NameDescriptionRisk Level
CaSCold Sore (Herpes Simplex)Viral infection causing fluid-filled blistersLow
CoSCanker Sore (Aphthous Ulcer)Shallow, painful ulcers inside mouthLow
GumGum Disease (Periodontal Disease)Infection and inflammation of gumsMedium
MCMucocele (Mucous Cyst)Benign cyst containing mucusLow
OCOral CancerMalignant tumor in oral cavityHigh
OLPOral Lichen PlanusChronic inflammatory conditionMedium
OTOther/Normal TissueHealthy tissue or benign conditionsLow

Data Split:

  • โ€”Training: 3,087 images (55%)
  • โ€”Validation: 1,028 images (18%)
  • โ€”Testing: 1,509 images (27%)

๐Ÿ—๏ธ Model Architecture

Development Phases

Phase 1: Custom CNN

  • โ€”Base CNN: 51.07% accuracy
  • โ€”With data augmentation: 80.45% accuracy
  • โ€”16.87M parameters

Phase 2: Transfer Learning

  • โ€”EfficientNetB0 pre-trained on ImageNet
  • โ€”Fine-tuned for dental pathology classification
  • โ€”Input size: 256ร—256 pixels
  • โ€”Improved performance with fewer parameters

๐Ÿš€ Web Application

The Streamlit app provides:

  • โ€”Image upload for classification
  • โ€”Prediction results with confidence scores
  • โ€”Medical information for each condition
  • โ€”Risk assessment (Low/Medium/High)
  • โ€”Session history tracking
  • โ€”Responsive design with dark mode support

๐Ÿ› ๏ธ Usage

How to Use

  1. 1.Upload a clear dental/oral image (JPG, PNG, BMP, TIFF)
  2. 2.Wait for AI analysis
  3. 3.Review prediction results with confidence scores
  4. 4.Follow medical recommendations

Supported Formats

  • โ€”JPG/JPEG
  • โ€”PNG
  • โ€”BMP
  • โ€”TIFF

๐Ÿ’ป Technical Implementation

Image Processing Pipeline

  1. 1.Format Validation: Supports JPG, PNG, BMP, TIFF formats
  2. 2.Preprocessing: RGB conversion, resizing to 256ร—256
  3. 3.Normalization: EfficientNet-specific preprocessing
  4. 4.Batch Processing: Optimized for single and batch predictions

Model Integration

  • โ€”Cached Loading: Efficient model loading with @st.cache_resource
  • โ€”Progress Tracking: Real-time loading and prediction progress
  • โ€”Error Handling: Comprehensive error management and user feedback
  • โ€”Memory Optimization: Efficient resource usage for web deployment

User Experience Features

  • โ€”๐Ÿ“ค Drag & Drop Upload: Intuitive file upload interface
  • โ€”๐Ÿ–ผ๏ธ Image Preview: Original image display with metadata
  • โ€”๐Ÿ“Š Interactive Results: Expandable sections and detailed breakdowns
  • โ€”๐Ÿ“ Prediction History: Session-based prediction tracking
  • โ€”๐Ÿ”„ Real-time Updates: Dynamic content updates without page refresh

๐Ÿ“ˆ Results

ModelAccuracyLossParameters
Custom CNN80.45%0.549816.87M
EfficientNetB0 Transfer95.2%0.1876.2M

๐Ÿ”ฌ Technical Highlights

  • โ€”Transfer Learning: EfficientNetB0 pre-trained on ImageNet
  • โ€”Medical Image Processing: Specialized preprocessing for dental images
  • โ€”Web Deployment: Streamlit application with modern UI
  • โ€”Data Augmentation: Improved model generalization
  • โ€”Multi-class Classification: 7 distinct oral pathology categories

๐ŸŽ“ Learning Outcomes

This project demonstrates:

  • โ€”Deep Learning: Custom CNN development and transfer learning
  • โ€”Computer Vision: Medical image classification and preprocessing
  • โ€”Web Development: Streamlit application deployment
  • โ€”Data Science: Model evaluation and performance analysis

๐Ÿš€ Future Enhancements

  • โ€”Model Improvements: Ensemble methods and additional architectures
  • โ€”More Categories: Expand to additional oral pathology types
  • โ€”Mobile App: Native mobile application development
  • โ€”API Development: RESTful API for integration
  • โ€”Batch Processing: Multiple image analysis capabilities

โš ๏ธ Disclaimer

This tool is for educational and research purposes only. It should not be used as a substitute for professional medical diagnosis or treatment. Always consult qualified healthcare providers for medical evaluation.


๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


๐Ÿ™ Acknowledgments

  • โ€”Cellula Technologies for the internship opportunity
  • โ€”Healthcare professionals for dataset validation
  • โ€”Open-source community for tools and libraries
  • โ€”TensorFlow and Streamlit teams for the frameworks

<div align="center"> <strong>Developed during Computer Vision Engineering Internship at Cellula Technologies</strong> </div>