<?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: Joy</title>
    <description>The latest articles on DEV Community by Joy (@joy_1o1).</description>
    <link>https://dev.to/joy_1o1</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%2F4151835%2F885b57f1-4ce8-45f3-8280-75dbd4eb19c8.jpg</url>
      <title>DEV Community: Joy</title>
      <link>https://dev.to/joy_1o1</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/joy_1o1"/>
    <language>en</language>
    <item>
      <title>What I Learned in My First Computer Vision Class: How a Computer Sees</title>
      <dc:creator>Joy</dc:creator>
      <pubDate>Tue, 13 Oct 2026 12:41:15 +0000</pubDate>
      <link>https://dev.to/joy_1o1/what-i-learned-in-my-first-computer-vision-class-how-a-computer-sees-hd4</link>
      <guid>https://dev.to/joy_1o1/what-i-learned-in-my-first-computer-vision-class-how-a-computer-sees-hd4</guid>
      <description>&lt;p&gt;This week I learned about computer vision. I knew nothing about it before. In this post I share what I learned in simple words. I hope it helps other beginners too.&lt;/p&gt;

&lt;h2&gt;
  
  
  A computer does not see a picture. It sees numbers.
&lt;/h2&gt;

&lt;p&gt;When I look at a photo, I know what it is in one second. A computer cannot do this. It only sees numbers.&lt;/p&gt;

&lt;p&gt;A photo is made of small squares called &lt;strong&gt;pixels&lt;/strong&gt;. Each pixel has three numbers: red, green and blue. Each number goes from 0 (none) to 255 (full). So a photo with 400 rows and 600 columns has 400 × 600 × 3 = &lt;strong&gt;720,000 numbers&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;In the notebook, I looked at one pixel from the photo. It was &lt;code&gt;[106, 99, 91]&lt;/code&gt;. The three numbers are close to each other and not very high, so the colour is a dark grey. Another pixel was &lt;code&gt;[4, 16, 40]&lt;/code&gt;. The numbers are very small, so it is almost black.&lt;/p&gt;

&lt;h2&gt;
  
  
  Filters help the computer find edges
&lt;/h2&gt;

&lt;p&gt;An &lt;strong&gt;edge&lt;/strong&gt; is a place where dark suddenly changes to bright, like the side of a bus.&lt;/p&gt;

&lt;p&gt;To find edges, we use a &lt;strong&gt;filter&lt;/strong&gt;. A filter is a small grid of numbers called &lt;strong&gt;weights&lt;/strong&gt;. You put it on top of the pixels, multiply each pixel by its weight, and add all the results. For example, the Sobel filter is:&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;It does "right side minus left side". If both sides are the same, the answer is 0, so there is no edge. If the left side is dark and the right side is bright, the answer is big, so there is an edge.&lt;/p&gt;

&lt;p&gt;I also tried a blur filter. It has 25 weights of 0.04, so it takes the average of 25 pixels and makes the photo soft.&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;blur&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;ones&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;25&lt;/span&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;h2&gt;
  
  
  CNN: the computer learns its own filters
&lt;/h2&gt;

&lt;p&gt;A &lt;strong&gt;CNN&lt;/strong&gt; (Convolutional Neural Network) does not use filters that a person writes. It starts with random weights, makes a guess, and checks the right answer. Then it changes the weights a little. After thousands of photos, it finds good filters by itself.&lt;/p&gt;

&lt;h2&gt;
  
  
  Three main tasks
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Classification:&lt;/strong&gt; one name for the whole photo&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Detection:&lt;/strong&gt; a box around each object&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Segmentation:&lt;/strong&gt; a label for every pixel&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I tried all three with a small YOLO model.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Classification.&lt;/strong&gt; On a sample photo of two men, the model said "suit" with only 34.7%. It cannot say "two people", because it can only choose from 1,000 names.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Detection.&lt;/strong&gt; On a bus photo, the model found 1 bus and 4 people. There is a setting called &lt;code&gt;conf&lt;/code&gt;, the confidence threshold. With &lt;code&gt;conf=0.9&lt;/code&gt; I got only the bus. The people disappeared, because the model was less than 90% sure about them. With a low threshold I get more boxes, but some can be wrong. This is the same problem as in medical screening: too many false alarms, or too many missed cases.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Segmentation.&lt;/strong&gt; The model made a mask for every object. I counted the pixels: the bus had 92,230 pixels, and the stop sign only 644. Segmentation can tell me how much of the photo each object covers.&lt;/p&gt;

&lt;h2&gt;
  
  
  Testing with my own photos
&lt;/h2&gt;

&lt;p&gt;This was my favourite part. I tested two photos from the internet.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A miss: ibiraha.&lt;/strong&gt; Ibiraha is a street food in Rwanda. The model said &lt;strong&gt;"pineapple"&lt;/strong&gt; [91.9%]. The food is golden and has many pointy corners, so the model thought it looked like a pineapple. The model has never seen ibiraha, and it cannot say "I don't know". It must choose one of its 1,000 names.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A hit: a street in Kigali.&lt;/strong&gt; In this photo there are motorbikes, cars and people in daylight. The detector found [person,motorcycle, car]. These are things the model saw many times in training.&lt;/p&gt;

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

&lt;p&gt;A model only knows what it was trained on. To test this, I made my Kigali street photo harder in four ways. Then I ran the detector on each version.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Version&lt;/th&gt;
&lt;th&gt;Objects found&lt;/th&gt;
&lt;th&gt;People found&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Original&lt;/td&gt;
&lt;td&gt;8&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Very dark&lt;/td&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Upside down&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Low resolution&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Blurry&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;What I saw:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The original photo gave 8 objects and 4 people. This is a good result.&lt;/li&gt;
&lt;li&gt;In the dark photo, the model lost some objects, but it still found most of them.&lt;/li&gt;
&lt;li&gt;The upside down, low resolution and blurry photos gave &lt;strong&gt;0 objects&lt;/strong&gt;. The model found nothing.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Why?&lt;/strong&gt; Upside down photos have the same pixels, but the model never saw streets in this position in training. In the low resolution and blurry photos, the edges and small details are gone, and the model needs them to recognise cars and people.&lt;/p&gt;

&lt;p&gt;This is a real problem. Cheap phone cameras, dusty lenses and bad light are common in many places in Africa. A model trained only on clear photos can fail there.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I learned
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;A computer sees only numbers. A filter helps to find patterns in them.&lt;/li&gt;
&lt;li&gt;A model only knows what it was trained on.&lt;/li&gt;
&lt;li&gt;A high confidence does not mean the answer is correct.&lt;/li&gt;
&lt;li&gt;Local data matters. A model trained on photos from other countries can fail on our food, roads and crops.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This is why computer vision for Africa needs African data. For my next step, I want to collect about 100 photos of Rwandan food and train a small model that knows ibiraha.&lt;/p&gt;

&lt;p&gt;Thank you for reading!&lt;/p&gt;

</description>
      <category>ai</category>
      <category>computervision</category>
      <category>python</category>
      <category>beginners</category>
    </item>
    <item>
      <title>I Tried to Teach a Computer "Apple" (It Thought It Was a Fruit, an iPhone, and a Vector)</title>
      <dc:creator>Joy</dc:creator>
      <pubDate>Wed, 30 Sep 2026 12:37:57 +0000</pubDate>
      <link>https://dev.to/joy_1o1/i-tried-to-teach-a-computer-apple-it-thought-it-was-a-fruit-an-iphone-and-a-vector-3bhj</link>
      <guid>https://dev.to/joy_1o1/i-tried-to-teach-a-computer-apple-it-thought-it-was-a-fruit-an-iphone-and-a-vector-3bhj</guid>
      <description>&lt;p&gt;Hello, DEV Community! 🙌 It’s my first time writing here. &lt;/p&gt;

&lt;p&gt;As I was studying how models handle text today, I ran into a funny realization: &lt;strong&gt;computers don't understand human words at all. They only understand numbers.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;So how do we explain to a model that a cat is a pet, an apple can be a fruit or a tech company?&lt;/p&gt;

&lt;p&gt;Here is what I learned today about &lt;strong&gt;Word Embedding&lt;/strong&gt;, explained from a pure logic and geometry perspective!&lt;/p&gt;




&lt;h2&gt;
  
  
  1. The First step: Making a Massive List(One-Hot Encoding)
&lt;/h2&gt;

&lt;p&gt;If you ask a beginner programmer how to turn words into numbers, the most obvious idea is to give every single word a simple code or an index in a giant list. &lt;/p&gt;

&lt;p&gt;Imagine taking an entire dictionary of 100,000 words and marking &lt;code&gt;1&lt;/code&gt; for the word you want and &lt;code&gt;0&lt;/code&gt; for everything else.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;cat&lt;/code&gt; = &lt;code&gt;[1, 0, 0, 0, ...]&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;dog&lt;/code&gt; = &lt;code&gt;[0, 1, 0, 0, ...]&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;apple&lt;/code&gt; = &lt;code&gt;[0, 0, 1, 0, ...]&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Why this fails:
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;It Wastes Endless Space:&lt;/strong&gt; You end up creating massive arrays full of useless zeros just to represent one tiny word. RIP RAM. 🪦&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Computers Got Zero "Street Smarts":&lt;/strong&gt; In pure math, these simple list positions have nothing in common. To the computer, &lt;code&gt;cat&lt;/code&gt; has as much in common with &lt;code&gt;dog&lt;/code&gt; as it does with &lt;code&gt;banana&lt;/code&gt;. It has no idea that two animals belong together.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  2. The Solution: Giving Words Map Coordinates
&lt;/h2&gt;

&lt;p&gt;Instead of a giant empty list, researchers like Mikolov et al. at Google introduced &lt;strong&gt;Word Embedding&lt;/strong&gt; (such as Word2Vec and GloVe).&lt;/p&gt;

&lt;p&gt;Think of it like plotting points on a map. In physics or math class, you plot points using X, Y, and Z coordinates. Word embedding does the exact same thing, except instead of 3 directions, they use 50 to 300 invisible dimensions!&lt;/p&gt;

&lt;p&gt;These dimensions represent hidden concepts like &lt;em&gt;is_animal&lt;/em&gt;, &lt;em&gt;is_food&lt;/em&gt;, &lt;em&gt;is_tech&lt;/em&gt;, or &lt;em&gt;grammatical_type&lt;/em&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;"cat"&lt;/strong&gt; gets coordinates near animal concepts.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;"dog"&lt;/strong&gt; gets coordinates right next to "cat".&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;"apple"&lt;/strong&gt; gets pulled into a coordinate spot sitting right in between the fruit neighborhood and the iPhone neighborhood!&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;How does the computer learn these coordinates? By sliding a "context window" across millions of sentences on the internet. It observes which words consistently live as neighbors in the same sentences so if words appear in similar contexts, they get pulled toward the same coordinates in vector space.&lt;/p&gt;

&lt;p&gt;Because the computer reads millions of sentences, it notices which words "live" in the same neighborhoods.&lt;/p&gt;




&lt;h2&gt;
  
  
  3. Math Geometry Magic
&lt;/h2&gt;

&lt;p&gt;Because every word becomes a point in space, we can measure how close two words are by calculating the angle or distance between their points. &lt;/p&gt;

&lt;p&gt;If two words point in nearly the exact same direction, they share similar meanings!&lt;/p&gt;

&lt;h3&gt;
  
  
  Doing Algebra with Words
&lt;/h3&gt;

&lt;p&gt;My discovery today was that you can actually do math equations with word coordinates:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;King - Man + Woman = Queen&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This famous vector arithmetic concept was demonstrated in the original Word2Vec paper by Mikolov et al. (2013)."&lt;/p&gt;

&lt;p&gt;If you start at the coordinate for &lt;strong&gt;King&lt;/strong&gt;, subtract the "male" direction, and add the "female" direction, your new coordinate in space lands right on &lt;strong&gt;Queen&lt;/strong&gt;. 🤯&lt;/p&gt;




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

&lt;p&gt;Learning that word embedding are just coordinate maps helped me bridge the gap between machine language (a.k.a  math) and human language. &lt;/p&gt;

&lt;h2&gt;
  
  
  In any case, word embedding are nothing but high dimensional maps that make words street-smart. The idea of understanding text via coordinates really clicked with me!
&lt;/h2&gt;

&lt;h2&gt;
  
  
  References &amp;amp; Further Reading
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Mikolov, T., Chen, K., Corrado, G., &amp;amp; Dean, J. (2013).&lt;/strong&gt; &lt;em&gt;Efficient Estimation of Word Representations in Vector Space.&lt;/em&gt; &lt;a href="https://arxiv.org/abs/1301.3781" rel="noopener noreferrer"&gt;arXiv:1301.3781&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pennington, J., Socher, R., &amp;amp; Manning, C. D. (2014).&lt;/strong&gt; &lt;em&gt;GloVe: Global Vectors for Word Representation.&lt;/em&gt; &lt;a href="https://nlp.stanford.edu/projects/glove/" rel="noopener noreferrer"&gt;Stanford NLP&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Alammar, J. (2019).&lt;/strong&gt; &lt;em&gt;The Illustrated Word2Vec.&lt;/em&gt; &lt;a href="https://jalammar.github.io/illustrated-word2vec/" rel="noopener noreferrer"&gt;jalammar.github.io&lt;/a&gt;
&lt;/li&gt;
&lt;/ol&gt;

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