<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: immaculee byukusenge</title>
    <description>The latest articles on DEV Community by immaculee byukusenge (@immaculee2).</description>
    <link>https://dev.to/immaculee2</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4151836%2F5a0f629e-ba65-4083-a972-c84b3025f546.png</url>
      <title>DEV Community: immaculee byukusenge</title>
      <link>https://dev.to/immaculee2</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/immaculee2"/>
    <language>en</language>
    <item>
      <title>Introduction to Computer Vision: How Machines Learn to See</title>
      <dc:creator>immaculee byukusenge</dc:creator>
      <pubDate>Tue, 13 Oct 2026 13:50:33 +0000</pubDate>
      <link>https://dev.to/immaculee2/introduction-to-computer-vision-how-machines-learn-to-see-2hg9</link>
      <guid>https://dev.to/immaculee2/introduction-to-computer-vision-how-machines-learn-to-see-2hg9</guid>
      <description>&lt;p&gt;After learning how computers &lt;em&gt;read&lt;/em&gt; text, I started asking myself another question: &lt;strong&gt;How do computers see and understand images?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When we look at a picture, we can easily recognise a person, a car, a dog, or a tree. But computers do not see the world in the same way humans do. They need a way to turn images into information they can process.&lt;/p&gt;

&lt;p&gt;In this blog, I will share what I learned about &lt;strong&gt;computer vision&lt;/strong&gt;, how it works, and why it sometimes makes mistakes.&lt;/p&gt;

&lt;p&gt;You do not need programming experience to follow along. I will use simple examples and a few formulas to make the ideas easier to understand.&lt;/p&gt;

&lt;p&gt;By the end, you will understand:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;How a computer turns a photo into numbers.&lt;/li&gt;
&lt;li&gt;How computers find the edges of objects.&lt;/li&gt;
&lt;li&gt;The main tasks of computer vision.&lt;/li&gt;
&lt;li&gt;How AI learns to recognise images.&lt;/li&gt;
&lt;li&gt;Why computer vision models sometimes make mistakes.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  1. What Does a Computer See?
&lt;/h2&gt;

&lt;p&gt;Imagine looking at a picture of a cat. You can recognise it almost immediately. You may notice its eyes, ears, fur, and the way it is sitting.&lt;/p&gt;

&lt;p&gt;Now imagine giving the same picture to a computer.&lt;/p&gt;

&lt;p&gt;A computer does not automatically understand that the picture contains a cat. First, it receives numerical information about the image.&lt;/p&gt;

&lt;h3&gt;
  
  
  Images are made of pixels
&lt;/h3&gt;

&lt;p&gt;Every digital image is made up of tiny squares called &lt;strong&gt;pixels&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Each pixel contains information about colour. In a common type of colour image, called an RGB image, each pixel has three values:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;R:&lt;/strong&gt; Red&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;G:&lt;/strong&gt; Green&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;B:&lt;/strong&gt; Blue&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each value usually ranges from 0 to 255. Different combinations of these values create different colours.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Colour&lt;/th&gt;
&lt;th&gt;RGB values&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Red&lt;/td&gt;
&lt;td&gt;&lt;code&gt;(255, 0, 0)&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Green&lt;/td&gt;
&lt;td&gt;&lt;code&gt;(0, 255, 0)&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Blue&lt;/td&gt;
&lt;td&gt;&lt;code&gt;(0, 0, 255)&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Black&lt;/td&gt;
&lt;td&gt;&lt;code&gt;(0, 0, 0)&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;White&lt;/td&gt;
&lt;td&gt;&lt;code&gt;(255, 255, 255)&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Think of a photo as a large collection of tiny coloured squares. The computer processes the numbers describing those squares to find useful patterns.&lt;/p&gt;

&lt;h3&gt;
  
  
  Formula 1: How many pixels are in an image?
&lt;/h3&gt;

&lt;p&gt;The number of pixels depends on the image's width and height.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Formula:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Total pixels = Width × Height&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Imagine an image that is 400 pixels wide and 600 pixels tall.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;400 × 600 = 240,000 pixels&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;If it is an RGB image with three colour values per pixel, we can calculate the total number of colour values:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Colour values = Total pixels × 3&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;240,000 × 3 = 720,000 colour values&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;That is a lot of numbers for a computer to process!&lt;/p&gt;

&lt;p&gt;A modern smartphone photo may contain millions of pixels, depending on the camera and image settings.&lt;/p&gt;

&lt;p&gt;The challenge is not simply storing these numbers. It is learning how to use them to recognise meaningful things, such as a cat, a person, or a motorcycle.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. How Does a Computer Find Edges?
&lt;/h2&gt;

&lt;p&gt;Imagine a black phone lying on a white table. You can easily see where the phone ends and the table begins.&lt;/p&gt;

&lt;p&gt;That boundary is called an &lt;strong&gt;edge&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Edges are useful because they help computer vision systems identify shapes and the boundaries of objects.&lt;/p&gt;

&lt;h3&gt;
  
  
  A simple example
&lt;/h3&gt;

&lt;p&gt;Imagine that the left side of an image is dark and the right side is bright.&lt;/p&gt;

&lt;p&gt;We can represent their brightness using numbers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Left side: 0&lt;/li&gt;
&lt;li&gt;Right side: 200&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We can calculate the difference between them.&lt;/p&gt;

&lt;h3&gt;
  
  
  Formula 2: Brightness difference
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;Difference = Right brightness − Left brightness&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Using our example:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Difference = 200 − 0 = 200&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The difference is large, so it may indicate an edge.&lt;/p&gt;

&lt;p&gt;If both sides had brightness values of 100, the calculation would be:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Difference = 100 − 100 = 0&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;There is no brightness change between the two sides.&lt;/p&gt;

&lt;p&gt;This is a simplified example. Real edge-detection methods examine several neighbouring pixels to identify changes in brightness and direction.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is a filter?
&lt;/h3&gt;

&lt;p&gt;Traditional image-processing methods often use small grids of numbers called &lt;strong&gt;filters&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;A filter moves across an image and performs a calculation at different positions. This helps the computer detect patterns such as edges.&lt;/p&gt;

&lt;p&gt;For example, consider this filter:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;-1   0   +1
-2   0   +2
-1   0   +1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The negative numbers on the left and positive numbers on the right help the filter detect brightness changes from left to right.&lt;/p&gt;

&lt;p&gt;Let's see what happens when we apply it to two small image regions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example A: No edge&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;100  100  100
100  100  100
100  100  100
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;All pixels have the same brightness.&lt;/p&gt;

&lt;p&gt;When we multiply the pixel values by the corresponding filter values and add the results, the positive and negative contributions cancel each other out.&lt;/p&gt;

&lt;p&gt;The result is:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;0&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This means there is no brightness change from left to right.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example B: A possible edge&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  0  100  200
  0  100  200
  0  100  200
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The left side is dark, while the right side is bright.&lt;/p&gt;

&lt;p&gt;Applying the filter gives:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;(0 × -1) + (100 × 0) + (200 × 1)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;for the first row, with similar calculations for the other rows.&lt;/p&gt;

&lt;p&gt;The complete result is:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;200 + 400 + 200 = 800&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The large result indicates a strong brightness change from left to right.&lt;/p&gt;

&lt;p&gt;The computer can use this information to identify a possible vertical boundary in the image.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is convolution?
&lt;/h3&gt;

&lt;p&gt;The process of applying a filter across an image is commonly called &lt;strong&gt;convolution&lt;/strong&gt; in image processing and deep learning.&lt;/p&gt;

&lt;p&gt;A simplified mathematical representation is:&lt;/p&gt;

&lt;p&gt;[&lt;br&gt;
S=\sum_{i=1}^{3}\sum_{j=1}^{3}I_{ij}K_{ij}&lt;br&gt;
]&lt;/p&gt;

&lt;p&gt;Where:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;(S) is the calculated result.&lt;/li&gt;
&lt;li&gt;(I_{ij}) represents a pixel value.&lt;/li&gt;
&lt;li&gt;(K_{ij}) represents the corresponding filter value.&lt;/li&gt;
&lt;li&gt;The symbol (\sum) means to add the results together.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In simple words, the computer multiplies each pixel by its corresponding filter number and adds the results.&lt;/p&gt;

&lt;p&gt;It repeats this process at different positions in the image.&lt;/p&gt;

&lt;p&gt;Filters can also be designed to detect horizontal edges and other patterns.&lt;/p&gt;

&lt;p&gt;The important idea is that &lt;strong&gt;a computer can use mathematical calculations to find patterns that help it understand an image&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. The Five Main Tasks of Computer Vision
&lt;/h2&gt;

&lt;p&gt;Computer vision is not just about recognising objects. It includes several different tasks.&lt;/p&gt;

&lt;p&gt;Here are five important examples.&lt;/p&gt;

&lt;h3&gt;
  
  
  A. Image classification
&lt;/h3&gt;

&lt;p&gt;Classification means giving an image a label.&lt;/p&gt;

&lt;p&gt;For example, if you show a model a picture of a dog, it might predict:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;"Dog."&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Classification focuses on identifying the category of an image rather than locating every object inside it.&lt;/p&gt;

&lt;h3&gt;
  
  
  B. Object detection
&lt;/h3&gt;

&lt;p&gt;Object detection identifies objects and estimates where they are in an image.&lt;/p&gt;

&lt;p&gt;Imagine a photograph of a busy road. A detection model might identify three motorcycles, two cars, and four people.&lt;/p&gt;

&lt;p&gt;It can draw a box around each detected object.&lt;/p&gt;

&lt;p&gt;This is useful when you want to count vehicles, identify objects, or monitor a particular area.&lt;/p&gt;

&lt;h3&gt;
  
  
  C. Image segmentation
&lt;/h3&gt;

&lt;p&gt;Segmentation identifies which pixels belong to particular objects or regions.&lt;/p&gt;

&lt;p&gt;Imagine a picture containing a motorcycle parked beside a person.&lt;/p&gt;

&lt;p&gt;Instead of drawing a box around each object, a segmentation model can identify the pixels belonging to the motorcycle and the person.&lt;/p&gt;

&lt;p&gt;This is useful when the exact shape or boundary of an object matters.&lt;/p&gt;

&lt;h3&gt;
  
  
  D. Optical Character Recognition (OCR)
&lt;/h3&gt;

&lt;p&gt;OCR allows computers to recognise text inside images.&lt;/p&gt;

&lt;p&gt;For example, a system can read:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Words on a street sign.&lt;/li&gt;
&lt;li&gt;Text on a document.&lt;/li&gt;
&lt;li&gt;Numbers on a receipt.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;OCR can help convert a photograph of printed text into digital text that a computer can process.&lt;/p&gt;

&lt;h3&gt;
  
  
  E. Object tracking
&lt;/h3&gt;

&lt;p&gt;Tracking means following an object across video frames.&lt;/p&gt;

&lt;p&gt;For example, a traffic camera may follow a motorcycle as it moves along a road.&lt;/p&gt;

&lt;p&gt;Detection helps locate the motorcycle in a particular frame, while tracking helps the system identify it across multiple frames.&lt;/p&gt;

&lt;h3&gt;
  
  
  Understanding the difference
&lt;/h3&gt;

&lt;p&gt;Imagine that you give three different computer vision systems the same photograph of a busy road.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Classification:&lt;/strong&gt; "This image contains vehicles."&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Detection:&lt;/strong&gt; Identifies individual vehicles and draws boxes around them.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Segmentation:&lt;/strong&gt; Identifies the pixels belonging to each vehicle.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each task provides a different level of information, depending on what we need.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. How Does AI Learn to Recognise Images?
&lt;/h2&gt;

&lt;p&gt;Finding simple edges is one thing. Recognising a cat, a dog, or a person is much more complicated.&lt;/p&gt;

&lt;p&gt;Objects can look different depending on their size, colour, position, and lighting. Writing a separate rule for every possible situation would be extremely difficult.&lt;/p&gt;

&lt;p&gt;This is where machine learning becomes useful.&lt;/p&gt;

&lt;h3&gt;
  
  
  Learning from examples
&lt;/h3&gt;

&lt;p&gt;Imagine teaching a child to recognise cats. You show the child many pictures of cats and explain what they are. Over time, the child begins to notice similarities between the pictures.&lt;/p&gt;

&lt;p&gt;AI image models learn in a somewhat similar way.&lt;/p&gt;

&lt;p&gt;We provide a model with many training images, usually with labels indicating what each image contains. During training, the model adjusts its internal values to improve its predictions.&lt;/p&gt;

&lt;p&gt;One popular type of model is called a &lt;strong&gt;Convolutional Neural Network (CNN)&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;CNNs are designed to learn useful patterns from images.&lt;/p&gt;

&lt;p&gt;Their layers may learn different kinds of features:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Simple patterns:&lt;/strong&gt; Edges, colours, and lines.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;More complex patterns:&lt;/strong&gt; Textures, shapes, and parts of objects.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Higher-level features:&lt;/strong&gt; Combinations of patterns that help identify objects.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For example, a model trained to recognise cats may learn visual patterns associated with ears, eyes, fur, and the overall shape of a cat.&lt;/p&gt;

&lt;p&gt;However, a model does not understand a cat exactly as a human does. It learns statistical patterns from its training data.&lt;/p&gt;

&lt;h3&gt;
  
  
  How does a model improve?
&lt;/h3&gt;

&lt;p&gt;During training, a model makes predictions and compares them with the correct answers. A loss function measures how far its predictions are from the desired results.&lt;/p&gt;

&lt;p&gt;For example, imagine a simplified numerical prediction:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Correct target value: 1&lt;/li&gt;
&lt;li&gt;Model prediction: 0.4&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The difference is:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Difference = Prediction − Target&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Difference = 0.4 − 1 = -0.6&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This illustrates that the prediction differs from the target. Real image classifiers commonly use more suitable loss functions, such as cross-entropy, rather than relying on this subtraction alone.&lt;/p&gt;

&lt;p&gt;The training algorithm uses the loss to adjust the model's internal parameters. This process repeats across many training examples.&lt;/p&gt;

&lt;p&gt;Over time, the model can learn to make better predictions on examples similar to those it has learned from.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Where Can We Use Computer Vision?
&lt;/h2&gt;

&lt;p&gt;Computer vision is already useful in many areas of everyday life.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Healthcare:&lt;/strong&gt; AI can help analyse medical images, such as X-rays, to identify patterns that may require a doctor's attention.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Agriculture:&lt;/strong&gt; A model can examine pictures of crop leaves and help identify possible signs of plant disease.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Transport:&lt;/strong&gt; Traffic systems can detect vehicles and help count motorcycles, cars, and pedestrians.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Security:&lt;/strong&gt; Cameras can detect movement or recognise objects in monitored areas.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Business:&lt;/strong&gt; Shops can use image recognition to help identify products or count items on shelves.&lt;/p&gt;

&lt;p&gt;For example, imagine a farmer in Rwanda who notices unusual spots on bean leaves.&lt;/p&gt;

&lt;p&gt;A computer vision model trained on relevant plant images could help identify a possible disease. However, the model would need suitable training data, including pictures of local crops taken under different conditions.&lt;/p&gt;

&lt;p&gt;Its predictions should also be checked before important decisions are made.&lt;/p&gt;

&lt;p&gt;This example shows how computer vision can help solve practical problems in our communities.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Why Do Computer Vision Models Make Mistakes?
&lt;/h2&gt;

&lt;p&gt;Although computer vision can be powerful, it is not perfect.&lt;/p&gt;

&lt;p&gt;A model may perform well during testing but struggle when it encounters images that are different from the ones it learned from.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Poor lighting:&lt;/strong&gt; A dark image may hide important details.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Low image quality:&lt;/strong&gt; A blurry photo may make objects difficult to recognise.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Unusual angles:&lt;/strong&gt; An object photographed from an unfamiliar direction may be harder to identify.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Different environments:&lt;/strong&gt; A model trained on one type of road or crop may struggle with another.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Limited training data:&lt;/strong&gt; If a model has not seen enough examples of an object, it may make incorrect predictions.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Why does local data matter?
&lt;/h3&gt;

&lt;p&gt;Imagine training a model using mostly pictures of roads from other countries and then using it on roads in Rwanda.&lt;/p&gt;

&lt;p&gt;The model might encounter different motorcycle designs, road conditions, vehicle types, and lighting conditions.&lt;/p&gt;

&lt;p&gt;If these examples are not well represented in its training data, its performance may suffer.&lt;/p&gt;

&lt;p&gt;This does not mean every model trained elsewhere will fail in Rwanda. It means we should test models in the environments where they will actually be used.&lt;/p&gt;

&lt;p&gt;Including diverse and representative local images can help make a model more reliable.&lt;/p&gt;

&lt;h3&gt;
  
  
  Formula 3: Measuring model accuracy
&lt;/h3&gt;

&lt;p&gt;One way to evaluate a classification model is to calculate its accuracy.&lt;/p&gt;

&lt;p&gt;[&lt;br&gt;
\text{Accuracy}=\frac{\text{Correct Predictions}}{\text{Total Predictions}}\times100\%&lt;br&gt;
]&lt;/p&gt;

&lt;p&gt;Suppose a model correctly identifies 90 images out of 100.&lt;/p&gt;

&lt;p&gt;[&lt;br&gt;
\text{Accuracy}=\frac{90}{100}\times100\%=90\%&lt;br&gt;
]&lt;/p&gt;

&lt;p&gt;Its accuracy is 90%.&lt;/p&gt;

&lt;p&gt;However, high accuracy does not guarantee that a model works well in every situation. For example, it might perform well on clear images but poorly on dark or blurry ones.&lt;/p&gt;

&lt;p&gt;That is why we need to test models with different images and conditions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The important lesson is that a model's performance depends partly on the quality and variety of the data it learns from.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  7. What I Learned
&lt;/h2&gt;

&lt;p&gt;After exploring computer vision, I now understand that computers do not automatically see and understand images as humans do.&lt;/p&gt;

&lt;p&gt;They process numerical representations of images and learn patterns that help them perform different tasks.&lt;/p&gt;

&lt;p&gt;Here are my main takeaways:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Images are represented using pixels and colour values.&lt;/li&gt;
&lt;li&gt;Filters can help identify edges and other visual patterns.&lt;/li&gt;
&lt;li&gt;Convolution involves applying filters to image regions through mathematical calculations.&lt;/li&gt;
&lt;li&gt;Classification, detection, segmentation, OCR, and tracking solve different problems.&lt;/li&gt;
&lt;li&gt;CNNs can learn useful image features from training examples.&lt;/li&gt;
&lt;li&gt;Computer vision models can make mistakes, especially when real-world images differ from their training data.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For me, the most interesting part is how simple numerical operations can become part of a system that recognises objects in a photograph.&lt;/p&gt;

&lt;h2&gt;
  
  
  8. Try It Yourself!
&lt;/h2&gt;

&lt;p&gt;You do not need to be an expert to start exploring computer vision.&lt;/p&gt;

&lt;p&gt;Here are three simple activities you can try.&lt;/p&gt;

&lt;h3&gt;
  
  
  Activity 1: Test an AI assistant
&lt;/h3&gt;

&lt;p&gt;Take a photo of a plant, a market, or a street. Ask an AI assistant that supports image uploads to describe what it sees.&lt;/p&gt;

&lt;p&gt;Check its answer:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What did it identify correctly?&lt;/li&gt;
&lt;li&gt;What did it miss?&lt;/li&gt;
&lt;li&gt;Did it describe anything incorrectly?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is a simple way to observe both the strengths and limitations of image understanding.&lt;/p&gt;

&lt;h3&gt;
  
  
  Activity 2: Choose the right computer vision task
&lt;/h3&gt;

&lt;p&gt;Imagine you want to count all the motorcycles in a road photograph.&lt;/p&gt;

&lt;p&gt;Which task would you choose?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Image classification&lt;/li&gt;
&lt;li&gt;Object detection&lt;/li&gt;
&lt;li&gt;Image segmentation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Answer: Object detection.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Detection can identify individual motorcycles and locate each one, making it useful for counting them.&lt;/p&gt;

&lt;h3&gt;
  
  
  Activity 3: Find a problem in your community
&lt;/h3&gt;

&lt;p&gt;Think about your community. Could computer vision help farmers identify crop diseases, count vehicles, or recognise text on documents?&lt;/p&gt;

&lt;p&gt;Ask yourself:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What images would the model need?&lt;/li&gt;
&lt;li&gt;Who would collect those images?&lt;/li&gt;
&lt;li&gt;What mistakes could the model make?&lt;/li&gt;
&lt;li&gt;How could we test whether it works reliably?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You do not need to build a model immediately. Start by identifying a problem and thinking about what information a computer would need to help solve it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Learning about computer vision has helped me understand another important part of artificial intelligence: teaching computers to work with images.&lt;/p&gt;

&lt;p&gt;I started with a simple question: &lt;em&gt;How do computers see?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I learned that the answer involves pixels, numbers, filters, mathematical calculations, and models that learn from examples.&lt;/p&gt;

&lt;p&gt;I also learned that building a model is not just about getting it to recognise an image. We must understand its limitations and test how it performs in the real world.&lt;/p&gt;

&lt;p&gt;My next step is to build a simple image classifier, test it using real images, and understand both what it can do and where it fails.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Have you ever used an AI tool that misunderstood a picture?&lt;/strong&gt; Share your experience in the comments. I would love to learn from it!&lt;/p&gt;




&lt;p&gt;&lt;em&gt;This post is based on what I learned and the research I did while exploring computer vision. I am continuing my journey into AI and machine learning, one concept at a time.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>computervision</category>
      <category>python</category>
      <category>beginners</category>
    </item>
    <item>
      <title>How I Started Understanding Word Embeddings</title>
      <dc:creator>immaculee byukusenge</dc:creator>
      <pubDate>Wed, 30 Sep 2026 13:40:46 +0000</pubDate>
      <link>https://dev.to/immaculee2/how-i-started-understanding-word-embeddings-2o0j</link>
      <guid>https://dev.to/immaculee2/how-i-started-understanding-word-embeddings-2o0j</guid>
      <description>&lt;p&gt;Introduction&lt;/p&gt;

&lt;p&gt;As I continue learning Artificial Intelligence and Natural Language Processing (NLP), I have started learning about word embeddings.&lt;/p&gt;

&lt;p&gt;Before learning about embeddings, I understood text mainly as words and sentences. However, computers cannot directly understand the meaning of words in the same way humans do. NLP needs a way to represent words as numbers so that machine-learning models can process them.&lt;/p&gt;

&lt;p&gt;This is where word embeddings become useful.&lt;/p&gt;

&lt;p&gt;What are Word Embeddings?&lt;/p&gt;

&lt;p&gt;Word embeddings are numerical representations of words in the form of vectors.&lt;/p&gt;

&lt;p&gt;Instead of representing a word simply as a label such as:&lt;br&gt;
                  ** "king"**&lt;/p&gt;

&lt;p&gt;an embedding represents it using a vector of numbers:&lt;/p&gt;

&lt;p&gt;king → [0.21, 0.45, -0.13, 0.72, ...]&lt;br&gt;
These numbers allow words to be represented in a mathematical space.&lt;/p&gt;

&lt;p&gt;The interesting part is that words with similar meanings or that appear in similar contexts can have similar vector representations.&lt;/p&gt;

&lt;p&gt;For example, words such as:&lt;/p&gt;

&lt;p&gt;king&lt;br&gt;
queen&lt;br&gt;
prince&lt;br&gt;
princess&lt;br&gt;
may have relationships in the embedding space.&lt;/p&gt;

&lt;p&gt;This is important because NLP systems need more than just knowing that two words are different. They need representations that can capture relationships between words.&lt;br&gt;
Why are Word Embeddings Important?&lt;/p&gt;

&lt;p&gt;Before learning about embeddings, I came across traditional approaches such as Bag-of-Words and TF-IDF.&lt;/p&gt;

&lt;p&gt;These approaches represent text using numerical values, but they do not represent the meaning of words in the same way that embeddings can.&lt;/p&gt;

&lt;p&gt;For example, consider these two sentences:&lt;/p&gt;

&lt;p&gt;The cat is sleeping.&lt;br&gt;
The kitten is sleeping.&lt;/p&gt;

&lt;p&gt;A traditional representation may treat cat and kitten as completely different words.&lt;/p&gt;

&lt;p&gt;Word embeddings can learn that these words are related because they often appear in similar contexts.&lt;/p&gt;

&lt;p&gt;This allows NLP models to work with relationships between words rather than treating every word as completely independent.&lt;/p&gt;

&lt;p&gt;Word2Vec&lt;/p&gt;

&lt;p&gt;One word-embedding method I learned about is Word2Vec.&lt;/p&gt;

&lt;p&gt;Word2Vec learns word representations by looking at the contexts in which words appear.&lt;/p&gt;

&lt;p&gt;There are two common approaches:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;CBOW (Continuous Bag of Words)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Skip-gram&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;CBOW&lt;/strong&gt; tries to predict a target word from surrounding words.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;p&gt;The cat is ___ on the sofa.&lt;/p&gt;

&lt;p&gt;The surrounding words can help the model predict the missing word.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Skip-gram&lt;/strong&gt; works in the opposite direction. It uses a target word to predict surrounding words.&lt;br&gt;
A Small Word2Vec Experiment&lt;/p&gt;

&lt;p&gt;I wanted to see what happens when a computer learns words from their context, so I created a very small dataset:&lt;/p&gt;

&lt;p&gt;sentences = [&lt;br&gt;
    ["cat", "eats", "fish"],&lt;br&gt;
    ["cat", "likes", "milk"],&lt;br&gt;
    ["dog", "eats", "meat"],&lt;br&gt;
    ["dog", "likes", "food"]&lt;br&gt;
]&lt;/p&gt;

&lt;p&gt;Then I trained a Word2Vec model:&lt;/p&gt;

&lt;p&gt;from gensim.models import Word2Vec&lt;/p&gt;

&lt;p&gt;model = Word2Vec(&lt;br&gt;
    sentences,&lt;br&gt;
    vector_size=10,&lt;br&gt;
    window=2,&lt;br&gt;
    min_count=1,&lt;br&gt;
    workers=1&lt;br&gt;
)&lt;/p&gt;

&lt;p&gt;After training, I asked the model for the vector representation of cat:&lt;/p&gt;

&lt;p&gt;print(model.wv["cat"])&lt;/p&gt;

&lt;p&gt;And I asked it to find words similar to cat:&lt;/p&gt;

&lt;p&gt;print(model.wv.most_similar("cat"))&lt;/p&gt;

&lt;p&gt;The exact results depend on the data used to train the model. With a very small dataset like this one, the results should not be treated as meaningful real-world language knowledge. A larger dataset would allow the model to learn better representations.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Something I Found Challenging&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;One thing I confused when I learned about word embeddings was the idea of representing a word using numbers.&lt;/p&gt;

&lt;p&gt;At first, I wondered:&lt;/p&gt;

&lt;p&gt;How can numbers represent the meaning of a word?&lt;/p&gt;

&lt;p&gt;I learned that the individual numbers themselves do not have a simple human-readable meaning. Instead, the position of a word's vector in the learned space and its relationship to other vectors are what make the representation useful.&lt;/p&gt;

&lt;p&gt;This helped me understand that machine learning does not need to understand words exactly as humans do. Instead, it can learn numerical patterns from data that represent useful relationships between words.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What I Learned&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The main thing I learned is that word embeddings provide a way of representing words as dense numerical vectors.&lt;/p&gt;

&lt;p&gt;I also learned that the context in which a word appears is important. Words used in similar contexts can have similar representations.&lt;/p&gt;

&lt;p&gt;Word2Vec showed me how a model can learn these representations from text instead of manually assigning meanings to every word.&lt;/p&gt;

&lt;p&gt;This has made me more interested in Natural Language Processing because it shows how mathematical representations can be used to work with human language.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Word embeddings are an important concept in NLP because they transform words into numerical vectors that machine-learning models can process.&lt;/p&gt;

&lt;p&gt;Word2Vec is one approach for learning these representations from the context of words.&lt;/p&gt;

&lt;p&gt;As a beginner in Artificial Intelligence, I am still learning how embeddings work and how they can be applied to real NLP projects. However, understanding the basic idea of representing words as vectors is an important step in my AI learning journey.&lt;/p&gt;

&lt;p&gt;REFERENCES&lt;/p&gt;

&lt;p&gt;[1] T. Mikolov, K. Chen, G. Corrado, and J. Dean, &lt;br&gt;
“Efficient Estimation of Word Representations in Vector Space,” &lt;br&gt;
International Conference on Learning Representations (ICLR), 2013. &lt;br&gt;
[Online]. Available: &lt;a href="https://arxiv.org/abs/1301.3781" rel="noopener noreferrer"&gt;https://arxiv.org/abs/1301.3781&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;[2] J. Pennington, R. Socher, and C. D. Manning, &lt;br&gt;
“GloVe: Global Vectors for Word Representation,” &lt;br&gt;
in Proceedings of the 2014 Conference on Empirical Methods in &lt;br&gt;
Natural Language Processing (EMNLP), 2014, pp. 1532–1543. &lt;br&gt;
[Online]. Available: &lt;a href="https://nlp.stanford.edu/projects/glove/" rel="noopener noreferrer"&gt;https://nlp.stanford.edu/projects/glove/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>nlp</category>
      <category>machinelearning</category>
    </item>
  </channel>
</rss>
