File size: 1,794 Bytes
1a56d9e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
---
license: mit
tags:
  - image-classification
  - pytorch
  - resnet
  - medical
  - dental
  - orthodontics
datasets:
  - custom
metrics:
  - accuracy
pipeline_tag: image-classification
---

# Orthodontic Condition Classifier

A ResNet18-based image classification model trained to detect orthodontic conditions from dental photos.

## Model Details

- **Architecture**: ResNet18
- **Input Size**: 512x512 RGB images
- **Output**: 8 orthodontic condition classes
- **Test Accuracy**: 72.73%

## Classes

1. Crossbite
2. Crowding
3. Deepbite
4. No Treatment Needed
5. Open Bite
6. Overbite
7. Spacing
8. Underbite

## Usage

```python
import torch
from torchvision import transforms, models
from PIL import Image

# Load model
model = models.resnet18(weights=None)
model.fc = torch.nn.Linear(model.fc.in_features, 8)
state_dict = torch.load("pytorch_model.pth", map_location="cpu")
model.load_state_dict(state_dict)
model.eval()

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

image = Image.open("dental_photo.jpg").convert("RGB")
input_tensor = transform(image).unsqueeze(0)

# Predict
with torch.no_grad():
    outputs = model(input_tensor)
    probabilities = torch.nn.functional.softmax(outputs, dim=1)
    predicted_class = torch.argmax(probabilities, dim=1).item()
```

## Training Data

Trained on a custom dataset of dental photographs labeled by orthodontic condition.

## Limitations

- This model is for screening purposes only and should not replace professional orthodontic evaluation
- Accuracy may vary based on image quality and lighting conditions
- Best results with clear, well-lit frontal photos of teeth

## License

MIT License