Skip to content

Conversation

@kephale
Copy link
Collaborator

@kephale kephale commented Apr 7, 2025

Overview

This PR adds a comprehensive set of particle detection features to the copick-torch library, making it easier to detect particles in cryoET data:

1. MONAI-based Particle Detector

  • Implements a 3D object detector based on RetinaNet from MONAI
  • Supports both 2D and 3D inputs
  • Includes training and inference pipelines
  • Sliding window inference for large tomograms
  • Customizable anchors and detection parameters

2. Difference of Gaussian (DoG) Detector

  • Classic blob detection algorithm reimplemented for particle picking
  • Optimized for cryoET data
  • Parameter optimization against ground truth
  • Multiscale detection capabilities
  • Simple but effective implementation

3. Evaluation Metrics

  • Precision, recall, F1 calculation with tolerance-based matching
  • Average Precision (AP) calculation
  • Helper functions for distance calculation
  • Comprehensive detector evaluation tools

4. CryoET Data Portal Integration

  • DataPortalDataset for loading tomograms with automatic resolution rescaling
  • ParticleDataset for training with automatic background sampling
  • Efficient caching mechanisms
  • Integration with the copick and cryoet_data_portal libraries

Example Scripts

  • Full example for the DoG detector
  • Command-line interface for training and inference with the MONAI detector

Tests

  • Comprehensive test suite for all components
  • Automated tests for all core functionality

Testing

All components have been tested with unit tests.

Impact

This PR provides easy-to-use implementations of particle detection algorithms that will help users analyze their cryoET data more effectively.

Future Work

  • Add more particle detector types
  • Improve training capabilities with larger datasets
  • Optimize inference speed further

kephale added 4 commits April 6, 2025 21:42
This commit adds several key features to copick-torch:

1. MONAI-based particle detector: A detector using MONAI's RetinaNet for 3D particle detection in cryoET data
2. Difference of Gaussian (DoG) detector: A classic blob detector reimplemented for particle picking
3. Evaluation metrics: Tools for analyzing detector performance with ground truth
4. CryoET Data Portal dataloader: A dataloader that automatically rescales tomograms to a target resolution

Each component has a comprehensive test suite and example usage scripts.
- Fix ResNetBasicBlock -> ResNetBlock in MONAI detector
- Add compatibility for older versions of scikit-image in DoG detector
  by handling peak_local_max without the indices parameter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants