I'm starting my first real data-science project, I made a reserach and want to ask if my approach is correct:

I HAVE: 600 photos of electronic components, hundreds of components in a single photograph, components shape and distance between them may vary between photographs but there is only 1 shape in a single photo. components shapes are squares, rectangles, ovals, "E"-shape and similar

I NEED: generic counter for components (no matter what is the type of elements on the photo)

PLANNED APPROACH: analyze each picture with openCV to gain predictions and then train CNN with Tensorflow and GPU (no previous experience).

is it the correct way of thinking?

  • 2
    $\begingroup$ I advice to start much smaller. For example, can you teach an algorithm to distinguish between just 2 types of components, or 1 component and all the others? Start simple and take it from there. $\endgroup$ Apr 13 '17 at 14:56
  • $\begingroup$ thanks for your replay. actually I do not need distinguish between types, my target is to prepare model to count elements no matter what type is on the photo (description in my post may be ambiguous, I will clarify it) $\endgroup$
    – domino7
    Apr 13 '17 at 15:14

For your situation, I would recommend using an object detection network to both locate and classify your components. Although you do not need the location or classification data, you can still count the number of objects the network detects. Moreover, this approach does not require any data science background because there are many tutorials on this subject and tons of out-of-the-box tools, such as tensorflow's object detection API.

You will need to annotate your data, but there are tons of programs to help you with that too. Here's one I found quickly.

I suggest using faster-RCNN with the NAS feature extractor because, although it is slower than other CNN architectures, it is the most accurate. Also, the network would probably perform better if you did not combine all the components into a single class.

The steps necessary to accomplish this task are essentially the following:

  1. Install and setup tensorflow
  2. Download faster RCNN NAS from the tensorflow detection model zoo
  3. Annotate your data by drawing bounding boxes around the components and labeling each bounding box.
  4. Train your model
  5. After saving the trained model, you just need to setup a pipeline that takes an input image, feeds it to your network, and returns the total number of detections ignoring the bounding box and classification data. Here's a great tutorial for deploying a trained model.

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.