EndoSeg was built for the Nebius Serverless AI Builders Challenge
we had fine-tune an ovarian-lesion ultrasound segmenter on Nebius Serverless Jobs, export it to ONNX, and run inference in the browser so the scan never leaves the user's device.
This post is the honest version of that story — including the gap between a green mask that looks clinical and a model that cannot tell you whether a patient has endometriosis.
Research / education only. EndoSeg is not a medical device. It does not diagnose endometriosis, score disease risk, or replace imaging review by a clinician
.
## The Short Verdict
`| What the UI Can Show | What the Model Actually Outputs |
| :--- | :--- |
| Teal overlay, Dice, agreement %, "max probability" | A per-pixel lesion-vs-background mask |
| "Endometrioma / Chocolate Cyst" style labels | *Nothing from the network* — shape heuristics in JS |
| Cloud vs local "agreement" | Mask overlap between two segmenters, not diagnostic truth |
> **Note:** There is no code`` path that computes P(endometriosis), healthy vs diseased, or endometrioma vs other cyst from learned class labels.`
That wasn't accidental drift. The PRD scoped MVP as binary ovarian-lesion segmentation for Nebius's medical image segmentation track. Endometriosis is the motivation and the disclaimer — not the training objective. We planned a P1 endometrioma type-flag head; we never trained it. MMOTU's eight class IDs are discarded at preprocess time (mask > 0).
So if a doctor loads a healthy ovary and still sees a finding-like overlay: that's expected behavior of this segmenter, not a mystery bug.
Cloud → browser pipeline on Nebius
MMOTU ultrasound
→ Job N1 preprocess (CPU)
→ Job N2 U-Net fine-tune (GPU, Dice+BCE)
→ Job N3 ONNX export + parity check
→ static browser app (ONNX Runtime Web, WebGPU → WASM)
→ optional Endpoint + token-hiding proxy ("Compare to cloud")
Privacy-by-design is real for the default path: model weights are fetched once and cached; local inference runs in a Web Worker. Images stay on-device unless the user explicitly clicks cloud compare.
Numbers we will stand behind
Trained on MMOTU (1,469 frames), 50 epochs:
Split Dice IoU
Val (best @ epoch 33)
0.764
0.670
Test
0.755
0.655
Limitation: on 8 random test images, per-sample Dice ranged from 0.02 to 0.97. Medium/large lesions usually look right; small/thin ones sometimes get a confident "typical blob." Aggregate Dice hides that.
Also: this MMOTU mirror lacks recoverable patient IDs, so the split is stratified by file — not strictly patient-disjoint.
Where the product language overshoots the model
Pixel confidence ≠ disease confidence. "Mean confidence" / "Max probability" are statistics over the sigmoid mask, not P(disease).
Class IDs were thrown away. Preprocess binarizes masks. Class 5 ("Normal ovary") can still light up as foreground.
Type labels are heuristics. age-clinical.js maps mask geometry (Round / Unilocular → "Endometrioma / Chocolate Cyst"). That is not a classifier.
Agreement / Dice vs cloud measures mask overlap — useful ONNX sanity check — not clinical correctness.
What a doctor would need vs what they get
Clinician wants EndoSeg today
Endometrioma vs other cyst vs normal
Not from the model
Clear healthy / abnormal call
Segmentation of "something"
Confidence in a diagnosis
Pixel confidence + mask agreement
Lesion localization
Yes — this is the real MVP
Even the unfinished type head would answer "which MMOTU tumor type?" — still not "does this patient have endometriosis?"
Why we're publishing this anyway
For the challenge: real Nebius Jobs + Endpoint usage, reproducible train → ONNX → browser path, privacy-default demo, honest failure modes.
For readers: do not let the UI narrate a classifier you never trained. A footer disclaimer does not cancel a chocolate-cyst label driven by circularity.
git clone https://github.com/Gnana-Shishir-Kumar/nebius-challenge.git
cd nebius-challenge
npx serve browser
Full pipeline: bash repro.sh. Configs under nebius/.
If we course-correct next
Stop collapsing MMOTU classes in preprocess.
Train a classification / multi-task head (endometrioma / other / normal).
Show class probabilities — demote or remove shape→disease heuristics.
Keep browser-private segmentation as localization, not silent diagnosis.
Takeaway
EndoSeg is aligned with the Nebius PRD: browser-private lesion segmentation, fine-tuned and optionally compared in the cloud.
It is not a disease-identification tool. The overlay answers where lesion-like pixels are. It does not answer whether this patient has endometriosis.
Repo: https://github.com/Gnana-Shishir-Kumar/nebius-challenge