Computation time is a fundamental concern when tracking objects in real time, especially in complex scenes. Inspired by previous works on automatic failure detection and in situ evaluation of tracking, the authors propose in this study an adaptive tracking algorithm based on pattern recognition techniques, which uses more computing resources only when tracking is likely to fail. Tracking quality is discretised into two binary values and a supervised classifier is trained using some features obtained from the tracking itself and ground truth data. During the operation of the classifier, whenever the tracking quality diminishes, the tracking algorithm reacts in a predefined way in order to avoid the failure. Two specific examples are presented, in which the action taken is different when a potential risk situation is detected: either the number of particles increases or the algorithm used to track changes. The experimental work shows that these methods can be easily implemented with a substantial reduction of processing time but with little tracking performance loss.