File size: 1,623 Bytes
cfdbf45
 
 
 
 
 
 
 
 
 
 
 
242c310
 
cfdbf45
 
 
 
 
 
 
 
 
 
 
 
 
242c310
cfdbf45
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
---
license: cc-by-4.0
tags:
  - electron-microscopy
  - stem
  - denoising
  - flow-matching
library_name: pytorch
---

# cimp-denoise weights

Weights for the `denoise` command from the `cimp-denoise` package
(code: [github.com/benke97/cimp-denoise](https://github.com/benke97/cimp-denoise)). It denoises STEM images by
rendering a frame as it would look after a longer exposure. The model is a conditional flow-matching U-Net (x2x),
steered by CMMP, a frozen encoder that describes an acquisition from its metadata or from the image itself.

| file | what it is | trained from |
|---|---|---|
| `cmmp.pt` | frozen CMMP encoder pair (image + 7-number acquisition metadata) | CMMP |
| `x2x.pt` | flow denoiser, metadata mode | `x2x_v2_local` ep500 |
| `x2x_cmmp.pt` | flow denoiser, CMMP mode (also trained with CMMP image embeddings as sources) | `x2x_v3_imgsrc` ep100 |
| `supervised.pt` | supervised denoiser; supplies the "clean look" target in CMMP mode | `sup_v1` ep100 |

## Use

```
pip install git+https://github.com/benke97/cimp-denoise
denoise frame.emd                 # downloads these files to ~/.cache/cimp-denoise on first use
```

Defaults: 8 draws × 4 sampler steps, about 5 s per 512 × 512 px and 90 s per 2048 × 2048 px on a desktop GPU.
Metadata mode (Velox .emd) is told min(recorded dwell, 1 µs) → 16× that. CMMP mode needs only the image.

## Limitations

- Trained on HAADF data from one microscope. BF and DF channels are processed, but the models were not trained on them.
- Very faint lattice fringes near the noise level can be smoothed away.
- Images must be at least 128 px per side.