Training Workflow and Sample Selection
The goal is to build a useful classifier quickly, not to create a perfect dataset before the first training run.
In practice, the fastest path is iterative: sample selection, training, result review, targeted corrections, and retraining.
Be consistent before you scale up
Expressed cells can appear at many intensity levels.
It is important to decide early what should count as ON and what should count as OFF.
For example, you may decide that even a faint signal is enough for ON, or you may decide that only strongly expressed cells should count as ON.
The important part is not which rule you choose, but that you apply the same rule consistently throughout labeling.
Inconsistent labels make the classifier unreliable.
Start with a small set of slices
It is usually best to work with only 3 to 5 slices unless there is more visual variety that you need to cover.
A good strategy is to pick 3 to 5 slices early and stay with them for the initial training workflow.
Ideally those slices should cover multiple animals when possible.
If you spread samples across too many slices too early, later correction becomes harder.
Start with an initial sample set
A practical starting point is around 200 samples total.
A good first target is around 100 ON and 100 OFF samples.
Prefer clear examples first.
Focus on interesting regions and add samples from regions that look different to build variety into the training set.
Use region-based sampling as the main workflow
Rectangle selection should be the main workflow for fast sample collection.
Select an interesting region and label the sampled cells as one class, for example OFF.
Then correct the sampled cells that should belong to the other class, for example select the cells that should be ON.
This works well because the random sampling gives a good representation of the real data while keeping the workflow fast.
Usually you should not try to label every visible cell.
In practice, batches of around 20 to 50 cells work well.
Train the first model early
Once you have the first around 200 samples, train the first model.
The purpose of the first model is mainly to show what the classifier has already learned and where it still fails.
This gives you much better guidance for what samples to add next.
Review the classifier output on real slices
Inspect a few real slices qualitatively after training.
Look for systematic mistakes, not only isolated errors.
Check whether the model misses specific kinds of ON cells, specific OFF cells, weak signals, strong signals, background patterns, or borderline cases.
A model is good enough when the results look good enough qualitatively on inspected slices.
Use error-mining to improve the model
The most effective next step is usually to add training samples from the model's mistakes.
Correct misclassified cells and use them as new training samples.
Focus on cases the classifier currently gets wrong rather than adding more easy examples it already handles well.
Steer the ON/OFF balance deliberately
In practice, expressed cells are often imbalanced, with many more OFF than ON cells, although this depends strongly on the marker.
You should steer how the classifier behaves by controlling how many ON and OFF cells are present in the training set overall.
If the classifier misses too many positives, add more ON examples of those missed cases.
If it calls too many cells ON, add more OFF examples from those confusing regions.
The training set should reflect the behavior you want from the classifier.
Repeat the loop
- Select samples
- Train the model
- Review the results
- Add targeted new samples
- Train again
Focus on quality over quantity
Usually, once you reach around 2000 training samples, classification does not improve much from simply adding more.
At that point, it is usually better to focus on sample quality, consistency, and difficult cases rather than quantity.
