derollins commited on
Commit
1af9684
·
verified ·
1 Parent(s): ceb0a19

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +200 -3
README.md CHANGED
@@ -1,3 +1,200 @@
1
- ---
2
- license: bsd-3-clause
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: bsd-3-clause
3
+ pipeline_tag: image-to-image
4
+ tags:
5
+ - AFM
6
+ - physics
7
+ - biology
8
+ - atomic-force-microscopy
9
+ - microscopy
10
+ - image-processing
11
+ - unet
12
+ - surface-analysis
13
+ - chemistry
14
+ - nanoscience
15
+ ---
16
+ # afMLevel-background-unet
17
+
18
+ This U‑Net model predicts tilt, scanner drift, and other large‑scale imaging artifacts present in Atomic Force Microscopy (AFM) height maps.
19
+ It outputs a **background** image, the same size and scale as the raw AFM image, which can be subtracted (via the accompanying [afMLevel](https://github.com/mayatek1/afMLevel)
20
+ code) to produce a levelled height map.
21
+
22
+ ## Model Details
23
+
24
+ ### Model Description
25
+
26
+ This model is part of the [afMLevel](https://github.com/mayatek1/afMLevel) project.
27
+ The repository includes tools for:
28
+
29
+ - running inference,
30
+ - subtracting the predicted background,
31
+ - integrating the model into analysis workflows.
32
+
33
+ The model is a 7‑layer **U‑Net**, adapted from the original U‑Net architecture, and implemented fully in **PyTorch**.
34
+ It performs image‑to‑image regression to estimate background height 'image' caused by physical and instrumental AFM artifacts.
35
+
36
+
37
+ - **Developed by:** Maya Tekchandani
38
+ - **Maintained by:** Dr Daniel E. Rollins
39
+ - **Principal Investigator:** Dr George R. Heath
40
+ - **Affiliation:** University of Leeds
41
+ - **Funded by [optional]:** [More Information Needed]
42
+ - **Shared by:** [Heath-AFM-Lab](https://heath-afm-lab.github.io/)
43
+ - **Model type:** U‑Net regression model for AFM background prediction
44
+ - **License:** BSD‑3‑Clause
45
+ - **Finetuned from model [optional]:** None (trained from scratch)
46
+
47
+ ### Model Sources [optional]
48
+
49
+ <!-- Provide the basic links for the model. -->
50
+
51
+ - **Repository:** https://github.com/mayatek1/afMLevel
52
+ - **Paper [optional]:** In preparation
53
+ - **Demo [optional]:** [Demonstration notebooks](https://github.com/mayatek1/afMLevel/tree/main/notebooks)
54
+
55
+ # Uses
56
+
57
+ ## Direct Use
58
+
59
+ The [afMLevel](https://github.com/mayatek1/afMLevel/) inference code operates on **NumPy arrays**, so raw AFM files must first be
60
+ loaded using an external reader such as [playnano](https://github.com/derollins/playNano), [AFMReader](https://github.com/AFM-SPM/AFMReader), or a custom
61
+ loader. Once loaded, the afMLevel repo and notebooks handle inference and output of either
62
+ the predicted background or the levelled image directly.
63
+
64
+ The model has been primarily tested on **biological AFM data** and is best suited to that
65
+ context, though it may generalise to other sample types with similar imaging characteristics.
66
+
67
+ ## Downstream Use
68
+
69
+ - Integration into the **playNano** package, which also handles file reading, making it a
70
+ natural end-to-end workflow.
71
+ - Batch levelling of **high-speed AFM videos** via playnano.
72
+ - As a preprocessing step feeding into segmentation, particle detection, or other analysis
73
+ tools.
74
+
75
+ ## Out‑of‑Scope Use
76
+
77
+ This model is **not** intended for:
78
+
79
+ - predicting physical or mechanical properties of samples,
80
+ - denoising extremely corrupted AFM images outside the training distribution,
81
+ - interpreting AFM contact mechanics,
82
+ - working on specialized AFM modes (KPFM, MFM, FMM, etc.) without validation,
83
+ - non-biological samples, without first validating performance on representative images.
84
+
85
+ # Bias, Risks, and Limitations
86
+
87
+ - The model was trained on a specific dataset of real AFM height maps; performance may degrade for very different imaging modes, scan sizes, or materials.
88
+ - Extremely noisy scans or those containing jump‑to‑contact instabilities may produce inaccurate background predictions.
89
+ - Users should visually inspect levelled outputs before scientific interpretation.
90
+
91
+ ### Recommendations
92
+
93
+ - Always verify a subset of corrected images manually.
94
+ - Avoid applying the model to AFM imaging modes it has not been trained on (i.e. phase, electrical, magnetic modes).
95
+
96
+ ## How to Get Started with the Model
97
+
98
+ The recommended way to use this model is through the
99
+ [afMLevel](https://github.com/mayatek1/afMLevel) repository, which handles inference,
100
+ background subtraction, and output. Demonstration notebooks are available
101
+ [here](https://github.com/mayatek1/afMLevel/tree/main/notebooks).
102
+
103
+ ## Training Details
104
+
105
+ The model was trained from scratch on real AFM topography data using the PyTorch framework.
106
+
107
+ ### Training Data
108
+
109
+ This model was trained on a **non‑public dataset of 2,001 real AFM height‑map images**.
110
+ To increase dataset size and improve generalization, images were augmented using:
111
+
112
+ - reflection along the y-axis,
113
+ - rotation by 180°,
114
+ - (mask model only) synthetic line-noise artefacts.
115
+
116
+ This produced **6,003 training images** for the background model.
117
+ A **60:40 train‑validation split** was used.
118
+
119
+ ### Training Procedure
120
+
121
+ - **Architecture:** 7‑layer U‑Net with large convolutional filters (9×9)
122
+ - **Framework:** PyTorch
123
+ - **Optimizer:** Adam
124
+ - **Learning rate:** 0.0005
125
+ - **Objective:** pixel‑wise continuous regression to target background images
126
+ - **Hardware:** trained using GPU acceleration
127
+ - Loss‑curve diagnostics were used to monitor convergence.
128
+
129
+ #### Preprocessing [optional]
130
+
131
+ [More Information Needed]
132
+
133
+
134
+ #### Training Hyperparameters
135
+
136
+ - **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
137
+
138
+ #### Speeds, Sizes, Times [optional]
139
+
140
+ <!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
141
+
142
+ [More Information Needed]
143
+
144
+ ## Evaluation
145
+
146
+ <!-- This section describes the evaluation protocols and provides the results. -->
147
+
148
+ ### Testing Data, Factors & Metrics
149
+
150
+ #### Testing Data
151
+
152
+ <!-- This should link to a Dataset Card if possible. -->
153
+
154
+ [More Information Needed]
155
+
156
+ #### Factors
157
+
158
+ <!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
159
+
160
+ [More Information Needed]
161
+
162
+ #### Metrics
163
+
164
+ <!-- These are the evaluation metrics being used, ideally with a description of why. -->
165
+
166
+ [More Information Needed]
167
+
168
+ ### Results
169
+
170
+ [More Information Needed]
171
+
172
+ #### Summary
173
+
174
+
175
+
176
+ ## Citation [optional]
177
+
178
+ Paper in preparation
179
+
180
+ **BibTeX:**
181
+
182
+ [More Information Needed]
183
+
184
+ **APA:**
185
+
186
+ [More Information Needed]
187
+
188
+ ## Model Card Authors [optional]
189
+
190
+ - **Maya Tekchandani** (primary developer)
191
+ - **Dr Daniel E. Rollins** (maintainer)
192
+ - **Dr George R. Heath** (project supervisor & PI)
193
+
194
+ ## Model Card Contact
195
+
196
+ # Contact
197
+
198
+ For questions or issues, please contact:
199
+ **George R. Heath- University of Leeds**
200
+ Email: G.R.Heath@leeds.ac.uk