Thanks for the detailed instruction. Based on your description, the total numbers of samples collected for each of categories A,B,C, and D are:
A: 7, B: 14, C: 14, D: 7
and the model weights are already fitted to the first three categories during the initial training (note that the Android code continuously trains the model with the same dataset several times until the pause button is clicked, so the model weight might be overly trained to certain categories). So the model might have a hard time converging when a newly introduced category is much less trained with and also the number of samples is one of the least (i.e. 7 samples).
Here are some suggestions we want to provide:
1. Increasing the number of fourth category samples.
2. Tweaking the batch size in case it helps with loss convergence in the demo code
3. Worst case, re-initialize the model when a new category is introduced and start over the training.
Hope this helps with your case.