Innovative ML model-switching approach for real-time traffic monitoring on smartphones