- Brief description
- What's new?
- Get the CellsCalculator app
- Discover what our product is capable of
- Available models
- Data
- Model quality metrics
- Run the code
- See also
- Contributors
CellsCalculator is an innovative application developed by project team "B" for processing mouse fibroblast cells of L929 cell line as well as cells of any other lines which visually appear to be similar to L929 line. It enables processing contrast microscopic images in lsm format, as well as images in standard formats, such as jpeg, png etc.
The latest release v2.0 includes several major updates and innovations, which include:
- 2 different segmentation models were implemented for cell image processing, which enabled automatic extraction of information on cell morphology (averaged diameter, area, extrapolated volume);
- additional filtering configuration has been added for in-place filtering of irrelevant detections based on the cell area;
- processing of low-scale (x10 scale) images has been improved significantly using SAHI approach;
- we have successfully created SOTA segmentation-based tracker of cellular spheroids, which enabled us to implement the functionality for processing frame sequences dsiplaying cellular spheroids;
- additional postprocessing utilities have been added for best user experience;
- folder-wise processing of cell microimages has been discontinued, based on user feedback
Summarizing, our achievements can be generally concluded as:
![[Releases]](/kikuroki/Cells-calculator/raw/main/images/Achievements.jpg)
On behalf of application architecture, starting from V2.0 CellsCalculator has plugin-based architecture, so that each independent tool is implemented within a dedicated plugin. As for now, there are 2 available plugins:
![[Releases]](/kikuroki/Cells-calculator/raw/main/images/plugins.png)
Visit this section to see demo examples of the mentioned features.
Should you want to try the CellsCalulator application, follow the guidelines below:
- On project's GitHub main page, search for Releases section in the right menu;
![[Releases]](/kikuroki/Cells-calculator/raw/main/images/Screenshot_8.png)
- Click on the latest release available;
- In the opened release window, go to Assets section at the bottom and click on CellsCalculator.zip file archive;
![[Assets]](/kikuroki/Cells-calculator/raw/main/images/Screenshot_9.png)
- Wait until the archive is completely loaded and then unpack it;
- Enter the automatically created CellsCalculator folder and run the main.exe file.
- Enjoy the application!
Remember: it is forbidden to rename or change location of ANY elements within the CellsCalculator directory, as it may badly influence the application behaviour, up to its full crash with unpredictable errors on the way. Please, note that the application does require the model folder with best_m.onnx file in it in order to calculate cells and work correctly in general.
CellsCalculator is a huge innovation indeed - just look at in what an awesome way it handles the job of calculating both cells and stained nuclei on given images, achieving nearly state-of-the-art performance on images of proper quality:
Segmentation of cell instances (left: input image, right: processed image)
![[cells_segmented]](/kikuroki/Cells-calculator/raw/main/images/Screenshot_39.jpg)
Processing low-scale images (left: original model, right: SAHI+original model)
![[cells_segmented_lowscale]](/kikuroki/Cells-calculator/raw/main/images/Screenshot_40.jpg)
Tracking of cellular spheroids through a sequence of frames (left: visualization of segmentation results, right: plots representing time-series data of spheroids' morphology)
![[spheroid_tracking]](/kikuroki/Cells-calculator/raw/main/images/spheroid_demo.gif)
The application includes several models for different use-cases. Those are:
- 2 models for cell segmentation;
- 1 model for spheroid tracking;
- 1 model for nuclei counting.
The submodel for nuclei counting is based on classical computer vision algorithms used for image pre-processing and DBSCAN clustering algorithm used for differetiating between separated stained nuclei and counting them based on their spatial relations. Additionaly, some statistical-based methods are used for final filtering of the clusters obtained. The hyperparameter values for DBSCAN algorithm have been chosen by fine-tuning them on several images.
If you want to take a look at how the model is designed and why certain elements were implemented, please visit our Colab notebook for more information:
The model for cell segmentation is a YOLO11-x instance segmentation deep neural network by ultralytics which enables high-quality low-resource-based cell segmentation. Below is its architecture:
The application includes 2 models which were trained with data of different resolution, which made their behaviours quite different. They have been trained from scratch for 59/74 epochs on a third-party dataset (more information is provided in Data section below) in Kaggle cloud environment with default T100 GPU using Adam optimizer with default parameters and early stopping as a main stopping criterion.
If you want to take a look at how to train the model from scratch, please visit our dedicated repository for more information.
The model for tracking spheroids is a custom-built tracker based on custom pre-trained YOLO11x instance segmentation model. The segmentation model here demonstrates SOTA performance, achieving AP@50-95 of 97.1% for the test data. Besides, YOLO architecture made it possible to process images as a very high speed, spending just 5-10 sec per frame on a middle-level CPU!
Original dataset which had been given to us was a set of unstandardized databases containing contrast images of L929 cells with some stained nuclei. Along with that, in response to our request we had been also given a set of images of cells only so that we could better analyze our model for cell counting.
![[L929_images]](/kikuroki/Cells-calculator/raw/main/images/target_data_smaller.png)
After performing EDA, it became clear that our data had several serious problems:
- Large data diversity (visually images differed significantly);
- Lack of data (fewer than 300 images available after filtering);
- No labels (no ground truth had been given to us - only the images).
As a result, it was decided to search for third-party datasets of cell microimages which would have visual appearance similar to ours. The dataset we found was LIVECell dataset, containing over 5,000 images (3,000+ training images), which was enough for us to train a deep model.
![[LIVECell_images]](/kikuroki/Cells-calculator/raw/main/images/livecell_data_smaller.png)
The test dataset for evaluating our cell segmentation models consists of 94 carefully chosen target images divided into 7 subsets so that images of different images could be analyzed in more details. The images were labelled manually using CVAT web-tool.
![[L929_barchart]](/kikuroki/Cells-calculator/raw/main/images/barchart.png)
The test dataset for evaluating the stained nuclei counter model consists of 23 images, on which we could clearly differentiate between actual nuclei and noisy regions when creating ground truth labels.
It should be noted that many pictures have been filtered out due to different reasons, mostly - small cell scale or because of us being unable to infer any ground truth information ourselves due to the low quality of the data.
The dataset originally consisted of 52 sequences of frames, each ~42 frames long on average. It was labelled in semi-automatic mode using SAM-2 model and point prompts:
(note: in some cases, bbox prompts had to be used instead to obtain better quality).
Next, it was splitted sequence-wise into train/val/test subsets, and then finally it was modified in accordance with ultralytics dataset requirements. For more information on dataset labelling procedure, check out our dedicated repository.
Should you want to run the raw application code, follow the guidelines below. Note that the prompts are designed for Windows CMD - for bash you may need to use other syntax:
- Clone the repository using the prompt below:
git clone https://github.com/kikuroki/Cells-calculator.git- Enter the folder in which the repo is cloned and set up your environment. To do that, you need to have Python 3.7 or above pre-installed. Install the required dependency packages by running:
pip install -r requirements.txt- To start the application, execute the
main.pyfile - you can do that by running:
python main.py- Enjoy the application running!
If you are interested to study the project details more thoroughly, follow the links below to get more information on:
- New models added: Trained and integrated StarDist (https://github.com/stardist/stardist), InstantSeg (https://github.com/instanseg/instanseg), and Cellpose (https://github.com/mouseland/cellpose) for more accurate and robust instance segmentation.
- Shifted approach: Moved from exemplar-based to instance segmentation, enabling better handling of overlapping and clustered cells.
- Performance comparison: Evaluated new models against our previous YOLO-based pipelines, showing improved segmentation quality and boundary accuracy.
CellsCalculator V2.0 has been developed by the following students of NTU "KhPI":
- Ponomarov Y. - team-lead, ML engineer;
- Kuznesova I. - ML engineer, data labelling;
- Batiuchenko O. - software developer;
- Noskova K. - ML engineer;
- Glushchenko D. - lead of documentation editing assistance, lead of data labelling;
- Baluka A. - documentation editing assistance, data labelling;
- Ipatko K. - documentation editing assistance, data labelling.
CellsCalculator V3.0 has been developed by the following students of NTU "KhPI":
- Cherkashyna I. - Team-lead, lead of documentary editing
- Fesenko M. - ML-engineer
- Lytvynenko S. - ML-engineer
- Olijnyk V. - ML-engineer
- Kovalov O. - tech-lead
![[Header]](/kikuroki/Cells-calculator/raw/main/images/header.png)