Instructions to use tbaumgauntlet/parallax-brain-loc-v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use tbaumgauntlet/parallax-brain-loc-v2 with MLX:
# Make sure mlx-vlm is installed # pip install --upgrade mlx-vlm from mlx_vlm import load, generate from mlx_vlm.prompt_utils import apply_chat_template from mlx_vlm.utils import load_config # Load the model model, processor = load("tbaumgauntlet/parallax-brain-loc-v2") config = load_config("tbaumgauntlet/parallax-brain-loc-v2") # Prepare input image = ["http://images.cocodataset.org/val2017/000000039769.jpg"] prompt = "Describe this image." # Apply chat template formatted_prompt = apply_chat_template( processor, config, prompt, num_images=1 ) # Generate output output = generate(model, processor, formatted_prompt, image) print(output) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Atomic Chat
parallax-brain-loc-v2: brain-tumor bounding boxes on single MRI slices (MLX LoRA adapter)
Curriculum point
v2, not the selected model. Published so that the Parallax efficiency table can be regenerated witheval.py. The selected checkpoint is tbaumgauntlet/parallax-brain-loc-n1024.
A LoRA adapter for mlx-community/Qwen3-VL-2B-Instruct-4bit (revision 9c4f5209e57b31f4b9dfba735de3fb983739c9cc), trained with MLX-VLM
0.7.11 on Apple Silicon. Given one unannotated, contrast-enhanced T1 brain MRI slice it returns the tightest
axis-aligned box around the tumor as {"bbox":[x1,y1,x2,y2]} on a 0β1000 grid (origin top-left, x right, y down).
It does not name the tumor type. Research use only; not for diagnosis or any clinical decision.
Use
Requires Apple Silicon and the Parallax repository's MLX environment (requirements-mlx.lock.txt, mlx-vlm 0.7.11).
python eval.py --model <this repo id> --revision <commit> --eval-set <eval.jsonl>
eval.py reads parallax_model.json, checks the adapter sha256 (c22adc1eff56bf352b81b99b3fe7460eb7611bb5a6974e1b8b2918d3beeb4eef), downloads the base at its pinned
revision and checks its weight hashes, applies the declared prompt with greedy decoding, parses the reply strictly and
scores IoU against the reference box.
Prompt (single user turn, image first): This is one T1-weighted contrast-enhanced brain MRI slice that contains an intracranial tumor. Return the tightest axis-aligned bounding box that encloses the visible tumor. Coordinates are integers from 0 to 1000 on a normalized grid over the whole image: (0,0) is the top-left corner of the image and (1000,1000) the bottom-right corner; x increases to the right and y increases downward. (x1,y1) is the top-left corner of the box and (x2,y2) its bottom-right corner, with x1 < x2 and y1 < y2. Do not name the tumor type and do not give any diagnostic commentary. Output exactly one JSON object and nothing else, in the form {"bbox":[x1,y1,x2,y2]}: no prose, explanation, markdown or other keys.
Adapter
LoRA rank 16, alpha 32 (scale 2.0), dropout 0.05, on 196 language-model Linear layers (down_proj, gate_proj, k_proj, o_proj, q_proj, up_proj, v_proj); the vision tower is frozen with no adapters. The base is the mlx-community 4-bit conversion (affine, group 64) of Qwen/Qwen3-VL-2B-Instruct; the conversion does not record the upstream commit. Training: 128 training slices (data v2 = nested curriculum positions 1-128) from 78 training patient families, mask-derived human boxes, plus 42 filtered teacher-written auxiliary cue rows; 170 AdamW updates, lr 0.0001, completion-only loss, 866 s on an M1 Max.
This is an MLX adapter. It is not a PyTorch/PEFT adapter and does not load in transformers/peft.
Evaluation
| Set / metric | Value |
|---|---|
| Official holdout (54 patients): IoU β₯ 0.50 | 34/54 (63.0%) |
| Official holdout: mean / median IoU | 0.553 / 0.607 |
| Official holdout by class (M / G / P) | 14/18 / 8/18 / 12/18 |
| Official holdout: format-valid | 54/54 |
| Robustness adherence (3 information-preserving perturbations Γ 54) | 102/162 (63.0%) |
| Development pilot (30, used for model selection) | 15/30, mean IoU 0.456 |
| Untuned base, official holdout | 9/54, mean IoU 0.227 |
| Best frontier prompting (Gemini 4 structured), official | 50/54, mean IoU 0.780 |
| Targets 95% adherence / 90% robustness | not reached |
Data and attribution
Images and tumor masks: Jun Cheng, Brain tumor dataset, figshare, doi:10.6084/m9.figshare.1512427.v8 (CC BY 4.0); Cheng et al., "Enhanced Performance of Brain Tumor Classification via Tumor Region Augmentation and Partition", PLoS ONE 10(10), 2015, and "Retrieval of Brain Tumors by Adaptive Spatial Pooling and Fisher Vector Representation", PLoS ONE 11(6), 2016. Modifications: slices rendered to 8-bit PNG with a per-slice percentile window; masks converted to bounding boxes. Target boxes come from the manual annotations; any teacher-generated auxiliary text is model-written and filtered (see the dataset card).
Limitations
Single 2-D slices from one public dataset (one institution group); patient-family-disjoint evaluation only within that dataset. Faint and diffuse gliomas have uncertain boundaries; some source masks follow non-tumor structures. Not validated for clinical use.
Quantized
Model tree for tbaumgauntlet/parallax-brain-loc-v2
Base model
mlx-community/Qwen3-VL-2B-Instruct-4bit