MATLAB Deep Learning
|Source: MathWorks| Retrieved: Sept 10,2019|
What Is Deep Learning?Deep learning is a branch of machine learning that teaches computers to do what comes naturally to humans: learn from experience. Machine learning algorithms use computational methods to “learn” information directly from data without relying on a predetermined equation as a model. Deep learning is especially suited for image recognition, which is important for solving problems such as facial recognition, motion detection, and many advanced driver assistance technologies such as autonomous driving, lane detection, pedestrian detection, and autonomous parking.
Deep Learning Toolbox™ provides simple MATLAB® commands for creating and interconnecting the layers of a deep neural network. Examples and pretrained networks make it easy to use MATLAB for deep learning, even without knowledge of advanced computer vision algorithms or neural networks.
Deep learning uses neural networks to learn useful representations of features directly from data. Neural networks combine multiple nonlinear processing layers, using simple elements operating in parallel and inspired by biological nervous systems. Deep learning models can achieve state-of-the-art accuracy in object classification, sometimes exceeding human-level performance.
You train models using a large set of labeled data and neural network architectures that contain many layers, usually including some convolutional layers. Training these models is computationally intensive and you can usually accelerate training by using a high performance GPU. This diagram shows how convolutional neural networks combine layers that automatically learn features from many images to classify new images.
Many deep learning applications use image files, and sometimes millions of image files. To access many image files for deep learning efficiently, MATLAB provides the imageDatastore function. Use this function to:
- Automatically read batches of images for faster processing in machine learning and computer vision applications
- Import data from image collections that are too large to fit in memory
- Label your image data automatically based on folder names.
For this project we need:
-Deep Learning Toolbox
-Pre-trained convolutional neural network, CNN
Deep Learning in MATLAB
1. Download Deep Learning Toolbox from MathWorks website
2. Download Neural Networks like Alexnet, Googlenet … etc.
3. Open MATLAB
4. Run these commands to connect to a webcam and create a CNN object.
camera = webcam; % Connect to the camera
5. Run the following code to show and classify live images.
Position the webcam at an object and the neural network classify and display what class of the object is predicted. It will keep classifying images until you press Ctrl+C. The code resizes the image for the network using imresize.
The above example is provided by MathWorks. Below is a video that is an extension of the Mathworks example. This project uses Alexnet and Googlenet to classify objects into their category.