Prepare multimodal data
Collect paired images and question–answer annotations, standardise image sizes and tokenise text while keeping a held-out set for evaluation.
Visual question answering assistant. Assess multimodal matches.
Visual question answering (VQA) pairs an image and a natural-language question to produce a concise answer. Real VQA systems combine robust multimodal embeddings, cross-modal grounding and answer decoding, and they must handle ambiguous questions, occlusion, and out-of-domain images.
Learning concept · Not a validated service
Visual question answering (VQA) pairs an image and a natural-language question to produce a concise answer. Real VQA systems combine robust multimodal embeddings, cross-modal grounding and answer decoding, and they must handle ambiguous questions, occlusion, and out-of-domain images.
A proposed assistant could help annotators or content editors find likely image regions and candidate answers for review; human verification remains essential when answers affect decisions or sensitive content.
Collect paired images and question–answer annotations, standardise image sizes and tokenise text while keeping a held-out set for evaluation.
Replace the toy vectors with a pretrained multimodal encoder (for example CLIP) to produce aligned image and text embeddings before any retrieval or fusion.
Use nearest-neighbour retrieval over multimodal embeddings as a baseline, then add an answer-decoder that conditions on retrieved evidence.
Measure VQA accuracy and grounding scores, inspect failure modes such as ambiguous questions, hallucinated answers, and out-of-domain images.
The supplied starter generates random NumPy arrays as text and image embeddings, horizontally concatenates them, creates a noisy query vector from one sample, then ranks dataset entries by cosine similarity and prints the top matches and scores. It does not parse natural-language questions, decode answers, or use a pretrained multimodal model such as CLIP.
# In production, replace these with CLIP, audio, video, or document embeddings.
text_embeddings = rng.normal(size=(5, 8))
image_embeddings = rng.normal(size=(5, 8))
combined_embeddings = np.hstack([text_embeddings, image_embeddings])
query_text_embedding = text_embeddings[0] + rng.normal(0, 0.05, 8)
query_image_embedding = image_embeddings[0] + rng.normal(0, 0.05, 8)
query = np.hstack([query_text_embedding, query_image_embedding]).reshape(1, -1)The code uses synthetic random embeddings and performs nearest-neighbour retrieval only. It does not implement VQA answer generation, question parsing, grounding, or any pretrained multimodal model; results are illustrative and not evaluative for VQA.
A proposed extension: replace random vectors with CLIP or a multimodal encoder, add a lightweight answer-decoder (e.g. a small transformer conditioned on retrieved evidence) and expose predictions through a review interface where humans verify or correct answers.
This is a potential application pathway, not a delivered product. The supplied starter does not implement this service or validate it with real users.
Networkers Home runs this topic inside its AI Engineer Course, with placement support and hands-on labs.