1
$\begingroup$

I am working on building a cow detector for a local farm. I have a dataset of images with bounding boxes (not segmentation polygons) for every cow appearing in the images (different number of cows in every image). What is the best and easiest model to use to accomplish this task? Many cows stand behind others so there will be a lot of cases of occlusion. Is there a go-to model that I can get running quickly in Keras to perform well on this dataset? Any tips would be appreciated.

$\endgroup$
1
$\begingroup$

There are 2 object detectors that are quite popular:

  • Haar Cascade Classifier, introduced by Viola and Jones: available on OpenCV (Python, Java and C++) and on Matlab computer vision toolbox (and probably on many other languages) is a great model for when deep learning is not a option.

  • Yolo, You Only Look Once: It is a real-time object detector and classifier, it uses a DL CNN and if I am not mistaken has cows on it's training dataset (so you can use transfer learning). It is part of the Darknet library and you should totally check the site. Also, check Tiny Yolo is you need some more speed.

You can should also take a look at:

  • MMOD (max-margin object-detection): has a great implementation using dlib.
  • Fast R-CNN and R-CNN: Deep learning classifier, check the paper on this site.

My advice would be to go straight to YOLO and try it out without training for the COW class, then do some fine tunning by retraining few layers with your data. If you need more accuracy than that you can go for R-CNN (probably has some models already trained with cows).

if you lack on computational power you can try MMOD and HCC. But if you got the time you should check BDNN: Binary convolution neural networks for fast object detection, don't know if it is implemented in any libraries already since this paper is relatively fresh (march 2019).

$\endgroup$
  • $\begingroup$ Thanks, Pedro. Would you recommend using the same approach to detect objects that are not in the original YOLO training set? And will this be able to detect objects even when occlusion occurs? $\endgroup$ – user3647894 Jul 4 at 16:10
  • 1
    $\begingroup$ Well, transfer learning might be useful either if the class is not present in the original training dataset but the features are similar to those that were. It is likely that the results wont be that great, but it depends on your goal. It usually detects objects with moderate occlusion. $\endgroup$ – Pedro Henrique Monforte Jul 4 at 18:06
  • 1
    $\begingroup$ Again: try without retraining, then try retraining last layer, then try retraining all layers and then try training from scratch with the same architecture. If you planning on using it for few object classes you can try Tiny Yolo. I can't give you any warranty on weather the model will work for your dataset or not, but it is very likely that it will. $\endgroup$ – Pedro Henrique Monforte Jul 4 at 18:09
  • 1
    $\begingroup$ Also, if the answer was useful vote it up or accept it as this improves site's statistics on SE Area 51 and make it more likely for others to look for answers to similar problems here. $\endgroup$ – Pedro Henrique Monforte Jul 4 at 18:10
  • 1
    $\begingroup$ learnopencv.com/… check this tutorial if you need a hand with YOLO training $\endgroup$ – Pedro Henrique Monforte Jul 5 at 15:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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