How to use from the
Use from the
sam2 library
# Use SAM2 with images
import torch
from sam2.sam2_image_predictor import SAM2ImagePredictor

predictor = SAM2ImagePredictor.from_pretrained("YAQICAI/LAO-X")

with torch.inference_mode(), torch.autocast("cuda", dtype=torch.bfloat16):
    predictor.set_image(<your_image>)
    masks, _, _ = predictor.predict(<input_prompts>)
# Use SAM2 with videos
import torch
from sam2.sam2_video_predictor import SAM2VideoPredictor

predictor = SAM2VideoPredictor.from_pretrained("YAQICAI/LAO-X")

with torch.inference_mode(), torch.autocast("cuda", dtype=torch.bfloat16):
    state = predictor.init_state(<your_video>)

    # add new prompts and instantly get the output on the same frame
    frame_idx, object_ids, masks = predictor.add_new_points(state, <your_prompts>)

    # propagate the prompts to get masklets throughout the video
    for frame_idx, object_ids, masks in predictor.propagate_in_video(state):
        ...

LAO-X

Model weights for "Localize Any Object in X-Ray Security Scans without Human Annotation" (NeurIPS 2026).

Paper ยท Code ยท Project website

LAO-X localizes objects in X-ray security scans without manual masks. The model is a granularity-controllable SAM 2.1 Hiera-S (UnSAMv2 architecture) fine-tuned only on synthetic X-ray images whose labels come from the LAO-X pipeline:

  1. an object bank mined from unlabeled DET-COMPASS scans (MuSc anomaly heatmaps fused with CutLER proposals),
  2. physics-guided synthesis: Beerโ€“Lambert composition of the banked objects' high/low-energy channels onto one empty container per image,
  3. oversegmentation pseudo-labels fused with the synthetic object masks,
  4. an easy โ†’ hard โ†’ extreme curriculum with increasing object count and overlap.

Files

File Description
laox_sam2.1_hiera_small.pt Final model (extreme stage, epoch 48), model weights only ({"model": state_dict}), float32, 46.4M parameters

SHA-256 of laox_sam2.1_hiera_small.pt: 9e7380409e0a51fb4f762db2f3c0fa875bcd299165ee29183b05516276f16d06

Usage

Install the code from the GitHub repository (see its INSTALL.md), then download the weights:

hf download YAQICAI/LAO-X laox_sam2.1_hiera_small.pt --local-dir checkpoints

Point prompts at a chosen granularity (0 = fine parts, 1 = whole objects):

import numpy as np
from PIL import Image
from sam2.build_sam import build_sam2
from sam2.sam2_image_predictor import SAM2ImagePredictor

model = build_sam2("configs/unsamv2_small.yaml", "checkpoints/laox_sam2.1_hiera_small.pt")
predictor = SAM2ImagePredictor(model)
predictor.set_image(np.array(Image.open("scan.png").convert("RGB")))
masks, scores, _ = predictor.predict(
    point_coords=np.array([[420, 300]]), point_labels=np.array([1]),
    multimask_output=False, gra=0.5,
)

Whole-image class-agnostic evaluation as in the paper (granularities 0.1โ€“0.8, mask threshold 0.5) is run with evaluate.py / scripts/eval_curriculum.sh in the GitHub repository.

Training

Initialized from SAM 2.1 Hiera-S and trained on 8 GPUs with batch size 2 per GPU; each stage starts from the previous stage's checkpoint.

Stage Objects / image Overlap gamma Samples Base LR Vision LR Epochs
easy 2โ€“4 0.0โ€“0.05 0โ€“4000 1.6e-4 4.8e-6 80
hard 4โ€“7 0.0โ€“0.3 0โ€“6000 1.2e-4 3.2e-6 64
extreme 6โ€“9 0.0โ€“0.5 0โ€“8000 1e-4 3e-6 48

No manual annotation was used for training.

Intended use and limitations

The model is intended for research on X-ray security imagery. It predicts class-agnostic masks and does not recognize object categories or threats; it must not be used as the sole basis for security decisions. It was trained on synthetic images built from DET-COMPASS scans and may perform worse on scanners with different colour rendering.

License

The weights are released under CC BY-NC-SA 4.0 (non-commercial use only), the same license as the LAO-X code. They are fine-tuned from SAM 2.1 (Apache-2.0).

Citation

@misc{cai2026localizeobjectxraysecurity,
      title={Localize Any Object in X-Ray Security Scans without Human Annotation},
      author={Yaqi Cai and Mingxuan Liu and Lorenzo Vaquero and Ning Wang and Nan Pu and Feng Xue and Elisa Ricci and Nicu Sebe},
      year={2026},
      eprint={2610.07326},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/2610.07326},
}
Downloads last month
113
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for YAQICAI/LAO-X

Finetuned
(21)
this model

Paper for YAQICAI/LAO-X