{"id":15158718,"url":"https://github.com/tensorflow/model-remediation","last_synced_at":"2025-09-30T08:31:47.425Z","repository":{"id":44680939,"uuid":"306709892","full_name":"tensorflow/model-remediation","owner":"tensorflow","description":"Model Remediation is a library that provides solutions for machine learning practitioners working to create and train models in a way that reduces or eliminates user harm resulting from underlying performance biases.","archived":true,"fork":false,"pushed_at":"2023-03-06T20:09:48.000Z","size":1509,"stargazers_count":42,"open_issues_count":7,"forks_count":20,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-09-17T01:11:00.545Z","etag":null,"topics":["machine-learning","tensorflow"],"latest_commit_sha":null,"homepage":"https://www.tensorflow.org/responsible_ai/model_remediation?hl=en","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tensorflow.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS"}},"created_at":"2020-10-23T17:56:58.000Z","updated_at":"2025-02-21T15:53:09.000Z","dependencies_parsed_at":"2024-01-07T18:29:45.774Z","dependency_job_id":null,"html_url":"https://github.com/tensorflow/model-remediation","commit_stats":{"total_commits":206,"total_committers":21,"mean_commits":9.80952380952381,"dds":0.616504854368932,"last_synced_commit":"98e1f9b47d6da43391a2fd2efa33e5e30e0231c9"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/tensorflow/model-remediation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tensorflow%2Fmodel-remediation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tensorflow%2Fmodel-remediation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tensorflow%2Fmodel-remediation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tensorflow%2Fmodel-remediation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tensorflow","download_url":"https://codeload.github.com/tensorflow/model-remediation/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tensorflow%2Fmodel-remediation/sbom","scorecard":{"id":873948,"data":{"date":"2025-08-11","repo":{"name":"github.com/tensorflow/model-remediation","commit":"98e1f9b47d6da43391a2fd2efa33e5e30e0231c9"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.3,"checks":[{"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":"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":"project is archived","details":["Warn: Repository is archived."],"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"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":"Code-Review","score":10,"reason":"all changesets reviewed","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":"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":"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":"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":"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":"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":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"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":"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":"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-24T05:14:15.380Z","repository_id":44680939,"created_at":"2025-08-24T05:14:15.380Z","updated_at":"2025-08-24T05:14:15.380Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276831436,"owners_count":25712336,"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-09-24T02:00:09.776Z","response_time":97,"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":["machine-learning","tensorflow"],"created_at":"2024-09-26T21:00:54.932Z","updated_at":"2025-09-30T08:31:46.974Z","avatar_url":"https://github.com/tensorflow.png","language":"Python","readme":"# TensorFlow Model Remediation\n\n\nTensorFlow Model Remediation is a library that provides solutions for machine\nlearning practitioners working to create and train models in a way that reduces\nor eliminates user harm resulting from underlying performance biases.\n\n[![PyPI version](https://badge.fury.io/py/tensorflow-model-remediation.svg)](https://badge.fury.io/py/tensorflow-model-remediation)\n\n[![Tutorial](https://img.shields.io/badge/doc-tutorial-blue.svg)](https://www.tensorflow.org/responsible_ai/model_remediation/min_diff/tutorials/min_diff_keras)\n\n[![Overview](https://img.shields.io/badge/doc-overview-blue.svg)](https://www.tensorflow.org/responsible_ai/model_remediation)\n\n## Installation\n\nYou can install the package from `pip`:\n\n```shell\n$ pip install tensorflow-model-remediation\n```\n\nNote: Make sure you are using TensorFlow 2.x.\n\n## Documentation\n\nThis library contains a collection of machine learning remediation techniques\nfor addressing potential bias in a model.\n\nCurrently TensorFlow Model Remediation contains the below techniques:\n\n*   MinDiff technique: Typically used to ensure that a model predicts the\n    preferred label equally well for all values of a sensitive attribute.\n    Helpful when trying to achieve [equality of\n    opportunity](https://developers.google.com/machine-learning/glossary/fairness#equality-of-opportunity).\n\n*   Counterfactual Logit Pairing technique: Typically used to ensure that a\n    model’s prediction does not change between “counterfactual pairs”, where the\n    sensitive attribute referenced in a feature is different. Helpful when\n    trying to achieve\n    [counterfactual fairness](https://developers.google.com/machine-learning/glossary/fairness#counterfactual-fairness).\n\nWe recommend starting with the\n[overview guide](https://www.tensorflow.org/responsible_ai/model_remediation) to\nget an idea of TensorFlow Model Remediation. Next try one of our interactive\nguides like the\n\n[MinDiff tutorial notebook](https://www.tensorflow.org/responsible_ai/model_remediation/min_diff/tutorials/min_diff_keras).\n\n[Counterfactual tutorial notebook](https://www.tensorflow.org/responsible_ai/model_remediation/counterfactual/guide/counterfactual_keras).\n\n\n```python\n\nimport tensorflow_model_remediation as tfmr\n\nimport tensorflow as tf\n\n# Start by defining a Keras model.\n\noriginal_model = ...\n\n# Next pick the remediation technique you'd like to use. For example, a\n# MinDiff implementation might look like the below:\n# Set the MinDiff weight and choose a loss.\n\nmin_diff_loss = tfmr.min_diff.losses.MMDLoss()\n\nmin_diff_weight = 1.0  # Hyperparamater to be tuned.\n\n# Create a MinDiff model.\n\nmin_diff_model = tfmr.min_diff.keras.MinDiffModel(\n\n   original_model, min_diff_loss, min_diff_weight)\n\n# Compile the MinDiff model as you normally would do with the original model.\n\nmin_diff_model.compile(...)\n\n# Create a MinDiff Dataset and train the min_diff_model on it.\n\nmin_diff_model.fit(min_diff_dataset, ...)\n\n```\n\n#### *Disclaimers*\n\n*If you're interested in learning more about responsible AI practices, including*\n\n*fairness, please see Google AI's [Responsible AI Practices](https://ai.google/education/responsible-ai-practices).*\n\n*`tensorflow/model_remediation` is Apache 2.0 licensed. See the\n[`LICENSE`](LICENSE) file.*\n","funding_links":[],"categories":["Technical Resources"],"sub_categories":["Open Source/Access Responsible AI Software Packages"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftensorflow%2Fmodel-remediation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftensorflow%2Fmodel-remediation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftensorflow%2Fmodel-remediation/lists"}