<?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: Axelle Toni</title>
    <description>The latest articles on DEV Community by Axelle Toni (@anaxelle).</description>
    <link>https://dev.to/anaxelle</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%2F4151930%2Fbe824f35-f159-4e54-accf-424b19f0b1af.png</url>
      <title>DEV Community: Axelle Toni</title>
      <link>https://dev.to/anaxelle</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/anaxelle"/>
    <language>en</language>
    <item>
      <title>How Computers See: What I Learned in My First Computer Vision Class</title>
      <dc:creator>Axelle Toni</dc:creator>
      <pubDate>Tue, 13 Oct 2026 14:05:33 +0000</pubDate>
      <link>https://dev.to/anaxelle/how-computers-see-what-i-learned-in-my-first-computer-vision-class-157</link>
      <guid>https://dev.to/anaxelle/how-computers-see-what-i-learned-in-my-first-computer-vision-class-157</guid>
      <description>&lt;p&gt;Before my first computer vision class, I thought a computer looked at a photo the way I do. I was wrong. A computer has never seen a photo, not once.&lt;/p&gt;

&lt;p&gt;This week we started computer vision, the part of AI that teaches machines to "see". Here is what I learned, in simple words, for anyone starting from zero like me.&lt;/p&gt;

&lt;h2&gt;
  
  
  A photo is just numbers
&lt;/h2&gt;

&lt;p&gt;When I look at a street photo, I instantly see a bus and some people. A computer gets a grid of numbers instead. Every tiny square (a pixel) has three numbers: how much &lt;strong&gt;red&lt;/strong&gt;, &lt;strong&gt;green&lt;/strong&gt; and &lt;strong&gt;blue&lt;/strong&gt; it has, each from 0 to 255. Why 255? Each value uses 8 bits, and 8 bits can hold 256 different values, from 0 to 255.&lt;/p&gt;

&lt;p&gt;In class we opened a sample photo with Python:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;numpy&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;PIL&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Image&lt;/span&gt;

&lt;span class="n"&gt;img&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Image&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;bus.jpg&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;convert&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;RGB&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;img&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;shape&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;   &lt;span class="c1"&gt;# (1080, 810, 3) for our sample photo
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;img&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;size&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;    &lt;span class="c1"&gt;# 2624400 numbers in total
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That one photo is 1080 rows × 810 columns × 3 colours, which is &lt;strong&gt;2,624,400 numbers&lt;/strong&gt;. The computer never "sees a bus". It only sees those numbers. The big challenge of computer vision is getting from the numbers to the meaning.&lt;/p&gt;

&lt;h2&gt;
  
  
  What can a computer do with a photo?
&lt;/h2&gt;

&lt;p&gt;Almost every vision system answers one of three questions: &lt;em&gt;What is in the image? Where is it? What is happening?&lt;/em&gt; We ran three pretrained models on the same street photo, and each one answered differently:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Classification&lt;/strong&gt; gives one label for the whole image. It said "minibus" with 57.1% confidence and "police van" with 33.7%. It was unsure between two vehicles that look alike, and one label is not very useful for a whole street scene.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Detection&lt;/strong&gt; draws a box around each object. It found 1 bus (94% confident) and 4 people.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Segmentation&lt;/strong&gt; labels every pixel. It marked exactly which pixels belong to each object. In our photo, the objects covered 44% of the image.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;More detailed answers need more detailed training labels, and those cost more to create.&lt;/p&gt;

&lt;h2&gt;
  
  
  How does a computer find an edge?
&lt;/h2&gt;

&lt;p&gt;This was my favourite part, because it is only multiplication and addition. A &lt;strong&gt;filter&lt;/strong&gt; is a small grid of weights that slides over the image. At each spot, you multiply each pixel by its weight and add everything up.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;sobel_x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;array&lt;/span&gt;&lt;span class="p"&gt;([[&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
                    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
                    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]])&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This filter computes "right side minus left side". On a flat patch where every pixel is 100, you get −400 + 400 = &lt;strong&gt;0&lt;/strong&gt;, so there is no edge. On a patch that goes from dark (0) to bright (200), you get 0 + 800 = &lt;strong&gt;800&lt;/strong&gt;, a big number, so there is an edge.&lt;/p&gt;

&lt;p&gt;A &lt;strong&gt;CNN&lt;/strong&gt; (convolutional neural network) does exactly this, with one difference: nobody chooses the weights. Training learns them from thousands of labelled images. The first layers learn edges and colours, the middle layers learn textures and parts like eyes or wheels, and the last layers recognise whole objects.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why YOLO is fast
&lt;/h2&gt;

&lt;p&gt;For detection we used &lt;strong&gt;YOLO&lt;/strong&gt;, which stands for "You Only Look Once". Older detectors first proposed possible regions and then classified each one, which was accurate but slow. YOLO looks at the whole image one time and predicts every box and label together. That is fast enough for live video and small devices. It was introduced in 2015 by Joseph Redmon and colleagues.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;ultralytics&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;YOLO&lt;/span&gt;

&lt;span class="n"&gt;detector&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;YOLO&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;yolo11n.pt&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;            &lt;span class="c1"&gt;# small pretrained detection model
&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;detector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;street.jpg&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;conf&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mf"&gt;0.4&lt;/span&gt;&lt;span class="p"&gt;)[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;  &lt;span class="c1"&gt;# only keep boxes it is 40%+ sure about
&lt;/span&gt;&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;box&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;boxes&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;names&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;box&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cls&lt;/span&gt;&lt;span class="p"&gt;)],&lt;/span&gt; &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nf"&gt;float&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;box&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;conf&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="si"&gt;:&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  When models fail
&lt;/h2&gt;

&lt;p&gt;This part surprised me most. We made the same photo harder, the way a cheap phone or bad lighting would:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Very dark:&lt;/strong&gt; the model invented a skateboard that was not there.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Upside down:&lt;/strong&gt; it lost the bus.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Low resolution:&lt;/strong&gt; it found nothing.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A model only knows what it was trained on. Many of these models were trained mostly on photos from Europe, North America and Asia. So where might they fail here? On crops, clothing, road scenes, skin tones and lighting. The fix is &lt;strong&gt;local data&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why this matters for us
&lt;/h2&gt;

&lt;p&gt;Our course looked at real examples from Africa. Nuru helps farmers diagnose cassava disease from a leaf photo, and it works offline on a basic phone, so it works in fields with no internet. BLAIVA, built by FabLab Rwanda in Kigali, is a wearable camera that describes objects, text and faces through earphones. It is still in beta testing. These systems were built by people like us, which makes this field feel close and possible.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I'm taking away
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Images are numbers: height × width × 3.&lt;/li&gt;
&lt;li&gt;Filters find patterns, and CNNs learn those filters on their own.&lt;/li&gt;
&lt;li&gt;Classification, detection and segmentation answer different questions.&lt;/li&gt;
&lt;li&gt;Models fail on what they have not seen, so local data matters.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Next, I'll build my own image classifier on photos from around me, with a separate test set so I can check it honestly.&lt;/p&gt;

&lt;h2&gt;
  
  
  Sources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;kLab TekHer AI Program, "Introduction to Computer Vision" class slides and demo notebook&lt;/li&gt;
&lt;li&gt;Ultralytics YOLO11 pretrained models; ImageNet and COCO datasets&lt;/li&gt;
&lt;li&gt;YOLO: Joseph Redmon et al., 2015&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>ai</category>
      <category>machinelearning</category>
      <category>python</category>
    </item>
    <item>
      <title>Word Embeddings, Explained Simply (For Developers Who Are New to NLP)</title>
      <dc:creator>Axelle Toni</dc:creator>
      <pubDate>Wed, 30 Sep 2026 14:38:28 +0000</pubDate>
      <link>https://dev.to/anaxelle/word-embeddings-explained-simply-for-developers-who-are-new-to-nlp-4jei</link>
      <guid>https://dev.to/anaxelle/word-embeddings-explained-simply-for-developers-who-are-new-to-nlp-4jei</guid>
      <description>&lt;p&gt;When I first heard the term "word embeddings," it sounded like something only researchers with PhDs would understand. It turns out the core idea is actually simple, and once it clicks, a lot of modern AI (chatbots, search engines, recommendation systems) suddenly makes a lot more sense.&lt;br&gt;
What are word embeddings, really?&lt;/p&gt;

&lt;p&gt;What are word embeddings, really?&lt;/p&gt;

&lt;p&gt;Computers don't understand words the way we do. To a computer, "cat" and "dog" are just strings of letters with no relationship to each other unless we tell it otherwise. Word embeddings are a way of converting words into lists of numbers (called vectors) so that words with similar meanings end up with similar numbers.&lt;/p&gt;

&lt;p&gt;For example, imagine every word gets plotted as a point in space. Words like "cat" and "dog" would land close together, because they're both animals, often pets, and used in similar sentences. A word like "airplane" would land far away, because it's used in a completely different context.&lt;/p&gt;

&lt;p&gt;This matters because it lets computers do things like:&lt;/p&gt;

&lt;p&gt;Understand that "good" and "great" mean similar things&lt;br&gt;
Search for a term and still find related results, not just exact matches&lt;br&gt;
Power translation, chatbots, and recommendation systems&lt;/p&gt;

&lt;p&gt;Without embeddings, a computer would treat every word as completely unrelated to every other word which makes real language understanding almost impossible.&lt;/p&gt;

&lt;p&gt;How Word2Vec works  &lt;/p&gt;

&lt;p&gt;One of the most well-known ways to create embeddings is Word2Vec, developed by researchers at Google. The idea behind it is surprisingly simple: "a word is defined by the company it keeps."&lt;/p&gt;

&lt;p&gt;Word2Vec looks at huge amounts of text and learns, based on which words tend to appear near each other, how to place each word in that numerical space. If "coffee" and "tea" often show up in similar sentences ("I drink coffee every morning," "I drink tea every morning"), the model learns to place them close together — even though it was never explicitly told they're both drinks.&lt;/p&gt;

&lt;p&gt;There are two main approaches inside Word2Vec:&lt;/p&gt;

&lt;p&gt;CBOW (Continuous Bag of Words): predicts a word based on the words around it.&lt;br&gt;
Skip-gram: does the opposite predicts the surrounding words based on one word&lt;/p&gt;

&lt;p&gt;Either way, the model isn't taught definitions. It only learns patterns from context, and meaning emerges from that.&lt;/p&gt;

&lt;p&gt;A concrete example&lt;/p&gt;

&lt;p&gt;Here's a simple example using the gensim library in Python, training a tiny Word2Vec model on a small sample of sentences:&lt;/p&gt;

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

&lt;p&gt;sentences = [&lt;br&gt;
    ["i", "drink", "coffee", "every", "morning"],&lt;br&gt;
    ["i", "drink", "tea", "every", "morning"],&lt;br&gt;
    ["dogs", "and", "cats", "are", "pets"],&lt;br&gt;
    ["cats", "chase", "mice"],&lt;br&gt;
]&lt;/p&gt;

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

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

&lt;p&gt;Even with this tiny amount of data, the model starts to notice that "coffee" and "tea" appear in similar contexts, and it will rank "tea" as more similar to "coffee" than something like "dogs."&lt;/p&gt;

&lt;p&gt;A classic (and honestly kind of magical) example from real, large-scale Word2Vec models is:&lt;/p&gt;

&lt;p&gt;King - man + woman = queen&lt;/p&gt;

&lt;p&gt;The model isn't told anything about royalty or gender it just learns this relationship purely from patterns in text.&lt;/p&gt;

&lt;p&gt;What surprised me and what I struggled with&lt;/p&gt;

&lt;p&gt;I haven't worked hands-on with word embeddings yet, but I've always loved anything related to IT, so this topic caught my attention right away. What I enjoyed most was understanding how these models are trained how they "learn" without actually thinking. A model doesn't understand meaning; it only picks up patterns from whatever data it's given, which means how well it performs depends entirely on what you train it with. That part stuck with me: as the person training a model, you have to be careful about the data you feed it, because it will simply repeat whatever patterns exist in that data. What didn't surprise me is that computers don't naturally understand human language, I already knew that from earlier learning.&lt;/p&gt;

&lt;p&gt;What I struggled with was the more practical side. When I looked at example code like the one above, I found it hard to fully understand the output, things like most_similar() results and what the numbers actually mean. I'm also still getting comfortable with writing this kind of code myself, rather than just reading someone else's. Understanding the theory made sense to me quickly, but going from theory to actually building and reading a working model is still something I'm learning to do.&lt;/p&gt;

&lt;p&gt;Final thoughts&lt;/p&gt;

&lt;p&gt;Word embeddings are one of those ideas that feel complicated from the outside but make a lot of sense once you see a small example. If you're starting out in NLP like I am, I would recommend just trying the code above with your own sentences seeing which words the model considers "similar" is a great way to build intuition.&lt;/p&gt;

&lt;p&gt;Sources:&lt;/p&gt;

&lt;p&gt;Sources: Mikolov et al., "Efficient Estimation of Word Representations in Vector Space" (2013); Gensim documentation: &lt;a href="https://radimrehurek.com/gensim/" rel="noopener noreferrer"&gt;https://radimrehurek.com/gensim/&lt;/a&gt;&lt;/p&gt;

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