User Tools

Site Tools


pipeline:window:cryolo

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
pipeline:window:cryolo [2019/07/29 16:02]
twagner [Configuration]
pipeline:window:cryolo [2019/08/30 13:40]
twagner [Data preparation]
Line 40: Line 40:
  
 ==== Data preparation ==== ==== Data preparation ====
-CrYOLO supports MRC, TIF and JPG files. It can work with 32 bit data, 8 bit data and 16 bit data. 
-It will work on original MRC files, but it will probably improve when the data are denoised. Therefore you should low-pass filter them to a reasonable level. Since Version 1.2 crYOLO can automatically do that for you. You just have to add 
-<code> 
-"filter":               [0.1,"filtered"] 
-</code>  
- 
-to the model section in your config file to filter your images down to an absolute frequency of 0.1. The filtered images are saved in folder ''filtered''. 
- 
-crYOLO will automatically check if an image in full_data is available in the ''filtered'' directory. The filtering is done in parallel. If you don't want to use crYOLO's internal filtering, just remove the line and filter them manually. If you remove the line, don't forget to remove the comma at the end of the line above.  
- 
-<hidden **Alternative: Using neural-network denoising with JANNI**> 
-<html><br></html> 
-Since crYOLO 1.4 you can also use neural network denoising with [[:janni|JANNI]]. The easiest way is to use the JANNI's general model ([[:janni#janni_general_model|Download here]]) but you can also [[:janni_tutorial#training_a_model_for_your_data|train JANNI for your data]]. crYOLO directly uses an interface to JANNI to filter your data, you just have to specify the path to your JANNI model, overlap of the batches (default 24), the batch size (default 3) and a path where the denoised images should be written.  
- 
-To use JANNI's denoising you have to use following entry in your config.json: 
- 
-<code> 
-"filter":               ["path/to/janni_model.h5",24,3,"filtered"] 
-</code>  
- 
-I recommend to use denoising with JANNI only together with a GPU as it is rather slow (~ 1-2 seconds per micrograph on the GPU and 10 seconds per micrograph on the CPU) 
- 
-<html><br></html> 
-</hidden>  
-<html><br></html> 
- 
 If you followed the installation instructions, you now have to activate the cryolo virtual environment with If you followed the installation instructions, you now have to activate the cryolo virtual environment with
  
Line 78: Line 52:
   * A very heterogenous background could make it necessary to pick more micrographs.   * A very heterogenous background could make it necessary to pick more micrographs.
   * If your micrograph is only sparsely decorated, you may need to pick more micrographs.   * If your micrograph is only sparsely decorated, you may need to pick more micrographs.
-We recommend that you start with 10 micrographs, then autopick your data, check the results and finally decide whether to add more micrographs to your training set. +We recommend that you start with 10 micrographs, then autopick your data, check the results and finally decide whether to add more micrographs to your training set. 
  
 {{:pipeline:window:box_manager.png?direct&400 |}} {{:pipeline:window:box_manager.png?direct&400 |}}
Line 184: Line 157:
 Navigate to the folder with ''config.json'' file, ''train_image'' folder, etc. Navigate to the folder with ''config.json'' file, ''train_image'' folder, etc.
  
-**1. Warm up your network**+**Train your network with 3 warmup epochs:**
  
 <code> <code>
 cryolo_train.py -c config.json -w 3 -g 0 cryolo_train.py -c config.json -w 3 -g 0
-</code> 
- 
-**2. Train your network** 
- 
-<code> 
-cryolo_train.py -c config.json -w 0 -g 0 
 </code> </code>
  
Line 199: Line 166:
  
 The training stops when the "loss" metric on the validation data does not improve 10 times in a row. This is typically enough. In case want to give the training more time to find the best model. You might increase the "not changed in a row" parameter to, for example, 15 by adding the flag //-e 15//: The training stops when the "loss" metric on the validation data does not improve 10 times in a row. This is typically enough. In case want to give the training more time to find the best model. You might increase the "not changed in a row" parameter to, for example, 15 by adding the flag //-e 15//:
 +
 <code> <code>
-cryolo_train.py -c config.json -w -g 0 -e 15+cryolo_train.py -c config.json -w -g 0 -e 15
 </code> </code>
 +
 to the training command. to the training command.
 ==== Picking ==== ==== Picking ====
Line 424: Line 393:
 In principle, there is not much difference in training crYOLO for filament picking and particle picking. For project with roughly 20 filaments per image we successfully trained on 40 images (=> 800 filaments). However, in our experience the warm-up phase and training need a little bit more time: In principle, there is not much difference in training crYOLO for filament picking and particle picking. For project with roughly 20 filaments per image we successfully trained on 40 images (=> 800 filaments). However, in our experience the warm-up phase and training need a little bit more time:
  
-**1. Warm up your network** +**Train your network with 10 warm up epochs:**
- +
-<code> +
-cryolo_train.py -c config.json -w 10 -g 0 +
-</code> +
- +
-**2. Train your network**+
  
 <code> <code>
-cryolo_train.py -c config.json -w -g 0 -e 10+cryolo_train.py -c config.json -w 10 -g 0 -e 10
 </code> </code>
  
pipeline/window/cryolo.txt · Last modified: 2021/02/19 10:00 by twagner