[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"doc-detail-122171-en":3,"doc-seo-122171-105":30,"detail-sidebar-cat-0-en-105":92},{"code":4,"msg":5,"data":6},0,"success",{"doc_id":7,"user_id":8,"nickname":9,"user_avatar":10,"doc_module":4,"category_id":11,"category_name":12,"doc_title":13,"doc_description":14,"doc_content":15,"file_id":16,"file_url":17,"file_type":18,"file_size":19,"view_count":20,"is_deleted":4,"is_public":20,"is_downloadable":20,"audit_status":20,"page_count":21,"language":22,"language_code":23,"site_id":24,"html_lang":23,"table_of_contents":25,"faqs":26,"seo_title":27,"seo_description":14,"update_tm":28,"read_time":29},122171,7971461740886,"Theodore","https://ap-avatar.wpscdn.com/davatar_3d24733baf745e90a7e4bdd5f77d97b2",8,"Research & Report","Detecting Out-of-distribution Data through In-distribution Class Prior","Given a pre-trained in-distribution (ID) model, inference-time out-of-distribution (OOD) detection seeks to flag OOD inputs during deployment. Many existing approaches rely on an unsupported uniformity assumption that the probabilities over ID classes for an OOD sample follow a uniform distribution. This paper shows that the assumption breaks down when the ID model is trained with class-imbalanced data. By examining causal links between classes and features, it identifies scenarios where OOD-to-ID probabilities should match the ID-class prior and introduces two score-adjustment strategies. Experiments demonstrate improved OOD performance under imbalanced pretraining, highlighting the central role of ID-class prior.","Detecting Out-of-distribution Data through In-distribution Class Prior  \nXue Jiang 1 2 Feng Liu 3 Zhen Fang 4 Hong Chen 5 Tongliang Liu 6 7 Feng Zheng 1 Bo Han 2  \nAbstract  \nGiven a pre-trained in-distribution (ID) model, the inference-time out-of-distribution (OOD) detection aims to recognize OOD data during the inference stage. However, some representative methods share an unproven assumption that the probability that OOD data belong to every ID class should be the same, i.e., these OOD-toID probabilities actually form a uniform distribution. In this paper, we show that this assumption makes the above methods incapable when the ID model is trained with class-imbalanced data. Fortunately, by analyzing the causal relations between ID/OOD classes and features, we identify several common scenarios where the OOD-to-ID probabilities should be the ID-classprior distribution and propose two strategies to modify existing inference-time detection methods: 1) replace the uniform distribution with the ID-class-prior distribution if they explicitly use the uniform distribution; 2) otherwise, reweight their scores according to the similarity between the ID-class-prior distribution and the softmax outputs of the pre-trained model. Extensive experiments show that both strategies can improve the OOD detection performance when the ID model is pre-trained with imbalanced data, reflecting the importance of ID-class prior in OOD detection. The codes are available at [https://github](https://github) . com/tmlr-group/class_prior.  \n1Department of Computer Science and Engineering, Southern University of Science and Technology 2Department of Computer Science, Hong Kong Baptist University 3University of Melbourne 4Australian Artificial Intelligence Institute, University of Technology Sydney 5College of Informatics, Huazhong Agricultural University 6Mohamed bin Zayed University of Artificial Intelligence 7 Sydney AI Centre, The University of Sydney. Correspondence to: Feng Zheng \u003C[f.zheng@ieee.org](f.zheng@ieee.org)>.  \nProceedings of the 40 th International Conference on Machine Learning, Honolulu, Hawaii, USA. PMLR 202, 2023 . Copyright 2023 by the author(s) .  \n1. Introduction  \nHow to reliably deploy machine learning models into realworld scenarios has been attracting more and more attention (Huang et al., 2021 ; Liang et al., 2018 ; Liu et al., 2020) . In real-world scenarios, test data usually contain known and unknown classes (Hendrycks & Gimpel, 2017) . We expect the deployed model to eliminate the interference of unknown classes while classifying known classes well. Nevertheless, current models tend to be overconfident in the unknown classes (Nguyen et al., 2015), and thus confusing known and unknown classes, which increases the risk of deploying these models in the real world. Especially, if the scenarios are life-critical (e.g., car-driving scenarios), we cannot take the risks of deploying unreliable models in them. This motivates researchers to study out-of-distribution (OOD) detection, where we need to identify unknown classes (i.e., OOD classes) and classify known classes (i.e., in-distribution (ID) classes) well at the same time (Hendrycks & Gimpel, 2017) .  \nIn the OOD detection, a well-known branch is to develop the inference-time/post hoc OOD detection methods (Huang et al., 2021 ; Liang et al., 2018 ; Liu et al., 2020 ; Lee et al., 2018a ; Sun et al., 2021), where we are given a pre-trained ID model and then aim to recognize upcoming OOD data well. The key advantage of inference-time OOD detection methods is that the classification performance on ID data will be unaffected since we only use the ID model instead of changing it. A general strategy to design a large-scalefriendly inference-time OOD detection method is to propose a socre function by using the ID model’s information. For example, the maximum softmax probability (MSP) uses the ID model’s outputs (Hendrycks & Gimpel, 2017), and GradNorm uses the ID model’s gradients (Huan","cbCaipDwxuI82Kys","https://ap.wps.com/l/cbCaipDwxuI82Kys","pdf",1008038,1,22,"English","en",105,"# Introduction\n## Inference-time OOD detection\n## Class imbalance and its impact\n## Uniform vs. ID-class-prior assumptions\n# Causal analysis of ID/OOD relationships\n## Common causal graphs for OOD detection","[{\"question\":\"What is the main goal of inference-time OOD detection in this paper?\",\"answer\":\"To identify out-of-distribution data during the inference stage using a pre-trained in-distribution model, without modifying the model itself.\"},{\"question\":\"Why do some existing OOD detection methods fail on class-imbalanced training data?\",\"answer\":\"They assume that an OOD sample’s probabilities over all ID classes follow a uniform distribution, which becomes invalid when the ID model is trained with class imbalance.\"},{\"question\":\"How does the paper address the mismatch between uniform probabilities and real behavior?\",\"answer\":\"It analyzes causal relations and proposes two strategies: replace the uniform distribution with the ID-class-prior distribution when methods explicitly assume uniformity, or reweight scores based on similarity between the ID-class prior and the model’s softmax outputs otherwise.\"}]","Detecting Out-of-distribution Data through In-distribution Class Prior | PDF",1785809174,55,{"code":4,"msg":31,"data":32},"ok",{"site_id":24,"language":23,"slug":33,"title":13,"keywords":34,"description":14,"schema_data":35,"social_meta":87,"head_meta":89,"extra_data":91,"updated_unix":28},"detecting-out-of-distribution-data-through-in-distribution-class-prior","",{"@graph":36,"@context":86},[37,54,69],{"@type":38,"itemListElement":39},"BreadcrumbList",[40,44,48,51],{"item":41,"name":42,"@type":43,"position":20},"https://docshare.wps.com","Home","ListItem",{"item":45,"name":46,"@type":43,"position":47},"https://docshare.wps.com/document/","Document",2,{"item":49,"name":12,"@type":43,"position":50},"https://docshare.wps.com/document/research-report/",3,{"item":52,"name":13,"@type":43,"position":53},"https://docshare.wps.com/document/detecting-out-of-distribution-data-through-in-distribution-class-prior/122171/",4,{"url":52,"name":13,"@type":55,"author":56,"headline":13,"publisher":58,"fileFormat":61,"inLanguage":23,"description":14,"dateModified":62,"datePublished":63,"encodingFormat":61,"isAccessibleForFree":64,"interactionStatistic":65},"DigitalDocument",{"name":9,"@type":57},"Person",{"url":41,"name":59,"@type":60},"DocShare","Organization","application/pdf","2026-08-05","2026-08-04",true,{"@type":66,"interactionType":67,"userInteractionCount":20},"InteractionCounter",{"@type":68},"ViewAction",{"@type":70,"mainEntity":71},"FAQPage",[72,78,82],{"name":73,"@type":74,"acceptedAnswer":75},"What is the main goal of inference-time OOD detection in this paper?","Question",{"text":76,"@type":77},"To identify out-of-distribution data during the inference stage using a pre-trained in-distribution model, without modifying the model itself.","Answer",{"name":79,"@type":74,"acceptedAnswer":80},"Why do some existing OOD detection methods fail on class-imbalanced training data?",{"text":81,"@type":77},"They assume that an OOD sample’s probabilities over all ID classes follow a uniform distribution, which becomes invalid when the ID model is trained with class imbalance.",{"name":83,"@type":74,"acceptedAnswer":84},"How does the paper address the mismatch between uniform probabilities and real behavior?",{"text":85,"@type":77},"It analyzes causal relations and proposes two strategies: replace the uniform distribution with the ID-class-prior distribution when methods explicitly assume uniformity, or reweight scores based on similarity between the ID-class prior and the model’s softmax outputs otherwise.","https://schema.org",{"og:url":52,"og:type":88,"og:title":13,"og:site_name":59,"og:description":14},"article",{"robots":90,"canonical":52},"index,follow",{"doc_id":7,"site_id":24},{"code":4,"msg":5,"data":93},[94,98,102,106,111,116,121,124,129,132,136],{"id":20,"doc_module":4,"doc_module_name":46,"category_name":95,"show_sort_weight":96,"slug":97},"Story & Novel",90,"story-novel",{"id":47,"doc_module":4,"doc_module_name":46,"category_name":99,"show_sort_weight":100,"slug":101},"Literature",80,"literature",{"id":53,"doc_module":4,"doc_module_name":46,"category_name":103,"show_sort_weight":104,"slug":105},"Exam",70,"exam",{"id":107,"doc_module":4,"doc_module_name":46,"category_name":108,"show_sort_weight":109,"slug":110},5,"Comic",60,"comic",{"id":112,"doc_module":4,"doc_module_name":46,"category_name":113,"show_sort_weight":114,"slug":115},6,"Technology",50,"technology",{"id":117,"doc_module":4,"doc_module_name":46,"category_name":118,"show_sort_weight":119,"slug":120},7,"Healthcare",40,"healthcare",{"id":11,"doc_module":4,"doc_module_name":46,"category_name":12,"show_sort_weight":122,"slug":123},30,"research-report",{"id":125,"doc_module":4,"doc_module_name":46,"category_name":126,"show_sort_weight":127,"slug":128},9,"Religion & Spirituality",20,"religion-spirituality",{"id":127,"doc_module":4,"doc_module_name":46,"category_name":130,"show_sort_weight":127,"slug":131},"World Cup","world-cup",{"id":133,"doc_module":4,"doc_module_name":46,"category_name":134,"show_sort_weight":133,"slug":135},10,"Lifestyle","lifestyle",{"id":137,"doc_module":4,"doc_module_name":46,"category_name":138,"show_sort_weight":107,"slug":139},19,"General","general"]