Creating particle recognition training data for deep learning
Last modified by hajaalin@helsinki_fi on 2024/01/24 07:08
(Thanks to Piotr Chmielarz for this info and for pioneering deep-learning approach at the Viikki Campus)
Description of Training data
The training data consists of 1) original data and 2) annotations as binary images with a single white pixel indicating the center of the particle. Other indications:
- All images the same size.
- Even image size.
- Not too big images, 400 x 400 is still good.
- All particles in the image must be annotated.
- 8-bit binary images.
- Include also difficult cases in the training set.
- Save original and annotation with the same name in different folders
- training_data/originals/image2.tiff
- training_data/annotations/image2.tiff
Creating the training data set with Fiji
- Open original file (File → Open...).
- Duplicate original file (Image → Duplicate...).
- Close original file.
- Crop duplicate to 400 x 400 or smaller.
- Open macro editor (File → New → Script).
- Set language to ImageJ macro language (Language → IJ1 macro).
- Type in editor screen "makeRectangle(50, 50, 400, 400);" (without the "s).
- Click "Run".
- Select the image window and verify that a rectangular selection was created.
- Drag the selection to a good location on the image.
- Crop (Image → Crop).
- Create multi-point selection.
- Select multi-point tool.
- Click on particle centers.
- Create a blank annotation image.
- Duplicate cropped image (Image → Duplicate).
- Edit → Selection → Select all.
- Edit → Clear.
- Image → Type → 8-bit.
- Transfer annotations.
- Select the image with particles selected
- Edit → Selection → Add to Manager.
- Select the blank image.
- Select ROI Manager, click on the point set.
- Draw pixels.
- Select the blank images (now with particle centers)
- Edit → Draw.
- Save files (File → Save as... → TIFF)