Software

We made a Cell Identifier Model, an open-source web-based tool for automated detection and quantification of GFP fluorescence in bacterial cell images. It uses classical computer vision to detect cells, measure intensity, and classify brightness levels without requiring AI training or expensive commercial software.

Software
All materials shared on this page are available under the Creative Commons Attribution 4.0 International (CC BY 4.0) license. You are free to share and adapt them with proper attribution.

Overview

Quantifying fluorescence and cell count given an image sample is time consuming and inconsistent. We made a Cell Identifier to automate this process using simple classical computer vision techniques, which allows users to quickly analyze bacteria populations for any reason!

Technology Stack: Flask 2.0+ | OpenCV 4.5+ | NumPy/SciPy/scikit-learn | HTML/CSS/JavaScript

The tool can be accessed at https://cell-identifier-ij23.onrender.com/.

The GitHub repository is located at https://github.com/delnorte-sd/Cell-Identifier/.

Synthetic Cell Generation

One part of this tool is a synthetic image generator. With this, users are able to create semirealistic images of fluorescent bacteria with a known ground truth. By customizing key variables such as cell count (from 1 to 200), morphological shape (pill-shaped like E. coli or simple ellipses), noise level, and whether or not cells can overlap. Once generated, the app will output a synthetic image that can be used for analysis!

Cell Identifier interface for synthetic cell generation

Automated Detection Pipeline

The app uses a robust automated detection pipeline with classical computer vision techniques to analyze cell images. There are multiple steps in this process which are sequenced to reliably segment the microscopy image and identify fluorescent cells. First, a Gaussian blur is applied onto the image to reduce any noise while preserving the edges of each cell. Intensity thresholding is then applied to create a binary mask of fluorescent regions. Then, the mask is cleaned with morphological operations that close up gaps within cells and remove small non-cellular artifacts. Finally, contour detection is used to identify the boundaries of each potential cell.

Result of analysis tool

Brightness Classification

Classifying the identified cells into brightness categories based on their mean fluorescence intensity is a key feature of this app. Thresholds may be adjusted, but by default, "low" is below 73, "medium" is 73-80, and "high" is over 80. This feature is critical as it can be used to find the bacteria's expression in the scenario. This feature also allows for analysis of dose-response curves by providing a clear breakdown of the cell's response.

Cell brightness data

Detection Pipeline

The detection algorithm uses a straightforward computer vision approach optimized for fluorescence microscopy:

1. Gaussian blur → Reduce noise (kernel size: 3-21)
2. Intensity threshold → Segment fluorescent regions (0-255)
3. Morphological close → Fill gaps in cells
4. Morphological open → Remove small artifacts
5. Contour detection → Find cell boundaries
6. Area filtering → Remove debris (50-3000 px default)
7. Feature extraction → Calculate centroid, area, mean intensity

Adjustable Parameters

Parameter Range Default Purpose
Min cell area 10-10000 px 50 Filter small debris
Max cell area 50-50000 px 3000 Filter large clumps
Intensity threshold 0-255 50 Brightness cutoff
Blur kernel 3-21 (odd) 5 Smoothing strength

Quick Start (Local)

Installation

git clone [repository_url]
pip install -r requirements.txt
python app.py
# Access at http://localhost:5000

Recommended Workflow

1. Optimize parameters: Generate synthetic image → upload → adjust until detected count ≈ ground truth

2. Analyze samples: Upload experimental images → apply optimized parameters → export data

3. Statistical analysis: Use CSV export for dose-response curves, time-series, etc.

Parameter Tuning Guide

Problem Solution
Too many detections Increase intensity threshold
Too few detections Decrease intensity threshold
Small artifacts Increase min area
Touching cells merged Decrease blur kernel
Noisy detections Increase blur kernel
Cell Identifier configuration panel

Validation & Performance

Accuracy Testing

Condition Accuracy False Positive Rate
No overlap, low noise 95% < 2%
No overlap, high noise 88% < 5%
Moderate overlap 90% < 5%
Severe overlap 65% 10-15%

Applications

This tool is versatile and can be used for any reasons for quantitative fluorescence microscopy in microbiology and synthetic biology research. We hope that other iGEM teams and researchers will be able to use our tool to eliminate subjective manual counting and brightness classification across experiments.

Gene expression studies: Quantify reporter fluorescence to compare promoter strengths, RBS efficiencies, or regulatory element activity

Biosensor characterization: Generate dose-response curves, calculate EC50 values, and validate logic gate behavior

Population-level analysis: Measure expression heterogeneity, identify subpopulations, and track cell-to-cell variability

Quality control: Assess transformation efficiency, verify plasmid stability over generations, and screen for contamination

Time-course experiments: Monitor dynamic fluorescence changes during induction, stress response, or growth phases

High-throughput screening: Rapidly evaluate libraries of mutants, strains, or culture conditions to identify optimal variants

Educational settings: Demonstrate image analysis principles and quantitative biology concepts in teaching labs

The simple open-source codebase allows for straightforward customization depending on the fluorescent protein of interest (GFP, YFP, RFP, mCherry, etc.), bacterial species (E. coli, B. subtilis, etc.), multi-channel imaging, or integration with automated microscopy workflows.

Limitations

The model has several limitations that we hope to address in future iterations. The type of sample image can greatly affect the model's performance:

Severe overlap: Multiple cells may count as one → use diluted samples

Uneven illumination: Fixed threshold struggles → apply flat-field correction preprocessing

Out-of-focus cells: Reduced intensity may cause misses → ensure proper focus during imaging

Debris/artifacts: Can trigger false positives → adjust area parameters carefully

Non-fluorescent cells: Invisible to detection → tool measures expressing population only

This is an example of a real image of cells that led to false results, even with calibration:

Example of false results from real image

Future Directives

Keeping the idea of a Cell Identifier model, one of the main future directives is to implement machine learning techniques to improve detection accuracy, as our model did not perform well in challenging scenarios like high cell density or uneven illumination. We would like to train convolutional neural networks using tools like U-Net or Mask R-CNN on diverse datasets of microscopy images to recognize complex patterns and cell boundaries that our current model built on classical computer vision techniques cannot. Additionally, domain adaptation techniques could be used to address the differences between synthetically generated training images and real experimental data. Although our current model prioritizes accessibility and ease of use regardless of device specs, these enhancements would help to make the Cell Identifier much more robust and helpful.