Detection of head-tail inversions

Problem: Tracking data often improperly mark the head and the tail, and the two landmarks may be inverted over entire trajectory segments. This can also be observed (in fewer occasions) in corrected tracks stored in trx.mat files.

Proposal: Include a non-exclusive tag - managed in UI similarly to a discrete behavior, but that could overlap with the actual behaviors - to allow users to mark inversion events or segments (choose one), and implement a correction mechanism on the backend side.

Questions: can a machine learning approach be used to detect inversion events or segments, using manual tags to draw some training data? How to identify the onset and termination of these inverted-head-tail segments if the manual tags are imprecise in time?