File Exchange

image thumbnail

Demos from "Object Recognition: Deep Learning" Webinar

version 1.0.0.1 (12.2 KB) by Johanna Pingel
Demos Used in "Object Recognition: Deep Learning and Machine Learning for Computer Vision" Webinar

106 Downloads

Updated 02 May 2017

View License

These examples go through the 3 demos explained in the "Object Recognition: Deep Learning and Machine Learning for Computer Vision" Webinar
The demos are as follows:
- BagOfFeatures for scene classification
- Transfer Learning - a Deep Learning approach
- Deep Learning as a Feature Extractor
The webinar can be viewed here: https://www.mathworks.com/videos/object-recognition-deep-learning-and-machine-learning-for-computer-vision-121144.html

Comments and Ratings (39)

Johanna Pingel

Mario: try downloading the cifar dataset from this documentation example: https://www.mathworks.com/help/deeplearning/examples/train-residual-network-for-image-classification.html
you can also try going to the website that has the zip file and download it directly from the website.

Please I always have issues with downloading the dataset, be it cifar10 or this one, it it because it is a school system and needs approval from admin to download???

Atul Dwivedi

Johanna Pingel

@ahmd - yes you have to use the same words to describe the test set. This is because the words are learned during training, and the frequency of those words is used to predict the class of image. I think of the encode function as counting the occurrence of the words. The 'bag' contains which words it is looking for.

ahmd yassine

so we have to use the same words to describe the test_set

ahmd yassine

Thank you very much for this webinar , it helps a lot ,but there is something that I can't understand
In demo 1 in the section of testing accuracy on test set we have
testSceneData = double(encode(bag, test_set));
the bag variable is generated from train_set and encoded with test_set
why it is not generated from the test_set instead

Harshit V

victor

victor (view profile)

Hi, Johanna Pingel!
I am testing teaching process and have found that without changing any parameters the accuracy of SVM is always different. What does it depend on?

Thank you

victor

victor (view profile)

How to choose vacabulary size?

victor

victor (view profile)

I am trying to understand consept of work of 'Create Visual Vocabulary' scene (including used methods).
1.How do we calculate value of "visual words number" and which method has been used?

Thank you

victor

victor (view profile)

Thank you very much for quick reply!

Yeah, that was my bad. I managed it right after wrote a comment.
Now getting familiar with classification learner.Training dataset requires some time.

Johanna Pingel

Hi victor - make sure you are running the file in the directory that contains the file 'prepareInputFiles.m' Let me know if you have any trouble.

victor

victor (view profile)

victor

victor (view profile)

First of all thank you for your trial!

While running the code i got this mistake:

Undefined function or variable 'prepareInputFiles'.

Error in Scene (line 53)
[training_set, test_set] = prepareInputFiles(imds);

anybodey know how to fix it?

mnbvcxzA1

Hi Johanna Pingel,how to compute mean accuracy?

how to use neural network for shadow detection.provide full code file in zip with dataset

Joeie Lim

It feels like my training process was stuck after the first epoch anybody can help me?

Arnav Singh

Hi Johanna.. As u made this program for 5 object classification and this really works but i want to use this code for 5 to 10 Object classification... so How to do that?

John Mike

Hi Johanna Pingel,
This video is well explained.But when i run this code i get the following error.

Error using matlab.io.datastore.ImageDatastore/subsasgn (line 196) Function readFunctionTrain does not exist.

I tried, trainingDS.ReadFcn = @(filename)readFunctionTrain(filename); but it also gives an error. How can i fix this? i use MATLAB R2016a

Chanki Kim

Thanks for the nice example code.

Hi Johanna Pingel,

I like your codes but if you provide your sample data it would prevent confusion about your codes. Not all users are experts like me and you to understand the details of your codes

Hanson Wang

Hello, I have one problem that is occurring. In the file below, it shows a screenshot of the problem.

https://www.dropbox.com/s/yo9tsfmytaoux03/Screen%20Shot%202017-07-14%20at%207.05.06%20PM.pdf?dl=0

The single photo window is not opening in its own separate window but is covering one of the "Visual Word Occurrences Graph."
Also, do you know how to switch to the next photo in the single photo window.

Do you how to fix these problems?

My email is hansonwanga@icloud.com

A bunch of errors even with the exact image categories downloaded from http://groups.csail.mit.edu/vision/SUN/, needless to say using other images and categories. Matlab should NOT provide such kind of easy-broken code for customers. Very disappointed.

xiao

xiao (view profile)

Dear Johanna Pingel,
Thanks for your work. I followed the example(the transfer learning demo) and carried out an implementation for 1000 categories just like the imagenet data. But it failed with "Error using nnet.internal.cnn.ImageDatastoreDispatcher>iCellTo4DArray (line 212)
Unexpected image size: All images must have the same size."
I set minibatch=20 and changed nothing. so, what is wrong? any help appreciated!

Johanna Pingel

Hi Maros, can you provide any extra information? I would like to update the files so they work for everyone 100% of the time, but I don't know how to improve the files without feedback.

Maros Brindza

it doesnt work....4

Johanna Pingel

In reference to img = read(training_set(1), randi(training_set(1).Count));

This line of code will work with imageSet which is what is required to run bagOfFeatures prior to 16B.

If you would like to change that line to work with ImageDatastore the lines are:

imgs = training_set.splitEachLabel(1,'randomize',true);
img = imgs.readimage(1);

Johanna Pingel

Demo 1 might be able to be tweaked to run in 15B, however our deep learning capabilities will only run on 16A and beyond.

Plus we have some very cool capabilities in 17A for deep learning, so you'll want to check it out!

liu lin

liu lin (view profile)

I can't find the fuction reluBackward in Matlab nnet toolbox,It is not in cnngpu.

The visualization of the feature vectors code does not work!

This line "img = read(training_set(1), randi(training_set(1).Count));"

gives the following error:

"Array formation and parentheses-style indexing with objects of class 'matlab.io.datastore.ImageDatastore' is not allowed. Use objects of
class 'matlab.io.datastore.ImageDatastore' only as scalars or use a cell array."

In any case, how did training_set became an array with 4 indicies after using splitEachLabel?

Please, fix the code for visualization.

Is it possible to work this example in MATLAB R2015b?

I have my own dataset of about 200 images. How to train it from scratch without using any pretrained model using DeepCNN . Any link is available?

Srinath Kumar

thanks

Thank You so much for your kind information

The links to the datasets are located in the comments of the example code. Feel free to substitute your own data for the ones I used. Additionally, you can always search online for publicly available datasets and you should find a lot of options there!

Dear Johanna Pingel great wabinar.
These are very helpful for understanding the basic concepts.
Can you provide me the link to use existing data?
Thanks

Updates

1.0.0.1

Added link to the webinar in the description. No updates to the files.

1.0.0.1

Updated license

1.0.0.1

Updated license

1.0.0.0

Copyright info added to files

MATLAB Release Compatibility
Created with R2016a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Discover Live Editor

Create scripts with code, output, and formatted text in a single executable document.


Learn About Live Editor