Umlomo – Oral Cancer Detection Model

This model is a fine‑tuned MobileNetV2 for binary classification of oral cavity images into Normal or Oral Cancer. It is part of the MySmile project, an AI‑powered oral health screening tool designed to empower individuals with early risk assessment.

Model Details

  • Base Architecture: MobileNetV2 (pretrained on ImageNet)
  • Fine‑tuned Dataset: Curated oral images (normal and cancerous)
  • Input Size: 224×224 RGB
  • Output: Two classes – Normal and Oral Cancer
  • Framework: PyTorch

Intended Use

This model is intended for research and educational purposes within the MySmile screening application. It provides a preliminary risk assessment and is not a substitute for professional medical diagnosis.

How to Use

Installation

pip install torch torchvision pillow

import torch
from torchvision import transforms
from PIL import Image

# Load model
model = torch.hub.load('mysmile/umlomo', 'model', trust_repo=True)
model.eval()

# Preprocess image
transform = transforms.Compose([
    transforms.Resize((224, 224)),
    transforms.ToTensor(),
    transforms.Normalize(mean=[0.485, 0.456, 0.406],
                         std=[0.229, 0.224, 0.225])
])

image = Image.open('oral_photo.jpg').convert('RGB')
input_tensor = transform(image).unsqueeze(0)

# Inference
with torch.no_grad():
    outputs = model(input_tensor)
    probs = torch.softmax(outputs, dim=1)
    pred_idx = torch.argmax(probs, dim=1).item()

class_names = ['Normal', 'Oral Cancer']
print(f"Prediction: {class_names[pred_idx]}, Confidence: {probs[0][pred_idx]:.2f}")

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support