apple / turicreate

Turi Create simplifies the development of custom machine learning models.
BSD 3-Clause "New" or "Revised" License
11.18k stars 1.13k forks source link

Any plans to support Single Shot Detectors or Faster R-CNN? #140

Open jrosebr1 opened 6 years ago

jrosebr1 commented 6 years ago

Right now Turicreate supports YOLO for object detection. YOLO is nice, but I've personally found Faster R-CNNs and SSDs to be more accurate and easier to train (but at the expense of model size). Combining SSD with MobileNet would be ideal to balance to speed, accuracy, and model size.

michaeldong commented 6 years ago

@jrosebr1 can you give me some instruction or document for that? Thanks.

jrosebr1 commented 6 years ago

Can you please clarify in particular what you are looking for? I can provide the papers to the Faster R-CNN and SSD papers along with the authors original TensorFlow/Caffe implementations -- but they would need to be converted to Turicreate format which I assume would mean porting the weights to mxnet.

gustavla commented 6 years ago

We are always interested to hear what other backend models you might want us to support, so thanks for the feedback!

pcmanik commented 6 years ago

Also the "full" YOLO model would be appreciated. Devs may find that the performance of tinyYOLO is not as important as accuracy of the "full" version of YOLO.

jrosebr1 commented 6 years ago

I second @pcmanik's comment on the full version of YOLO.

I would still recommend SSDs and R-CNNs over YOLO if accuracy is valued more than the performance/speed of the pipeline (although SSD + MobileNet does a great job balancing both).

pcmanik commented 6 years ago

Is SSD or R-CNN really that better? According to results published in YOLO paper - https://arxiv.org/abs/1612.08242 Both of them are slower to execute with lower mAP.

If workflow doesn't expect detecting small objects where YOLO is not very good, than YOLO is winner here in both accuracy and perf no?

Maybe you have better experience with them that's just what I found. I'm not very experienced in this area.

Edit: YOLO wins on Pascal dataset, but loose on COCO I didn't notice that at first look.

jrosebr1 commented 6 years ago

In practice I've found that YOLO9000's accuracy isn't as good as SSD or Faster R-CNN (speed is another story, YOLO is very speedy). YOLO can also be more challenging to train, depending on the task. As you also noted, YOLO doesn't work well with small objects. Of course, this is based on my own experiences.

It's impossible to say "this architecture is always the best" because (as we know) which architecture + training procedure is best is highly dependent on the dataset, task, and project.

My general rule of thumb is that if speed isn't a concern, Faster R-CNN is a good starting point. If speed is paramount and accuracy can suffer a bit, give YOLO a try. If a middle ground is needed, start with SSD variants (SSD + MobileNet for speed; SSD + Inception for potentially higher accuracy but longer inference time) and go from there.

Again, that is just my rule of thumb from my own personal experience training these networks on a number of datasets. Whether or not it holds up to a particular task is highly dependent on the data and overall goals.

steve21124 commented 6 years ago

Any new info on SSD or Faster R-CNN support?

pcmanik commented 6 years ago

@gustavla Anything new? It's 4 months already.

gustavla commented 6 years ago

@steve21124 @pcmanik Sorry for not responding in such a long time. We have been busy with Turi Create 5.0 work and altogether a new detector is not featured, the existing now has acceleration on Mac GPUs.

As we plan for new features, it's really useful for us to know what our users are currently missing from the detector. Are you prioritizing low latency, high accuracy, short training time, or a small model size? In your experience, why is SSD or Faster R-CNN the answer to this?

pcmanik commented 6 years ago

In my case I was working with YOLO in my diploma thesis. I've implemented Mac and iOS app with YOLO and tinyYOLO using CoreML. But training them in Darknet is pain. So that's why I would like to use Turi Create for training. But currently it's limited just to tinyYOLO which for my use case wasn't accurate enough. Since there are multiple networks that try to solve that problem including SSD, R-CNN, RetinaNet and maybe some others which I don't know about. It could be really useful to test the results of multiple architectures in terms of performance / accuracy on give datasets and choose the best one for given use case.

Are you prioritizing low latency, high accuracy, short training time, or a small model size?

In my priority list latency and accuracy is on top, with model size following and training time on the end of the list. For example if I have to spend 10 more hours on training for better user experience it's worth it.

teaglin commented 6 years ago

@gustavla

Are you prioritizing low latency, high accuracy, short training time, or a small model size? In your experience, why is SSD or Faster R-CNN the answer to this?

My priority is accuracy and then very closely latency. Model size does matter to some extent, but would prefer the other two hands down. Short training time is absolutely meaningless.

In it's current form turicreate is just not usable for my use cases. The accuracy of tinyYOLO can't be relied upon for real world applications. Therefore, I've had to fall back to using faster r-cnn on device. Would really love a CoreML implementation of faster r-cnn. Maybe I'll just do it myself.

gustavla commented 6 years ago

@teaglin Thanks for the detailed feedback! This is great to know during feature planning.

dustturtle commented 5 years ago

@gustavla What do you mean by " the existing now has acceleration on Mac GPUs."? Can we utilize gpu in the macbook to accelerate training task???

nickjong commented 5 years ago

@dustturtle With Turi Create 5.0, yes, we should now be using any available discrete GPU (including eGPU but not including integrated Intel GPUs) to accelerate object detector training significantly.

jrosebr1 commented 5 years ago

@nickjong Wow, including the Radeon Pro Vega 64? If so, awesome!

dustturtle commented 5 years ago

sounds awesome! I will make a try! Thanks all!

nickjong commented 5 years ago

@jrosebr1 Yes, the Radeon Pro Vega 64 should work! I suspect that if you attach one to a MacBook Pro, the bottleneck may be the CPU-side data loading (depending on configuration), but we expect to continue optimizing this path in the future. (Right now too much of this work is driven by Python code, which doesn't facilitate multi-threaded work very well.)

timgudex commented 5 years ago

turicreate is awesome, but the tiny yolo backend is not accurate enough. I just wanted to add an upvote for full yolo model

TobyRoseman commented 3 years ago

TuriCreate now supports One Shot Object Detection.