Image Analysis 4.0 packages multiple computer vision tasks behind one HTTP endpoint, and the features query parameter decides which visual feature pipelines execute per call. The shape of that parameter directly drives cost (per feature, per transaction), latency (each feature adds milliseconds of model inference), and the contents of the response JSON. Selecting the right feature set is therefore the first design decision in any image processing workload, and it is the single largest predictor of whether a vision integration scales economically.
The supported feature names are tags, objects, caption, denseCaptions, read, smartCrops, and people. They can be combined freely. Each maps to a distinct model head in Image Analysis 4.0, and each carries its own constraints. Captioning, dense captioning, and tagging require an English-speaking region (West Europe, East US, North Europe, West US, Southeast Asia, East Asia, West US 2, France Central, Switzerland North, Australia East, Korea Central, Japan East, North Central US, Sweden Central, Norway East) because Florence captioning has not shipped in every region. OCR (read) and objects, tags, smartCrops, and people are available in additional regions. When choosing a region for a Foundry account you intend to use for Image Analysis 4.0, you pick first by feature availability, then by data residency, then by latency.
A second axis of selection is the underlying model version. The 4.0 API accepts a model-version query parameter; passing latest opts into the most recent stable Florence backbone, while pinning a specific version (for example 2023-10-01) freezes responses for regression testing. Pinning is the right call once a system is in production: an upstream model refresh that improves overall accuracy can still change individual captions or confidence values, which can break downstream rules. The same model-version semantics apply to caption gender neutrality: the gender-neutral-caption parameter, when set to true, instructs the captioner to swap gendered pronouns and nouns for neutral alternatives. Applications that surface captions in user-facing copy almost always want this on; analytics applications that key off descriptive captions can leave it off.
The third axis is per-feature configuration. smartCrops accepts smartcrops-aspect-ratios as a comma-separated list of floats between 0.75 and 1.8 (for example 0.9,1.33), one cropped region returned per ratio. read honors the language parameter when the workload knows the document language up front, which improves OCR accuracy on look-alike scripts. caption and denseCaptions honor language to localize captions into a subset of supported tongues, with English remaining the default. people and objects return bounding boxes only and do not take additional parameters at request time.
The fourth axis is request scope: synchronous vs. analyzed-from-blob. Image Analysis 4.0 supports both Content-Type: application/json with a {"url": "..."} body and Content-Type: application/octet-stream with raw image bytes. The maximum image size is documented as 20 MB, dimensions between 50 by 50 and 16,000 by 16,000 pixels, and supported formats JPEG, PNG, GIF, BMP, WEBP, ICO, TIFF, and MPO. Smart crop and OCR have a working dimension floor of 50 pixels for the shortest side.
# Image Analysis 4.0 client with feature selection per request
import os
from azure.ai.vision.imageanalysis import ImageAnalysisClient
from azure.ai.vision.imageanalysis.models import VisualFeatures
from azure.identity import DefaultAzureCredential
endpoint = os.environ["VISION_ENDPOINT"]
client = ImageAnalysisClient(
endpoint=endpoint,
credential=DefaultAzureCredential(),
)
# Cost-shaped call: pick exactly what the downstream consumer needs.
result = client.analyze_from_url(
image_url="https://contoso.blob.core.windows.net/intake/receipt-9821.jpg",
visual_features=[
VisualFeatures.READ,
VisualFeatures.CAPTION,
VisualFeatures.TAGS,
],
language="en",
gender_neutral_caption=True,
model_version="latest",
)
When ergonomically selecting features, walk the use case decision tree. A "describe this image for an alt text generator" path picks caption (plus gender-neutral-caption=true) and nothing else, because the rest is waste. A "moderate uploads for unwanted content" path picks tags (and pairs it with Content Safety, not Image Analysis). A "redact PII on scanned forms" path picks read only, because boxes and captions are noise. A "social media post composer for a marketing site" path picks caption, denseCaptions, and smartCrops to power alt text, hashtags, and thumbnails. A "warehouse inventory tracker" path picks objects for box geometry, and switches to Custom Vision when the inventory taxonomy diverges from the Image Analysis general object vocabulary.
Train a custom image model, including image classification and object detection
Prebuilt Image Analysis is sufficient when the recognition domain matches the public Florence vocabulary (people, vehicles, furniture, food, animals, common signage). Domain-specific recognition (a brand-specific damage taxonomy, a factory-floor parts catalog, a medical-device shelf, a sports-league logo set) needs a trained custom image model. The training surface for an image model has two flavors: Custom Vision projects (the long-standing product hosted at customvision.ai) and Image Analysis 4.0 model customization (the Florence-based fine-tuning surface for classification and detection). Both produce a model artifact you can call from the prediction REST API.
Custom Vision splits projects into image classification (whole image label) and object detection (label plus bounding box), and within classification it splits multiclass (one label per image) and multilabel (zero or more labels per image). The choice is permanent at project creation. Image Analysis 4.0 customization, by contrast, lets you train both classification and detection models that ride the Florence vision backbone, which lowers the minimum training set per category to as few as 2 to 5 images while still producing usable accuracy. The price for that low minimum is that Image Analysis 4.0 customization is available in fewer regions than the base Image Analysis service and shares the standard Image Analysis pricing tier.
Training data sourcing is the same in both products. Each labeled image must be at least 256 pixels on the smallest side, at most 6 MB (training) or 4 MB (prediction), in JPEG, PNG, BMP, or GIF format. Each tag should hit a class balance target. The published guidance is at least 50 images per tag for usable classification, at least 15 per tag as an absolute floor for an evaluable model, and a roughly even spread (no class more than 2x the smallest class) to avoid bias. Object detection needs more images per tag and tighter bounding boxes; the documented floor is 15 bounded instances of each tag across the training set, but 50 to 100 is more representative.
# Bootstrap a Custom Vision classification project, then a detection project.
from azure.cognitiveservices.vision.customvision.training import CustomVisionTrainingClient
from msrest.authentication import ApiKeyCredentials
training_key = os.environ["CV_TRAINING_KEY"]
training_endpoint = os.environ["CV_TRAINING_ENDPOINT"] # ends in /customvision.ai/
credentials = ApiKeyCredentials(in_headers={"Training-key": training_key})
trainer = CustomVisionTrainingClient(training_endpoint, credentials)
# Domain IDs identify model architectures (General, Food, Landmarks, Retail,
# Compact variants for edge export). General [A2] is the typical default for
# server-side multiclass classification.
domains = trainer.get_domains()
classification_domain_id = next(d.id for d in domains if d.name == "General [A2]" and d.type == "Classification")
detection_domain_id = next(d.id for d in domains if d.name == "General [A1]" and d.type == "ObjectDetection")
classifier = trainer.create_project(
name="contoso-defect-classifier",
classification_type="Multilabel",
domain_id=classification_domain_id,
)
detector = trainer.create_project(
name="contoso-pallet-detector",
classification_type=None,
domain_id=detection_domain_id,
)
Domains in Custom Vision are pre-baked vision backbones tuned for specific verticals. The names follow a stable pattern: General, General (compact), General [A1], General [A2], General [A1] (compact), Food, Food (compact), Landmarks, Landmarks (compact), Retail, Retail (compact). The non-compact variants stay server-hosted and reach higher accuracy on a deep backbone; the compact variants export to TensorFlow, CoreML, ONNX, Docker, or the Vision AI Dev Kit for edge inference. General [A1] and General [A2] are newer architectures that outperform the older General on most workloads. A classification project must use a Classification-type domain; an object detection project must use an ObjectDetection-type domain. Mixing the two is rejected at project create time.
💡 Exam Trap: Custom Vision projects fix
classification_typeanddomain_idat creation. You cannot convert a multiclass project to multilabel, you cannot convert a classification project to object detection, and you cannot swap from General [A2] to Retail without exporting the labeled images and re-importing them into a fresh project.
💡 Exam Trap: Image Analysis 4.0 model customization is a separate surface from Custom Vision; they share neither training data, projects, nor APIs. Custom Vision projects do not feed into Image Analysis 4.0, and Image Analysis 4.0 custom models cannot be exported as compact ONNX for edge deployment in the way Custom Vision compact domains can.
⚠️ Anti-Pattern: Selecting every visual feature on every call as a default. Each feature adds a billable transaction in some pricing models, plus inference latency on the order of tens to hundreds of milliseconds per feature. The right shape is per-route feature selection in the application layer.
📊 Limit: Image Analysis 4.0 image input limits are 20 MB maximum, between 50 by 50 and 16,000 by 16,000 pixels, formats JPEG, PNG, GIF, BMP, WEBP, ICO, TIFF, MPO. Smart Crop minimum dimension is 50 pixels per side.
🎯 Scenario: A retail intake portal needs to validate uploaded product photos and generate alt text for the storefront. The team picks
caption(withgender-neutral-caption=true) for alt text,tagsto drive search facets,smartCropswith0.75,1.0,1.33for the thumbnail set, andreadto flag accidental text watermarks. They skipdenseCaptionsbecause the storefront caption budget is one sentence per image, and they skipobjectsbecause they have a separate Custom Vision project for product classification.
Decision Anchor. Choose Image Analysis 4.0 prebuilt features when the recognition vocabulary is general (people, objects, scenes, text in standard scripts) and the workload is read-only consumption. Choose Custom Vision when you need to recognize a domain-specific taxonomy with edge export. Choose Image Analysis 4.0 model customization when you need domain-specific recognition but want to start from a Florence backbone with very small training sets.
