Using tensorflow/Keras, I have built a good model which is currently binary classification. For example, training labels would be images of a person's knees bent or knees not bent.

The idea behind such a model could be using a continuous video feed, and when it detects either knees bent or not, a certain probability would output. It works, however, since it's binary, I have probabilities close to 0 or 1 even though a person is not even in the video feed.

Any ideas on how I can change my model (perhaps multi-class) in over a continuous feed - which could be hundreds of images over a minute would only give me probabilities for those events of knees bent or not? If going multi-class, would I then have to also train all other potential images? That seems close to impossible, even with using transfer learning with ImageNet. Any suggestions?

  • $\begingroup$ If you have enough computational power, you can do a binary classification (person present vs person not present). When it's present, do your other model for knees bent vs not bent $\endgroup$
    – Ant
    Apr 5, 2018 at 15:11

1 Answer 1


Using a multi-class network would probably be the most efficient approach.

Training two networks (as suggested in the comments: one network to detect the presence of a person and one to detect the state of the knee) is unnecessary and overly complex. You can train the network on three classes: bent knee, straight knee, absent knee. For the absent knee, you do not need to train on all possible images, just images you expect to see. For instance, these negative data could be the background of your intended images; take a picture with the knee and one without.

If speed is a major requirement, the model architecture becomes critical. I suggest exploring MobileNets as they are quite fast and do not sacrifice too much accuracy.


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.