第一章:神奇的眼睛——计算机视觉入门 / Chapter 1: Magical Eyes - Introduction to Computer Vision
你有没有想过,当你用手指轻轻触碰手机屏幕,手机怎么就知道是你在使用它呢?或者你有没有注意到,当你走进一栋大楼,门竟然自己就开了,好像有一个隐形的朋友在帮你开门一样?再想象一下,你最喜欢的那个会自己躲开障碍物的吸尘器机器人,它是怎么"看到"地上的玩具和电线,然后巧妙地绕过去的呢?
These are all examples of computer vision in action. Computer vision is one of the most exciting and amazing parts of artificial intelligence (AI). It gives machines the ability to "see" and understand the world just like you do with your eyes. But instead of using eyeballs and brains, machines use cameras and special computer programs to look at pictures and videos and figure out what's in them.
Let's think about how you see the world. When you look at a cute puppy, your eyes send signals to your brain, and your brain says, "Hey, that's a fluffy brown puppy with floppy ears!" Your brain has learned to recognize puppies from all the puppies you've seen before. It knows that puppies have four legs, a tail that wags, and they usually look happy when they see you.
Computer vision works in a similar way, but instead of a brain, computers use something called algorithms, which are like super-smart sets of instructions. And instead of years of growing up and learning, computers can learn from millions and millions of pictures. That's a lot of pictures! In fact, if you looked at a million pictures, and you looked at one picture every second, it would take you about 11 days without sleeping! Computers can look at millions of pictures much, much faster than that.
你有没有注意到,当你刚出生的时候,其实你不太会"看"东西?你只能看到模糊的光和影子。但是随着你慢慢长大,你看到了越来越多的东西,你的大脑就开始学习,学会了认识妈妈的脸、爸爸的脸,还有家里的小猫、小狗,还有各种各样颜色鲜艳的玩具。你的大脑就像一台超级聪明的学习机器,它一直在观察,一直在学习,一直在变得更厉害。
Babies learn to see gradually. When a baby is first born, they can only see blurry shapes and lights. But as they grow and see more and more things, their brain learns to recognize faces, objects, and colors. Your brain is an amazing learning machine that never stops getting smarter!
Machines learn to see in a similar way, but they need a lot more examples. Imagine if you had to see 10,000 puppies before you could recognize one. That's a lot of puppies! But computers don't get bored, and they can look at pictures much faster than humans can. So scientists and engineers show computers millions and millions of pictures, and the computers learn to find patterns in those pictures. They learn what makes a puppy look like a puppy, and not like a cat or a teddy bear.
你知道吗?科学家们其实花了很长很长的时间,才教会计算机像人类一样"看"东西。早在1960年代,也就是你的爷爷奶奶还是小朋友的时候,就有一些非常聪明的科学家开始研究这个问题了。他们想知道:能不能让计算机也像我们一样,认出照片里有什么呢?
科学家们做了很多很棒的研究。有一位叫大卫·马尔(David Marr)的科学家,在1970年代提出了一个很重要的想法:计算机会"看"东西,其实就像我们画画一样,是一层一层、从简单到复杂的过程。想象一下,你画一个人,你要先画一个大大的圆形作为头,然后画两条线作为身体,再画四条线作为胳膊和腿......一步一步的,最后就变成了一个完整的小人!
The journey to teaching computers to see has been a long and exciting adventure. Scientists and researchers have been working on this problem since the 1960s, even before your grandparents were born! They've made incredible progress over the decades, developing new and better ways to help machines understand images.
One important scientist named David Marr, who worked in the 1970s, had a brilliant idea. He said that computer vision should work like building something step by step, from simple to complex. Think about how you might draw a person. First, you might draw a big circle for the head. Then you add lines for the body and arms and legs. Finally, you add details like eyes, nose, and clothes. Computer vision works in a similar way, building up understanding from simple shapes to complex scenes.
后来到了1980年代,又有一位叫杨·乐坤(Yann LeCun)的法国科学家,他教会了计算机一种特别的学习方法,叫做"神经网络"(Neural Network)。这个名字听起来是不是有点像我们大脑里那些密密麻麻的神经细胞?没错!这位科学家的灵感就是从我们的大脑来的!我们的脑子里有 billions(数十亿)个神经细胞,它们手拉手连成网络,一起工作让我们能看见东西、记住东西、思考问题。杨·乐坤就想:如果能让计算机也像我们的大脑一样工作,那计算机是不是也能学会"看"呢?
In the 1980s, a brilliant scientist named Yann LeCun from France developed something called "neural networks," which was inspired by how our own brains work. Your brain has billions of tiny cells called neurons that are connected together in a network. When you see something, millions of neurons work together to figure out what you're looking at. Yann LeCun thought, "What if we could make computers work the same way?" And it worked! Neural networks became one of the most important tools for teaching computers to see.
神经网络的工作方式真的很神奇。想象一下,你的大脑里有很多很多小人,每个小人都负责判断图片的某一个部分。有的小人专门看有没有圆形,有的小人专门看有没有直线,有的小人专门看有没有曲线......然后所有小人的判断汇总起来,最后就能认出这是一只猫还是一条狗,是苹果还是香蕉。神经网络也是这样工作的——它有好多好多"虚拟小人"(我们叫它们"神经元"),每个神经元都负责看图片的一小部分,然后大家一起商量,最终得出结论。
Neural networks are groups of tiny virtual "decision makers" that work together. Think of it like a team of friends trying to figure out what's in a picture. One friend might look for circles, another might look for lines, another might look for curves. When they all share what they found, they can figure out if the picture is a cat, a dog, an apple, or a banana. Neural networks work the same way, with thousands or even millions of tiny "neurons" all working together to understand images.
时间快进到2010年代,科学家们又有了更厉害的突破!他们发明了一种叫做"深度学习"(Deep Learning)的方法。"深度"在这里的意思是,这个神经网络有很多很多层,就像一座很高很高的楼房一样。层数越多,能学到的东西就越复杂。想象一下,一层楼的楼房能做的事情很有限,但是一百层楼的摩天大楼可以做很多事情,对吧?深度学习也是一样的道理——层数越多,计算机就越"聪明",能识别的图片就越复杂、越准确。
By the 2010s, scientists made another breakthrough called "deep learning." The word "deep" means that these neural networks have many, many layers, like a tall building with many floors. The more floors a building has, the more things it can do. Similarly, the more layers a neural network has, the smarter it becomes! Deep learning networks can recognize incredibly complex things in images with amazing accuracy.
2012年,有一个叫亚历克斯·克里泽夫斯基(Alex Krizhevsky)的年轻科学家,他建造了一个叫做AlexNet的系统,参加了一个很有名的比赛。这个比赛叫做ImageNet大规模视觉识别挑战赛(ILSVRC),听起来很长对吧?简单来说,就是全世界最聪明的科学家们比赛,看谁能做出最准确的图片识别系统。
In 2012, something amazing happened. A young scientist named Alex Krizhevsky built a system called AlexNet and entered a famous competition called the ImageNet Large Scale Visual Recognition Challenge, or ILSVRC for short. In this competition, scientists from all over the world tried to build the most accurate image recognition system.
AlexNet的表现让所有人都惊呆了!它比之前的系统准确率高太多了,就像一个学生突然考了满分一样!从那以后,深度学习就像一阵旋风一样席卷了整个科技界,成为了最热门的研究方向。科学家们用深度学习做出了越来越厉害的系统,现在计算机识别图片的准确率甚至已经超过了人类!你能想象吗?一台机器在一场特别的"看图比赛"中,超过了真正的人类的眼睛!
AlexNet's performance shocked everyone! It was much more accurate than any previous system, like a student who suddenly got a perfect score on a test! After that, deep learning became the hottest topic in technology. Scientists built better and better systems, and today, computers can recognize images even more accurately than humans can! Isn't that amazing? A machine can beat human eyes in a special "picture recognition competition"!
好了,现在你大概知道计算机视觉是怎么发展起来的了。但是你可能会问:这个东西到底有什么用呢?为什么要教机器"看"东西呢?其实,计算机视觉的用处可大了!它正在悄悄地改变我们生活的方方面面,让我们的生活变得更加方便、更加安全、更加有趣。
Now you know a little bit about how computer vision was developed. But you might be wondering: what can we actually use it for? Why do we want to teach machines to "see"? Computer vision is actually incredibly useful! It's quietly changing many parts of our daily lives, making things more convenient, safer, and more fun.
让我们一起来看看计算机视觉在生活中有哪些神奇的应用吧!
Let's explore some of the amazing ways computer vision is used in our everyday lives!
第一个故事:会认人的手机和相机
你有没有注意到,当你拿起爸爸妈妈的手机,它怎么就知道是谁在用它呢?如果是你妈妈在用,它可能就会显示她的主屏幕和照片;如果是爸爸在用,就会显示完全不同的界面。这是怎么做到的呢?
Have you ever noticed that when you pick up your parents' phone, it somehow knows who's using it? If Mom picks it up, it might show her home screen and photos. If Dad picks it up, it shows something completely different. How does it do that?
答案就是人脸识别(Face Recognition)!手机前置摄像头会悄悄拍一张你的脸,然后用计算机视觉的技术,分析你脸上的一些特别的地方,比如眼睛之间的距离、鼻子的形状、嘴巴的位置等等。每个人的脸都是独一无二的,就像你的指纹一样。计算机把这些信息记下来,下次再看到你的脸,就知道是你啦!
The answer is face recognition! The phone's front camera quietly takes a picture of your face, and computer vision technology analyzes special features on your face, like the distance between your eyes, the shape of your nose, and where your mouth is. Everyone's face is unique, just like your fingerprints.