Lesson 2 - Official Topic

Did you make the COVID video part available? I need to convince more people to use masks!!

One thing to try is to apply it to your own data (if possible, a “real” problem). In that case, you will have to do some work to improve your performance, or at least to know that your performance is already the maximum you can get :slight_smile:

This figure was mentioned in the lecture. I went to the paper afterwards and discussed with a few colleagues but I cannot get a consolidated answer in the following:

My understanding: the grey squares are the scores of layer 2. This means after wx+b but probably before applying any activation function (i.e. if we had applied relu, the pictures would be mostly black with some white). Note: this assumption may not be correct.

My question is: what does each small square mean? Is each big square the same filter and the small squares the output of the filter for the different images on the right?
How was this selection on images done?

What is a general guideline for minimum image dataset size ? I have 5 categories and about 10 images per category so far. Not getting a useable model from that.
How much can data augmentation help ? If I do 3 transforms is it the equivalent of having 3x more images ?

1 Like

The short answer is “until your model is getting good results”. My general rule of thumb is I try to find at least 30 images of each class if not 50 if possible. Data augmentation does help, but it’s not a simple 1:1. The more you transform your images the more different they look each time.

4 Likes

To add a great example from an earlier project: Cricket or baseball? Lesson 1 with small datasets

This got great results using just 15 images for training!

3 Likes

Hey didn’t Jeremy mentioned a book about deployment in the lecture? I think I remember something like that, and it was supposed to be added to the resources at the top. If someone knows what book he was talking about, could you add it up there? Thanks!

1 Like

This seems to be quoted from Section 4.4.2 (p.132) of Neuromorphic Computing and Beyond by Khaled Salah Mohamed.

Would this be considered a standard definition?

I think it’s this book: http://shop.oreilly.com/product/0636920215912.do

3 Likes

This discussion reminds me of the motivation for dropout. Heuristically, dropout trains a large number so-called “thinned” networks and averages them at test time.

Message to beginners

Dropout is a technique introduced in Dropout: A Simple Way to Prevent Neural Networks from Overfitting. The first four (4) pages are very readable and are definitely worth a read even (and especially?) at the start of the course.

2 Likes

We’re a bit early to be looking at this - we’ll do it later in the course.

1 Like

I think it helps to separate modelling and training.

A model, whether it is a good or bad, trained or not, will use its parameters to make predictions given an input.

Training a model (in order to make it better) is done by acting on its parameters. Training has its own set of parameters, and these are called hyper-parameters.

At the end of the lesson Jeremy shows how to export model and do inference with an image file. How can I do inference on a PIL image or np.array? I wish to make predictions on live video feed frames without saving the test images to individual files.

2 Likes

predict will run it based on all that is available, it’s not just for an input image, but whatever it can make an image out of. It’ll use what’s in the PILImage class header which if we see it’s it’s .create:

def create(cls, fn:(Path,str,Tensor,ndarray,bytes), **kwargs)->None:
        "Open an `Image` from path `fn`"
        if isinstance(fn,TensorImage): fn = fn.permute(1,2,0).type(torch.uint8)
        if isinstance(fn,Tensor): fn = fn.numpy()
        if isinstance(fn,ndarray): return cls(Image.fromarray(fn))
        if isinstance(fn,bytes): fn = io.BytesIO(fn)
        return cls(load_image(fn, **merge(cls._open_args, kwargs)))

It’ll accept bytes, a numpy array, a Pillow image, or a regular tensor

3 Likes

Awesome, thanks!

Does anybody have more information on seeme.ai ? It looks very interesting, but it also looks like they’re not active yet (the only option is to join a wait list). Is there an account for people in this class?

@giacomov Please check this thread linked in Top Wiki:

I followed the fastai2 deployment quick guide and I was able to create my account from the notebook (instead of doing it via the website).

Please check the Seeme.ai thread for discussions/Questions.

2 Likes

Ah, I see. I did see that notebook, but I thought you needed to have username and password already. This is great!

2 Likes

I signed up on azure for bing image search and provided my creidit card. I see no place to find my Azure_search_key. Did anybody have luck with this?

Hi @giacomov, I’m the founder of SeeMe.ai and a long time fan of Fast.ai.

Indeed, on our website you can only register for the waitlist for now, but we’re making an exception for members of the fast.ai forums. We created quick guides for both fastai v1 and v2, which takes you through all the steps of training (all credits to fast.ai), deploying, using and sharing your models.

To be clear, the platform is in development at the moment, but we would love for you to test it and provide feedback. You can add models, make predictions and share with friends or colleagues.

From the quick guides :slight_smile:

I would be love to talk about what you are trying to accomplish, and of course, if you have questions or need support, you can just reach out to me here.

All the best!
Jan

2 Likes