{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/online-test-time-adaptation-of-spatial","title":"Online Test-Time Adaptation of Spatial-Temporal Traffic Flow Forecasting","arxiv_id":"2401.04148","date":"2024-01-08","proceeding":null,"authors":["Pengxin Guo","Pengrong Jin","Ziyue Li","Lei Bai","Yu Zhang"],"abstract":"Accurate spatial-temporal traffic flow forecasting is crucial in aiding traffic managers in implementing control measures and assisting drivers in selecting optimal travel routes. Traditional deep-learning based methods for traffic flow forecasting typically rely on historical data to train their models, which are then used to make predictions on future data. However, the performance of the trained model usually degrades due to the temporal drift between the historical and future data. To make the model trained on historical data better adapt to future data in a fully online manner, this paper conducts the first study of the online test-time adaptation techniques for spatial-temporal traffic flow forecasting problems. To this end, we propose an Adaptive Double Correction by Series Decomposition (ADCSD) method, which first decomposes the output of the trained model into seasonal and trend-cyclical parts and then corrects them by two separate modules during the testing phase using the latest observed data entry by entry. In the proposed ADCSD method, instead of fine-tuning the whole trained model during the testing phase, a lite network is attached after the trained model, and only the lite network is fine-tuned in the testing process each time a data entry is observed. Moreover, to satisfy that different time series variables may have different levels of temporal drift, two adaptive vectors are adopted to provide different weights for different time series variables. Extensive experiments on four real-world traffic flow forecasting datasets demonstrate the effectiveness of the proposed ADCSD method. The code is available at https://github.com/Pengxin-Guo/ADCSD.","url_abs":"https://arxiv.org/abs/2401.04148v1","url_pdf":"https://arxiv.org/pdf/2401.04148v1.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"online-test-time-adaptation-of-spatial","repo_url":"https://github.com/pengxin-guo/adcsd","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"test-time-adaptation","task_name":"Test-time Adaptation"},{"task_slug":"traffic-prediction","task_name":"Traffic Prediction"}],"methods":[{"method_slug":null,"method_name":"Travel"}],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/traffic-prediction-on-nyctaxi","task":"Traffic Prediction","dataset":"NYCTaxi","model":"ADCSD","rank_in_archive_order":5,"of":5,"metrics":{"MAE @ in":"16.987","MAE @ out":"14.595"},"uses_additional_data":false},{"leaderboard":"/sota/traffic-prediction-on-pems07","task":"Traffic Prediction","dataset":"PeMS07","model":"ADCSD","rank_in_archive_order":8,"of":17,"metrics":{"MAE@1h":"19.62"},"uses_additional_data":false}],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2401.04148","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2401.04148"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/pengxin-guo/adcsd","reach":{"status":"ok"}}],"summary":{"ran":8,"unverified":1},"by_repo_kind":{"official":{"samples":9,"ran":8,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":9,"samples":[{"code_sha256_prefix":"8b1fe12a843654ca","entry":"log_cosh_loss","repo":"pengxin-guo/adcsd","repo_kind":"official","path":"libcity/model/loss.py","file_url":"https://github.com/pengxin-guo/adcsd/blob/HEAD/libcity/model/loss.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"8b1fe12a843654ca"}},{"code_sha256_prefix":"adfbb8bc32262202","entry":"mae","repo":"pengxin-guo/adcsd","repo_kind":"official","path":"libcity/evaluator/eval_funcs.py","file_url":"https://github.com/pengxin-guo/adcsd/blob/HEAD/libcity/evaluator/eval_funcs.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"adfbb8bc32262202"}},{"code_sha256_prefix":"2a82a90d91ced4b6","entry":"masked_mae_loss","repo":"pengxin-guo/adcsd","repo_kind":"official","path":"libcity/model/loss.py","file_url":"https://github.com/pengxin-guo/adcsd/blob/HEAD/libcity/model/loss.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"2a82a90d91ced4b6"}},{"code_sha256_prefix":"addcdb338a54bba0","entry":"masked_mae_torch","repo":"pengxin-guo/adcsd","repo_kind":"official","path":"libcity/model/loss.py","file_url":"https://github.com/pengxin-guo/adcsd/blob/HEAD/libcity/model/loss.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"addcdb338a54bba0"}},{"code_sha256_prefix":"a57096075ed5bfb9","entry":"mse","repo":"pengxin-guo/adcsd","repo_kind":"official","path":"libcity/evaluator/eval_funcs.py","file_url":"https://github.com/pengxin-guo/adcsd/blob/HEAD/libcity/evaluator/eval_funcs.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"a57096075ed5bfb9"}},{"code_sha256_prefix":"d43c793b0819b516","entry":"rmse","repo":"pengxin-guo/adcsd","repo_kind":"official","path":"libcity/evaluator/eval_funcs.py","file_url":"https://github.com/pengxin-guo/adcsd/blob/HEAD/libcity/evaluator/eval_funcs.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"d43c793b0819b516"}},{"code_sha256_prefix":"1fca944cc6ee41b8","entry":"sort_confidence_ids","repo":"pengxin-guo/adcsd","repo_kind":"official","path":"libcity/evaluator/utils.py","file_url":"https://github.com/pengxin-guo/adcsd/blob/HEAD/libcity/evaluator/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"1fca944cc6ee41b8"}},{"code_sha256_prefix":"57277243f9a05725","entry":"transfer_data","repo":"pengxin-guo/adcsd","repo_kind":"official","path":"libcity/evaluator/utils.py","file_url":"https://github.com/pengxin-guo/adcsd/blob/HEAD/libcity/evaluator/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"57277243f9a05725"}},{"code_sha256_prefix":"9b199ea651c27032","entry":"evaluate_model","repo":"pengxin-guo/adcsd","repo_kind":"official","path":"libcity/evaluator/utils.py","file_url":"https://github.com/pengxin-guo/adcsd/blob/HEAD/libcity/evaluator/utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"9b199ea651c27032"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}