{"id":30294671,"url":"https://github.com/groshanlal/nn2rules","last_synced_at":"2025-08-17T01:36:40.256Z","repository":{"id":49854788,"uuid":"368402070","full_name":"groshanlal/NN2Rules","owner":"groshanlal","description":"Explain fully connected ReLU neural networks using rules","archived":false,"fork":false,"pushed_at":"2022-07-26T19:01:05.000Z","size":68,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2023-03-02T07:58:11.441Z","etag":null,"topics":["explainability","explainable-ai","fully-connected-deep-neural-network","interpretability","interpretable-ai","machine-learning","neural-networks","relu-activation","rule-learning"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/groshanlal.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-05-18T04:38:54.000Z","updated_at":"2023-02-23T17:42:57.000Z","dependencies_parsed_at":"2022-09-05T23:51:11.790Z","dependency_job_id":null,"html_url":"https://github.com/groshanlal/NN2Rules","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"purl":"pkg:github/groshanlal/NN2Rules","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/groshanlal%2FNN2Rules","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/groshanlal%2FNN2Rules/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/groshanlal%2FNN2Rules/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/groshanlal%2FNN2Rules/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/groshanlal","download_url":"https://codeload.github.com/groshanlal/NN2Rules/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/groshanlal%2FNN2Rules/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270796191,"owners_count":24647319,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-16T02:00:11.002Z","response_time":91,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["explainability","explainable-ai","fully-connected-deep-neural-network","interpretability","interpretable-ai","machine-learning","neural-networks","relu-activation","rule-learning"],"created_at":"2025-08-17T01:36:08.659Z","updated_at":"2025-08-17T01:36:40.230Z","avatar_url":"https://github.com/groshanlal.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NN2Rules\n\n## Introduction\nWe present an algorithm, NN2Rules, to convert a trained neural network into a rule list. Rule lists are more interpretable since they align better with the way humans make decisions. NN2Rules is a decompositional approach to rule extraction, i.e., it extracts a set of decision rules from the parameters of the trained neural network model. We show that the decision rules extracted have the same prediction as the neural network on any input presented to it, and hence the same accuracy. A key contribution of NN2Rules is that it allows hidden neuron behavior to be either soft-binary (eg. sigmoid activation) or rectified linear (ReLU) as opposed to existing decompositional approaches that were developed with the assumption of soft-binary activation. \n\nFor more detailed introduction of NN2Rules, please check out our paper.\n\n## Demo\n\nRun the follwing python scripts to decompose a simple neural network into rules:\n\nStep 1: Generate data:\n```\npython3 data_prep/data_prep_contraception.py\n```\nStep 2: Train a neural network model:\n```\npython3 train.py 3\n```\nStep 3: Explain the neural network using NN2Rules:\n```\npython3 explain.py\n```\n\n## Citation\nPlease cite [NN2Rules](https://arxiv.org/abs/2207.12271) in your publications if it helps your research:\n```\n@article{nn2rules2022,\n  title={NN2Rules: Extracting Rule List from Neural Networks},\n  author={Lal, G Roshan and Mithal, Varun},\n  journal={arXiv preprint arXiv:2207.12271},\n  year={2022}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgroshanlal%2Fnn2rules","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgroshanlal%2Fnn2rules","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgroshanlal%2Fnn2rules/lists"}