https://github.com/rybakov-ks/particleanalyzer

A Computer Vision-based tool for automatic segmentation and size analysis of particles in Scanning Electron Microscope (SEM) images.

https://github.com/rybakov-ks/particleanalyzer

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.1%) to scientific vocabulary

Keywords

computer-vision data-analysis deep-learning detectron2 electron-microscopy image-segmentation materials-characterization microscopy-images nanotechnology object-detection particle-analysis scanning-electron-microscopy scientific-research sem sem-image-analysis yolo
Last synced: 5 months ago · JSON representation

Repository

A Computer Vision-based tool for automatic segmentation and size analysis of particles in Scanning Electron Microscope (SEM) images.

Basic Info
  • Host: GitHub
  • Owner: rybakov-ks
  • License: gpl-3.0
  • Language: Python
  • Default Branch: main
  • Homepage: https://particleanalyzer.ru
  • Size: 266 MB
Statistics
  • Stars: 3
  • Watchers: 1
  • Forks: 1
  • Open Issues: 0
  • Releases: 21
Topics
computer-vision data-analysis deep-learning detectron2 electron-microscopy image-segmentation materials-characterization microscopy-images nanotechnology object-detection particle-analysis scanning-electron-microscopy scientific-research sem sem-image-analysis yolo
Created 10 months ago · Last pushed 6 months ago
Metadata Files
Readme License

README.md

Table of Contents

  1. ParticleAnalyzer
  2. Examples
  3. Key Features
  4. Installation Guide
  5. Segmentation Optimization Guide
  6. Analysis Outputs
  7. Advanced Settings
  8. Scale Calibration
  9. Contributors
  10. Citation

ParticleAnalyzer

Online Demo Slow Demo? PyPI Version Monthly Downloads

[!WARNING] If you experience low performance of the demo version, we suggest following this link as a solution.

ParticleAnalyzer Logo

A Computer Vision Tool for Automatic Particle Segmentation and Size Analysis in Scanning Electron Microscope (SEM) Images.

Video demonstrations:

Local video (MP4) | YouTube demonstration

Example

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.

Examples

Key Features

  • 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, 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

Installation Guide

### 1. Install PyTorch with CUDA support Make sure your system has an NVIDIA GPU with CUDA. Install PyTorch using the appropriate CUDA version (e.g., CUDA 11.8): python pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118 If you do not have a CUDA-capable GPU, use the CPU version insteadhowever, in this case, ParticleAnalyzer will run significantly slower: python pip install torch torchvision torchaudio

2. Install Detectron2 (Optional)

If you want to enable advanced instance segmentation, install Detectron2: python pip install 'git+https://github.com/facebookresearch/detectron2.git'

[!WARNING] There may be problems installing Detectron2. Use the official documentation.

3. Install ParticleAnalyzer

Finally, install ParticleAnalyzer from PyPI: python pip install --upgrade ParticleAnalyzer Now you're ready to run the application: python ParticleAnalyzer run Open in browser: http://127.0.0.1:8000

You can specify the port if necessary: python ParticleAnalyzer run --port 5000

Launch with LLM support (OpenRouter or Hugging Face API key required): python ParticleAnalyzer run --port 5000 --api-key YOUR_OPENROUTER_API_KEY

Segmentation Optimization Guide

Core Parameters: - Model Selection - Detection Confidence Threshold (0-1) - Increase (e.g., 0.70.85) to reduce false positives - Decrease (e.g., 0.50.3) to detect faint particles - IoU Threshold (0-1) - Increase (e.g., 0.50.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 400400 - 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 | | Mask R-CNN X152 | Challenging morphology | Slow | Irregular/overlapping particles |

Analysis Outputs

Statistical Data Table

Statistics Table
Statistics Table

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)

Size Distribution Visualization

Distribution Plots

Normal distribution fitting for all measured parameters showing particle population characteristics

Data filtering

https://github.com/user-attachments/assets/6548071a-3c83-4539-897a-6ebf175bec17

AI Interpretation of SEM Data

Statistics Table

Advanced Settings Panel

Settings Menu

Configuration options include: - Model Selection: YOLOv11, YOLOv12, Detectron2 - SAHI Mode: Enable/disable sliced inference for large images

SAHI Mode

  • 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

Scale Calibration

https://github.com/user-attachments/assets/cf2e272b-6d04-4347-abff-7a1eadaa3033

Micrometer values are calculated by: 1. Identifying the SEM image's scale bar using two marker points 2. Manually specifying the known real-world distance between markers 3. Automatically computing the pixel-to-m conversion ratio

Real Scale

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

Contributors

Kirill Rybakov, PhD | Chemistry
Affiliation: Saratov State University
Email: rybakov-ks@ya.ru

Citation

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

Owner

  • Login: rybakov-ks
  • Kind: user

GitHub Events

Total
  • Release event: 12
  • Watch event: 2
  • Delete event: 12
  • Push event: 128
  • Fork event: 1
  • Create event: 31
Last Year
  • Release event: 12
  • Watch event: 2
  • Delete event: 12
  • Push event: 128
  • Fork event: 1
  • Create event: 31

Committers

Last synced: 8 months ago

All Time
  • Total Commits: 104
  • Total Committers: 1
  • Avg Commits per committer: 104.0
  • Development Distribution Score (DDS): 0.0
Past Year
  • Commits: 104
  • Committers: 1
  • Avg Commits per committer: 104.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
rybakov-ks 5****s 104

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 0
  • Total pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 0
  • Total pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 1,004 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 24
  • Total maintainers: 1
pypi.org: particleanalyzer

SEM Image Analysis Tool

  • Versions: 24
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 1,004 Last month
Rankings
Dependent packages count: 9.0%
Average: 29.9%
Dependent repos count: 50.7%
Maintainers (1)
Last synced: 6 months ago

Dependencies

.github/workflows/publish.yml actions
  • actions/checkout v4 composite
  • actions/setup-python v5 composite
  • pypa/gh-action-pypi-publish release/v1 composite
pyproject.toml pypi
setup.py pypi
  • Pillow *
  • Requests *
  • gradio >=5.33.1
  • huggingface_hub *
  • matplotlib *
  • numpy *
  • openai *
  • opencv-python *
  • opencv-python-headless *
  • pandas *
  • plotly *
  • sahi *
  • scipy *
  • tqdm *
  • ultralytics *