Esacode

Docs / Demo projects

Data curation

From a raw pile of images to a training-ready set: quality, duplicates, embeddings, label checks, a review grid, a split and a before and after report.

Two public image datasets cleaned with the same blocks: broken, blurred and duplicated pictures and wrong labels are flagged, reviewed in a grid, and the rest is split into training and validation sets with a report of what changed.

The flows

FlowWhat it does
1 · Fruit: download and curateFruitNet (good, bad and mixed quality of six fruits) downloaded once, checked, de-duplicated, labels checked with CLIP, split and reported.
2 · Zebras: read from Hugging Face and curateA sample of GZCD (Grevy's zebras, Kenya) read at an exact commit, checked, de-duplicated and sorted by CLIP into zebras, giraffes and empty frames.
3 · Same step, any acceleratorThe same images embedded on the CPU and on an NVIDIA GPU, images per second side by side; add a Tenstorrent worker for a third.

What you need

Any worker; embeddings are faster on an NVIDIA GPU or a Tenstorrent card. The worker needs Run code from projects turned on (Computing > your worker > Worker settings).

Try it

  1. Open Projects > Demos and choose Data curation. Read its readme.
  2. Open flow 1 in the Blueprint and press Run: it runs as it is on your own workers. Switch to the View page to watch it. Its runs and results are yours only.
  3. To change it, choose Clone into my workspace: a copy goes into your workspace, with its readme, blueprints, the code of its blocks and its files, saved to a GitHub repository of yours (link GitHub first, under Profile > GitHub).

The blocks behind it

A model is only as good as the images it learns from. The curation blocks check every image of a set on your worker, flag the ones to look at, let a person decide in a grid, and write a clean set split into training and validation, with a report of what was removed and why. The images stay on the worker; only small previews and tables reach EsaSim.

Build the flow yourself

  1. Bring the images in. Use a Dataset block for a folder your worker shares, Hugging Face dataset for a dataset on the Hub at a fixed commit, or Download files for a link, a Zenodo record, a Mendeley Data dataset or a GitHub release. Folder names are often the labels (apple_good, zebra).
  2. Check them. Connect the images to Image quality check, Embed images, Find duplicates and Check labels. Each writes a table with one row per flagged image and the reason.
  3. Look at the flagged ones. Image previews packs small previews of the flagged images (and a sample of the rest) with what the tables say about each. Connect it to a Review grid view.
  4. Decide. In the Review grid, keep, remove or relabel each image, then Save decisions as review.csv.
  5. Write the clean set. Curate and split removes the flagged images (your decisions win over the checks), balances the classes and writes train/ and val/ with a manifest. Send it to Save as dataset or Publish to Hugging Face.

What each check finds

BlockFlagsHow
Image quality checkbroken, small, blurred, dark, bright, flatSharpness (variance of the Laplacian) against the typical sharpness of the same folder, brightness, contrast and the share of nearly black or white pixels. A few hundred images per second on any worker.
Embed images(no flags: vectors for the others)CLIP ViT-B/32 or DINOv2 small turn each image into a vector; on a Tenstorrent card, an NVIDIA GPU or the CPU. With CLIP, Prompts give each image the label that fits it best, with no training.
Find duplicatesduplicate, with the image keptPerceptual hashes catch copies, resized or recompressed versions and small crops; with embeddings and a Similarity (0.97 for near copies, 0.9 for the same scene), images that look the same join the group. Each group keeps the largest, sharpest image.
Check labelslabel (with the label suggested), outlierThe most similar images vote with their labels; an image whose own label loses the vote is flagged. A confusion table shows which labels are mixed up.
Embedding map(a map)UMAP or PCA lays the images out on a plane, with their flags, for a Chart of points: clusters, classes that mix, odd images.

The Review grid

Each image is a card with its picture, name, label, the label it looks like, a badge per flag and the reason. Filter by decision, flag, label or name. Click a picture for a large view; a duplicate shows the image kept next to it.

KeyAction
K / RKeep or remove
LGive another label
UUndo
Arrows, EnterMove between cards, enlarge one

Decisions stay on your computer until you clear them. Save decisions gives review.csv (path, decision, label). Keep it in a dataset and connect it through a Dataset block to the Review input of Curate and split, then run again: your decisions override the checks.

What Curate and split writes

  • train/<class>/… and val/<class>/…, split by class with Validation %, at most Most per class each, the same way every time for the same Seed.
  • manifest.csv, and the licence and credit files of the source.
  • A report (curation.md, curation.json and CSV tables for charts): images in, removed by reason, kept, and the classes before and after.
  • removed.csv: every image removed and why.

Sources and licences

Hugging Face dataset resolves a branch or tag to its commit, so the run records exactly which version it read, and Most files takes a repeatable sample for a demo-sized set. Download files keeps downloads in the worker's cache, reads only the files it keeps out of large zips when the server allows it, and writes a manifest with each file's source and checksum. Both write the licence next to the files. Publish to Hugging Face makes each publish one commit, with a card naming the licence and the credit. Respect the licence of the data you use and publish.

Save your Hugging Face token once in Profile > Keys: blocks that read private datasets or publish use it when you run a flow.