Advice for image classification when classes are very, very similar


(Ramesh Sampath) #21

Hi @jeremy - Created a pull request to convert .cuda to use to_gpu syntax - https://github.com/fastai/fastai/pull/15. But couldn’t test it because the model_summary was giving me an error. More details and screenshots in the pull request.


(Arjun Rajkumar) #22

Hi @jeremy, Am interested in this too. Submitted for the first time to Kaggle a few hours earlier - now wondering how I could take this live on a website? Just to know the process and the easiest way to explain DL to folks and family. See, upload any pic of a dog and the program will predict what breed it is :slight_smile:

Any links / resources to the same will be really helpful. Thanks.


(Ramesh Sampath) #23

I wrote a Tornado App to wrap PyTorch Models. I can create a Sample Web App / API for FastAI and share it here by this weekend.

Update: Note sure if I can get to it by end of the week, but hopefully over the thanksgiving break.


(Amrit ) #24

@wgpubs @arjunrajkumar, Ive looked at getting models onto android but I have some learning to do. I took the android development course at Udacity to get knowledge on android. I used these resources on using models on android, it does however use tensorflow.


(WG) #25

I have no idea what this is, but it sounds cool and useful!


(Amrit ) #26

My understanding is that we can save a model as a .pb file. I believe Jeremy said we will go through this at some point and then we can download this .pb file onto an android device to use as a classifier.


(Ramesh Sampath) #27

Yeah. I am actually not sure if I can get to it by this weekend. But will create a sample app by end of the month.


(Jeremy Howard) #28

In the meantime - here’s a sample pytorch app: https://github.com/jaroslaw-weber/hotdog-not-hotdog

To do single image predictions with fastai, use the code here: How do we use our model against a specific image?


(Isam Abdullah Balghari) #29

Hi @wgpubs, I am facing a similar type of issue, where classes are very difficult to distinguish. Can you please help me by giving me insights on how did you solve the problem?

Thanks.


(WG) #30

Just try it first and see how the model does. That is essentially what I did and the results were actually really good.

Sometimes we tend to overthink things and imagine problems that aren’t really there. I’ve been burnt a few times myself trying to fix things in my data that didn’t need to be fixed. Lmk how it goes.

wg


(Isam Abdullah Balghari) #31

Thanks. Sure I will.


(Isam Abdullah Balghari) #32

Hi @wgpubs, I really have tried a lot things. One problem is that there are four classes, and they are not evenly distributed. Also the classes are much similar. Can you give any advice in this regard?
TIA


(RobG) #33

No special secret sauce here. Using more data is probably the best advice.

I have also found a ‘helping hand’ works in some cases, a bit like the way we encourage a toddler to take its first steps by lifting it up to balance and giving it a gentle nudge. Too often we set ‘hard homework’ for networks, like throwing every piece of information we can at a problem, when we might very well know beforehand a distinguishing characteristic. eg why throw 11 channels of image information at a problem immediately when we know one channel in particular is key? You’d have to experiment what that means for you. Maybe start by training with some burger logos then grow the data set. Find something different about the burgers (one has lettuce and the other doesn’t?) and train there first, before throwing the whole dataset in. Don’t do too much of it, you want to let the toddler learn on its own.

It sounds to me like a cool project would be determining whether someone is an in-out-out person or not from their location, age, gender, income :slight_smile:


(Isam Abdullah Balghari) #34

Great!. Thanks for your help. I really appreciate that.