New individual - new ID in DeepLabCut

I’m working on / struggling with a specific use case for DeepLabCut: I image mosquitoes that walk on a substrate and can fly in and out of the field of view. In a given experiment there may be 30 mosquitoes in a cage, yet there typically are not more than 10 in a field of view at any given time. Animals can leave and enter the field of view as they please. I’m figuring out how to assign new IDs to animals that come into the field of view, and not reassign animals that appear later to this same ID (default practice in deeplabcut).

More detail: I train my network with 20 individuals, and as there are never more than 20 individuals visible in the field of view so I can track all of them. However, when animal #1 leaves the field of view, and another random animal comes into the field of view a couple of frames later, that animal gets #1 assigned (or any other vacant number). However, I would like this new animal to be labelled 21, and any new animal that appears in the field of view n + 1 (so in a long experiment I may use 100s of IDs). In this way I will be able to analyze all behavioral trajectories separately, instead of wrongly/randomly grouping them into 20 ‘individuals’.

I’m curious about two things:

  1. is anyone else encountering this issue, and if yes, did anyone solve this?
  2. I’m working on some code to reassign trajectories to new ID numbers (i.e. when there is a ‘gap’ in a trajectory, slice that trajectory into multiple IDs), would people be interested in such an analysis?