Skip to content
elevatedevco

Computer Vision

Making images with AI

Learn Making images with AI: 36 practice questions and answers with an interactive quiz — from the offline AI Learning app.

Intermediate36 questions36 quiz questions

Questions & Answers

Tap a question to reveal its answer. Written for self-study and interview preparation.

What is a pixel, and why does it matter in AI image generation?

A pixel is the smallest colored unit in a digital image — like a tiny square of one solid color. When you zoom into any photo you can see thousands of these tiny squares. AI image generators work by deciding what color each pixel should be in order to produce a realistic or creative picture, so understanding pixels is the first step to understanding how AI images are built.

What does GAN stand for, and what is its basic idea?

GAN stands for Generative Adversarial Network. It is a type of AI that uses two competing neural networks — one that creates fake images (the generator) and one that judges whether images are real or fake (the discriminator). They train each other in a contest: the generator tries to fool the discriminator, and the discriminator tries not to be fooled. Over thousands of rounds, this competition pushes the generator to produce increasingly realistic images.

In a GAN, what is the job of the 'generator'?

The generator is the part of the GAN that creates brand-new images. It starts by taking random noise (think of it as a scrambled mess of numbers) and tries to transform it into a convincing image. At first the images look terrible, but with every training round the generator adjusts itself to fool the discriminator better, so the images gradually become more and more realistic.

In a GAN, what is the job of the 'discriminator'?

The discriminator acts like a detective: it looks at images — some real ones from the training dataset and some fake ones made by the generator — and tries to decide which is which. When it is wrong, both networks learn and adjust. This feedback loop is what drives the whole GAN training process forward, because the generator has to keep improving to keep fooling the discriminator.

What is a 'prompt' in a text-to-image AI system?

A prompt is the written description you type to tell the AI what image you want, such as 'a purple elephant reading a book under a palm tree'. The AI reads your words and uses them to guide the image it generates. Writing clear, specific prompts usually produces images much closer to what you imagined — prompt crafting has even become a skill of its own called 'prompt engineering'.

How does a diffusion model generate an image?

A diffusion model learns by watching real images get gradually destroyed — small amounts of random noise are added step by step until the image looks like pure static. Then, during generation, the model reverses that process: it starts with pure noise and carefully removes a little noise at each step, guided by what it learned during training, until a clear image emerges. Different prompts or random starting points lead to different final images.

What is 'training data' and why does an AI image generator need so much of it?

Training data is the large collection of images — often tens of millions — that an AI studies before it can generate anything on its own. By looking at this huge variety of images, the AI learns what dogs look like, how shadows fall, how colors blend, and countless other visual patterns. Without enough high-quality training data the model would not know what a realistic image should look like, and its outputs would appear random or nonsensical.

What is a neural network, in simple terms?

A neural network is a computer system loosely inspired by the way neurons in a human brain connect to each other. It is built from layers of tiny mathematical units called nodes that pass numbers back and forth. During training the network adjusts millions of internal connection strengths — called 'weights' — until it gets good at a task such as recognising objects or generating images.

What is a Convolutional Neural Network (CNN) and why is it good at understanding images?

A Convolutional Neural Network (CNN) is a special type of neural network designed to process visual data. It uses a mathematical operation called convolution to scan small patches of an image and detect features — first simple things like edges and corners, then more complex things like eyes, wheels, or fur. Because it shares the same learned detectors across the whole image, it is very efficient and powerful for image tasks.

What is 'latent space' in an AI image generator?

Latent space is a hidden, compressed mathematical space where the AI stores its understanding of images as short lists of numbers called vectors. Instead of memorising millions of pixel colors, the model squashes the key information about any image into a much smaller set of numbers. When generating a new image, the AI picks a point in latent space — perhaps guided by your text prompt — and then 'decodes' those numbers back into pixels, which is why smoothly changing one number in latent space can smoothly change one visual feature in the output.

What is image-to-image (img2img) generation?

Image-to-image generation is when you supply an existing image as a starting point and the AI modifies or reimagines it based on a text prompt. For example, you could sketch a rough dragon in pencil, then prompt the AI to turn it into a detailed oil painting — it keeps the rough shape but adds realistic color, texture, and detail. This is different from generating from scratch because the AI uses your input image as a structural guide.

What is neural style transfer?

Neural style transfer is an AI technique that combines the content of one image with the visual style of another. For example, you could take a photo of your school and 'paint' it in the style of Van Gogh's Starry Night — the buildings stay recognisable, but the brushstrokes, colors, and swirling patterns of Van Gogh's painting are applied to them. The AI achieves this by separately measuring 'what is in the image' and 'how it looks' using internal layers of a neural network.

What is a Variational Autoencoder (VAE) and how does it relate to image generation?

A Variational Autoencoder (VAE) is a neural network with two halves: an encoder that compresses an image into a short list of numbers in latent space, and a decoder that reconstructs an image from those numbers. Unlike a regular autoencoder, the VAE learns a range of possible values for each position in latent space rather than one fixed value, so you can sample new points and decode them into new images. VAEs are used as building blocks inside tools like Stable Diffusion, which actually processes images in this compressed latent space to save computing power.

What does 'noise' mean in the context of a diffusion model?

In diffusion models, 'noise' means random pixel variations — the same kind of scrambled static you might see on a television with no signal. During training, real images are progressively corrupted by adding more and more noise until nothing recognisable remains. The model learns how to run this process in reverse, so at generation time it starts from pure noise and cleans it up step by step into a meaningful image guided by your prompt.

What is CLIP and how does it help text-to-image AI understand your prompt?

CLIP (Contrastive Language–Image Pre-training) is an AI model trained on millions of image-text pairs to understand which text descriptions match which images. It learns a shared mathematical space where the phrase 'a red apple' and an actual photo of a red apple end up close together. Text-to-image systems like Stable Diffusion use CLIP to translate your written prompt into a mathematical direction in that shared space, which then steers the image generation process toward what you described.

What is an 'embedding' in AI image systems?

An embedding is a list of numbers (called a vector) that represents a word, phrase, or image in a form the AI can work with mathematically. For example, the concept 'ocean' might be stored as hundreds of numbers like [0.3, -0.7, 1.2, ...]. What makes embeddings powerful is that similar concepts end up with similar number patterns — 'ocean' and 'sea' will be close together — and image generation systems use these number patterns to connect the meaning of your written prompt to the visual world.

What is 'fine-tuning' an AI image model?

Fine-tuning means taking a large AI model that was already trained on millions of images and then training it further — for a shorter time — on a smaller, more specific dataset. For example, you might fine-tune a general image model on hundreds of paintings by one particular artist so that it learns to generate new images in that artist's style. This is far faster than training from scratch because most of the visual knowledge is already baked in; you are just specialising it.

What is a 'deepfake'?

A deepfake is an AI-generated image or video in which a real person's face or voice has been convincingly replaced with someone else's, making it appear as if that person said or did something they never actually did. Deepfakes are made by training AI models — often GANs — on many real recordings of the target person. They are called 'deepfakes' because they use deep learning to produce fakes that can be very difficult to spot with the naked eye.

Why are deepfakes considered ethically harmful?

Deepfakes are harmful because they can make it look convincingly like real people — politicians, celebrities, or ordinary individuals — said or did things they never actually did. This can destroy someone's reputation, spread dangerous political misinformation, enable fraud, or be used for harassment and bullying. Because they can fool many viewers, researchers, governments, and tech companies are racing to build detection tools and legal frameworks to limit the damage deepfakes can cause.

What is AI image 'inpainting'?

Inpainting is the ability of an AI to fill in a selected or missing area of an image so that it looks natural and blends with the rest of the picture. For example, you could draw a mask over an unwanted person in a photo and the AI would fill that space with a realistic background. The AI uses the surrounding pixels as context clues to decide what textures, colors, and objects should plausibly appear in the masked region.

What is AI image upscaling (super-resolution)?

AI image upscaling, also called super-resolution, uses a trained neural network to increase the resolution of a low-quality image by intelligently predicting what the finer details should look like. Ordinary resizing just stretches pixels and makes images blurry, but an AI upscaler has learned from thousands of high-resolution examples and can fill in sharp, realistic detail. This technique is used to restore old photographs, improve game textures, and sharpen medical scans.

What is a 'checkpoint' in AI model training, and why is it useful?

A checkpoint is a saved snapshot of all the learned weights inside an AI model at a specific moment during training. Because training an image generation model can take days or even weeks on powerful computers, saving checkpoints means you can pause and resume training without losing progress, or roll back to an earlier version if the model starts getting worse. Many open-source AI image communities share specific checkpoints because different training stages produce models with different styles and capabilities.

What is the difference between image classification and image generation?

Image classification means an AI looks at an existing image and decides what is in it — for example, 'this is a photo of a cat'. Image generation is the opposite: the AI creates a brand-new image from scratch, usually guided by a text prompt or random noise. Classification is about understanding images that already exist, while generation is about producing images that never existed before — both tasks use neural networks but in very different ways.

What is data augmentation and why do AI image trainers use it?

Data augmentation means taking existing training images and applying random transformations — like flipping left-to-right, rotating, cropping, or adjusting brightness — to create additional training examples automatically. This teaches the AI that a dog is still a dog whether it is upside down, slightly zoomed in, or photographed in different lighting. It also effectively multiplies the size of your dataset for free, which helps prevent overfitting when you don't have millions of photos to start with.

What is 'overfitting' in an AI image generation model?

Overfitting happens when an AI model memorises its training images too closely instead of learning the deeper patterns behind them. An overfit image generator might just reproduce near-copies of images it saw during training rather than creating genuinely new and varied results. It is like a student who memorises exam answers word for word without understanding the subject — they can repeat what they've seen but cannot handle anything new.

What is 'sampling' in a diffusion model, and why does the number of steps matter?

Sampling in a diffusion model is the step-by-step process of gradually turning random noise into a final image during generation. At each step the model predicts how much noise to remove and in which direction, slowly revealing coherent structure. Using more steps generally produces higher-quality, more detailed images but takes longer; fewer steps is faster but can produce blurry or odd-looking results. Different sampling algorithms (like DDIM or DPM++) try to get good quality with fewer steps.

Name three popular text-to-image AI tools and explain what they have in common.

Three widely known text-to-image AI tools are DALL-E (made by OpenAI), Midjourney, and Stable Diffusion. All three take a written text prompt from the user and generate a new image based on it, and all three were trained on very large datasets of images from the internet. The main differences are that Stable Diffusion is open-source (anyone can download and run it), while DALL-E and Midjourney are accessed through paid services or subscription APIs.

Why does generating AI images require so much computing power?

Creating one image with a diffusion model involves running billions of floating-point math operations — multiplications and additions through many layers of the neural network — repeated across dozens or hundreds of de-noising steps. These calculations are best handled by Graphics Processing Units (GPUs), which can process thousands of operations simultaneously in parallel. Training the model in the first place is even more demanding: it can require running hundreds or thousands of GPUs continuously for days or weeks.

What copyright concerns arise from training AI image models on internet images?

AI image models are trained on millions of images scraped from the internet, many of which are the copyrighted work of artists, illustrators, and photographers who never gave permission for their work to be used this way and received no payment. This raises the legal question of whether that training counts as copyright infringement. There is also a separate debate about whether images produced by an AI can be owned and copyrighted by the person who typed the prompt, since no human actually drew the image.

How are GANs used to generate realistic faces of people who don't exist?

GANs can produce photorealistic human faces of people who have never existed by training the generator on tens of thousands of real portrait photographs. As the training progresses, the generator learns the statistical patterns behind human faces — the symmetry of eyes, the shape of noses, how skin tones look under different lighting — until it can produce convincing new faces. The website 'thispersondoesnotexist.com' is a famous example, showing a fresh AI-generated face on every page visit.

What is Stable Diffusion and why did it matter for the AI art community?

Stable Diffusion is a powerful text-to-image diffusion model released in 2022 by Stability AI. What made it a landmark moment was that it was released as open-source — the model weights and code were made freely available so anyone with a reasonably powerful GPU could download, run, and modify it at home. This openness sparked an explosion of community tools, fine-tuned models, and creative experiments that would not have been possible if the technology had remained behind a paid API.

What is the 'attention' mechanism and why does it improve AI image generation?

Attention is a mechanism in neural networks that lets the model decide which parts of its input — specific words in a prompt or specific regions of an image — are most relevant to what it is generating at each moment. In image generation, attention helps the model correctly connect words in your prompt to the right visual regions, for example making 'red hat' affect only the head area and not the whole scene. It is a key reason why modern systems like those behind DALL-E and Stable Diffusion can handle long, complex prompts with many separate details.

What does it mean when an AI image model 'hallucinates'?

In image AI, hallucination refers to when the model confidently generates details that are visually wrong or physically impossible — such as a human hand with six fingers, text that looks like letters but is unreadable gibberish, or an object with an impossible shape. This happens because the model generates what it statistically expects based on patterns in its training data, without any true understanding of physics or logic. Hallucinations are an important limitation to check for whenever you use AI-generated images for anything serious.

How do you load a pre-trained text-to-image pipeline in Python using the diffusers library?

The Hugging Face `diffusers` library makes it straightforward to use Stable Diffusion in Python. You import `StableDiffusionPipeline`, call `from_pretrained()` with the model name to download and set up the model, then call the pipeline with your text prompt and save the result. This shows how open-source tools have made powerful image generation accessible to beginner coders — in just four lines you can generate a custom image on your own computer.

from diffusers import StableDiffusionPipeline

pipeline = StableDiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-2-1")
image = pipeline("a golden retriever sitting on the moon").images[0]
image.save("output.png")
What is 'negative prompting' in text-to-image AI and why is it useful?

Negative prompting is the technique of telling the AI what you do NOT want to see in the generated image, alongside your main description. For example, alongside 'a portrait of a knight' you might add a negative prompt like 'blurry, extra fingers, low quality' to steer the AI away from common failure modes. Diffusion models support this because the guidance signal can be pulled toward your positive prompt and simultaneously pushed away from the negative one during the sampling process.

Why might an AI image model struggle to generate readable text inside images?

Most image generation models learn by finding statistical patterns in pixel data across millions of images, but readable text requires exact, precise character shapes that are hard to encode this way. The model has seen many images containing text but represents them as visual textures rather than understanding the meaning of each character. As a result, generated 'text' inside images often looks convincingly text-like from a distance but is actually garbled, wrong, or unreadable when examined closely — this is one of the well-known weaknesses of diffusion models.

Put it into practice with AI Learning

This topic — and hundreds more — comes from our free, offline AI Learning app. Practice Q&A, quizzes and cheat sheets anywhere, no account needed.

  • Free
  • No account
  • Works offline
Coming soon toGoogle Play