How Computers 'See' and 'Read': Turning the World into Numbers

Computers cannot see colors or read letters—they only understand numbers. Discover how photos become grids of pixels and how words become coordinates on a giant idea map (embeddings).

Foundational Knowledge & Simpler Primers
Need a simpler explanation or feeling stuck?

Need to review how computers adjust their dials from examples? Review:

Unsure of mathematical notation or technical terms on this page? Our 57-term AI Glossary breaks down every concept with plain-English analogies and rigorous engineering specs.
Open AI Glossary (57 Terms)

1. Theoretical Motivation & Foundations

A computer's silicon processor has never seen a sunset, heard a song, or read a sentence. A computer is simply a high-speed calculator that shuffles numbers around. So how can an AI recognize your dog in a photo, or read an essay you wrote? It does it by translating everything in the physical world into numbers. For pictures, this is easy: an image is divided into a tiny grid of dots called Pixels. Each pixel is made of three numbers: how much Red, how much Green, and how much Blue light it has (from 0 to 255). A digital photo of a dog is literally just a giant grid of numbers! But what about language? You can't turn words into colors. Instead, language models break sentences into puzzle pieces called Tokens (which might be a word, a syllable, or a punctuation mark). Then comes the magic idea: every token is assigned a set of coordinates on a giant multi-dimensional 'Idea Map' called an Embedding Space. Words that share similar meanings (like 'puppy' and 'dog') sit right next to each other on the map. Words with opposite meanings sit far apart. By measuring the distance between words on this map, computers can calculate meaning using geometry!

2. Mathematical Formulations & Derivations

The governing analytical formulations and proof frameworks for this module:

How Real-World Things Become Numbers: 1. Digital Images (Pixels): A 3×3 pixel image = 9 pixels × 3 colors (RGB) = 27 numbers. Pure Black = [0, 0, 0] | Pure White = [255, 255, 255] | Red = [255, 0, 0] 2. Word Coordinates (Concept Embeddings): Imagine a simple 2D map: [Fluffy Score, Size Score] Hamster: [0.9, 0.1] (Very fluffy, very small) Golden Ret: [0.8, 0.6] (Fluffy, medium size) Elephant: [0.0, 0.9] (Not fluffy, massive size) Distance Formula (Euclidean Distance on the Map): d = √((x₂ - x₁)² + (y₂ - y₁)²) The smaller the distance, the more similar the concepts!

3. From-Scratch Reference Implementation

Executable, production-tested reference code without magic libraries:

# The Giant Idea Map: Measuring Word Similarity with Simple Math import math # A tiny 2D concept map: [Cute & Domestic, Big & Wild] word_map = { 'kitten': (0.95, 0.05), 'puppy': (0.90, 0.10), 'lion': (0.15, 0.85), 'tiger': (0.10, 0.90), 'airplane': (0.01, 0.99), } def calculate_similarity_distance(word1: str, word2: str) -> float: x1, y1 = word_map[word1] x2, y2 = word_map[word2] # Euclidean distance between the two points on our map return math.sqrt((x2 - x1)**2 + (y2 - y1)**2) print('Distance between Kitten & Puppy:', round(calculate_similarity_distance('kitten', 'puppy'), 3)) print('Distance between Kitten & Tiger:', round(calculate_similarity_distance('kitten', 'tiger'), 3)) print('Distance between Kitten & Airplane:', round(calculate_similarity_distance('kitten', 'airplane'), 3)) # Notice: Kitten and Puppy are right next to each other (distance ~0.07)!

4. Systems Complexity & Memory Footprint

First Principles Takeaway: All machine learning operates on geometry. Whether it is search engines finding documents or AI generating art, everything boils down to distances on a coordinate map.

5. Canonical Literature & Primary Research

Original research papers and foundational texts recommended for advanced study:

  1. Mikolov, T., et al. (2013). Efficient Estimation of Word Representations in Vector Space. arXiv:1301.3781.
  2. Pennington, J., Socher, R., & Manning, C. D. (2014). GloVe: Global Vectors for Word Representation. EMNLP.
  3. Krizhevsky, A., Sutskever, I., & Hinton, G. E. (2012). ImageNet Classification with Deep CNNs. NeurIPS.
Next Page for Further Learning
Mastered this concept? Keep advancing

Now that you know how words and photos become numbers, see how artificial neurons process them: