{"success":true,"data":{"author":"Heath AFM Lab","bucketAccessType":"public","bucketName":"Heath-AFM-Lab/afMLevel-data","bucketPrefix":"","category":"Structural Biology","cloudProvider":"huggingface","createdAt":"2026-11-17T14:12:21.781Z","description":"Training and test data for afMLevel, a deep learning tool from the Heath AFM lab that levels atomic force microscopy (AFM) topography images by automated background estimation or foreground masking. Each sample pairs a raw AFM height image with a reference image levelled by hand in NanoLocz, plus a binary foreground mask. There are 2,165 images (2,001 train, 164 test), 32-bit float single-channel TIFFs in nanometres, from 128 x 128 to 1024 x 1024 pixels, released before augmentation; masks are CSV files. Layout: train/ and test/ each with Image/, Levelled/ and Mask/ folders paired by index, plus per-image provenance tables (training_data_sources.csv, test_data_sources.csv). Read the TIFFs with tifffile rather than PIL to keep float height values. About 3 GB. Useful for AFM image processing, background subtraction and U-Net segmentation of biomolecular AFM. The card states the dataset is released under CC BY 4.0, with contributing authors of unpublished data agreeing to that license; cite the afMLevel paper and github.com/mayatek1/afMLevel.","displayTitle":"afMLevel: paired raw and levelled atomic force microscopy height images with foreground masks","huggingFaceUrl":"https://huggingface.co/datasets/Heath-AFM-Lab/afMLevel-data","id":"c5528365-d7b8-50ea-b998-1e2b9628666e","license":"CC-BY-4.0","licenseEvidenceUrl":"https://huggingface.co/datasets/Heath-AFM-Lab/afMLevel-data","objectCountEstimate":6499,"probeStatus":"ok","referenceUrl":"https://github.com/mayatek1/afMLevel","region":"us","schemaCard":{"accessHints":[{"language":"python-datasets","snippet":"from datasets import load_dataset\nds = load_dataset(\"Heath-AFM-Lab/afMLevel-data\")"},{"language":"python-hub","snippet":"from huggingface_hub import snapshot_download\nsnapshot_download(repo_id=\"Heath-AFM-Lab/afMLevel-data\", repo_type=\"dataset\")"}],"caveats":["HuggingFace metadata: author=Heath-AFM-Lab, license:cc-by-4.0, size_categories:1K<n<10K, format:imagefolder, downloads=2256"],"format":"mixed","generatedAt":"2026-11-17T14:23:11.349Z","layout":{"example":"test/Mask/test_mask_000.csv","pattern":"{repoId}/{filename}"},"mountPath":"/mnt/archive","sampleHeaders":[{"bytes":"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1\n","encoding":"utf8","key":"test/Mask/test_mask_000.csv","truncatedAt":512}],"sampleObjects":["test/Image/test_image_000.tiff","test/Image/test_image_001.tiff","test/Image/test_image_002.tiff","test/Image/test_image_003.tiff","test/Image/test_image_004.tiff"],"sidecars":[{"bytes":"---\r\npretty_name: afMLevel Training and Test Data\r\ntask_categories:\r\n  - image-to-image\r\n  - image-segmentation\r\ntags:\r\n  - atomic-force-microscopy\r\n  - afm\r\n  - hs-afm\r\n  - microscopy\r\n  - image-levelling\r\n  - biophysics\r\nsize_categories:\r\n  - 1K<n<10K\r\nlicense: cc-by-4.0\r\n---\r\n\r\n# afMLevel: AFM Image Levelling and Masking Dataset\r\n\r\nPaired atomic force microscopy (AFM) height images used to train and evaluate\r\nthe U-Net models in [afMLevel](https://github.com/mayatek1/afMLevel): a deep\r\nlearning tool for AFM image levelling through automated background estimation\r\nor foreground masking of AFM topography images.\r\n\r\nEach sample consists of a **raw AFM height image** and its corresponding\r\n**reference-levelled image**, produced by conventional manual levelling in\r\n[NanoLocz](https://george-r-heath.github.io/NanoLocz/). Both\r\nare stored as 32-bit float TIFFs. Binary foreground masks are stored as CSVs.\r\n\r\n> **Note:** Do not load the TIFFs through a standard Python image pipeline (PIL,\r\n> imagefolder, PNG conversion) as these will quantise the 32-bit float height\r\n> data. Use `tifffile`.\r\n\r\n## Dataset structure\r\n\r\n```txt\r\ntrain/\r\n  Image/      raw height TIFFs          train_image_0000.tiff … train_image_2000.tiff\r\n  Levelled/   reference-levelled TIFFs  train_levelled_0000.tiff … train_levelled_2000.tiff\r\n  Mask/       binary foreground masks   train_mask_0000.csv … train_mask_2000.csv\r\ntest/\r\n  Image/                                test_image_000.tiff … test_image_163.tiff\r\n  Levelled/                             test_levelled_000.tiff … test_levelled_163.tiff\r\n  Mask/                                 test_mask_000.csv … test_mask_163.csv\r\ntraining_data_sources.csv   per-image provenance for train split\r\ntest_data_sources.csv       per-image provenance for test split\r\nREADME.md                   This datacard\r\n```\r\n\r\nFiles are paired by numeric index: `train_image_0042.tiff`, `train_levelled_0042.tiff`,\r\nand `train_mask_0042.csv` all correspond to the same acquisition frame.\r\n\r\n| Split | Images |\r\n| --- | --- |\r\n| Train | 2001 |\r\n| Test | 164 |\r\n| **Total** | **2165** |\r\n\r\nImages are 32-bit float, single-channel, and range from 128×128 to 1024×1024\r\npixels. Some images are non-square. Z-values are in nanometres.\r\n\r\nImages are released in their **pre-augmentation** form. The models were trained\r\non augmented versions of these images (×3 for MLBackground, ×5 for MLMask);\r\nusers wishing to replicate training should apply augmentation as described in\r\nthe accompanying paper.\r\n\r\n## Loading\r\n\r\n```python\r\nimport tifffile\r\n\r\n# Load a paired sample\r\nraw      = tifffile.imread(\"train/Image/train_image_0042.tiff\")       # float32, nm\r\nlevelled = tifffile.imread(\"train/Levelled/train_levelled_0042.tiff\")  # float32, nm\r\n\r\n# Iterate all training pairs\r\nimport os\r\nfor fname in sorted(os.listdir(\"train/Image\")):\r\n    if not fname.endswith(\".tiff\"):\r\n        continue\r\n    idx = fname.replace(\"train_image_\", \"\").replace(\".tiff\", \"\")\r\n    raw = tifffile.imread(f\"train/Image/{fname}\")\r\n    lev = tifffile.imread(f\"train/Levelled/train_levelled_{idx}.tiff\")\r\n```\r\n\r\n## Derived targets used during training\r\n\r\nThe model ground-truth targets are **derived from the raw and levelled images\r\nat load time** in the training scripts, not stored separately as image files.\r\nBoth are deterministic and fully reproducible from this data plus the training\r\ncode in the afMLevel repository.\r\n\r\n**Background model target:** the normalised difference between raw and levelled,\r\nsharing the raw image's z-scale:\r\n\r\n```python\r\nimport numpy as np\r\n\r\ndef xyplanefit(im, px=1, py=1):\r\n    mc = np.mean(im, axis=0); x = np.arange(len(mc))\r\n    im = im - np.polyval(np.polyfit(x, mc, px), x)[np.newaxis, :]\r\n    mr = np.mean(im, axis=1); y = np.arange(len(mr))\r\n    return im - np.polyval(np.polyfit(y, mr, py), y)[:, np.newaxis]\r\n\r\ndef normalise(im):\r\n    im = im - im.min(); return im / (im.max() + 1e-8)\r\n\r\nraw_fit  = xyplanefit(raw)\r\nimnorm   = normalise(raw_fit)\r\nlevnorm  = (levelled - raw_fit.min()) / (raw_fit.max() - raw_fit.min())\r\nbackground_target = imnor","encoding":"utf8","key":"README.md","name":"README.md","size":8157,"truncated":true}],"sourceObjectKey":"test/Mask/test_mask_000.csv","starterCell":"import pandas as pd\ndf = pd.read_csv(\"hf://datasets/Heath-AFM-Lab/afMLevel-data/test/Mask/test_mask_000.csv\")\ndf.head()","starterSamplePath":"test/Image/test_image_000.tiff","totalObjects":6499},"summary":"Training and test data for afMLevel, a deep learning tool from the Heath AFM lab that levels atomic force microscopy (AFM) topography images by automated background estimation or…","title":"afMLevel: paired raw and levelled atomic force microscopy height images with foreground masks","updatedAt":"2026-11-17T20:01:07.792Z","visibility":"public","websiteUrl":"https://huggingface.co/datasets/Heath-AFM-Lab/afMLevel-data"}}