AP6621 commited on
Commit
6069067
Β·
verified Β·
1 Parent(s): b887528

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +118 -32
README.md CHANGED
@@ -1,58 +1,144 @@
1
  ---
2
  license: mit
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  ---
4
- Got it. I’ll prepare a README file for the `teeth_alignment_detection_modal` Keras model hosted on Hugging Face. This README will include details such as model architecture, purpose, usage instructions, input/output formats, and licensing if available.
5
 
6
- I’ll let you know as soon as it’s ready.
7
 
8
- # Teeth Alignment Detection Model
9
 
10
- **Model Overview:** This Keras model is designed to analyze dental images and classify teeth alignment (e.g., whether teeth are properly aligned or not). It can assist in dental diagnostics and orthodontic assessments by flagging alignment issues from intraoral photographs or X-rays. Clinical tooth photographs are essential for orthodontic diagnosis and treatment planning ([Application of deep learning artificial intelligence technique to the classification of clinical orthodontic photos | BMC Oral Health | Full Text](https://bmcoralhealth.biomedcentral.com/articles/10.1186/s12903-022-02466-x#:~:text=Taking%20facial%20and%20intraoral%20clinical,photos%20according%20to%20their%20orientations)), and convolutional neural networks (CNNs) like this one have been successfully applied to similar orthodontic imaging tasks ([Application of deep learning artificial intelligence technique to the classification of clinical orthodontic photos | BMC Oral Health | Full Text](https://bmcoralhealth.biomedcentral.com/articles/10.1186/s12903-022-02466-x#:~:text=Taking%20facial%20and%20intraoral%20clinical,photos%20according%20to%20their%20orientations)). In practice, this model could be used as a screening tool in orthodontics or general dentistry to quickly flag cases of malocclusion or crowding for further evaluation by a specialist.
 
 
11
 
12
- **Model Architecture:** The exact layer details are not documented, but the model is implemented as a convolutional neural network (CNN) in Keras. Such dental image classifiers typically consist of multiple convolutional layers (often with large initial filters, e.g. 7Γ—7, followed by smaller filters), pooling or subsampling layers, and residual connections ([
13
- Artificial Intelligence for Classifying and Archiving Orthodontic Images - PMC
14
- ](https://pmc.ncbi.nlm.nih.gov/articles/PMC8813223/#:~:text=Our%20framework%20is%20composed%20of,features%20were%20obtained%20based%20on)). The network likely ends with one or more fully connected (dense) layers producing the alignment classification. (For example, CNN architectures for orthodontic image tasks use stacks of Conv2D + ReLU + pooling layers, sometimes with residual shortcuts, as seen in related work ([
15
- Artificial Intelligence for Classifying and Archiving Orthodontic Images - PMC
16
- ](https://pmc.ncbi.nlm.nih.gov/articles/PMC8813223/#:~:text=Our%20framework%20is%20composed%20of,features%20were%20obtained%20based%20on)).) The expected input shape is an image tensor (e.g., height Γ— width Γ— 3 for RGB photos). Inference would take a preprocessed image of the patient’s teeth (resized to the model’s input size, e.g. 224Γ—224 or similar) and output a probability or class label indicating β€œaligned” vs β€œmisaligned” teeth.
17
 
18
- **Training Data:** No public dataset details are provided. In general, a teeth alignment classifier would require a collection of labeled dental images (such as intraoral photos or panoramic X-rays) annotated for alignment. For example, intraoral photos are routinely used in orthodontic diagnosis and have been labeled by experts for CNN training in research ([Application of deep learning artificial intelligence technique to the classification of clinical orthodontic photos | BMC Oral Health | Full Text](https://bmcoralhealth.biomedcentral.com/articles/10.1186/s12903-022-02466-x#:~:text=Taking%20facial%20and%20intraoral%20clinical,photos%20according%20to%20their%20orientations)). We assume this model was trained on a dataset of dental images (photos or scans) with labels for proper vs. improper alignment. (If using this model, ensure that your input images are similar in style and quality to its training data.)
19
 
20
- **Usage Instructions:** Below is a Python example showing how to load and use the model for inference. You will need the `tensorflow` and `huggingface_hub` libraries.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
 
22
  ```python
23
  from tensorflow import keras
24
  from huggingface_hub import hf_hub_download
25
 
26
- # Download the model file from Hugging Face Hub
27
  model_path = hf_hub_download(repo_id="AP6621/teeth_alignment_detection_modal", filename="final_teeth_model.keras")
28
  model = keras.models.load_model(model_path)
29
 
30
- # Load and preprocess an image of teeth
31
  img = keras.preprocessing.image.load_img("path/to/teeth_image.jpg", target_size=(224, 224))
32
- x = keras.preprocessing.image.img_to_array(img) / 255.0 # normalize pixel values
33
- x = x.reshape((1,) + x.shape) # add batch dimension
34
 
35
- # Run the model on the image
36
  preds = model.predict(x)
37
- print("Raw model output:", preds)
38
- # For a binary classifier, you might interpret preds[0][0] > 0.5 as "misaligned", for example.
39
  ```
40
 
41
- *Expected input:* a color image of teeth (e.g. JPG or PNG), resized to the model’s input resolution (the original training size, e.g. 224Γ—224). Preprocessing may include scaling pixel values (as shown).
42
- *Output:* A 1D array of probabilities or logits. For a two-class model, `preds[0]` might contain two values (e.g. `[p_aligned, p_misaligned]`). Interpret the higher probability as the predicted class (for example, `preds[0].argmax()` yields the predicted label).
43
 
44
- **Performance and Evaluation:** No official accuracy or F1 metrics are provided for this specific model. For context, CNN-based models in orthodontic imaging tasks often achieve very high accuracy. For example, a published CNN classifier of orthodontic clinical photos achieved about 98% accuracy on its test set ([Application of deep learning artificial intelligence technique to the classification of clinical orthodontic photos | BMC Oral Health | Full Text](https://bmcoralhealth.biomedcentral.com/articles/10.1186/s12903-022-02466-x#:~:text=Results)). However, real-world performance can vary: model accuracy depends on the similarity of new images to the training set. Users should validate this model’s performance on their own data before relying on its predictions in practice.
45
 
46
- **Limitations:** As with any AI model, this should be used as a supplementary tool, not a definitive diagnostic. The model’s performance will depend on the quality and representativeness of its training data. In one study, models trained only on specialist-reviewed orthodontic images did not generalize well to different datasets ([
47
- Artificial Intelligence for Classifying and Archiving Orthodontic Images - PMC
48
- ](https://pmc.ncbi.nlm.nih.gov/articles/PMC8813223/#:~:text=Nevertheless%2C%20our%20study%20presents%20several,of%20the%20lack%20of%20dentists)). Similarly, if the training images lack diversity (age, demographics, imaging conditions), the model may perform poorly on out-of-distribution cases. Manual labeling by dental experts was required in related work ([
49
- Artificial Intelligence for Classifying and Archiving Orthodontic Images - PMC
50
- ](https://pmc.ncbi.nlm.nih.gov/articles/PMC8813223/#:~:text=Nevertheless%2C%20our%20study%20presents%20several,of%20the%20lack%20of%20dentists)), so if the training set has noisy or biased labels, predictions may be unreliable. In summary, only use this model on similar types of dental images to those it was trained on, and always review its output with expert judgment. This model is *not* a replacement for a professional dental evaluation and has not been clinically validated.
51
 
52
- **License:** This model is released under the **MIT License** ([AP6621/teeth_alignment_detection_modal Β· Hugging Face](https://huggingface.co/AP6621/teeth_alignment_detection_modal#:~:text=Keras)), meaning it is open source and free to use under the terms of the MIT license.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
53
 
54
- **References:** While this model’s own documentation is sparse, related orthodontic imaging studies provide context: intraoral clinical photos are key to diagnosis ([Application of deep learning artificial intelligence technique to the classification of clinical orthodontic photos | BMC Oral Health | Full Text](https://bmcoralhealth.biomedcentral.com/articles/10.1186/s12903-022-02466-x#:~:text=Taking%20facial%20and%20intraoral%20clinical,photos%20according%20to%20their%20orientations)), and CNNs with convolutional and residual layers are commonly used for tooth image analysis ([
55
- Artificial Intelligence for Classifying and Archiving Orthodontic Images - PMC
56
- ](https://pmc.ncbi.nlm.nih.gov/articles/PMC8813223/#:~:text=Our%20framework%20is%20composed%20of,features%20were%20obtained%20based%20on)) ([
57
- Artificial Intelligence for Classifying and Archiving Orthodontic Images - PMC
58
- ](https://pmc.ncbi.nlm.nih.gov/articles/PMC8813223/#:~:text=Nevertheless%2C%20our%20study%20presents%20several,of%20the%20lack%20of%20dentists)).
 
1
  ---
2
  license: mit
3
+ tags:
4
+ - keras
5
+ - teeth-alignment
6
+ - dental
7
+ - healthcare
8
+ - unsupervised-learning
9
+ - rlhf
10
+ - image-classification
11
+ datasets:
12
+ - custom
13
+ library_name: keras
14
+ language: en
15
+ pipeline_tag: image-classification
16
  ---
 
17
 
18
+ # 🦷 Teeth Alignment Detection Model
19
 
20
+ <h1 align="center">🦷 Teeth Alignment Detection Model</h1>
21
 
22
+ <p align="center">
23
+ <img src="https://huggingface.co/VilaVision/dentalmisalignmentdetection/resolve/main/Overbite.jpeg" alt="VilaVision Logo" width="400"/>
24
+ </p>
25
 
 
 
 
 
 
26
 
27
+ ## 🧠 Overview
28
 
29
+ This Keras model classifies dental images into **aligned** vs. **misaligned** categories. It is designed to aid dental practitioners and orthodontists by analyzing clinical photos or X-rays and detecting signs of malocclusion, crowding, or improper alignment.
30
+
31
+ πŸ§ͺ **Training Highlights**:
32
+ - **Unsupervised Learning Phase**: Learns visual features from unlabeled dental image data.
33
+ - **RLHF (Reinforcement Learning with Human Feedback)**: Fine-tuned using expert-labeled feedback to make the predictions align with real-world diagnoses.
34
+
35
+ > πŸ“Œ This model is a research tool and not a substitute for professional dental evaluation.
36
+
37
+ ---
38
+
39
+ ## πŸ—οΈ Architecture
40
+
41
+ The model is a Convolutional Neural Network (CNN), built in Keras. It likely includes:
42
+
43
+ - Convolutional layers (Conv2D + ReLU)
44
+ - MaxPooling or AveragePooling layers
45
+ - Dense classification layers
46
+ - Possibly residual connections for stability
47
+
48
+ πŸ–ΌοΈ **Input shape**: `(224, 224, 3)`
49
+ πŸ“€ **Output**: Class probabilities (e.g., `[0.8, 0.2]` β†’ "aligned")
50
+
51
+ ---
52
+
53
+ ## 🧾 Training Data
54
+
55
+ Though the dataset is not publicly available, it likely contains:
56
+
57
+ - Intraoral or panoramic dental photographs
58
+ - Images annotated by human experts
59
+ - Unlabeled data used in the unsupervised phase
60
+ - Labeled samples used during RLHF fine-tuning
61
+
62
+ The model is inspired by techniques described in [BMC Oral Health, 2022](https://bmcoralhealth.biomedcentral.com/articles/10.1186/s12903-022-02466-x) and [PMC Orthodontic AI](https://pmc.ncbi.nlm.nih.gov/articles/PMC8813223/).
63
+
64
+ ---
65
+
66
+ ## πŸš€ Usage
67
+
68
+ ### πŸ”§ Install Dependencies
69
+
70
+ ```bash
71
+ pip install tensorflow huggingface_hub
72
+ ```
73
+
74
+ ### πŸ“„ Load and Predict
75
 
76
  ```python
77
  from tensorflow import keras
78
  from huggingface_hub import hf_hub_download
79
 
80
+ # Download model
81
  model_path = hf_hub_download(repo_id="AP6621/teeth_alignment_detection_modal", filename="final_teeth_model.keras")
82
  model = keras.models.load_model(model_path)
83
 
84
+ # Preprocess image
85
  img = keras.preprocessing.image.load_img("path/to/teeth_image.jpg", target_size=(224, 224))
86
+ x = keras.preprocessing.image.img_to_array(img) / 255.0
87
+ x = x.reshape((1,) + x.shape)
88
 
89
+ # Predict
90
  preds = model.predict(x)
91
+ print("Raw output:", preds)
92
+ # Example: preds[0][0] > 0.5 β†’ "misaligned"
93
  ```
94
 
95
+ ---
 
96
 
97
+ ## πŸ“₯ Input & πŸ“€ Output
98
 
99
+ | Type | Description |
100
+ | ------ | ------------------------------------------- |
101
+ | Input | JPG/PNG image of teeth (224Γ—224), RGB |
102
+ | Output | Class probabilities for alignment detection |
 
103
 
104
+ ---
105
+
106
+ ## πŸ“ˆ Performance
107
+
108
+ While no official metrics are available, CNN models for orthodontic imaging tasks have reported:
109
+
110
+ * ~95–98% accuracy ([BMC Oral Health, 2022](https://bmcoralhealth.biomedcentral.com/articles/10.1186/s12903-022-02466-x))
111
+ * High F1-scores in clinical benchmarks
112
+
113
+ **Note:** Performance may vary on images that differ from the training distribution.
114
+
115
+ ---
116
+
117
+ ## ⚠️ Limitations
118
+
119
+ * Not suitable for diagnostic use without expert supervision
120
+ * Trained on specific dental image styles β€” generalization may be limited
121
+ * May not perform well on low-quality or occluded images
122
+ * Biases in training data may affect outputs
123
+
124
+ Always consult a licensed orthodontist or dentist before taking action based on model predictions.
125
+
126
+ ---
127
+
128
+ ## πŸ“œ License
129
+
130
+ πŸͺͺ MIT License – free to use, modify, and distribute.
131
+
132
+ [View on Hugging Face β†’](https://huggingface.co/AP6621/teeth_alignment_detection_modal)
133
+
134
+ ---
135
+
136
+ ## πŸ“š References
137
+
138
+ * [Deep Learning for Orthodontic Photo Classification – BMC Oral Health](https://bmcoralhealth.biomedcentral.com/articles/10.1186/s12903-022-02466-x)
139
+ * [AI for Classifying Orthodontic Images – PMC Study](https://pmc.ncbi.nlm.nih.gov/articles/PMC8813223/)
140
+ * [OpenAI – Learning from Human Feedback (RLHF)](https://openai.com/research/learning-from-human-feedback)
141
+
142
+ ---
143
 
144
+ 🧠 *Model built and maintained by [VilaVision](https://github.com/VilaVision)*