PATCHGAN PARADOX/ brats-2020
Dataset BraTS 2020 · 369 volumes Ablation Models A–D Runs 5 × 35 epochs Compute 12.2 GPU-h Author Dhruv Gupta · Bennett University
Deployment

The Second Opinion Diagnostic Gateway

A trained model in a .keras file helps nobody. This is the architecture that puts Model D in a radiologist's browser — an automated second opinion for boundary verification, with no local GPU, no install, and no patient data leaving the clinic's control.

Inference TensorFlow + FastAPI Gateway Node.js / Express Client browser dashboard Footprint zero installation
The gap

Built for the underserved middle

Large teaching hospitals already run segmentation software, bundled into six-figure PACS contracts with on-premise GPU servers behind them. Individual researchers can run a notebook. The gap is everything in between: mid-sized clinical networks and diagnostic centres that have radiologists and scanners but no imaging-informatics budget and no machine-learning engineer to maintain a deployment.

For that group the barrier is never model accuracy. It is installation, hardware, licensing and maintenance. So the design constraint here is not "how good can the segmentation be" but "what is the smallest thing a radiologist has to do to get a second opinion on a boundary?" The answer targeted here is: open a browser tab and drop in a slice.

Design constraints

  • Zero installation. No desktop client, no PACS plugin, no driver.
  • No local compute. A 7.76 M-parameter 2D model runs in seconds on a CPU container.
  • Stateless inference. The engine holds no scan after the response is returned.
  • Preprocessing on the server. CLAHE and resizing run next to the model, so a client can never silently feed the network the wrong distribution.
  • Assistive, never autonomous. The output is a second opinion on a boundary a human has already drawn — not a diagnosis.
Architecture

Serverless microservice

Three tiers, each independently deployable, with the model isolated behind a gateway that never lets the browser talk to it directly.

CLIENTGATEWAYINFERENCE Clinical dashboard browser · no install · raw MRI slice upload · mask overlay + opacity · side-by-side comparison Backend proxy Node.js / Express · secure clinical gateway · resolves cross-origin limits · auth, rate limit, audit log AI inference engine TensorFlow + FastAPI · stateless container · CLAHE natively handled · Model D generator, 29.7 MB slice POST /segment base64 mask overlay INSIDE THE CONTAINER decodeCLAHEresize + scale generatorargmax → PNG No scan is persisted — the container holds the slice only for the duration of the request.
The proxy exists for two reasons: it terminates the browser's cross-origin constraints so the inference container never needs a public CORS surface, and it is the only tier that has to know anything about clinic identity, quotas or audit.
Model size on the wire
29.7MB
the Model D generator, loaded once per cold start
Inference hardware
CPU
a 2D 7.76 M-parameter network needs no GPU at serving time
Client requirement
None
a browser; the preprocessing contract lives on the server

Why the preprocessing belongs on the server

This is the one deployment decision that comes directly out of the research. Model D was trained on a very specific input distribution: FLAIR in channel 0, T1ce in channel 1, resized to 128×128, divided by the volume maximum, and — in the CLAHE pipeline — contrast-equalised with a clip limit of 2.0 over 8×8 tiles.

Get any of that wrong and the network does not fail loudly. It returns a confident, plausible, wrong mask. Swapping the two channels alone is enough. Putting the entire preprocessing chain inside the inference container means no client — and no future integration written by someone who has never read the training notebook — can violate the contract the model was trained under.

Scope of the claim. The architecture on this page is the deployment design proposed in the study, not a running clinical product. The models are research artefacts trained on 250 BraTS patients and evaluated on that same benchmark distribution. Any real deployment would need prospective validation, regulatory clearance, and a clinical governance process. Nothing here is a medical device.

Roadmap

Three directions, in the order the study argues they matter.

1 · 3D volumetric segmentation

Every model here segments a slice at a time, so nothing prevents an implausible jump between adjacent slices of the same lesion. Processing raw NIfTI volumes end to end would let the discriminator penalise structural anomalies across the continuous Z axis — which is exactly the global-coherence property the PatchGAN Paradox showed to be the fragile one. It is the natural next step for this specific finding, not just a generic upgrade.

2 · Federated learning

Segmentation models generalise poorly across scanners, field strengths and acquisition protocols, and the obvious fix — pooling scans from many clinics — is the one thing patient-data law makes hardest. Federated training aggregates weight updates from clinic nodes on a cloud node while protected health information never leaves the site that holds it. For the target market of this deployment — many small networks rather than one large hospital — it is the only training strategy that scales.

3 · Multi-modal expansion

The gateway is modality-agnostic: the browser tier, the proxy and the container contract do not care what the model inside segments. Extending the same platform to other imaging tasks (bone fracture detection is the worked example) turns a single research model into a privacy-preserving B2B diagnostic platform rather than a one-off demo.


The deployment architecture and roadmap on this page are drawn from the project report and presentation by Dhruv Gupta, Bennett University. Read the paper (PDF) · Presentation deck (PDF)