Skip to content

Latest commit

 

History

History
104 lines (77 loc) · 3.85 KB

README.md

File metadata and controls

104 lines (77 loc) · 3.85 KB

Automated Ag Crystal Size Distribution Quantification Using Tuned MobileSAM

This project builds an image-analysis pipeline for automatically quantifying the crystal size distribution (CSD) of acicular Ag crystals from optical microscope images.

The workflow combines image preprocessing, Tuned MobileSAM instance segmentation, geometry/ridge-based filtering, skeletonization, and statistical calibration against Morphologi measurements.

Project Overview

  • Target material: 0.3 wt% Ag Long-Needle crystals
  • Dataset: OpenCrystalDataset, optical microscope images
  • Goal: Estimate particle length distribution from microscope images without relying on expensive particle analysis equipment
  • Core method: MobileSAM-based mask generation + domain-specific filtering + skeleton length measurement
  • Validation reference: Morphologi static image analysis measurements

Pipeline

  1. Preprocessing

    • White Top-Hat correction for uneven illumination
    • Gaussian blur for noise suppression
    • CLAHE for local contrast enhancement
  2. Tuned MobileSAM Segmentation

    • Automatic mask generation
    • Bright-region positive prompt generation using the top 2% intensity regions
    • Prompt-limited inference for computational efficiency
  3. Post-processing and Filtering

    • Aspect-ratio and solidity-based filtering
    • Sato ridge filter validation for linear crystal structures
    • IoU-based non-maximum suppression for duplicate masks
  4. Skeletonization

    • Zhang-Suen thinning extracts 1-pixel centerlines
    • Skeleton length is used as the pixel-level crystal length estimate
  5. Statistical Calibration

    • Pixel lengths are calibrated to micrometers using Morphologi D50
    • Estimated scale: 1 pixel ~= 0.53 um

Key Results

The low-concentration image set produced 800 detected crystal centerline lengths across 10 images.

Metric This project Morphologi Error
D10 30.1 um 20.1 um +10.0 um / 49.8%
D50 67.3 um 67.3 um 0.0 um / 0.0%
D90 135.7 um 141.8 um -6.1 um / 4.3%

D50 was used as the calibration anchor, so D10 and D90 are more meaningful for independent distribution-shape validation.

Repository Structure

.
|-- notebooks/
|   `-- ag_crystal_csd_mobilesam.ipynb
|-- src/
|   `-- ag_crystal_csd_pipeline.py
|-- results/
|   |-- comparison/
|   |-- limitation/
|   |-- mask_results/
|   |-- tables/
|   |-- crystal_lengths.csv
|   |-- csd_histogram.png
|   `-- image_summary.csv
`-- docs/
    |-- final_presentation_ko.pptx
    `-- project_summary_ko.docx

Main Files

  • notebooks/ag_crystal_csd_mobilesam.ipynb: full annotated experimental workflow
  • src/ag_crystal_csd_pipeline.py: exported code cells for quick review
  • results/tables/csd_summary.csv: summary statistics for the detected crystal length distribution
  • results/csd_histogram.png: final CSD histogram
  • docs/final_presentation_ko.pptx: Korean final presentation deck
  • docs/project_summary_ko.docx: Korean project summary report

Dependencies

The original experiment was executed on Google Colab with a T4 GPU.

Install the main Python dependencies with:

pip install -r requirements.txt

MobileSAM weights are downloaded automatically by the notebook if mobile_sam.pt is not present.

Limitations and Future Work

  • High-concentration images show under-segmentation when crystals overlap or cross heavily.
  • Short crystals in the D10 region are more difficult to preserve because aspect-ratio filtering can remove small particles.
  • Current physical-scale calibration depends on Morphologi D50; future work should use microscope images with scale bars or multi-point calibration.

References

  • Barhate et al., OpenCrystalData, Digital Chemical Engineering, 2024.
  • Kirillov et al., Segment Anything, arXiv, 2023.
  • Zhang et al., Faster Segment Anything, arXiv, 2023.