Systematic correction for short duration states/actions
For each time step in a larva track, MaggotUBA picks a defined number of time steps before and after, and tags the time step based on the track segment alone. As a consequence, some predicted behavior tags in a track may last a single time step, which may not make sense.
- We could systematically post-process sequential predictions to turn A->B->A patterns into A->A->A (referring to 3 successive time steps). In the online regime, this means delaying the prediction by one extra time step, which may be acceptable.
In addition, MaggotUBA does not pick an even number of time steps before and after, in the case of an even window length. For example, a 20-timepoint window picks 10 time steps before the central time step, and 9 after. A one-timepoint delay would lead to picking as many time points before and after the central time step.
- We could also introduce a more general post-processing mechanism for the offline regime, to handle more complex patterns such as A->A->B->C->A (turn the non-As into As).
Both approaches could be implemented very close to the level of the predict
method of a MaggotTrainer
object (see the predict_model.py script).
Not sure yet what could be made general enough to go in TaggingBackends.