[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"doc-detail-119768-en":3,"doc-seo-119768-105":30,"detail-sidebar-cat-0-en-105":90},{"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},119768,549758146520,"Patrick","https://ap-avatar.wpscdn.com/avatar/80002397d8c0411e94?_k=1775819394049821470",8,"Research & Report","MLGuard - Defend Your Machine Learning Model! - Contracts, Validation Models and Runtime Enforcement","Machine Learning (ML) is applied in critical, highly regulated, high-stakes domains such as finance, medicine, and transportation, where model correctness directly affects safety and economic outcomes. Existing ML testing and monitoring improve reliability but cannot fully address pre/post uncertainty handling, probabilistic corrective actions, or continual verification during system operation. The paper introduces MLGuard as a contract-based framework: specifying pre/post conditions, invariants and altering behaviors; generating validation models estimating contract-violation probability; and wrapping models to enforce contracts and respond to violations, enabling ongoing safety monitoring for ML systems.","MLGuard: Defend Your Machine Learning Model!  \nSheng Wong Scott Barnett  \n[wongsh@deakin.edu.au](wongsh@deakin.edu.au)[ ](wongsh@deakin.edu.au)[scott.barnett@deakin.edu.au](scott.barnett@deakin.edu.au)[ ](scott.barnett@deakin.edu.au)Deakin University Melbourne, Victoria, Australia  \nJessica Rivera-Villicana  \n[jessica.rivera.villicana@rmit.edu.au](jessica.rivera.villicana@rmit.edu.au)[ ](jessica.rivera.villicana@rmit.edu.au)RMIT University Melbourne, Victoria, Australia  \nAnj Simmons Hala Abdelkader  \n[a.simmons@deakin.edu.au](a.simmons@deakin.edu.au)[ ](a.simmons@deakin.edu.au)[h.abdelkader@deakin.edu.au](h.abdelkader@deakin.edu.au)[ ](h.abdelkader@deakin.edu.au)Deakin University Melbourne, Victoria, Australia  \narXiv :2309 .0 1379v 1 [ cs . SE] 4 Sep 2023  \nJean-Guy Schneider  \n[Jean-Guy.Schneider@monash.edu](Jean-Guy.Schneider@monash.edu)[ ](Jean-Guy.Schneider@monash.edu)Monash University Clayton, Victoria, Australia  \nABSTRACT  \nMachine Learning (ML) is used in critical highly regulated and high-stakes fields such as finance, medicine, and transportation. The correctness of these ML applications is important for human safety and economic benefit. Progress has been made on improving ML testing and monitoring of ML. However, these approaches do not provide i) pre/post conditions to handle uncertainty, ii) defining corrective actions based on probabilistic outcomes, or iii) continual verification during system operation. In this paper, we propose MLGuard, a new approach to specify contracts for ML applications. Our approach consists of a) an ML contract specification defining pre/post conditions, invariants, and altering behaviours, b) generated validation models to determine the probability of contract violation, and c) an ML wrapper generator to enforce the contract and respond to violations. Our work is intended to provide the overarching framework required for building ML applications and monitoring their safety.  \nCCS CONCEPTS  \n• Software and its engineering → Software creation and management; • Computing methodologies → Machine learning.  \nKEYWORDS  \ndesign by contract, error handling, system validation, ML validation  \nACM Reference Format:  \nSheng Wong, Scott Barnett, Jessica Rivera-Villicana, Anj Simmons, Hala Abdelkader, Jean-Guy Schneider, and Rajesh Vasa. 2023. MLGuard: Defend Your Machine Learning Model!. In Proceedings of the 1st International Workshop on Dependability and Trustworthiness of Safety-Critical Systems with Machine Learned Components (SE4SafeML’23), December 4, 2023, San Francisco, CA, USA. ACM, New York, NY, USA, 4 pages. [https:](https:)//[doi.org/10.1145/3617574.3617859](doi.org/10.1145/3617574.3617859)  \nPermission to make digital or hard copies of part or all ofthis work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for third-party components of this work must be honored.  \nFor all other uses, contact the owner/author(s) . SE4SafeML’23, December 4, 2023, San Francisco, CA, USA © 2023 Copyright held by the owner/author(s) .  \nACM ISBN 979-8-4007-0379-9/23/12 .  \n[https://doi.org/10.1145/3617574.3617859](https://doi.org/10.1145/3617574.3617859)  \nRajesh Vasa [rajesh.vasa@deakin.edu.au](rajesh.vasa@deakin.edu.au)  \nDeakin University Melbourne, Victoria, Australia  \n1 INTRODUCTION  \nRobustness in business software where the domain is well understood is achieved through software testing, and adherence to best practices and processes. However, for Machine Learning (ML) systems this is insufficient. ML systems are dependent on data input streams that are non-stationary. As a result, ML is behaviour is underspecified [5] in the presence of subtle changes in the data (i.e. data shift [15]) . Data schema validation alone is insufficient as detecting violations of these conditions, e.g., out of distribution data [10], can only be d","cbCairM5AmlYamMj","https://ap.wps.com/l/cbCairM5AmlYamMj","pdf",488787,1,4,"English","en",105,"# Abstract\n# Introduction","[{\"question\":\"Why are traditional ML testing and monitoring insufficient for safety-critical use?\",\"answer\":\"They improve ML testing and monitoring but do not cover uncertainty-aware pre/post conditions, probabilistic corrective actions, or continual verification during system operation.\"},{\"question\":\"What are the core components of MLGuard?\",\"answer\":\"MLGuard includes an ML contract specification (pre/post conditions, invariants, altering behaviors), generated validation models to estimate contract-violation probability, and an ML wrapper generator that enforces contracts and responds to violations.\"},{\"question\":\"How does MLGuard support robustness under non-stationary data?\",\"answer\":\"It uses interface contracts that encapsulate modeling assumptions and treats uncertainty as a first-class element, enabling probabilistic detection of violations when runtime data shifts from offline assumptions.\"}]","MLGuard - Defend Your Machine Learning Model! - Contracts, Validation Models and Runtime Enforcement | PDF",1785726196,10,{"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":85,"head_meta":87,"extra_data":89,"updated_unix":28},"mlguard-defend-your-machine-learning-model-contracts-validation-models-and-runtime-enforcement","",{"@graph":36,"@context":84},[37,53,67],{"@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":21},"https://docshare.wps.com/document/mlguard-defend-your-machine-learning-model-contracts-validation-models-and-runtime-enforcement/119768/",{"url":52,"name":13,"@type":54,"author":55,"headline":13,"publisher":57,"fileFormat":60,"inLanguage":23,"description":14,"dateModified":61,"datePublished":61,"encodingFormat":60,"isAccessibleForFree":62,"interactionStatistic":63},"DigitalDocument",{"name":9,"@type":56},"Person",{"url":41,"name":58,"@type":59},"DocShare","Organization","application/pdf","2026-08-03",true,{"@type":64,"interactionType":65,"userInteractionCount":20},"InteractionCounter",{"@type":66},"ViewAction",{"@type":68,"mainEntity":69},"FAQPage",[70,76,80],{"name":71,"@type":72,"acceptedAnswer":73},"Why are traditional ML testing and monitoring insufficient for safety-critical use?","Question",{"text":74,"@type":75},"They improve ML testing and monitoring but do not cover uncertainty-aware pre/post conditions, probabilistic corrective actions, or continual verification during system operation.","Answer",{"name":77,"@type":72,"acceptedAnswer":78},"What are the core components of MLGuard?",{"text":79,"@type":75},"MLGuard includes an ML contract specification (pre/post conditions, invariants, altering behaviors), generated validation models to estimate contract-violation probability, and an ML wrapper generator that enforces contracts and responds to violations.",{"name":81,"@type":72,"acceptedAnswer":82},"How does MLGuard support robustness under non-stationary data?",{"text":83,"@type":75},"It uses interface contracts that encapsulate modeling assumptions and treats uncertainty as a first-class element, enabling probabilistic detection of violations when runtime data shifts from offline assumptions.","https://schema.org",{"og:url":52,"og:type":86,"og:title":13,"og:site_name":58,"og:description":14},"article",{"robots":88,"canonical":52},"index,follow",{"doc_id":7,"site_id":24},{"code":4,"msg":5,"data":91},[92,96,100,104,109,114,119,122,127,130,133],{"id":20,"doc_module":4,"doc_module_name":46,"category_name":93,"show_sort_weight":94,"slug":95},"Story & Novel",90,"story-novel",{"id":47,"doc_module":4,"doc_module_name":46,"category_name":97,"show_sort_weight":98,"slug":99},"Literature",80,"literature",{"id":21,"doc_module":4,"doc_module_name":46,"category_name":101,"show_sort_weight":102,"slug":103},"Exam",70,"exam",{"id":105,"doc_module":4,"doc_module_name":46,"category_name":106,"show_sort_weight":107,"slug":108},5,"Comic",60,"comic",{"id":110,"doc_module":4,"doc_module_name":46,"category_name":111,"show_sort_weight":112,"slug":113},6,"Technology",50,"technology",{"id":115,"doc_module":4,"doc_module_name":46,"category_name":116,"show_sort_weight":117,"slug":118},7,"Healthcare",40,"healthcare",{"id":11,"doc_module":4,"doc_module_name":46,"category_name":12,"show_sort_weight":120,"slug":121},30,"research-report",{"id":123,"doc_module":4,"doc_module_name":46,"category_name":124,"show_sort_weight":125,"slug":126},9,"Religion & Spirituality",20,"religion-spirituality",{"id":125,"doc_module":4,"doc_module_name":46,"category_name":128,"show_sort_weight":125,"slug":129},"World Cup","world-cup",{"id":29,"doc_module":4,"doc_module_name":46,"category_name":131,"show_sort_weight":29,"slug":132},"Lifestyle","lifestyle",{"id":134,"doc_module":4,"doc_module_name":46,"category_name":135,"show_sort_weight":105,"slug":136},19,"General","general"]