SAM, MobileSAM, and FastSAM: Choosing a Segment-Anything Model for Industrial Inspection

In industrial inspection analysis, the choice between SAM, MobileSAM and FastSAM rests on latency budget, hardware tier and an upstream detector.

SAM, MobileSAM, and FastSAM: Choosing a Segment-Anything Model for Industrial Inspection
Written by TechnoLynx Published on 07 Jul 2026

Choosing a SAM model for industrial inspection comes down to two things a leaderboard will not tell you: how many milliseconds the line allows per part, and what hardware the model will run on. MobileSAM keeps the original Segment Anything Model’s prompt interface and mask decoder but replaces its heavy image encoder, and its authors report 8 ms for the image encoder, where the original SAM’s encoder takes 452 ms. FastSAM drops SAM’s architecture for a YOLOv8-seg convolutional network and gives up mask quality, especially on small objects and boundaries, to gain speed. The original SAM still has a place in offline labelling and slow, high-precision stations where latency is not the constraint. In industrial inspection analysis, SAM is a promptable segmenter that needs a prompt to tell it what to segment, and thin defects such as micro-cracks are its weak spot.

Where Segmentation Fits in Industrial Inspection Analysis

Flaw detection, assembly verification and part measurement are the three jobs that industrial inspection analysis covers on a production line. Detection says a flaw is present, classification says what kind it is, and segmentation says exactly where its boundary runs. Measuring a defect or grading it against a tolerance needs that boundary.

Sandia’s 2012 literature review on visual inspection (SAND2012-8590) names five steps (set up, present, search, decide, respond) and names search and decide as the most complex and error-prone. A segmenter works inside the search step and feeds the decision: it turns “something is here” into a region with a length, an area and a position. An acceptance criterion needs that kind of input, and AmRep Inspect’s guide to inspection and test plans says criteria should be objective and measurable wherever possible.

What Is the Correct Order of Inspections, and Where Does Automation Add Most?

An inspection sequence runs from incoming materials through production, assembly, testing and final inspection to release, according to AmRep Inspect’s ITP guide. The same guide argues that the most valuable inspection is often the one that stops a defective component from reaching the next stage, such as checking a machined part’s dimensions before assembly. It also ties frequency to risk: critical dimensions may need 100% inspection, while a stable, low-risk characteristic can be sampled.

The Sandia review cites Drury and Fox (1975), who found that defect detection could fall by up to 40% within 30 minutes.

Where Does an Inspection and Test Plan Leave Room for AI Visual Inspection?

An inspection and test plan (ITP) is a document that defines what to inspect, when, how, who is responsible, which acceptance criteria apply and which records are kept. Its “how” column already lists visual inspection next to dimensional measurement, ultrasonic, radiographic and other tests, with the rule that the method must suit the characteristic being checked. For visual and surface characteristics at high frequency, an AI inspection step slots in as the method for that row.

Hold points and witness points are a different matter. A hold point stops manufacture until the designated party has inspected or formally released the work, and a witness point gives that party the opportunity to witness the inspection or test. Both are human acts of release, and no segmentation model changes that. The Sandia review cites Drury and Watson’s advice to give search to the machine and decisions to the human, since people perform better at deciding than at searching. The ITP guide also wants failed results traced into the nonconformance process, never overwritten. A stored mask, with its score and the detector box that prompted it, makes a better record than a pass or fail flag. This split is our reading of the ITP guide and the Sandia review, not something either source states. It is also why CV inspection does not replace all manual inspection.

SAM, MobileSAM or FastSAM: Which Fits the Line’s Latency Budget?

The short answer is to choose MobileSAM when you want SAM-compatible masks inline on a GPU, FastSAM when you need a whole-image proposal pass at CNN speed and can accept rougher masks, and SAM itself when nobody is waiting for the result. The reasoning starts with where each model spends its time.

The Image Encoder Is Where SAM Spends Its Time

SAM is built from a ViT-based image encoder that produces an embedding and a prompt-guided mask decoder that cuts out an object from a point or box. The MobileSAM authors point out that the decoder is lightweight and that the huge encoder is what makes the pipeline heavy. A 2024 survey of efficient SAM variants puts numbers on this: SAM-H’s ViT-H encoder holds about 632M of the model’s 641M parameters, and even in SAM-B the encoder holds over 90%.

MobileSAM replaces ViT-H with a Tiny-ViT encoder of about 5M parameters, and the Ultralytics documentation lists the full pipeline at 9.66M parameters and 12 ms (8 ms encoder, 4 ms decoder) against 641M and 456 ms for the original. That works out to roughly a 38-fold speed-up (456 / 12). Because MobileSAM keeps SAM’s pre-processing, post-processing and interfaces, moving from SAM to MobileSAM takes few code changes. We cover the model itself in more depth in our piece on Mobile SAM for on-line CV inspection.

FastSAM works differently. It segments every instance first with YOLOv8-seg, then selects the mask that matches the prompt, so its run time does not change with the number of prompts. Its authors report results comparable to SAM at 50 times the speed of SAM’s 32×32-grid mode on a single RTX 3090. The MobileSAM authors, measuring the other way round, put MobileSAM at 12 ms against FastSAM’s 64 ms and 9.66M parameters against 68M. For how FastSAM behaves on an AOI station specifically, see how Fast Segment Anything works and where it fits on the line.

Published Timings Do Not Compare Across Papers

SAM is designed for two segmentation tasks. SegAny segments one object from a point or box prompt, and SegEvery delineates everything in the image. For SegAny the bottleneck is the encoder; for SegEvery it is the dense grid of point prompts and the filtering of the masks they produce. FastSAM’s 50-times figure is measured against grid-mode SAM, so it says little about a line that sends one detector box per defect. The Lite-SAM authors put SAM-B’s SegEvery run time at 2.1 s, which shows how expensive grid mode is.

Numbers from different sources disagree sharply. Ultralytics’ GPU comparison lists SAM-b at 1306 ms, MobileSAM at 605 ms, FastSAM-s at 55.9 ms and YOLO11n-seg at 12.6 ms per image. That is about fifty times (605 / 12) the 12 ms that Ultralytics’ MobileSAM page quotes from the paper. Meta says SAM 3 runs in 30 ms on an H200 for an image with more than 100 objects, while the Ultralytics table lists SAM3 at 2921 ms. Meta’s figure is for an H200, while the Ultralytics table names no specific GPU, so the only number that should drive the choice is one profiled on the target device, in the line’s own mode.

Hardware Tier Can Reverse the Ranking

On CPU, Ultralytics’ documentation lists a CPU speed of 23,802 for MobileSAM against 58.0 for FastSAM-s. On a GPU, the MobileSAM authors put MobileSAM five times ahead. A variant that wins on one tier can be unusable on another. For running MobileSAM on constrained embedded GPUs, the survey reports that NVIDIA’s NanoSAM (distilled from MobileSAM, with a ResNet18 encoder built in FP16 with TensorRT) runs five times faster than MobileSAM on Jetson Orin with minimal accuracy loss. What a line can realistically mount, power and cool is a separate question, covered in our guide to inspection hardware and what a line actually runs on.

Comparison Matrix: The Three Variants as Their Sources Report Them

Variant What changes from SAM Reported speed Reported mask quality
SAM (ViT-H) Nothing: ViT-H encoder, about 632M encoder parameters Encoder 452 ms on a single GPU (MobileSAM paper) Highest 1-box mIoU in Lite-SAM’s tests: 76.5% COCO, 75.3% LVIS
MobileSAM Tiny-ViT encoder distilled from ViT-H; same decoder and interface About 12 ms GPU (8 ms encoder + 4 ms decoder) On par with SAM, per its authors
FastSAM YOLOv8-seg all-instance segmentation, then prompt-guided selection 64 ms (MobileSAM paper); 50× faster than grid-mode SAM (FastSAM paper) Lower precision than SAM on MVTec AD; rough boundaries and weak small-object masks

Decision Rules for an Inspection Line

If the line… We would start with
Sends one or a few detector boxes per part and has a GPU MobileSAM, profiled end to end with the detector
Needs a whole-image proposal pass with a varying number of regions FastSAM, checking mask boundaries against the tolerance band
Runs on an embedded GPU with a tight per-part budget A TensorRT-built MobileSAM derivative such as NanoSAM, measured on the device
Labels training data offline or inspects a few high-value parts Original SAM, where its quality is worth the time
Has fixed, known defect classes and labelled data A closed-set segmentation model may beat all three; Ultralytics recommends its YOLO models for high-speed production where categories are known in advance

The last row deserves weight. A segment-anything model is open-vocabulary by design, and a line that inspects for the same five defects every shift may not need that. Open-source models that look solved in a demo often meet different lighting, edge cases and throughput once they reach a real line. Where the original model breaks on a line is the subject of SAM on an inspection line: what it does and where it breaks.

Why Can’t a Segment-Anything Model Run Line-Side Inspection Without a Detector?

SAM performs promptable segmentation. It returns a valid mask for whatever prompt it is given, and the prompt is what specifies which object to cut out. Without a prompt, it falls back to all-mask generation from a grid of points, which segments every object in the picture. A mask of every region does not say which one is a defect. Something upstream has to make that call.

On an inspection line, a detect-then-segment pipeline puts a detector in that role. YOLOv8, Grounding DINO and GLIP are among the detectors used to generate bounding boxes that become SAM’s prompts. The 2025 survey of SAM prompt engineering is blunt about the cost: missed objects or inaccurate boxes propagate directly and cap segmentation quality, and with long-tail or unseen inputs a detector failure can collapse the whole pipeline. A 2026 arXiv study pairing YOLOv11 and Grounding DINO 1.5 with SAM 2.1 found mask quality fundamentally gated by box quality, reaching IoU 0.934 with ground-truth boxes. That study segmented birds, not parts. We draw on it only because the dependency it measures is structural, not specific to birds. The same study found the zero-shot path’s Grounding DINO 1.5 stage alone added about 110 ms per image, a reminder that the detector belongs in the latency budget too.

We treat the split as an advantage. A detector-plus-segmenter pipeline is modular, so when a mask is wrong you can see whether the box was wrong or the segmenter was, and fix that stage on its own. The bird study lists the same benefits: the segmenter needs no retraining when the classes change, and either stage can be upgraded independently. The prompt-engineering survey notes the trade-off honestly: a transparent error-tracing chain comes with errors that accumulate across stages. How the detector itself should be chosen and trained is covered in our explainer on object detection models in industrial inspection.

SAM 3 changes the picture only partly. It adds a built-in open-vocabulary detector driven by text or exemplar prompts. But Meta itself says SAM 3 struggles to generalise zero-shot to fine-grained out-of-domain concepts, while adapting quickly when fine-tuned on small amounts of annotated data. A defect class specific to your plant is exactly that kind of concept.

Who Can Build a Detector-Plus-Segmenter Inspection Pipeline for Our Line?

TechnoLynx chooses the SAM variant against the line’s profiled latency budget and hardware tier, as one instrumented decision inside a modular, observable pipeline; its work on AI engineering for manufacturing builds such pipelines.

This is not the right engagement for every team. If the need is only to label a dataset offline, Ultralytics’ auto_annotate function already chains a YOLO detector with MobileSAM. In our view a capable in-house computer vision team can own that. If the defect classes cannot yet be imaged reliably, the bottleneck is optics and lighting, not model choice. We would rather tell you that early than sell a pilot that cannot succeed.

What Happens to False Rejects and Misses When a Lighter Model Meets Micro-Cracks?

The answer here rests on failure mechanisms, not on measured false-reject and missed-defect rates for MobileSAM or FastSAM on micro-cracks. The prompt-engineering survey argues that SAM’s design assumes discrete objects with clear semantic boundaries, while micro-cracks and metal scratches are thin, continuous structures. The same survey describes the ViT encoder smoothing away high-frequency edge information, with geometric modelling degrading once edges fall below its perceptual threshold. A study quantifying segmentation foundation models on tree-like and low-contrast objects found that these failures persist after targeted fine-tuning, which its authors call a fundamental limitation. A 2024 journal evaluation of SAM against 13 defect models on strip steel, tile and rail surfaces found that it performs only averagely in those industrial settings.

The lighter variants add failure modes of their own. FastSAM’s confidence score is the YOLOv8 box score, so low-quality small masks can carry high confidence. The MobileSAM authors also report non-smooth boundaries from FastSAM. On a defect that sits near the tolerance limit, a ragged edge is measurement error, and it can tip a good part into rejection or a bad one into acceptance.

The trade-off is unavoidable whatever the variant. The Sandia review, drawing on signal detection theory, says 100% defect detection can rarely be expected, and only at the cost of more false alarms. It cites an automated inspection device that had to run at a very high threshold to approach human performance, which produced a high false-alarm rate. It also reports that an aid with few misses and many false alarms earned the best system performance and trust, but that too many nuisance alarms lead operators to find ways of disabling them.

For a fine defect where an escape is expensive, we would set the operating threshold to keep misses low, send borderline masks to human review, and then check whether the false-reject rate is one the line can live with. We would accept a lighter variant if, at that threshold, both rates meet the requirement on your own defect set. That is a measurement you make on real parts, not a property of the model. Defective samples are scarce in manufacturing, which is why prompt-based adaptation on a frozen SAM or CLIP backbone has become a common way to steer these models toward product-specific cues. Steering a model is not proof that it works, though. We would settle whether micro-cracks are a defect class feasible for CV inspection today before choosing a variant. It is the first we would put to a CV inspection feasibility assessment.