I am building a Convolution neural network to predict certain categories based on images (the location of a pointer on a surface) . However in many cases there will be no pointer in the view or something that is not the pointer. Initially I was just going to train it with outputs of the different classifications including the null classification. However given that the null classification is far more common than the others (perhaps 1000 times more likely) would it be better to have a separate null classifier and then if this outputted non null then the second classifier would be used.

Any suggestions?

  • $\begingroup$ Hi, can you share some more details on the area of application? What is it that you are trying to locate in the images? And what exactly does it mean when "nothing" is in view? $\endgroup$
    – Jonathan
    Dec 5, 2019 at 15:06
  • $\begingroup$ I've updated the question to reflect the problem is about locating a pointer on a surface in an image $\endgroup$ Dec 5, 2019 at 15:16
  • $\begingroup$ You'll be fine so long as you use softmax and cross entropy loss. Take Alexnet. It has 1000 classes to classify, and since it only ever outputs 1, 999 times out of 1000, the desired output is 0. Despite this, it still operates fantastically due to its final activation and loss function. $\endgroup$
    – Recessive
    Dec 6, 2019 at 2:59
  • $\begingroup$ I think there is a significant difference between an example where there are many classes each reasonably unlikely to an example where one state has around a 99.9% chance of occurring. In my example my main worry is making sure there are very few errors in this class. $\endgroup$ Dec 6, 2019 at 9:11

1 Answer 1


I see multiple reasons to take a different route:

  1. While in "classical" pattern recognition you might have done things like feature engineering outside of your model, one idea of deep learning was to "insource" it into the model and let the model take care of "everything". Following that, I have seen a general tendency in deep net architectures to let your deep net handle all the work in one single model. So your idea kind of contradicts the architectural mainstream.

  2. There are so many deep net architectures being published which are well engineered and tested for all kinds of tasks. Therefore, I would check if there is anything "ready off the shelf" for a task like yours in the very first place. If there is, then it will probably be better than your self-engineered model architecture. And if there is not, you might want to check related tasks and see how they solved this problem, e.g. medical applications where specific cells need to be detected with most examples being negative (and if there is a positive example the area in a picture might still be mostly negative as it is just a single positive cell among many others).

  3. Your thought of feeding the "present/not present" binary classification to your task of locating an object is very closely related to what has been discussed as auxiliary tasks. I don't know if it has been applied to exactly your problem but there are similar applications. For example there is an application where "name recognition" is complemented by the auxiliary task of deciding whether any name is present in a given sentence or not. Which is somewhat similar to your case. The paper An Overview of Multi-Task Learning in Deep Neural Networks provides an overview. A famous example using auxiliary tasks would be GoogleNet. This also goes back to my first point of letting the deep net handle "everything" internally.

However, as a disclaimer, this is a theoretical perspective as I cannot speak from experience regarding your problem.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .