DEV Community

Cover image for Beyond Pixels: How Computers Learn to See — My Journey into Computer Vision
Cynthia Umutoniwase
Cynthia Umutoniwase

Posted on

Beyond Pixels: How Computers Learn to See — My Journey into Computer Vision

kLab TekHer AI Program · Cohort 2 · Computer Vision · Day 1 Reflection
By UMUTONIWASE Adeline Cynthia — Software Engineering Graduate


A photograph is just numbers. So how does a machine understand it?

Close your eyes and picture a busy street in Kigali — a moto-taxi weaving through traffic, a vendor arranging tomatoes at the roadside, a child in a school uniform walking past a painted wall. You can picture it in an instant. Your brain identifies objects, estimates distances, reads the scene, and assigns meaning before you have consciously thought about any of it.

Now consider what a computer actually receives when you hand it that same photograph. Not a scene. Not objects. Not meaning. Just numbers. Millions of them, arranged in a grid, each one between 0 and 255, representing how much red, green, and blue light hit a tiny square of the sensor at the moment the shutter clicked.

That gap — between a grid of numbers and a meaningful understanding of the world — is the central problem of computer vision. On the first day of the kLab TekHer AI Program, Cohort 2, I began to understand how researchers and engineers have spent decades building bridges across it.

This article is my attempt to share what I learned, connect it to problems I care about, and think honestly about what it means to build AI systems that work for real people in real environments.

"The computer never sees a bus. It only sees numbers. Its job is to get from the numbers to a meaning."


Section 1 — What computer vision actually is

Computer vision is the field of artificial intelligence that gives machines the ability to extract meaningful information from images, video, and other visual inputs. It is not a single algorithm — it is a collection of techniques, architectures, and training strategies that together allow a system to answer three fundamental questions about visual data:

  • What is in the image? — identifying objects, scenes, or categories
  • Where is it? — locating objects within the frame
  • What is happening? — understanding actions, relationships, or changes over time

These three questions map directly onto the core tasks the field has developed: classification, detection, segmentation, recognition, and tracking. Each task answers a different question and requires a different kind of model output.

Understanding this distinction early saved me from a lot of confusion — "computer vision" is often used as if it were one thing, when it is really a family of related but distinct problems.

Suggested visual: A single photograph of a Kigali street annotated three times — once with a single label (classification), once with bounding boxes (detection), once with coloured pixel masks (segmentation). Caption: "Three questions, three different outputs — all from the same image."


Section 2 — The mathematics hidden inside every photograph

Every digital photograph is a three-dimensional array of numbers — what engineers call a tensor. The three dimensions are height (rows of pixels), width (columns of pixels), and colour channels.

Most photographs use the RGB colour model: three channels representing red, green, and blue light. Each pixel stores three values, one per channel, each ranging from 0 (none of that colour) to 255 (full intensity).

A pixel reading [197, 184, 168] has a lot of red, a lot of green, and slightly less blue — which produces a light beige. Why 255? Each channel value is stored as an 8-bit unsigned integer. Eight bits can represent 2⁸ = 256 distinct values, from 0 to 255.

The practical implication becomes clear when you do the arithmetic:

400 rows × 600 columns × 3 colour channels = 720,000 numerical values

A 1080 × 810 photograph contains:
1,080 × 810 × 3 = 2,624,400 numbers.

The computer never sees "a bus". It sees two and a half million integers.
Enter fullscreen mode Exit fullscreen mode

When you pass a photograph to a neural network, you are passing it a three-dimensional grid of numbers. The network's job is to transform that grid — through a series of mathematical operations — into a prediction.

Suggested visual: A 6×6 patch cropped from a high-contrast area of a photograph, shown beside a table of its red-channel values. Caption: "Each cell is one number stored in memory. This is what the computer actually receives."


Section 3 — Five ways a machine can look at an image

To make the five core tasks concrete, I will use one consistent example: a photograph of a busy street in Kigali, showing pedestrians, vehicles, and roadside stalls.

Task Question answered Output Kigali street example
Classification What is the dominant subject? Single label + confidence score "Street scene — 87% confidence"
Object Detection What objects are present, and where? Bounding boxes + labels + scores Boxes around each moto-taxi, pedestrian, and stall
Segmentation Which exact pixels belong to each object? Per-pixel class or instance masks Coloured masks outlining each person and vehicle precisely
OCR What text is visible in the image? Extracted text strings Reading shop signs, number plates, or painted street names
Object Tracking How do objects move across frames? Trajectories across a video sequence Following a specific moto-taxi through a traffic video

Each task requires a different model architecture, different labelled training data, and a different evaluation strategy.

Choosing the wrong task formulation is one of the most common and costly mistakes in applied computer vision projects. If you want to count vehicles at a junction, you need detection, not classification. If you want to measure building footprints from satellite imagery, you need segmentation.


Section 4 — How filters reveal what is hidden in plain sight

Before neural networks learn their own filters, it helps to understand what a filter actually does. A filter (also called a kernel) is a small grid of weights — typically 3×3 or 5×5 — that slides across an image. At each position, it multiplies each pixel value by the corresponding weight and sums the results. That sum becomes the new value of the centre pixel in the output image.

This operation is called convolution. Different weight patterns produce dramatically different effects:

  • Blur filter — a 5×5 grid where every weight equals 1/25. Each output pixel becomes the average of its 25 neighbours. Sharp details fade. The image looks softer.
  • Sobel X filter — weights of −1, 0, +1 arranged in columns. It subtracts the left side of each patch from the right side. Where brightness jumps from left to right — the side of a building, the edge of a person — the result is large (bright). Sobel X responds to horizontal changes in brightness, which is why it reveals vertical edges.
  • Sobel Y filter — the transpose of Sobel X. It responds to vertical changes in brightness and reveals horizontal edges: rooflines, road markings, the horizon.

Combining both Sobel filters using √(gx² + gy²) — implemented as np.hypot(gx, gy) — produces a map of all edges in the image, regardless of direction.

Key insight: A Convolutional Neural Network (CNN) does exactly this — but instead of using hand-designed weights, it learns the weights from data. The blur and Sobel filters above are human intuitions about what is useful. A CNN discovers what is useful by itself, from examples.

Suggested visual: Side by side — the original grayscale image, the blurred version, the vertical-edge map (Sobel X), and the full-edge map (combined Sobel). Caption: "The same image, processed by four different filters. Each reveals a different aspect of the visual information."


Section 5 — From hand-designed filters to learned representations

A Convolutional Neural Network (CNN) is a type of neural network designed specifically for grid-structured data like images. Its defining feature is the convolutional layer: a set of learnable filters that slide across the input, producing feature maps that highlight different patterns.

What makes CNNs powerful is not any single layer — it is the composition of many layers. As information flows deeper into the network, the representations become progressively more abstract:

Raw pixels → Edges & gradients → Textures & patterns → Parts & shapes → Objects & scenes
Enter fullscreen mode Exit fullscreen mode

This is a conceptual illustration, not a rigid sequence that every CNN follows identically. But the general principle holds: early layers respond to low-level patterns, and later layers respond to combinations of those patterns that correspond to higher-level concepts.

Training is the process of adjusting the filter weights so that the network's predictions match the correct labels. You show the network a labelled image, it makes a prediction, you measure how wrong that prediction is (the loss), and you use an algorithm called backpropagation to nudge every weight slightly in the direction that reduces the loss. Repeat this millions of times across thousands of images, and the network gradually learns to see.


Section 6 — YOLO: You Only Look Once

Early object detection systems worked in two stages: first propose regions of the image that might contain objects, then classify each region. This approach — used by architectures like R-CNN — was accurate but slow.

YOLO (You Only Look Once) changed the approach. Instead of proposing regions and then classifying them separately, YOLO frames detection as a single regression problem. One forward pass of the network over the entire image simultaneously predicts every bounding box, class label, and confidence score. The result is dramatically faster inference — fast enough for real-time video on modest hardware.

In our demo, we used YOLO11n (the "nano" variant — approximately 5 MB). On a street photograph, it detected a bus at 94% confidence, several people, and a bicycle, and printed the pixel coordinates of each bounding box.

The speed and compactness of models like this matter enormously for deployment in contexts where compute is limited — a Raspberry Pi at a field station, a mobile phone in a rural clinic, an edge device on a camera trap in a national park.

Suggested visual: The street photograph with YOLO bounding boxes drawn, showing labels and confidence scores. Caption: "YOLO11n detects objects in a single forward pass. Each box shows the predicted class and confidence score."


Section 7 — Vision Transformers: when images become language

CNNs dominated computer vision for most of the 2010s. Then, in 2020, researchers published the Vision Transformer (ViT), which borrowed the Transformer architecture that had already transformed natural language processing.

The key idea is elegant. Instead of sliding filters across an image, a Vision Transformer divides the image into a grid of fixed-size patches — say, 16×16 pixels each. Each patch is flattened into a vector and treated as a token, analogous to a word token in a language model. The sequence of patch tokens is then processed by a Transformer, which uses self-attention to model relationships between every pair of patches simultaneously.

Image → Split into patches → Each patch becomes a token vector
→ Transformer processes token sequence → Prediction
Enter fullscreen mode Exit fullscreen mode

A CNN processes an image by looking at local neighbourhoods — a 3×3 filter can only see 9 pixels at once. A Vision Transformer can relate any patch to any other patch in the image from the very first layer. That global receptive field is one reason ViTs have achieved strong results on large-scale benchmarks.

The connection to NLP is real but should not be overstated. Image patches and text tokens are not identical in every technical respect. But the shared architectural backbone has enabled a wave of multimodal models that process both images and text together — opening up applications that neither modality could support alone.


Section 8 — Computer vision can solve real problems across Africa

One of the most important things I took from Day 1 was a shift in perspective. Computer vision is not just a research topic for well-funded labs in California or London. It is a set of tools that can be applied to problems that matter here — in Rwanda, across East Africa, and across the continent.

But applying those tools responsibly requires understanding both their potential and their failure modes.


🌿 Agriculture — Cassava disease detection

The problem: Cassava is a staple crop for millions of families across sub-Saharan Africa. Diseases like cassava mosaic virus and cassava brown streak disease can devastate harvests.

The technique: Image classification — a model trained on leaf photographs flags potential disease from a smartphone image.

The benefit: Early intervention without requiring a specialist visit. Offline functionality matters here: many smallholder farmers have limited connectivity. A model that runs on-device is far more useful than one that requires a reliable internet connection.

What could go wrong: A model trained on images from one region may struggle with local crop varieties, different disease stages, or unfamiliar backgrounds. A false negative — missing a real disease — could lead a farmer to delay treatment until the crop is lost.


🏥 Healthcare — Tuberculosis screening from chest X-rays

The problem: Tuberculosis remains a leading cause of infectious disease mortality in Africa. Specialist radiologist capacity is limited in many settings.

The technique: Classification models that analyse chest X-rays to help radiologists prioritise cases.

The benefit: Faster triage in high-burden settings where specialist capacity is stretched.

What could go wrong: A false negative in a medical screening context is not a minor inconvenience — it is a missed diagnosis. Models must be validated on locally representative X-ray datasets. Deployment without clinical validation and appropriate human oversight is dangerous.


🐘 Conservation — Wildlife monitoring in Gabon

The problem: Camera traps generate enormous volumes of imagery that conservation teams cannot manually review at scale.

The technique: Object detection models automatically identify species — forest elephants, gorillas, pangolins — enabling near-real-time monitoring.

The benefit: Reduced manual review burden; faster detection of poaching activity.

What could go wrong: Models trained on images from one ecosystem may perform poorly in another due to differences in lighting, vegetation, and camera angle.


🪪 Digital Identity — Facial verification and OCR in onboarding

The problem: Digital financial services and government identity systems need to verify identity documents at scale.

The technique: Facial verification and OCR to read identity documents.

The benefit: Extended financial inclusion to people who previously lacked access to formal banking.

What could go wrong: Facial recognition systems have documented accuracy disparities across skin tones and demographic groups. Deploying a biased system at scale in an identity context can systematically exclude the people it is meant to serve. Bias auditing and diverse training data are not optional.


🛰️ Urban Planning — Building footprint extraction from satellite imagery

The problem: Many settlements across Africa are not captured in official records.

The technique: Segmentation models applied to satellite imagery automatically extract building footprints.

The benefit: Better data for urban planners, humanitarian organisations, and infrastructure teams.

What could go wrong: Informal settlements with dense, irregular structures and varied roofing materials can be harder to segment accurately than planned urban areas.


♿ Accessibility — BLAIVA at FabLab Rwanda, Kigali

The problem: Visually impaired users need assistance navigating and understanding their environment.

The technique: Computer vision to describe scenes, read text, and identify objects through a wearable or handheld device.

The benefit: Greater independence for visually impaired users in Kigali and beyond.

What could go wrong: Assistive technology that fails unpredictably — misidentifying an obstacle, misreading a sign — can put users at risk. Reliability and graceful failure behaviour are as important as accuracy.


What strikes me about all six examples is that the technical challenge is rarely the hardest part. The harder questions are about data, evaluation, and deployment — and those are software engineering questions as much as they are machine learning questions.


Section 9 — When models fail — and what that actually tells us

One of the most valuable parts of Day 1 was not the impressive demo results. It was the deliberate attempt to break the model.

We took the same street photograph and created four degraded versions:

  • Very dark — brightness multiplied by 0.15, simulating a night-time photo
  • Upside down — rotated 180°
  • Low resolution — shrunk to 48 pixels wide and scaled back up
  • Blurry — Gaussian blur with radius 8

Then we ran the same YOLO detector on all four versions and compared the results.

The very dark version detected almost nothing. The upside-down version missed several objects. The low-resolution version produced fewer, less confident detections. The blurry version degraded more gracefully — still finding the main objects, but with lower confidence scores.

An incorrect prediction does not mean the model is useless. It means the model encountered conditions that differ from its training distribution. The right response is to investigate: What conditions caused the failure? Are those conditions representative of the deployment environment?

This matters enormously for applications in Rwanda. A crop-disease model trained on images collected in Uganda, under different lighting conditions, with different camera equipment, may perform well on its original test set and poorly in the field.

The test set accuracy is not the deployment accuracy. These are different numbers, and conflating them is one of the most dangerous mistakes in applied machine learning.

Locally representative datasets are a prerequisite for building systems that actually work for the communities they are meant to serve. And choosing the right evaluation metric — precision, recall, F1 score, mean average precision — depends on the cost of different kinds of errors in the specific application.

Suggested visual: A 2×2 grid showing the original photograph alongside the very dark, upside-down, and low-resolution versions, each with the YOLO detection output overlaid. Caption: "Same model, four inputs, four very different results. Robustness testing is not optional."


Optional practical — Seeing it in code

import numpy as np
from PIL import Image
import matplotlib.pyplot as plt

# Load the image and convert to a NumPy array.
# Pillow reads in RGB order — no channel swap needed.
with Image.open("street.jpg") as img:
    rgb = np.array(img.convert("RGB"), dtype=float)

# Convert to grayscale by averaging the three colour channels.
gray = rgb.mean(axis=2)

def convolve(image, kernel):
    """Slide a kernel over a grayscale image, keeping the same dimensions."""
    k = kernel.shape[0]
    pad = k // 2
    padded = np.pad(image, pad, mode="edge")
    out = np.zeros_like(image, dtype=float)
    for dy in range(k):
        for dx in range(k):
            out += kernel[dy, dx] * padded[
                dy : dy + image.shape[0],
                dx : dx + image.shape[1]
            ]
    return out

# Sobel X: responds to horizontal brightness changes → reveals vertical edges.
sobel_x = np.array([[-1, 0, 1],
                    [-2, 0, 2],
                    [-1, 0, 1]], dtype=float)

# Sobel Y: responds to vertical brightness changes → reveals horizontal edges.
sobel_y = sobel_x.T

gx = convolve(gray, sobel_x)
gy = convolve(gray, sobel_y)

# Combine both directions using the Pythagorean theorem.
edges = np.hypot(gx, gy)

fig, axes = plt.subplots(1, 3, figsize=(14, 4))
for ax, data, title in zip(axes,
                            [gray, np.abs(gx), edges],
                            ["Grayscale", "Vertical edges (Sobel X)", "All edges"]):
    ax.imshow(data, cmap="gray")
    ax.set_title(title)
    ax.axis("off")
plt.tight_layout()
plt.show()

# KEY DIFFERENCE FROM A CNN:
# Every weight above was chosen by a human.
# In a CNN, weights are initialised randomly and adjusted during training —
# thousands of times, across thousands of images — until the network learns
# which patterns are useful for the task at hand.
Enter fullscreen mode Exit fullscreen mode

Conclusion — The numbers are just the beginning

A photograph that looks simple to a human contains numerical information that a machine must learn to interpret. That learning process — training a model on labelled data, adjusting millions of parameters, evaluating honestly on unseen examples — is not magic. It is engineering.

The real challenge is not getting a model to make predictions. It is building systems that work reliably in the environments and communities they are intended to serve. That means collecting locally representative data. It means testing honestly. It means choosing evaluation metrics that reflect the actual cost of errors. It means deploying with appropriate human oversight.

Rwanda and Africa have an enormous opportunity in computer vision — not just as consumers of models built elsewhere, but as builders of systems designed for local realities. The cassava fields of the Eastern Province, the informal settlements visible in satellite imagery, the wildlife of Volcanoes National Park, the patients in district hospitals — these are not edge cases for a global model. They are the primary use case for a locally-built one.

"The most important question in applied AI is not 'does the model work?' It is 'does the model work for the people it is meant to serve, in the conditions they actually live in?'"

I am at the beginning of this journey. But I am convinced that the engineers who will build the most meaningful AI systems in this region will be the ones who combine technical rigour with genuine curiosity about the problems that matter here.

If you are working on a computer vision problem in Rwanda or elsewhere in Africa — or if you have a local challenge you think computer vision could help address — I would genuinely love to hear about it in the comments.


What I am exploring next

  • Datasets — how training data is collected, labelled, and split; exploring datasets relevant to African contexts
  • CNN architectures — going deeper into convolutional layers, pooling layers, and fully connected layers
  • Data augmentation — how rotations, flips, and brightness changes can improve robustness
  • Evaluation metrics — precision, recall, F1 score, mean average precision (mAP)
  • Building an image classifier — training a small model from scratch on a local dataset, with an honest test set

I will write about each of these as I work through them. Follow along if you are on a similar journey.


Written by UMUTONIWASE Adeline Cynthia — Software Engineering Graduate, kLab TekHer AI Program Cohort 2, Kigali, Rwanda.

#ComputerVision #AIinAfrica #MachineLearning #TechForGood #kLabRwanda

Top comments (2)

Collapse
 
claire_d06ed33be71378af3a profile image
CLAIRE •

Great explanation, Cynthia! The part on Sobel X was the clearest I have read: it responds to horizontal brightness changes, so it reveals vertical edges. I also agree with your point that test set accuracy is not deployment accuracy. A model that works on its test set can still fail in the field, like the crop-disease example you gave. Which metric would you choose first for that one: precision or recall?

Collapse
 
tuyishimire_claudine_a7c9 profile image
Tuyishimire claudine •

Great article, Adeline! The point that test accuracy is not deployment accuracy is so important. Thanks for connecting computer vision to real problems in Rwanda.

Really enjoyed this, Adeline! The cassava and BLAIVA examples show how useful computer vision can be here. Keep sharing your journey!