Making a training set


I’m only through course number one in the specialization, so please forgive me if these questions are addressed in future classes.

I was very excited to complete the deep learning cat identification exercise. However, my friend insists that my next project be a similar identification neural network called “Hot Dog / Not Hot Dog”. How big of a training set should I strive for reasonable results? Should I aim for slightly higher resolution images? I fear many of my cat tests were false negatives due to heavy compression.

Thanks in advance,

1 Like

Hello @Alex_Hall !

I also had a lot of fun solving this lab. In fact, I’m enchanted by every new piece of content I learn, and I feel like it unlocks a new skill to tackle fresh challenges and create more creative solutions.

Regarding the size and quality of the training and resolution set, I suggest you run tests. This will greatly enrich your learning experience. Test high-quality images as well as those of lower quality. Throughout the courses, various strategies will be discussed so that you can explore the dataset you are using and enhance it to improve the performance of your algorithms.

Hi, Alex.

It’s a really interesting question, of course. Unfortunately there’s not an easy or simple answer. Well, I guess the closest you could some to a short answer would be: enough images with enough resolution that it works. Then it becomes more a question of how you experimentally go about finding the answers to those questions.

On the resolution question, my guess is that the reason that our “cat” model in Course 1 Week 4 doesn’t generalize very well is not so much the 64 x 64 resolution. It’s really more the fact that the training set is so incredibly small. Here’s a thread which shows some experiments with rearranging the training and test data to see what happens. As a point of comparison, you can take a look at the Kaggle Cats and Dogs dataset. It has 25k entries and they are 32 x 32 resolution images if I remember correctly. I haven’t studied the results of that contest (it’s an old one) to see how good the resulting accuracies are.

The first question is to look around and see if you can find any databases of food images and then to consider how wide you want to make the space of “not hot dog” images. :laughing:

There will be more discussion in Course 2 and a lot in Course 3 about what it takes to develop a successful system.

1 Like

Hey @Alex_Hall

Your friend is a very good friend! To make it a bit funnier, if I were you, I would ask your friend to prepare for 100 test images, and then I would start collecting images as many as I can within a time window - say 3 hours.

You see, I believe building a model won’t be a thing for you because you have already tried one, but building a good model that can withstand those unknown, challenging testing images is the real thing, and that experience to slowly evolve your model from good to better to best is the real thing.

Paul mentioned about course 2 and 3, but even if you just finish the videos under the sections of C3 W1 “Setting Up Your Goal”, “Comparing to Human-level Performance”, and C2 W2 “Error Analysis” and “Mismatched Training and Dev/Test Set” which are less than 2.5 hours in total, you will get the idea of how to evaluate and evolve your model. There is no pre-requisite to watch those videos, no maths except for basic arithmetrics, no difficult theories.

Imagine that you spend 3 hours to collect your first training set, 3 hours to shift your current code to it and implement the evaluations, 3 hours to train your model and evaluate it. 9 hours is sufficient for your first cycle of the evolution of your model. (Btw, you will see what I mean by cycle after finishing those course 3 videos)

Then you can continue on to the second cycle and it’s only going to take less time than the first because much of the 9 hour is one-time start-up cost. Let’s say the second cycle takes 3 hours, and three cycles total 9 + 3 + 3 = 15 hours, plus watching the course videos, it will be 18 hours. Therefore, it can be a 3-day project, and the most important take-away is the process of improvement, not necessarily to build a perfect model because even you are lucky to build a perfect model for hot-dogs, it doesn’t imply anything in the future. However, the improvement process is something you can bring over to the future.

This is just a suggestion and feel free to do it or not do it. If you want to do it but your friend is too busy to find some test images, or your friend wants the one who suggested this to contribute something too, let me know and I can collect 100 test images myself for you. :smiley: :wink:

However, I will only share my images with you after you have finished the training :smiling_imp:


1 Like

Thank you all so much for the well-thought-out replies - it feels great to have the support of folks with know-how and experience.

Seems like the general plan is to continue with the class series (sounds like 2 and 3 are the most applicable) with a real ear towards dataset construction and model testing/tuning.

I was somewhat saddened to learn that my friend’s concept is from a comedy TV show and that a “Hot Dog / Not Hot Dog” app already exists. I’ve (we’ve!) already put too much thought into the project to stop now, though. It will be a great learning experience and perhaps the fact that it already exists will produce some free training data.

Some nasty y=0 cases my neighbors have suggested:
toy hot dogs
pets in hot dog costumes
empty hot dog buns

@bruno_ramos_martins - I totally agree with you, each project feels like a solid tool in the toolbelt.
@paulinpaloalto - Thank you for the resolution insight; that is fascinating and also a bit of a relief.
@rmwkwok - The timeframe you’re laying out makes the project seem quite doable and is inspiration to forge ahead. Thank you for the generous offer of a test set, I will keep you in the loop!


Hey @Alex_Hall

No matter what your plan is, tell me two days before you need my test images. That promise is valid till the end of this October. :wink:

Let’s stay in touch here!