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

I spent some time studying OpenCFU seriously, but now I still can't isolate its core algorithm. #29

Open
jsxyhelu opened this issue Nov 3, 2020 · 5 comments

Comments

@jsxyhelu
Copy link

jsxyhelu commented Nov 3, 2020

I spent some time studying OpenCFU seriously, but now I still can't isolate its core algorithm. To be honest, I rarely use CodeBlocks. I generally choose to use vs on the win10 and QT on UBUNTU. Now I really want to be able to rewrite OpenCFU using Csharp, but apart from the paper 《OpenCFU, a New Free and Open-Source Software to Count Cell Colonies and Other Circular Objects》, I have not found more information about the algorithm. I think you must have been inspired a lot before finally forming this excellent product. I don’t know if you can share something.
In addition, if the rewrite is successful, I very much hope to join OpenCFU's current project for open source.
thanks!

@qgeissmann
Copy link
Owner

Hi @jsxyhelu, Sorry for the late reply and thanks for your interest! That would be great to have help to maintain the project! It really is the first piece of software I ever wrote, so it is a bit... messy, but the code for the image processing is all in https://github.com/qgeissmann/OpenCFU/tree/master/src/processor/src. In there. processing is defined in 4 'steps'. Each step takes input parameters (e.g. from the GUI) and caches the resutls to recompute only if as new image or parameters are used. Step 3 does some iterative background subtraction (based on the validity of contour), and step 4 split touching contours/colonies. Both steps use a ML predictor (Predictor) that takes as input a contour (to assess their validity)... I hope it helps a little bit!

@jsxyhelu
Copy link
Author

Hi@qgeissmann,Thanks for replying, I will do my best. And now ,I am most interesting in the step3 and step4,you say "Both steps use a ML predictor (Predictor) that takes as input a contour". Can you tell me more about this? For example, what is your ML predictor based on? thank you very much!

@qgeissmann
Copy link
Owner

Yes, of course. The ML predictor is updated compared to the original publication. It is a Random forest classifier that sort contours. Each contour is represented by a vector of features created/defined in https://github.com/qgeissmann/OpenCFU/blob/master/src/processor/src/Features.cpp. The classifier predicts one of three levels: the object is {single colony, multiple colonies, background}.

@jsxyhelu
Copy link
Author

Very effective! I will continue to study.

@jsxyhelu
Copy link
Author

jsxyhelu commented Dec 2, 2020

Hello, for the random forest method you mentioned before, I have conducted further research, basic parameter settings

m_trees = cv::ml::RTrees::create();
m_trees->setMaxDepth(10);
m_trees->setMinSampleCount(10);
m_trees->setRegressionAccuracy(0);
m_trees->setUseSurrogates(false);
m_trees->setMaxCategories(2);
m_trees->setCalculateVarImportance(true);
m_trees->setActiveVarCount(false);
m_trees->setTermCriteria({ cv::TermCriteria::MAX_ITER + cv::TermCriteria::EPS,100, 0.01});

But at present, I can only get 50% accuracy on the data set I prepared myself, which of course is ridiculous. I would like to ask further questions on this issue:

  1. How many indicators could you get at that time? (Precise/recall)
  2. If possible, can you share a part of the data set at that time? I really want to reproduce this part of the function, I think it is very valuable!
    thank you!

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

2 participants