MathWorks - Mobile View
  • MathWorks 계정에 로그인합니다.MathWorks 계정에 로그인합니다.
  • Access your MathWorks Account
    • 내 계정
    • 나의 커뮤니티 프로필
    • 라이선스를 계정에 연결
    • 로그아웃
  • 제품
  • 솔루션
  • 아카데미아
  • 지원
  • 커뮤니티
  • 이벤트
  • MATLAB 다운로드
MathWorks
  • 제품
  • 솔루션
  • 아카데미아
  • 지원
  • 커뮤니티
  • 이벤트
  • MATLAB 다운로드
  • MathWorks 계정에 로그인합니다.MathWorks 계정에 로그인합니다.
  • Access your MathWorks Account
    • 내 계정
    • 나의 커뮤니티 프로필
    • 라이선스를 계정에 연결
    • 로그아웃

비디오 및 웨비나

  • MathWorks
  • 비디오
  • 비디오 홈
  • 검색
  • 비디오 홈
  • 검색
  • 영업 상담
  • 평가판 신청
  Register to watch video
  • Description
  • Full Transcript
  • Code and Resources

Deep Learning with MATLAB: Deep Learning in 11 Lines of MATLAB Code

From the series: Deep Learning with MATLAB

Joe Hicklin, MathWorks

Watch a quick demonstration of how to use MATLAB®, a simple webcam, and a deep neural network to identify objects in your surroundings. This demo uses AlexNet, a pretrained deep convolutional neural network (CNN or ConvNet) that has been trained on over a million images.

The example has two parts: setting up the camera and performing object recognition. The first part shows how to use the webcam command to acquire images from the camera. Using the drawnow command, MATLAB is able to continuously update and display images taken by the camera.

The second part illustrates how to download a pretrained deep neural network called AlexNet and use MATLAB to continuously process the camera images. AlexNet takes the image as input and provides a label for the object in the image. You can experiment with objects in your surroundings to see how accurate AlexNet is.

Today you can do this very easily with MATLAB, but even just a few years ago it would have been considered science fiction.

Learn more about deep learning with MATLAB or download the demo code.

Recorded: 6 Dec 2016

Hi. My name is Joe Hicklin. I'm a senior developer at the MathWorks. I've been experimenting with deep learning with MATLAB and the Neural Net Toolbox. I've written a simple little program that does something pretty cool. I'd like to show that to you now.

What I've done is I've taken a webcam and attached it to a neural net that recognizes images. Now I can point the webcam at various objects and it recognizes it. A corkscrew, or maybe a screwdriver, or perhaps a revolver, a harmonica, a teapot, a shovel, that sort of thing. It's not perfect, but it does a pretty good job.

So let's look at the code that does this. This is the whole program, right? It's just 11 lines. We're going to go through it. But we're going to do it in three separate stages.

We're going to clear the workspace. We're going to ask the camera to connect to the webcam, have the camera and take a picture, and then finally, show that picture on the screen. So when we run this we should get a fresh picture going on here. And that's the picture we just took.

But that's a still image. We want this to be a continuous video. So we're going to add three more lines to put it in a loop.

We'll put a while loop around the code that's taking the picture. And we'll add a drawnow so MATLAB draws immediately. When I run this, we'll get the same thing. But now, it's a live video.

Finally, we need to add in the neural net. I'm using a network called AlexNet. AlexNet is a large deep convolutional neural net. They train this network on over a million images. And it can recognize about 1,000 different objects.

I've downloaded it. And now we're ready to use it. This line is going to ask the network to classify the picture we just took. So we'll pass each picture to the network and it will return a label of that picture.

Before we do that, we have to resize the picture to the size that AlexNet expects. It was trained on a particular size of image. Finally, I'm going to use that label in the title of my picture. And I've got to convert it to a string with this command right here.

So we're all set. Those are the lines. Let's run it again. And we're running again.

I can recognize a keyboard, or maybe a space bar. Recognize my mouse, or maybe it's a spatula. And there we go.

I hope the simplicity of this program encourages you to try out deep learning. The next natural step would be to try transfer learning. Transfer learning is where you take a network like AlexNet and retrain the last few layers on your own particular images. That will result in a network even better than AlexNet for your particular images. If you are interested in learning more about how to apply deep learning to your problems, check out the links in the description.

Download Code and Files

Get the code used in this video

Related Products

  • Deep Learning Toolbox
  • Image Processing Toolbox
  • MATLAB

Learn More

Deep Learning with MATLAB (ebook)
Machine Learning with MATLAB
Object Recognition: Deep Learning and Machine Learning for Computer Vision (26:57)
Introduction to Deep Learning (3 Videos)
Practical Deep Learning Examples with MATLAB (ebook)

FREE EBOOK

Introducing Deep Learning with MATLAB

Download ebook

DOWNLOAD CODE

Get the code used in this video

Feedback

Featured Product

Deep Learning Toolbox

  • Request Trial
  • Get Pricing

Up Next:

Learn how to use transfer learning in MATLAB to re-train deep learning networks created by experts for your own data or task.
3:59
Transfer Learning in 10 Lines of MATLAB Code
View full series (5 Videos)

Related Videos:

30:17
Designing a Digital Camera Pipeline with MATLAB
39:01
Thermal Analysis with MATLAB and FLIR cameras
56:56
Brainstorm: Imaging Neural Activity at the Speed of Brain...
46:05
Rapid Development of Image Processing Algorithms with MATLAB
40:21
Introduction to MATLAB with Image Processing Toolbox

View more related videos

MathWorks - Domain Selector

Select a Web Site

Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .

Select web site

You can also select a web site from the following list:

How to Get Best Site Performance

Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.

Americas

  • América Latina (Español)
  • Canada (English)
  • United States (English)

Europe

  • Belgium (English)
  • Denmark (English)
  • Deutschland (Deutsch)
  • España (Español)
  • Finland (English)
  • France (Français)
  • Ireland (English)
  • Italia (Italiano)
  • Luxembourg (English)
  • Netherlands (English)
  • Norway (English)
  • Österreich (Deutsch)
  • Portugal (English)
  • Sweden (English)
  • Switzerland
    • Deutsch
    • English
    • Français
  • United Kingdom (English)

Asia Pacific

  • Australia (English)
  • India (English)
  • New Zealand (English)
  • 中国
    • 简体中文Chinese
    • English
  • 日本Japanese (日本語)
  • 한국Korean (한국어)

Contact your local office

  • 영업 상담
  • 평가판 신청

제품 소개

  • MATLAB
  • Simulink
  • 학생용 소프트웨어
  • 하드웨어 지원
  • File Exchange

다운로드 및 구매

  • 다운로드
  • 평가판 신청
  • 영업 상담
  • 가격 및 라이선스
  • MathWorks 스토어

사용 방법

  • 문서
  • 튜토리얼
  • 예제
  • 비디오 및 웨비나
  • 교육

지원

  • 설치 도움말
  • 사용자 커뮤니티
  • 컨설팅
  • 라이선스 센터
  • 지원 문의

회사 정보

  • 채용
  • 뉴스 룸
  • 사회적 미션
  • 영업 상담
  • 회사 정보

MathWorks

Accelerating the pace of engineering and science

MathWorks는 엔지니어와 과학자들을 위한 테크니컬 컴퓨팅 소프트웨어 분야의 선도적인 개발업체입니다.

활용 분야 …

  • Select a Web Site United States
  • 특허
  • 등록 상표
  • 정보 취급 방침
  • 불법 복제 방지
  • 매스웍스코리아 유한회사
  • 주소: 서울시 강남구 삼성동 테헤란로 521 파르나스타워 14층
  • 전화번호: 02-6006-5100
  • 대표자 : 이종민
  • 사업자 등록번호 : 120-86-60062

© 1994-2021 The MathWorks, Inc.

  • Naver
  • Facebook
  • Twitter
  • YouTube
  • LinkedIn
  • RSS

대화에 참여하기