[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"doc-seo-290907-105":3,"detail-sidebar-cat-0-en-105":81,"doc-detail-290907-en":130},{"code":4,"msg":5,"data":6},0,"ok",{"site_id":7,"language":8,"slug":9,"title":10,"keywords":11,"description":12,"schema_data":13,"social_meta":74,"head_meta":76,"extra_data":78,"updated_unix":80},105,"en","interpreting-machine-learning-models-using-conditional-counterfactual-generation-masters-thesis-2026","Interpreting Machine Learning Models using Conditional Counterfactual Generation - Master’s thesis 2026","","With the rapid development and application of complex machine learning models, interpretability of internal processes has become increasingly relevant. This thesis proposes a conditional counterfactual interpretation method using an autoencoder to reconstruct data and visualize learned patterns. The approach is validated on a constructed normal-distribution regression task, then tested on disease classification in chest X-ray images from the CheXpert dataset. Naive implementation produces adversarial reconstructions that mislead the model, so the thesis introduces an additional latent-space model to improve interpretability, suggesting potential for practical use with further research.",{"@graph":14,"@context":73},[15,34,56],{"@type":16,"itemListElement":17},"BreadcrumbList",[18,23,27,31],{"item":19,"name":20,"@type":21,"position":22},"https://docshare.wps.com","Home","ListItem",1,{"item":24,"name":25,"@type":21,"position":26},"https://docshare.wps.com/document/","Document",2,{"item":28,"name":29,"@type":21,"position":30},"https://docshare.wps.com/document/research-report/","Research & Report",3,{"item":32,"name":10,"@type":21,"position":33},"https://docshare.wps.com/document/interpreting-machine-learning-models-using-conditional-counterfactual-generation-masters-thesis-2026/290907/",4,{"url":32,"name":10,"@type":35,"image":36,"author":41,"headline":10,"publisher":44,"fileFormat":47,"inLanguage":8,"description":12,"dateModified":48,"datePublished":49,"encodingFormat":47,"isAccessibleForFree":50,"interactionStatistic":51},"DigitalDocument",{"url":37,"@type":38,"width":39,"height":40},"https://docshare.wps.com/thumbnails/interpreting-machine-learning-models-using-conditional-counterfactual-generation-masters-thesis-2026/290907.png","ImageObject",300,407,{"name":42,"@type":43},"Skyler","Person",{"url":19,"name":45,"@type":46},"DocShare","Organization","application/pdf","2026-10-29","2026-09-17",true,{"@type":52,"interactionType":53,"userInteractionCount":55},"InteractionCounter",{"@type":54},"ViewAction",10,{"@type":57,"mainEntity":58},"FAQPage",[59,65,69],{"name":60,"@type":61,"acceptedAnswer":62},"What problem does the thesis address in machine learning interpretability?","Question",{"text":63,"@type":64},"It targets the need to interpret complex black-box machine learning models by explaining internal patterns the models have learned.","Answer",{"name":66,"@type":61,"acceptedAnswer":67},"How does the proposed method interpret the models?",{"text":68,"@type":64},"It uses a (conditional) autoencoder to generate reconstructions intended to provide an interpretable visualization of learned patterns through conditional counterfactual generation.",{"name":70,"@type":61,"acceptedAnswer":71},"Why was a naive implementation insufficient for the disease-classification task?",{"text":72,"@type":64},"Naively applying the method made the autoencoder generate adversarial patterns that trick the disease classifier instead of yielding interpretable explanations.","https://schema.org",{"og:url":32,"og:type":75,"og:title":10,"og:site_name":45,"og:description":12},"article",{"robots":77,"canonical":32},"index,follow",{"doc_id":79,"site_id":7},290907,1789642934,{"code":4,"msg":82,"data":83},"success",[84,88,92,96,101,106,111,115,120,123,126],{"id":22,"doc_module":4,"doc_module_name":25,"category_name":85,"show_sort_weight":86,"slug":87},"Story & Novel",90,"story-novel",{"id":26,"doc_module":4,"doc_module_name":25,"category_name":89,"show_sort_weight":90,"slug":91},"Literature",80,"literature",{"id":33,"doc_module":4,"doc_module_name":25,"category_name":93,"show_sort_weight":94,"slug":95},"Exam",70,"exam",{"id":97,"doc_module":4,"doc_module_name":25,"category_name":98,"show_sort_weight":99,"slug":100},5,"Comic",60,"comic",{"id":102,"doc_module":4,"doc_module_name":25,"category_name":103,"show_sort_weight":104,"slug":105},6,"Technology",50,"technology",{"id":107,"doc_module":4,"doc_module_name":25,"category_name":108,"show_sort_weight":109,"slug":110},7,"Healthcare",40,"healthcare",{"id":112,"doc_module":4,"doc_module_name":25,"category_name":29,"show_sort_weight":113,"slug":114},8,30,"research-report",{"id":116,"doc_module":4,"doc_module_name":25,"category_name":117,"show_sort_weight":118,"slug":119},9,"Religion & Spirituality",20,"religion-spirituality",{"id":118,"doc_module":4,"doc_module_name":25,"category_name":121,"show_sort_weight":118,"slug":122},"World Cup","world-cup",{"id":55,"doc_module":4,"doc_module_name":25,"category_name":124,"show_sort_weight":55,"slug":125},"Lifestyle","lifestyle",{"id":127,"doc_module":4,"doc_module_name":25,"category_name":128,"show_sort_weight":97,"slug":129},19,"General","general",{"code":4,"msg":82,"data":131},{"doc_id":79,"user_id":132,"nickname":42,"user_avatar":133,"doc_module":4,"category_id":112,"category_name":29,"doc_title":10,"doc_description":12,"doc_content":134,"file_id":135,"file_url":136,"file_type":137,"file_size":138,"view_count":55,"is_deleted":4,"is_public":22,"is_downloadable":22,"audit_status":22,"page_count":139,"language":140,"language_code":8,"site_id":7,"html_lang":8,"table_of_contents":141,"faqs":142,"seo_title":143,"seo_description":12,"update_tm":80,"read_time":144,"preview_page_count":4},2336464648746,"https://ap-avatar.wpscdn.com/davatar_276721f389ce27ea32af1340a28f341c","Interpreting Machine Learning Models using Conditional Counterfactual Generation  \nMaster’s thesis in Engineering mathematics and computational science  \nSAMUEL MARTINSSON  \nDEPARTMENT OF PHYSICS AND ASTRONOMY  \nCHALMERS UNIVERSITY OF TECHNOLOGY Gothenburg, Sweden 2026  \n[www.chalmers.se](www.chalmers.se)  \nMaster’s thesis 2026  \nInterpreting Machine Learning Models using Conditional Counterfactual Generation  \nSAMUEL MARTINSSON  \nDepartment of Physics and Astronomy Chalmers University of Technology Gothenburg, Sweden 2026  \nInterpreting Machine Learning Models using Conditional Counterfactual Generation SAMUEL MARTINSSON  \n© SAMUEL MARTINSSON, 2026 .  \nSupervisor: Andreas Gillgren, Department of Physics and Astronomy  \nExaminer: Per Bjerkeli, Department of Physics and Astronomy  \nMaster’s Thesis 2026  \nDepartment of Physics and Astronomy Chalmers University of Technology SE-412 96 Gothenburg  \nTelephone +46 31 772 1000  \nCover: Reconstructions of chest X-ray images from a generative model conditioned on different values corresponding to the presence of the lung disease pleural effusion. See section 4.4.4 for further explanation of figure.  \nTypeset in LATEX  \nPrinted by Chalmers Reproservice Gothenburg, Sweden 2026  \nInterpreting Machine Learning Models using Conditional Counterfactual Generation  \nSAMUEL MARTINSSON Department of Physics and Astronomy Chalmers University of Technology  \nAbstract  \nWith the rapid development and application of complex machine learning models, the need to interpret the internal processes of such models have become increasingly relevant. In this thesis, a novel method for interpreting black box machine learning models is proposed, where an autoencoder is used to generate reconstructions of data to visualize in an interpretable way what patterns a model has learned to detect. The method is first shown to work for a simple constructed problem, being able to interpret a model that has learned to predict the mean of an underlying normal distribution from samples. It is then evaluated for a more complex problem, where a model has learned to classify the existence of disease in images from the CheXpert dataset of X-ray images. It is demonstrated that naively implementing the method to interpret this model leads to the autoencoder generating adversarial patterns to trick the model, instead of showing the an interpretable explanation of what the model has learned. To mitigate this issue, the thesis explores adding an additional model in the latent space of the conditional autoencoder and demonstrates that this can provide a certain degree of interpretability. Because of this, the method shows promise for interpreting black box models and with further research it might become viable for practical use.  \nKeywords: machine learning, interpretability, autoencoders, counterfactual, chest X-ray images.  \nAcknowledgements  \nI want to thank my supervisor Andreas Gillgren for providing the initial idea for the project and for all the support he has provided throughout the duration of this project. His expertise has been invaluable to this project and his supervision has really made this project into an educational experience. I want to thank my examiner Per Bjerkeli for his constructive feedback on the initial project proposal and for his support with the administration. I also want to thank Rachael Harkness for the insightful discussion meand Andreas had with her before the project started concerning her previous research and Andreas initial idea. Lastly, I also want to thank Michail Marios Skyllas for trying to help me with computational resources for the project, even though an alternative solution was chosen in the end.  \nSamuel Martinsson, Gothenburg, May 2026  \nDisclosure of use of generative AI  \nWhen programming, the models Claude Sonnet 4.6, Claude Sonnet 4.5 and Claude Haiku 4.5 from Anthropic have been used via web interface for debugging code or as a complement to python library documentation. The su","cbCaisxSBpqSaOaT","https://ap.wps.com/l/cbCaisxSBpqSaOaT","pdf",14499818,67,"English","# Abstract\n# Keywords\n# Acknowledgements\n# Disclosure of use of generative AI\n# List of Acronyms\n# Nomenclature","[{\"question\":\"What problem does the thesis address in machine learning interpretability?\",\"answer\":\"It targets the need to interpret complex black-box machine learning models by explaining internal patterns the models have learned.\"},{\"question\":\"How does the proposed method interpret the models?\",\"answer\":\"It uses a (conditional) autoencoder to generate reconstructions intended to provide an interpretable visualization of learned patterns through conditional counterfactual generation.\"},{\"question\":\"Why was a naive implementation insufficient for the disease-classification task?\",\"answer\":\"Naively applying the method made the autoencoder generate adversarial patterns that trick the disease classifier instead of yielding interpretable explanations.\"}]","Interpreting Machine Learning Models using Conditional Counterfactual Generation - Master’s thesis 2026 | PDF",169]