Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Original picture set #2

Open
GeorgeGkinis opened this issue Jun 2, 2020 · 9 comments
Open

Original picture set #2

GeorgeGkinis opened this issue Jun 2, 2020 · 9 comments

Comments

@GeorgeGkinis
Copy link

Nice work @jakebruce !

I have been thinking about cell classification of frames for some days now and I came across your article.

I would like to see if using TensorFlow or another neural network framework, if classification could be further refined to make a distinction between worker and drone brood, pollen, capped honey, uncapped honey and egg/larvae (possibly stages of developement).

The Distinction between uncapped honey and egg/larva seems to be the most difficult after seeing the sample images.

A bigger dataset than the provided images in this repo would be needed to train such a neural net.

What do you think?
Do you still have the whole original set of images?

@jakebruce
Copy link
Owner

jakebruce commented Jun 2, 2020

Hey @GeorgeGkinis, sounds good! I agree that this could be done with machine learning. The main challenge will be deployment-time variations in things like lighting, framing, and camera properties.

As you say, the solution here is a giant (labeled) dataset. I'd ballpark that you'd want a set of photos in the high thousands for that, with as much diversity as possible. Unfortunately I hand-tuned this algorithm on only a few dozen photos.

The domain experts are likely to have many more you might be able to obtain, however. You might try reaching out to my co-authors and to authors of other papers that cite our work here.

I'm optimistic about the performance of e.g. a SegNet style architecture if you can get a hold of the data to train it.

@jakebruce
Copy link
Owner

Thinking about it a bit more, you might be able to get away with far less data if you limit the scope to n-way classification of just the individual cells. Maybe this is what you were thinking of all along. You could do a rotation-invariant thing by using a polar representation of the individual cell patches, or make use of data augmentation in the form of rotation and mirroring to squeeze as much juice as you can out of limited data. Maybe do some lighting invariance techniques using the CIELAB channels etc to minimize lighting differences.

Given that there are hundreds of cells per image, maybe you could get that down to a manageable amount of photos and labelling.

@GeorgeGkinis
Copy link
Author

I was thinking of individual cell classification, yes.
I can program quite well but I am new to machine learning.
This would be my first endeavor with training neural networks.

The approach I was thinking of would be :

  • The frame area for each image would be clipped, ignoring areas outside the frame.
  • Keep the yellow/brownish area within the frame
  • Following would be the clipping of the individual cells as single images.
  • Coordinates (x,y,side of frame) could be retained.
  • Image manipulation like altering resolution/color before feeding the algorithm
  • Your idea of rotating, mirroring (or maybe slightly deforming) each cell image to enrich the dataset is awesome!
  • Build a tool to show each cell and manually classify choosing between a set of labels to make labeling faster/easier. Would not take longer than a couple of days for 1-2 people
  • Train a model

I will need to look into the following terms which I do not clearly understand ( or not at all! :)

  • SegNet style architecture
  • rotation-invariant thing
  • polar representation of the individual cell patches
  • lighting invariance techniques
  • CIELAB channels

@jakebruce
Copy link
Owner

Sounds good to me!

SegNet [1] is a fully-convolutional neural network for image segmentation. i.e. every input pixel gets an output label, but this isn't necessary if you're doing patchwise classification.

Data augmentation can get you pretty good rotation robustness. I was imagining some kind of rotationally invariant representation of the individual cell patches, like doing a convolution in polar space (angle, distance from center) rather than in (x, y) space. Just spitballing there, not sure if there's established state of the art in this area.

CIELAB is the color space that I'm using in some of this code, it's an alternative to RGB where the first channel ("L") is meant to represent human-perceived brightness, independent of the hue of the color, whereas the "a" and "b" channels represent hue. So it's sometimes used in computer vision to achieve lighting invariance [2].

[1] https://arxiv.org/abs/1511.00561
[2] http://www.cs.sfu.ca/~mark/ftp/Eccv04/

Good luck! I wish I had data for you, but I think contacting the bee experts will be your best bet there.

@GeorgeGkinis
Copy link
Author

Thanks for your input!

Gotta read some more :)

Cheers!

@Theotime-Colin
Copy link

Theotime-Colin commented Jun 2, 2020 via email

@GeorgeGkinis
Copy link
Author

GeorgeGkinis commented Jun 3, 2020

Wow! I feel like a time traveler seeing it already implemented 👍

I see you used keras. Nice :)

I can learn much going through your code.

A machine learning approach would be great.

So you did not use machine learning in your work?
There is a classification and segmentation model under software/model

An upload would be greatly appreciated!

@Theotime-Colin
Copy link

Theotime-Colin commented Jun 3, 2020 via email

@GeorgeGkinis
Copy link
Author

They did use ML with keras which uses tensor flow.
Also they have a ton of training images there :
https://github.com/AvsThiago/DeepBee-source/blob/release-0.1/src/data/resources/images_urls.csv

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants