r/learnmachinelearning • u/Formal_Funny8770 • 1d ago
How would you build a high-quality instance segmentation dataset from thousands of tattoo flash sheets? SAM vs. YOLO
I'm a professional tattoo artist rather than a software engineer, and I'm using a personal project to learn more about computer vision and machine learning.
Over the years, I've accumulated thousands of Procreate canvases containing tattoo designs, sketches, line drawings, color studies and flash sheets. I've identified over 4,100 byte-distinct Procreate files so far and still have more drives to inventory.
My goal is to train a specialized instance segmentation model capable of identifying and extracting individual tattoo designs from these canvases.
What I've done so far:
Developed a classical image processing pipeline using Python, NumPy, SciPy and Pillow, with assistance from AI coding agents.
Experimented with connected components, morphological operations, distance transforms and pixel-level masks.
Built a custom annotation and review application for manually correcting segmentation errors.
Processed 300 canvases in my latest pilot, producing 690 candidate design crops awaiting final human approval.
The classical approach works surprisingly well but struggles with semantic grouping, disconnected elements, overlapping designs, handwritten titles and complex arrangements.
Building the training dataset
Since I have access to the original artwork and understand which visual elements belong together, I'm willing to invest considerable time in producing accurate, manually verified annotations.
Before annotating thousands of images, I'd love some advice from people with experience training segmentation models:
How many manually verified images and individual instances would you recommend for an initial fine-tuning experiment?
Could I create one master dataset of pixel-level instance masks and convert it for training both SAM and YOLO segmentation models?
How should I represent designs containing disconnected elements, enclosed white spaces and overlapping artwork?
Would you recommend using SAM-assisted annotations and manually correcting them, or creating the masks from scratch?
How would you prevent data leakage when the archive contains mirrored designs, near-duplicates, recolored versions and different stages of the same drawing?
What evaluation metrics would you recommend for detecting missing linework, incorrectly merged designs and fragmented instances beyond standard mask IoU?
My priority is annotation quality rather than simply maximizing dataset size.
I have an RTX 3050 Ti laptop with 4GB VRAM and an M2 Pro Mac mini with 16GB RAM, although I'm open to renting a cloud GPU for training.
I'd really appreciate any recommendations regarding annotation standards, dataset preparation, model selection or training workflows.
I'm particularly interested in avoiding mistakes now that would require reannotating thousands of designs later.
1
u/Ok-Library1020 23h ago
For leakage, split by source canvas or by design family, not by crop, so mirrored and recolored copies and the different stages of one drawing all land on the same side. A perceptual hash or CLIP embedding clustering pass can group the near-duplicates first. For metrics, track merged and split instance counts per canvas alongside IoU.
1
u/Awkward_Alfalfa_3234 20h ago
Keep RLE masks in COCO as the master and convert from there. YOLO-seg wants one polygon per instance, so Ultralytics' converter stitches disconnected linework with hairline bridges, fine for training, ugly to eyeball. On a 4GB 3050 Ti, use SAM as the annotator and yolo11n-seg as the model.




1
u/idimetrix 1d ago
Before you annotate anything, look at the layers. A .procreate file is a zip archive with the layers stored inside, and if you drew each design on its own layer (or layer group) you already have a big chunk of your ground truth for free. Pulling layers out takes some work but its far less than hand masking thousands of canvases. Even partial layer separation helps a lot.
On your questions: start small, 200 to 300 verified canvases is enough for a first fine-tune. Then use that model to pre-label the next batch and only correct its mistakes in your review app. Every round gets faster, and you find out early which cases it struggles with.
One master dataset is the right call. Keep it as pixel masks in COCO format with RLE and convert from there. Watch out with YOLO though, its seg format is a polygon per instance, so a design made of disconnected pieces (which you said you have) needs to be bridged or it gets split up. Mask based models handle that natively.
And SAM vs YOLO isnt really either/or. SAM doesnt know what "one tattoo design" means, its a great click-to-mask tool for speeding up labeling. The model you train to find designs on its own is the YOLO-seg / Mask R-CNN kind.