OpenCFU icon indicating copy to clipboard operation
OpenCFU copied to clipboard

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

Open jsxyhelu opened this issue 4 years ago • 5 comments

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!

jsxyhelu avatar Nov 03 '20 12:11 jsxyhelu

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!

qgeissmann avatar Nov 16 '20 07:11 qgeissmann

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!

jsxyhelu avatar Nov 16 '20 10:11 jsxyhelu

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}.

qgeissmann avatar Nov 16 '20 10:11 qgeissmann

Very effective! I will continue to study.

jsxyhelu avatar Nov 16 '20 11:11 jsxyhelu

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!

jsxyhelu avatar Dec 02 '20 00:12 jsxyhelu