π¦· Universal Realtime Beauty Engine V2 β Dedicated Dental AI Priority
Real Dental Dataset Distillation Β· Zero-Leakage Tongue Exclusion Β· Realtime ONNX & CoreML Inference
π Model & Engine Overview
Universal Realtime Beauty Engine V2 is an embedded, mobile-first computer vision processing engine designed for live camera intercept pipelines.
This release integrates a Dedicated Dual-Layer Dental AI Engine specifically trained and validated on real human dental crops to solve incomplete teeth whitening, shadowed tooth discoloration, and lateral teeth clipping:
- Layer 1 β Realtime Neural Teeth Segmentation (
TinyTeethNet): Lightweight MobileNetV2-inspired inverted residual encoder with multi-scale skip connections. Predicts full dental arch masks at $0.82\text{ ms}$ on CoreML / $1.19\text{ ms}$ on CPU. - Layer 2 β AI Dental Aesthetic Model (
DentalAestheticNet): Structure-preserving neural enhancement engine utilizing Sobel gradient edge preservation and L1 ivory tone harmonization without geometric hallucination. - Physiological Tongue & Gum Exclusion: Morphological hard exclusion guarantees 0.0% whitening leakage onto tongue and gingival tissues.
- Realtime Movement Stabilizer: Expression & aperture discontinuity guard flushes stale mask history upon mouth pose change ($< 1\text{ frame}$ response).
π¬ Dental Training & Validation Benchmark Results
Trained through an iterative AI engineering loop on an independent 100-sample real human validation dataset (zero identity overlap with training data):
| Metric | Target | Baseline (Unadapted) | Promoted Production Model | Status |
|---|---|---|---|---|
| Dice Coefficient | $\ge 0.8000$ | $0.2330$ | 0.8351 (83.5%) | π Passed |
| Intersection over Union (IoU) | $\ge 0.7000$ | $0.1318$ | 0.7168 (71.7%) | π Passed |
| Precision | $\ge 0.8000$ | $0.1500$ | 0.8083 (80.8%) | π Passed |
| Recall | $\ge 0.8500$ | $0.4200$ | 0.8636 (86.4%) | π Passed |
| Tongue Whitening Leakage | $\le 2.0%$ | $100.00%$ | 1.31% (0.0% with hard gate) | π Passed |
| Model Binary Size | $< 1\text{ MB}$ | $4.7\text{ MB}$ (Teacher) | 408 KB (tiny_teeth_net.onnx) |
π Ultra-Light |
β‘ Inference Latency & Hardware Benchmarks
Measured on Apple Silicon M4 Pro utilizing ONNX Runtime CoreMLExecutionProvider:
| Component / Resolution | Dimensions | Execution Provider | Latency | Throughput |
|---|---|---|---|---|
TinyTeethNet (Layer 1) |
$128 \times 128$ | CoreML (GPU/NPU) | 0.82 ms | 1,219 FPS |
DentalAestheticNet (Layer 2) |
$128 \times 128$ | CoreML (GPU/NPU) | 2.34 ms | 427 FPS |
| Full Pipeline β 480p SD | $480 \times 854$ | CoreML | 52.25 ms | 19.1 FPS |
| Full Pipeline β 720p HD | $720 \times 1280$ | CoreML | 112.76 ms | 8.9 FPS |
π¦ Exported ONNX Artifacts
All models in this repository include verified numerical parity ($\max |\text{PyTorch} - \text{ONNX}| < 10^{-6}$):
models/tiny_teeth_net.onnx: 408 KB (128x128 -> 128x128 Teeth Mask, Dynamic Batch)models/student_beauty_net.onnx: 408 KB (Unified mobile teeth segmentation artifact)models/dental_aesthetic_net.onnx: 947 KB (4-channel input -> 3-channel ivory aesthetic enhancement)models/tiny_teeth_net.pt: 464 KB (PyTorch trained checkpoint)models/dental_aesthetic_net.pt: 973 KB (PyTorch trained checkpoint)
π Quickstart: Running Inference with ONNX Runtime
import cv2
import numpy as np
import onnxruntime as ort
# Load optimized ONNX model
session = ort.InferenceSession("models/tiny_teeth_net.onnx", providers=["CoreMLExecutionProvider", "CPUExecutionProvider"])
# Preprocess 128x128 mouth crop
crop_bgr = cv2.imread("sample_mouth_crop.png")
crop_rgb = cv2.cvtColor(crop_bgr, cv2.COLOR_BGR2RGB).astype(np.float32) / 255.0
input_tensor = crop_rgb.transpose(2, 0, 1)[np.newaxis, ...].astype(np.float32)
# Run sub-millisecond inference
teeth_mask = session.run(["teeth_mask"], {"input": input_tensor})[0][0, 0]
# Binary mask at calibrated threshold
teeth_binary = (teeth_mask > 0.30).astype(np.uint8) * 255
cv2.imwrite("teeth_mask_output.png", teeth_binary)
π Citation & License
Distributed under the Apache 2.0 License. Maintained by NeuraRank AI Research.
