Your profile

One profile for every MSDEVBUILD site. Only you can see it, and the site owner if you write in.

Lesson 27 of 39
❮Prev Next❯

Multimodal Image Understanding: Captions, Alt Text and Visual Q&A

Module 3: Computer Vision ⏱ 9 min read Updated

Your note

My notes for this lesson

Select any text in the lesson to highlight it or add a note. Saved in this browser.

    No highlights yet. Select a sentence in the lesson, then pick a colour or add a note.

    All my bookmarks and notes

    Reading settings

    For every lesson, saved in this browser.

    Text size
    Line spacing
    Font

    With IaaS you rent the virtual machine. Microsoft looks after the building, power and hardware; you patch the operating system.

    30-second answer

    A multimodal chat model such as gpt-4.1-mini reads images sent with your prompt, and the prompt decides the result: a concise or detailed caption, an answer to a visual question grounded in what's visible, or alt text that follows accessibility rules. One request can carry up to 10 images, and the detail setting (low, high, auto) trades cost and speed against small text.

    Simulate it » No Azure account needed

    Exam objective: 3.2.1 Build a solution that analyzes visual context by using multimodal models. 3.2.2 Configure apps to produce concise or detailed captions for single or multiple images. 3.2.3 Implement question answering grounded in visual evidence. 3.2.4 Configure generation of alt text and extended image descriptions aligned to accessibility guidelines. (Skills measured as of April 16, 2026)

    Simulations

    Feel it before you read it. No account needed, nothing leaves this page.

    Azure portal: Captions, questions and alt text from a multimodal model Caption, question and alt text in the Chat playground with an image.
    </> Embed

    Embed this simulation

    Free for trainers, teachers and bloggers. Paste this into your page:

    Loading the portal…

    Pick a deployment whose model accepts <strong>image input</strong>. <strong>gpt-4.1-mini</strong> does. A text-only model returns an error when you attach a picture.

    👆 Click the glowing item in the portal to continue

    Read the steps as text
    1. Pick a deployment whose model accepts image input. gpt-4.1-mini does. A text-only model returns an error when you attach a picture.
    2. In the Chat playground attach one or more images. The instructions decide the caption style: a concise caption here, a detailed one when you ask for layout, colours and text.
    3. For visual question answering, tell the model to answer from visible evidence only. Then it says "I can't tell" instead of guessing.
    4. For alt text, put the accessibility rules in the instructions: purpose first, short, readable text included. A separate prompt can write a longer extended description.
    5. In code, the image goes in an image_url content part, as a URL or a base64 data URL. detail trades cost and speed against small print.

    🧪 Simulation for learning. Screens are simplified versions of the Azure portal; names, prices and IDs are examples. Nothing here touches real Azure.

    😟 THE PROBLEM

    A claims team reads 2,000 car photos a day, and the website images have no alt text.

    😊 THE SOLUTION

    Send the photos to a multimodal model with a prompt per job: caption, grounded question or alt text.

    • Gallery needs short captions✓ A concise caption prompt
    • Which door is damaged?✓ A question grounded in visible evidence
    • Screen readers hear nothing✓ Alt text with purpose, short and readable text
    🛠️ Solved with: Vision-enabled chat models

    Start with a question

    You send a friend a photo of a dented car door and ask, 'Which door is it?' Why does your friend answer so quickly?

    They look at the photo, find the dent and tell you. If you ask, “How old is the car?” they’ll say, “I can’t tell from this picture.”

    That’s the behaviour you want from a multimodal model. It reads the image and your question together, answers from what it sees, and says so when the photo doesn’t show the answer.

    Explain it like I’m 10

    The technical explanation

    Pick a deployment whose model takes image input, such as gpt-4.1-mini. A text-only deployment returns an error when you attach a picture.

    Send an image

    response = client.chat.completions.create(
        model="gpt-4.1-mini",                      # deployment name
        messages=[
            {"role": "system", "content": "Answer only from what is visible. If the image does not show it, say you can't tell."},
            {"role": "user", "content": [
                {"type": "text", "text": "Which door is damaged?"},
                {"type": "image_url", "image_url": {"url": data_url, "detail": "high"}},
            ]},
        ],
    )
    print(response.choices[0].message.content)

    url can be a web address or a base64 data URL. Add more image_url parts to send several images (up to 10 in one request).

    DetailWhat the model seesUse it for
    lowA reduced versionFast, cheap captions and big objects
    highMore of the full imageSmall text, tiny objects
    autoThe service decidesA sensible default

    Four jobs, four prompts

    JobWhat the prompt asks for
    Concise caption“One sentence, under 20 words, no opinions.” Good for galleries and notifications.
    Detailed caption“Describe layout, colours, objects, readable text and anything unusual.” Good for reports and search.
    Grounded Q&A“Answer only from what is visible. If it isn’t shown, say you can’t tell.”
    Alt textPurpose first, short, read out meaningful text, no “image of”, empty for decoration.

    With several images in one request, the model can also compare them: “Which of these photos shows damage?”

    Alt text and extended descriptions

    Alt text is for people who can’t see the image. Keep it to the point, around a sentence. A chart or a floor plan often needs more. Put the short version in alt and offer an extended description in the page text or a linked page. The guidance comes from accessibility standards such as WCAG, and your prompt is where you apply it.

    Locating things

    You can ask the model to return JSON with a label and a box for each object, as fractions of the image width and height. Treat the boxes as approximate. Draw them for a person to confirm, or use Content Understanding when you need repeatable fields.

    Architect level What if the photo contains text that gives orders?

    The model reads that text like any other part of the picture, and it might obey it. That’s an indirect prompt injection, and it gets its own lesson in this module. For now remember one rule: text inside an image is data, not a command.

    Real-world business scenario

    Insurance

    Fabrikam Insurance

    The problem
    Adjusters opened 2,000 car photos a day, and the claims site had no alt text for the images it showed.
    What they used
    A gpt-4.1-mini deployment in Foundry. One prompt writes a concise caption for the claim list, another answers grounded questions such as which door is damaged, and a third writes alt text.
    Why that choice
    The model reads photos in the same request as the question, grounding instructions stop guesses about hidden details, and accessibility rules live in the prompt.
    The result
    Adjusters triaged photos from the caption list, and the claims site passed its accessibility review.

    When to use it and when not to

    ✓ Use it when…

    • People need flexible descriptions, summaries or answers about photos.
    • You want captions or alt text without training a custom model.
    • A question comes with the image and the answer changes each time.

    ✕ Think twice when…

    • A database needs the same typed fields for every photo.
    • You need exact coordinates or measurements.
    • The image text might carry hidden instructions and the model has powerful tools.

    ↔ Alternatives to consider

    • Content Understanding analyzers for repeatable fields.
    • A custom vision model when you must detect one narrow class very accurately.
    Ready for more?The full lesson adds the technical explanation, when to use it, interview questions and revision notes.

    Test yourself with exercises

    5 original practice questions in the AI-103 style. Pick your answers, then check them. You will see why each option is right or wrong. Score 75% or more and this topic is marked complete.

    Question 1

    Question 1 of 5

    A news site has 40,000 product photos that need a one-sentence description for thumbnails. Which approach meets the requirement with the least effort?

    Question 2

    Question 2 of 5

    An insurance application asks a multimodal model about a photo: 'How old is the car?' The model must not guess when the photo does not show the answer. What should the developer configure?

    Question 3

    Question 3 of 5

    A web team must generate alt text for informative images. Which instruction best follows accessibility guidance?

    Question 4

    Question 4 of 5

    An application sends 12 images in one request to a multimodal chat deployment to compare them. The request fails. What is the most likely cause?

    Question 5

    Question 5 of 5

    An application reads small printed text in photographs of delivery labels, but the model often misses characters. The application sets detail to low to save cost. What should the developer change?

    Interview preparation

    Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.

    Beginner What changes between a short caption and a detailed one?

    Model answer

    Only the prompt. The same model and the same photo give one sentence or a full description depending on what I ask for, so I put the length and the style in the instructions.

    Intermediate How do you stop a model from guessing about a photo?

    Model answer

    I tell it to answer only from what's visible and to say it can't tell otherwise. I also keep the temperature low and test with questions the photo can't answer.

    Experienced developer What goes into good alt text instructions?

    Model answer

    Purpose first, short, meaningful text in the picture read out, no "image of", and empty alt for decorative images. For charts and diagrams I produce a separate extended description.

    Scenario Small printed text on parcel labels keeps being misread. What do you try?

    Model answer

    I switch detail from low or auto to high so the model sees more of the image. If it still fails, I'd crop to the label first or use Content Understanding with a field for the label text.

    Quick revision

    Key points

    • Use a deployment whose model accepts image input, such as gpt-4.1-mini.
    • Images go in an image_url content part as a URL or base64 data URL.
    • Up to 10 images per request. Detail is low, high or auto.
    • Prompts set concise vs detailed captions, grounded Q&A and alt text rules.
    • Boxes or locations from a language model are approximate.

    Important terminology

    Multimodal model
    A model that accepts more than one kind of input, such as text and images, in the same request.
    Visual question answering
    Answering a question about an image, ideally using only what the image shows.
    Alt text
    A short text alternative for an image that a screen reader can read aloud.
    Extended description
    A longer description of a complex image, shown on the page or linked, when alt text is too short to carry the meaning.
    Detail parameter
    An image input setting (low, high or auto) that controls the resolution the model uses, and so the cost and the ability to read small text.

    Common mistakes

    • Sending an image to a text-only deployment.
    • Letting the model answer from imagination instead of visible evidence.
    • Writing alt text that starts with "image of" or describes decoration.

    Exam tips

    • "Short description for a thumbnail" = concise caption prompt.
    • "Answer only from the image" = grounding instruction in the system message.
    • "Screen reader users" = alt text; long complex image = extended description.

    Five quick revision questions

    1. 1.How many images can one request contain?Show

      Up to 10.

    2. 2.Which setting helps read small text?Show

      detail set to high.

    3. 3.What controls concise or detailed output?Show

      The prompt.

    4. 4.What should alt text describe?Show

      The purpose of the image, briefly.

    5. 5.How do you reduce guessing?Show

      Tell the model to answer only from what's visible and to say when it can't tell.

    Official references

    Finished this lesson? Tick it off. Your progress is saved in this browser.

    Next up: Content Understanding for Images and Video

    Studying with a friend? Send them this lesson

    It's free and needs no sign-up. Their progress saves in their own browser.

    Lesson done? Make it stick with a quick gameSort It, Match the Pairs, Lightning Round and Who Am I? Earn XP and badges. Play ❯

    Install MSDEVBUILD Azure

    Free · no account · works offline

    Save the whole course for offline ›

    Hi, I’m your Nimbus

    Your study buddy. Pick what we do next.

    MSDEVBUILD · Multi-Stack Dev Build

    Sign in to MSDEVBUILD

    One account for Azure certifications and the blog: sign in here and you are signed in on both. Your XP, streak, practice deck and certificate stay in sync on every device. Optional: everything works without an account.