0
$\begingroup$

I have given an image dataset of 1000 classes, each class has 100 images. Now My requirement is to train a model which will take an image as input, and it should answer whether the image is present or not, there is no need to specify which class it is. It just has to say yes or no.

I thought of using a CNN with a sigmoid function at the last layer, but not able to connect the dots.

$\endgroup$

3 Answers 3

0
$\begingroup$

First, you have a huge number of nominal categories (1000 classes). If you need a simple answer regardless of dimensionality and complexity, you just need to use one-hot encoding and sigmoid activation function in the last layer for the 1000 neurons there. But you will end up with a huge sparse output matrix.

If you look for an optimized solution and your purpose is to train the model efficiently, I recommend you to use binary encoding to encode the 1000 classes into 10 classes, instead. You can now use 10 sigmoid neurons in the output layer. If the result is one class meaning the absence of other classes because the output should be always one class.

$\endgroup$
0
$\begingroup$

There is an example of classification in this repository:
DogVsCat

$\endgroup$
0
$\begingroup$

It sounds like you want to do this: https://en.wikipedia.org/wiki/Object_detection. Without more information on your specific problem, there's not much more I can say, but suggest you start there.

$\endgroup$
2
  • $\begingroup$ This is one of the interview question asked to me, Let's say we are given with CIFAR dataset, consider the dataset contains only dogs and cats of different types total divided into classes. Now our requirement is , to train a model which can take a new image as input and should tell whether it is from one of the trained classes or not. $\endgroup$
    – GOPI M
    Commented Apr 2, 2020 at 7:20
  • $\begingroup$ Iam still learning ML and Deep learning concepts,Only one thing that came to my mind is to use a CNN network with a sigmoid layer at output. $\endgroup$
    – GOPI M
    Commented Apr 2, 2020 at 7:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.