jianlin-cheng / CryoTransformer

A transformer model for picking protein particles in cryo-EM images
MIT License
32 stars 3 forks source link

Adjusting Particle Count while making new predictions. #2

Open iamtekson opened 6 months ago

iamtekson commented 6 months ago

Straight-forward instructions to make new predictions. I appreciate your great work.

I have a question about adjusting the quantity of selected particles using the existing pre-trained model. In the code snippet within predict.py, I've noticed two parameters: num_queries and quartile_threshold. However, I'm uncertain about how these thresholds function. Could you guide me on modifying these parameters to change the final count of selected particles in my specific scenario?

image

Ashwin-Dhakal commented 6 months ago

Hi @imtekson, thanks for the compliment.

The num_queries parameter is integral to the Hungarian matching algorithm during training, facilitating an optimal one-to-one mapping of N queries to N annotations, and it's fixed at 600 for our particle picking. So, I don't recommend changing this parameter.

Instead, consider modifying the quartile_threshold parameter to regulate the number of picked particles. The default value is 0.25, implying that only particles with confidence scores in the 25th to 100th percentile range are retained. To increase the number of picked particles, you can lower it to 0.2, 0.1, or even 0. This expands the picked particle count and may yield varied protein particle orientations, albeit with a potential for false positives.

Conversely, to obtain a smaller set of high-quality particles, raise the parameter to 0.3, 0.5, or beyond (max:1).

You can use these commands to make changes in the number of picked particles while making predictions:

 `python predict.py -- empiar '10081' --quartile_threshold 0.10` to increase the number of particles
 `python predict.py -- empiar '10081' --quartile_threshold 0.30` to decrease the number of particles

Hope this helps. Thanks.