1
$\begingroup$

I am trying to create a CNN model that classifies if a person is wearing a seatbelt or not to verify they drive safely. I know to get images of people wearing seatbelts and people not wearing seatbelts, but I have a problem.

What if the person doesn’t submit a picture of them in a car at all? How do I construct the rest of the dataset to determine if that picture is an actual picture of a person wearing a seatbelt?

Do I insert completely random pictures in a different category? Do I classify images that don’t have a high confidence score as "wrong" images? Or leave it?

$\endgroup$
1
  • $\begingroup$ Yes, thanks! If you can reference a Bayesian NN with CNNs in Tensorflow that would be a great help! $\endgroup$ Commented Aug 2, 2020 at 21:47

2 Answers 2

1
$\begingroup$

From what I understood, you want to be able to determine whether the input to your classifier is a valid picture or not. Where:

  • Valid picture: image of a person wearing or not wearing a seatbelt
  • Not valid picture: unrelated images (say a kitchen picture) or noise, or a black image (no input at all)

For that you could build a Bayesian model from your current deep-learning model. Check out Pyro (from pytorch). The main idea behind it, is that the model will always predict a class: person wearing or not wearing a seatbelt. But since it is a Bayesian model it will also tell you the confidence of the prediction in terms of the similarity of the input with the input distribution for which the model was trained. In other words, it will also tell you "how valid" is that prediction, or "how valid" is the input for that prediction.

Check out this post where it is very well explained. Hope it helps!

$\endgroup$
2
  • $\begingroup$ This may be a good suggestion, but, in practice, it isn't guaranteed that the Bayesian model will provide well-calibrated uncertainty estimates. $\endgroup$
    – nbro
    Commented Aug 2, 2020 at 15:56
  • $\begingroup$ Thanks so much! If you can reference a way to do so using a CNN and/or Tensorflow, I would appreciate it as it would save time learning a new library. Thanks again. $\endgroup$ Commented Aug 2, 2020 at 18:06
1
$\begingroup$

Yes, a category "no person" or "random image" would make sense. Binary classification is only helpful if you know that your input always belongs to one or the other category, for example by pre-filtering the inputs.

$\endgroup$
2
  • $\begingroup$ I've heard using Bayesian Neural Networks are good for this sort of problem. BNNs print out a probability that doesn't add up to only one, and there is a threshold then for the confidence score for the model to be able to say "I don't know." Which approach would be more effective, do you think? $\endgroup$ Commented Aug 2, 2020 at 22:28
  • $\begingroup$ I can't say. In general, you need experience with several methods to judge which is best for a given case, or you need to ask an expert, which I am not in the image classification field. $\endgroup$ Commented Aug 3, 2020 at 5:18

You must log in to answer this question.

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