- 🔎 ParticleAnalyzer
- ✅ Examples
- ✨ Key Features
- 📥 Installation Guide
- 🛠 Segmentation Optimization Guide
- 📊 Analysis Outputs
- ⚙️ Advanced Settings
- 📏 Scale Calibration
- 📧 Contributors
- 📖 Citation
A Computer Vision-Based Tool for Automatic Segmentation and Size Analysis of Nanoparticles in Scanning Electron Microscope (SEM) and Transmission Electron Microscope (TEM) Images.
If you encounter any errors while using Particle Analyzer, please open an issue in the GitHub repository or contact me at rybakov-ks@ya.ru for support. If the model cannot segment your images correctly, please send them to rybakov-ks@ya.ru . Your images will be used to retrain the model's.
Example.1.mp4 |
Example.2.mp4 |
Example.3.mp4 |
Example.4.mp4 |
Example.5.mp4 |
- Automated particle segmentation in SEM images
- SAHI mode enables accurate detection of small particles in high-resolution images via a sliding window method
- Comprehensive statistical analysis of particle characteristics
- Interactive visualization of size distributions
- Dual unit support — switch between pixels and micrometers (µm)
- Supports multiple AI models: YOLOv11, YOLOv12, RF-DETR Seg (Preview) and Detectron2
- Advanced configuration options for fine-tuning detection accuracy
- AI Interpretation of SEM Data
- Multi-language interface: Russian, Simplified Chinese, Traditional Chinese, English (ru, zh-CN, zh-TW, en)
- Try it online: particleanalyzer.ru
Make sure your system has an NVIDIA GPU with CUDA. Install PyTorch using the appropriate CUDA version (e.g., CUDA 11.8):
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118If you do not have a CUDA-capable GPU, use the CPU version instead—however, in this case, ParticleAnalyzer will run significantly slower:
pip install torch torchvision torchaudioIf you want to enable advanced instance segmentation, install Detectron2:
pip install 'git+https://github.com/facebookresearch/detectron2.git'Warning
There may be problems installing Detectron2. Use the official documentation.
Finally, install ParticleAnalyzer from PyPI:
pip install --upgrade ParticleAnalyzer✅ Now you're ready to run the application:
ParticleAnalyzer runOpen in browser: http://127.0.0.1:8000
You can specify the port if necessary:
ParticleAnalyzer run --port 5000Launch with LLM support (OpenRouter or Hugging Face API key required):
ParticleAnalyzer run --port 5000 --api-key YOUR_OPENROUTER_API_KEY🔧 Core Parameters:
- Model Selection
- Detection Confidence Threshold (0-1)
- Increase (e.g., 0.7→0.85) to reduce false positives
- Decrease (e.g., 0.5→0.3) to detect faint particles
- IoU Threshold (0-1)
- Increase (e.g., 0.5→0.7) to eliminate duplicate detections
- Decrease for dense particle fields
- Enable SAHI Processing (split-analyze-merge)
🧩 SAHI Configuration (for large images):
- Slice Size: Start with 400×400
- Overlap Ratio: 0.2-0.3 (prevents edge artifacts)
SAHI mode helps detect small objects in high-resolution images by using a sliding window approach
🔄 Model Selection:
| Model | Best For | Speed | Recommended Use Case |
|---|---|---|---|
| YOLOv11 | General use (balanced) | ⚡⚡⚡ Fast | Quick analysis of standard samples |
| YOLOv12 | High precision detection | ⚡⚡⚡ Fast | Critical measurements |
| RF-DETR Seg (Preview) 🆕 | Transformer-based segmentation | ⚡⚡⚡ Fast | Precise object counting and segmentation with limited density (200 objects per image) |
| Mask R-CNN X152 | Challenging morphology | ⚡ Slow | Irregular/overlapping particles |
Comprehensive metrics including mean, median, min/max, standard deviation values for:
- Area (px² or µm²)
- Perimeter (px or µm)
- Equivalent diameter (px or µm)
- Feret diameters and angles (px or µm and °)
- Eccentricity (unitless)
- Intensity values (grayscale units)
Normal distribution fitting for all measured parameters showing particle population characteristics
Filtering.data.mp4
AI Interpretation of SEM Data
Configuration options include:
- Model Selection: YOLOv11, YOLOv12, Detectron2
- SAHI Mode: Enable/disable sliced inference for large images
- Detection Threshold: Confidence level (0-1)
- IOU Threshold: Overlap threshold for NMS (0-1)
- Max Detections: Maximum number of particles to detect
- Scaling Mode: Pixel/µm unit selection
- Image Resolution: Output resolution control
- Result Rounding: Decimal places for metrics
- Single Particle Mode: Detailed individual analysis
- Histogram Bins: Number of intervals for distribution plots
instruction.mp4
Micrometer values are calculated by:
- Identifying the SEM image's scale bar using two marker points
- Manually specifying the known real-world distance between markers
- Automatically computing the pixel-to-µm conversion ratio
Note: For accurate µm measurements, please ensure:
- The scale bar is clearly visible in your image
- Enter the correct scale
- The scale bar was created at the same magnification as your particles
Kirill Rybakov, PhD | Chemistry
Affiliation: Saratov State University
Email: rybakov-ks@ya.ru
If you plan to publish results obtained using ParticleAnalyzer, we would appreciate it if you mention the use of ParticleAnalyzer (https://github.com/rybakov-ks/ParticleAnalyzer).







