Home Problem Solution Features Interface Demo Architecture AI / ML PAR Index Software Testing Team Gallery Resources
Light / dark theme
2nd Year Project · CO2060 · Dept. of Computer Engineering, University of Peradeniya

Automated PAR Index Calculation from 3D Dental Models

A web-based clinical system that digitises orthodontic PAR (Peer Assessment Rating) scoring — replacing manual, cast-based measurement with 3D model upload, landmark detection, and automated geometric calculation of the weighted PAR score.

Stack · React · Spring Boot · FastAPI · MySQL Formats · STL / OBJ Roles · Admin · Orthodontist · Undergraduate
System overview graphic: a wireframe dental arch mesh with PAR component readouts (overjet, overbite) and the project's technology stack
0
Core Services — Frontend, Backend, ML Service
0
Weighted PAR Components Scored
0
Role-Based User Types
0/case
3D Scan Slots — Upper, Lower, Buccal
The Problem

Manual PAR scoring doesn't scale

The PAR Index is the clinical standard for measuring malocclusion severity and treatment outcome, but the way it's actually produced in practice hasn't changed much.

  • ✕
    Manual, cast-based measurement. Clinicians traditionally measure PAR components by hand from physical or scanned dental casts using a ruler and a PAR gauge.
  • ✕
    Slow, repetitive process. Seven components — upper/lower anterior, buccal occlusion, overjet, overbite, and centreline — must each be measured and recorded separately per case.
  • ✕
    Dependent on a trained clinician. Consistent scoring assumes the assessor is calibrated to the British Standard PAR system — capacity that is not always available at scale.
  • ✕
    Inter-observer variability. Manual measurement naturally varies between different clinicians scoring the same case, which is a well-known limitation of hand-scored PAR.
  • ✕
    3D scan data goes underused. Practices increasingly capture intraoral 3D scans, but that geometric data isn't routinely used to automate the scoring it could support.
Our Solution

From 3D scan to PAR score, digitally

The system takes the same clinical inputs orthodontists already work with — upper, lower, and buccal 3D scans — and automates the scoring pipeline around them, while keeping the clinician in control of every landmark it proposes.

  • ✓
    Digital 3D model upload. Orthodontists upload upper, lower, and buccal STL scans directly into a patient's case — no physical cast handling.
  • ✓
    ML-assisted landmark proposal. A geometric detection service analyses each mesh and proposes clinical landmark points automatically as a starting point.
  • ✓
    Clinician review & confirmation. The orthodontist reviews and adjusts proposed landmarks in an interactive 3D viewer before anything is scored — the clinician always has the final say.
  • ✓
    Automated, weighted PAR calculation. Once landmarks are confirmed, the system computes the full weighted PAR total using the British Standard weighting — consistently, every time.
  • ✓
    Optional independent ML cross-check. A separately trained regression model can estimate a total PAR score directly from the mesh geometry, as an advisory second opinion — never a replacement for the confirmed score.

Conceptual flow

1

3D Dental Model

Upper / lower / buccal STL upload

2

Landmark Detection

Geometric proposal by the ML service

3

Clinical Review

Orthodontist confirms landmark points

4

PAR Scoring

Weighted score computed & stored

Key Features

What the system actually does

Every feature below is implemented in the codebase — nothing here is aspirational.

Automated PAR Calculation

Computes the full weighted PAR total from confirmed clinical landmarks — upper/lower anterior, buccal occlusion, overjet, overbite, and centreline.

3D Dental Model Processing

Accepts STL mesh uploads per case, rendered and manipulated in an interactive Three.js-based 3D viewer in the browser.

Orthodontic Landmark Detection

A geometric mesh-analysis service proposes landmark points per arch, which the clinician reviews and confirms before scoring.

Patient & Case Management

Create and search patient records; manage PRE/POST treatment cases that can be paired to track progress across treatment.

Authentication & Authorization

Stateless JWT authentication with BCrypt password hashing, enforced by role-based access control on every endpoint.

Training Dataset Support

Undergraduate users submit anonymised scan sets with a ground-truth PAR score; orthodontists review and approve them for ML retraining.

ML Cross-Check & Audit Trail

An advisory total-PAR estimate from a trained regression model, with every calculation, prediction, and finalize action written to an audit log.

Administrative Functions

Admin-only user management, audit log review, ML model metrics, versioned training runs, and rollback control.

Case Finalization

Orthodontists lock a case once scoring is complete; only an administrator can reopen a finalized case.

System Interface

What the application looks like

Real screens captured from the running application — from account creation through to a finalised PAR score.

Create Account screen showing full name, email, password fields and an Orthodontist / Dental Undergraduate role selector
Sign-Up / LoginRole selection at registration — Orthodontist or Dental Undergraduate
Clinician dashboard showing My Patients, Submissions to Review, and Total Assigned Reviews counters
DashboardClinical overview for the signed-in user
Patient detail page showing date of birth, contact, status and a list of orthodontic cases
Patient ManagementPatient records & case history
Three.js 3D model viewer displaying an uploaded lower arch STL scan with Upper/Lower/Buccal tabs
3D Model ViewerThree.js STL viewer for an uploaded arch
3D Auto-Detection Workflow showing named landmark points being placed on an upper arch scan with a live progress checklist
Landmark PlacementGuided point-by-point landmark placement, ML-assisted
Manual PAR entry form with dropdowns for all seven weighted components: anterior segments, buccal occlusion, overjet, overbite and centreline
PAR CalculationManual entry form for all 7 weighted components
PAR Score Result page showing a total weighted PAR of 6 with a per-component breakdown table and an ML predicted PAR panel
Results PageWeighted PAR score breakdown & ML cross-check
Demo Video

Watch the system in action

A full walkthrough of the workflow — from patient creation to 3D model upload, landmark placement, and automated PAR scoring.

System Architecture

Three services, one clinical record

The browser never talks to the ML service directly — every ML call is proxied and authorised through the Spring Boot backend, which owns all clinical data.

🧑‍⚕️
Orthodontist / Admin / Undergraduate Browser
🖥️
React SPA Vite dev server · :5173
☕
Spring Boot API par-backend · :8081
🗄️
MySQL 8 par-mysql · :3307→3306
🧠
FastAPI ML Service par-ml · :8000
📁
Shared Upload Volume backend_uploads (read-only to ML)
Service-to-service auth. Every backend → ML request carries a shared X-ML-Service-Key header, validated by FastAPI middleware — the ML service is never reachable directly from the browser.

Frontend responsibilities

  • 3D model upload & viewing (Three.js)
  • Landmark review & confirmation UI
  • Case, patient & results dashboards
  • JWT-authenticated API calls

Backend responsibilities

  • Authentication & role authorization
  • Patient / case / file persistence
  • PAR calculation logic
  • Proxying & securing ML requests

ML service responsibilities

  • Geometric landmark detection
  • Trained PAR regression inference
  • Model training & version rollback
  • Dataset preprocessing for retraining
AI / ML

Two distinct capabilities — kept clearly separate

It matters clinically which parts of a score are geometric measurement and which are model prediction. The system is explicit about this at every step.

1 · Geometric Landmark Detection

A rule-based, geometric method — surface curvature and mesh analysis (via trimesh / networkx) — not a trained neural network. It proposes a starting set of landmark points per arch. Every point must still be reviewed and confirmed by the orthodontist before it can influence a score.

2 · PAR Regression Model

A PyTorch (CPU) regression model, trained on approved training-set submissions, predicts an independent total PAR score directly from mesh geometry — with a confidence value. It is advisory only and never substitutes for the clinician-confirmed geometric score.

Input

Upper, lower, and buccal STL meshes uploaded to a case (three files for a full /predict call; a single slot for landmark proposal).

Processing

FastAPI service (par-ml) reads mesh files from a shared, read-only Docker volume — no re-upload required — and runs geometric or model inference.

Output

Proposed landmark coordinates, or a predicted total PAR score with confidence — both stored with a score_source so their origin is always traceable.

Retraining pipeline. Undergraduate-submitted training sets are reviewed and approved by an orthodontist, then a preprocessing script builds the tensor dataset an admin uses to trigger a new training run — with the previous model version automatically backed up for rollback.
PAR Index Calculation

The British Standard weighted PAR index

The system implements the standard weighted PAR components. The weighted total is calculated only from confirmed clinical landmarks.

ComponentWeight
Upper anterior×1
Lower anterior×1
Buccal occlusion — left×1
Buccal occlusion — right×1
Overjet×6
Overbite×2
Centreline×4
Total Weighted PAR ScoreΣ (component × weight)

How a score is produced

  • Landmark points are placed (or ML-proposed then confirmed) on the uploaded meshes
  • Each of the seven components is measured geometrically from confirmed landmarks
  • Each raw component value is multiplied by its fixed weight
  • The weighted total is stored against the case with a score_source — MANUAL, AUTO_LANDMARK, or ML

Unconfirmed, ML-proposed landmarks can never contribute to a stored clinical score.

3D Model Processing

From mesh upload to landmark-ready viewer

Confirmed supported format: STL. Each case holds three model slots.

01

Upload

The orthodontist uploads an STL mesh for the upper arch, lower arch, and buccal (bite) view.

POST /cases/{id}/models
02

Storage & checksum

The backend stores the file and its checksum, and can verify mesh integrity on demand.

GET /cases/{id}/models/{slot}/verify
03

Interactive 3D viewing

The mesh renders in-browser using a Three.js-based viewer, allowing the clinician to rotate, inspect, and place or adjust landmark points.

04

ML-assisted proposal

The backend reads the same file from a shared volume and requests a geometric landmark proposal from the ML service.

POST /cases/{id}/predict-landmarks
Software

Technology stack

Every technology below is a direct dependency in the repository's build files.

Frontend

React 19 Vite React Router 7 Three.js Recharts Axios

Backend

Spring Boot 3 Spring Security Spring Data JPA Flyway JWT (jjwt)

ML Service

Python 3.11 FastAPI Uvicorn PyTorch (CPU) trimesh NetworkX

Data & Infra

MySQL 8.0 Docker Compose springdoc-openapi
User Roles

Three roles, clearly scoped permissions

Administrator

  • Full user management & audit log review
  • ML training control & version rollback
  • Unfinalize a locked case
  • Pre-seeded only — cannot self-register

Orthodontist

  • Create & manage patients and cases
  • Upload 3D models, review & confirm landmarks
  • Calculate & finalize PAR scores
  • Review undergraduate training submissions

Undergraduate

  • Submit anonymised scan sets
  • Provide ground-truth PAR scores for training data
  • Track their own submission status
Security

How access is protected

Authentication

Stateless JWT sessions (HMAC-signed), BCrypt password hashing at cost factor 10.

Authorization

Spring Security URL rules plus method-level @PreAuthorize role checks on nearly every endpoint.

Service-to-service

Backend → ML calls are authenticated with a shared secret header; CORS restricted to known local origins.

Testing & Validation

Current test coverage

This reflects what's actually in the repository today — reported plainly rather than overstated.

ComponentTest TypeStatus
Backend — Security JUnit unit & integration tests (JwtUtilTest, JwtAuthFilterTest, JwtRoundTripIntegrationTest, AccessControlServiceTest) Tested
Backend — Case Lifecycle MockMvc controller tests (CaseControllerTest) — finalize/unfinalize, PRE→POST case rules Tested
Backend — Training Set Workflow MockMvc controller tests (TrainingSetControllerTest) — review validation, reviewer authorization Tested
Backend — ML Endpoints MockMvc controller tests (MLControllerTest) — per-endpoint role matrix Tested
Backend — Auth Service JUnit unit tests (AuthServiceTest) Tested
Backend — File Serving MockMvc security tests (FileServeControllerSecurityTest) Tested
Backend — Landmark Placement MockMvc controller tests (LandmarkControllerTest) — role gating across all 5 endpoints, request-body validation Tested
Backend — Patient Service JUnit unit tests (PatientServiceTest) Partial
Backend — Storage Service JUnit unit tests (StorageServiceTest) — file validation, path-traversal guard Tested
PAR Calculation — Manual Entry Manual end-to-end verification (7-component form → weighted total) Tested
PAR Calculation — Auto (Landmark-based) Manual end-to-end verification against real scanned arches Tested
PAR Calculation — ML Prediction Manual end-to-end verification of the ML-predicted total score Tested
System / Docker Manual verification via docker compose up and container healthchecks Manual
Honest status. All three PAR-scoring pathways — manual entry, geometric auto-calculation from confirmed landmarks, and ML prediction — have been manually tested end-to-end and confirmed working. The backend carries 123 automated JUnit/MockMvc tests across 15 classes, all passing — covering authentication, case lifecycle, training-set review and ownership, ML endpoint authorization, and landmark-placement access control. Frontend and ML-service automated coverage is still a natural next step for the project.
Our Team

Group 10 · CO2060

Department of Computer Engineering, Faculty of Engineering, University of Peradeniya.

Team Leader
Photo of M.K.H. Ahamed

M.K.H. Ahamed

E/22/014
e22014@eng.pdn.ac.lk
Photo of M.A.M. Assadh

M.A.M. Assadh

E/22/034
e22034@eng.pdn.ac.lk
Photo of M.F.M. Ayyash

M.F.M. Ayyash

E/22/035
e22035@eng.pdn.ac.lk
Photo of M.N. Aamir

M.N. Aamir

E/22/036
e22036@eng.pdn.ac.lk
Supervisors

Project supervision

AB

Dr. Asitha Bandaranayake

Supervisor asithab@eng.pdn.ac.lk
HR

Dr. H.S.K. Ratnatilake

Supervisor
Resources

Documentation & links

GitHub Repository

Full source code for the frontend, backend, and ML service.

View on GitHub →

README & Docs

Installation, API reference, and technical documentation.

Read the README →

Department Listing

This project's page on the department's project directory.

View listing →

Department of CE

Faculty of Engineering, University of Peradeniya.

Visit department →