A web-based, mobile accessible artificial intelligence system designed for preventive oral health screening using smartphone images. It allows users to take a photo of their teeth using their smartphone camera, upload it to the platform, and receive an instant AI-powered analysis that identifies visible signs of common oral health conditions including calculus, caries, gingivitis, hypodontia, mouth ulcer, and tooth discoloration.
Watch the SmartSmile system deployed:
- AI-Powered Analysis: Uses your custom-trained EfficientViT-B0 model
- 6 Condition Detection:
- Calculus (Tartar)
- Caries (Cavities)
- Gingivitis
- Hypodontia (Missing Teeth)
- Mouth Ulcer
- Tooth Discoloration
- User Authentication: Secure signup and login with Supabase
- Email Verification: Users must verify their email before accessing the dashboard
- Password Management: Forgot password and password change functionality
- Profile Settings: Update name, phone, and manage account
- Home Page: Landing page with system information
- Dashboard: View screening history and recent results
- Screening: Upload dental images for AI analysis
- Results: Detailed analysis with heatmap visualization
- History: View all past screening results
- Settings: Account and profile management
- Education: Oral health education articles
- About: Information about SmartSmile
- Contact: Contact form for inquiries
- Privacy Policy: Data handling and privacy information
- Terms of Service: User terms and conditions
- Admin Panel: Admin-only dashboard for platform management
The EfficientViT-B0 model was selected after comparing 20+ deep learning architectures. Here are the results:
| Metric | Score |
|---|---|
| Accuracy | 91.94% |
| Precision | 90.54% |
| Recall | 90.72% |
| F1 Score | 90.61% |
| Model | Accuracy | Precision | Recall | F1 Score |
|---|---|---|---|---|
| InceptionResnetV2 | 92.54% | 91.06% | 91.85% | 91.32% |
| EfficientViT-M2 | 92.37% | 91.74% | 92.02% | 91.74% |
| EfficientViT-M5 | 92.28% | 92.15% | 90.41% | 90.80% |
| EfficientNetB2 | 92.10% | 92.39% | 92.10% | 92.21% |
| EfficientViT-B0 | 91.94% | 90.54% | 90.72% | 90.61% |
Note: EfficientViT-B0 was chosen for deployment due to its excellent balance of accuracy and computational efficiency, making it suitable for real-time applications.
- Framework: PyTorch with timm library
- Image Size: 224x224 pixels
- Training Epochs: 25
- Optimizer: AdamW
- Learning Rate: 0.001
- Dataset: 6-class oral disease classification (6,000+ images)
- Node.js 18+
- Python 3.8+
- pip
- Gmail account (for sending emails) or Supabase account
- Clone the repository
git clone <repository-url>
cd SmartSmile- Install Python dependencies:
cd backend
pip install -r requirements.txt- Install Node.js dependencies:
npm install- Configure Environment Variables:
Create a .env.local file in the root directory:
# Python Backend API URL
PYTHON_API_URL=http://localhost:8000
NEXT_PUBLIC_APP_URL=http://localhost:3000
# Supabase Configuration (get these from your Supabase project)
NEXT_PUBLIC_SUPABASE_URL=https://your-project.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-key
SUPABASE_JWT_SECRET=your-jwt-secret
SUPABASE_SERVICE_ROLE_KEY=your-service-role-key
# SMTP Configuration for Custom Emails (Gmail)
SMTP_USERNAME=your-email@gmail.com
SMTP_PASSWORD=your-app-password
EMAIL_FROM_NAME=SmartSmile
EMAIL_FROM_EMAIL=your-email@gmail.com- Start the Python Backend (Terminal 1):
cd backend
python app.pyServer runs at: http://localhost:8000
- Start the Frontend (Terminal 2):
npm run devApp runs at: http://localhost:3000
- Open Browser: Go to http://localhost:3000
- Sign up for a new account
- Verify your email by clicking the link in the welcome email
- Log in and start screening!
βββ app/ # Next.js frontend (App Router)
β βββ api/ # API routes
β β βββ analyze/ # Image analysis endpoint
β β βββ auth/ # Authentication endpoints
β β βββ email/ # Email sending endpoint
β βββ dashboard/ # User dashboard
β βββ screening/ # Dental image upload & analysis
β βββ results/ # Analysis results display
β βββ history/ # Screening history
β βββ settings/ # Account settings
β βββ admin/ # Admin panel
β βββ education/ # Educational content
β βββ about/ # About page
β βββ contact/ # Contact form
β βββ privacy/ # Privacy policy
β βββ terms/ # Terms of service
β βββ login/ # Login page
β βββ signup/ # Signup page
β βββ verify/ # Email verification page
β βββ page.tsx # Home/Landing page
βββ backend/ # Python FastAPI backend
β βββ app.py # Main server with endpoints
β βββ model_loader.py # PyTorch model loading
β βββ inference.py # Image prediction logic
β βββ email_service.py # Gmail SMTP email service
β βββ requirements.txt # Python dependencies
β βββ best_model/ # Trained model files
β βββ efficientvit_b0_oral_disease_classifier.pth
βββ components/ # React components
β βββ ui/ # UI component library
βββ lib/ # Utility functions
βββ hooks/ # React hooks
βββ best_model/ # Trained model (backup location)
βββ notebooks/ # Jupyter notebooks for model training
βββ README.md # This file
Watch the SmartSmile system in action:
- User signs up with email and password
- SmartSmile sends a verification email via Gmail SMTP
- User clicks the verification link to confirm their email
- After verification, user can log in and access the dashboard
- User can update profile, change password, and manage their account
- User logs in and navigates to the Screening page
- User uploads a dental photograph
- Image is sent to the Python backend for AI analysis
- The EfficientViT-B0 model processes the image
- Results are displayed with:
- Detected condition
- Confidence score
- Risk level (Low/Moderate/High)
- Professional recommendations
- Heatmap visualization showing areas of concern
- Results are saved to user's history
- Framework: Next.js 14 (App Router)
- Language: TypeScript
- UI Components: Custom component library with Tailwind CSS
- Authentication: Supabase Auth
- State Management: React hooks and context
- Framework: Python FastAPI
- AI/ML: PyTorch, timm library
- Model: EfficientViT-B0 (custom trained)
- Email: Gmail SMTP with custom templates
- Database: Supabase (PostgreSQL)
- Authentication: Supabase Auth with email/password
GET /- API informationGET /health- Health checkPOST /predict- Run inference on dental imagePOST /email/send-verification- Send verification emailPOST /email/send-password-reset- Send password reset emailPOST /email/send-password-changed- Send password changed confirmation
POST /api/auth/signup- User registrationPOST /api/auth/login- User loginPOST /api/auth/verify- Email verificationPOST /api/analyze- Submit image for analysisPOST /api/email/send- Send various email types
- The trained model file must be in
backend/best_model/directory - Ensure both servers (frontend and backend) are running before using the application
- Gmail requires an "App Password" for SMTP - enable 2FA and create an app password
- Users must verify their email before accessing the dashboard (email verification required)
- Email confirmation required before login access
- Password reset via email
- Password change notifications
- Secure Supabase authentication with JWT tokens
- Service role key used for admin operations only
This project is for educational and demonstration purposes.