{"id":33176715,"url":"https://github.com/SelfExplainML/Aletheia","last_synced_at":"2026-01-25T00:01:07.330Z","repository":{"id":56296478,"uuid":"313004539","full_name":"SelfExplainML/Aletheia","owner":"SelfExplainML","description":"A Python package for unwrapping ReLU DNNs","archived":false,"fork":false,"pushed_at":"2024-01-19T11:18:13.000Z","size":72114,"stargazers_count":68,"open_issues_count":6,"forks_count":20,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-04-19T17:00:01.317Z","etag":null,"topics":["deep-neural-networks","explainable-ai","local-interpretation","local-linear-models","self-explanatory-ml"],"latest_commit_sha":null,"homepage":"","language":null,"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/SelfExplainML.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":"2020-11-15T10:15:48.000Z","updated_at":"2024-01-21T08:41:34.000Z","dependencies_parsed_at":"2022-08-15T16:10:40.017Z","dependency_job_id":null,"html_url":"https://github.com/SelfExplainML/Aletheia","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/SelfExplainML/Aletheia","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SelfExplainML%2FAletheia","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SelfExplainML%2FAletheia/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SelfExplainML%2FAletheia/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SelfExplainML%2FAletheia/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SelfExplainML","download_url":"https://codeload.github.com/SelfExplainML/Aletheia/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SelfExplainML%2FAletheia/sbom","scorecard":{"id":127432,"data":{"date":"2025-08-11","repo":{"name":"github.com/SelfExplainML/Aletheia","commit":"5c0ac9716f221cc7f8f9df802463af49c95ad8fb"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.6,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-16T04:20:14.456Z","repository_id":56296478,"created_at":"2025-08-16T04:20:14.456Z","updated_at":"2025-08-16T04:20:14.456Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28739318,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-24T22:12:27.248Z","status":"ssl_error","status_checked_at":"2026-01-24T22:12:10.529Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["deep-neural-networks","explainable-ai","local-interpretation","local-linear-models","self-explanatory-ml"],"created_at":"2025-11-16T03:00:21.738Z","updated_at":"2026-01-25T00:01:07.314Z","avatar_url":"https://github.com/SelfExplainML.png","language":null,"funding_links":[],"categories":["Technical Resources"],"sub_categories":["Open Source/Access Responsible AI Software Packages"],"readme":"# Aletheia \nA Python package for unwrapping ReLU Neural Networks\n\n## Installation \n\nThe following environments are required:\n\n- Python 3.6, 3.7, 3.8, 3.9 (Try Google Colab)\n- matplotlib\u003e=3.1.3\n- numpy\u003e=1.17\n- pandas\u003e=1.1.2\n- seaborn\u003e=0.9.0\n- scikit-learn\u003e=0.23.0\n- statsmodels\u003e=0.12.2\n\n```shell\npip install aletheia-dnn\n```\n\n## Usage\n\n**Load data** \n```python\nimport numpy as np \nimport pandas as pd \nimport matplotlib.pyplot as plt\nfrom sklearn.datasets import make_circles\nfrom sklearn.model_selection import train_test_split\n\nrandom_state = 0\n\nx, y = make_circles(n_samples=2000, noise=0.1, random_state=random_state)\ntrain_x, test_x, train_y, test_y = train_test_split(x, y, test_size=0.2, random_state=random_state)\n\nplt.figure(figsize=(10,8))\nscatter = plt.scatter(x[:, 0], x[:, 1], c=y)\nplt.legend(*scatter.legend_elements(), loc=\"upper right\")\nplt.show()\n```\n\n**Train a ReLU Net**\n```python\nfrom sklearn.neural_network import MLPClassifier\nmlp = MLPClassifier(hidden_layer_sizes=[40] * 4, max_iter=2000, early_stopping=True, \n                    n_iter_no_change=100, validation_fraction=0.2,\n                    solver='adam', activation=\"relu\", random_state=random_state, \n                    learning_rate_init=0.001)\nmlp.fit(train_x, train_y)\n```\n\n**UnwrapperClassifier**\n```python\nfrom aletheia import *\nclf = UnwrapperClassifier(mlp.coefs_, mlp.intercepts_)\nclf.fit(train_x, train_y)\nclf.summary()\n```\n\n![CoCircleSummary](https://github.com/SelfExplainML/Aletheia/blob/master/examples/results/CoCircle_SummaryTable.png)\n\nPartitioned regions\n```python \nclf.visualize2D_regions(figsize=(8, 8), meshsize=300, show_label=False)\n```\n![CoCircleRegions](https://github.com/SelfExplainML/Aletheia/blob/master/examples/results/CoCircle_Regions.png)\n\n**Simplification**\n```python \nfrom sklearn.metrics import make_scorer, roc_auc_score\nfrom sklearn.model_selection import GridSearchCV, PredefinedSplit\nfrom sklearn.linear_model import LogisticRegressionCV, LogisticRegression\n\ndatanum = train_x.shape[0]\nindices = np.arange(datanum)\nidx1, idx2 = train_test_split(indices, test_size=0.2, random_state=random_state)\nval_fold = np.ones((len(indices)))\nval_fold[idx1] = -1\n\ngrid = GridSearchCV(MergerClassifier(unwrapper=None, \n                                     weights=mlp.coefs_, \n                                     biases=mlp.intercepts_,\n                                     min_samples=30,\n                                     n_neighbors=np.round(clf.nllms * 0.01).astype(int),\n                                     refit_model=LogisticRegression()),\n                                     param_grid={\"n_clusters\": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20]},\n                                     scoring={\"auc\": make_scorer(roc_auc_score, needs_proba=True)},\n                                     cv=PredefinedSplit(val_fold), refit=\"auc\", n_jobs=10, error_score=np.nan)\ngrid.fit(train_x, train_y)\nclf_merge = grid.best_estimator_\nclf_merge.summary()\n```\n\u003cimg src=\"https://github.com/SelfExplainML/Aletheia/blob/master/examples/results/CoCircle_MergeSummaryTable.png\" width=\"480\"\u003e\n\n**Local Inference**\n```python \ntmpid = 0\nclf_merge.visualize2D_one_line(tmpid, figsize=(8, 8))\nclf_merge.local_inference_wald(tmpid).round(4)\n```\n\u003cimg src=\"https://github.com/SelfExplainML/Aletheia/blob/master/examples/results/CoCircle_Local.png\" width=\"480\"\u003e\n\u003cimg src=\"https://github.com/SelfExplainML/Aletheia/blob/master/examples/results/CoCircle_Inference.png\" width=\"480\"\u003e\n\n## Citations\nAgus Sudjianto, William Knauth, Rahul Singh, Zebin Yang and Aijun Zhang. 2020. Unwrapping The Black Box of Deep ReLU Networks: Interpretability, Diagnostics, and Simplification. [arXiv:2011.04041](https://arxiv.org/abs/2011.04041)\n\n```latex\n@article{sudjianto2020unwrapping,\n  title={Unwrapping The Black Box of Deep ReLU Networks: Interpretability, Diagnostics, and Simplification},\n  author={Sudjianto, Agus and Knauth, William and Singh, Rahul and Yang, Zebin and Zhang, Aijun},\n  journal={arXiv:2011.04041},\n  year={2020}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSelfExplainML%2FAletheia","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSelfExplainML%2FAletheia","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSelfExplainML%2FAletheia/lists"}