{"id":14065763,"url":"https://github.com/microsoft/hi-ml","last_synced_at":"2025-08-18T17:03:47.720Z","repository":{"id":37086718,"uuid":"382004101","full_name":"microsoft/hi-ml","owner":"microsoft","description":"HI-ML toolbox for deep learning for medical imaging and Azure integration","archived":false,"fork":false,"pushed_at":"2025-07-07T20:37:17.000Z","size":30863,"stargazers_count":293,"open_issues_count":114,"forks_count":59,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-07-26T18:46:34.589Z","etag":null,"topics":["ai","azure","azureml","deep-learning","health","healthcare","machine-learning","ml","mlops","python"],"latest_commit_sha":null,"homepage":"https://aka.ms/hi-ml","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/microsoft.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-07-01T11:03:52.000Z","updated_at":"2025-07-21T08:55:49.000Z","dependencies_parsed_at":"2024-01-01T23:23:37.100Z","dependency_job_id":"e5fda9a5-4c75-4d1c-8896-6ea51932797e","html_url":"https://github.com/microsoft/hi-ml","commit_stats":{"total_commits":495,"total_committers":23,"mean_commits":21.52173913043478,"dds":0.7535353535353535,"last_synced_commit":"97b9bae3d192218a4d1de209dc1f714f88822ad7"},"previous_names":[],"tags_count":49,"template":false,"template_full_name":null,"purl":"pkg:github/microsoft/hi-ml","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Fhi-ml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Fhi-ml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Fhi-ml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Fhi-ml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/microsoft","download_url":"https://codeload.github.com/microsoft/hi-ml/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Fhi-ml/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267763739,"owners_count":24140825,"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-07-29T02:00:12.549Z","response_time":2574,"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":["ai","azure","azureml","deep-learning","health","healthcare","machine-learning","ml","mlops","python"],"created_at":"2024-08-13T07:04:42.577Z","updated_at":"2025-07-29T21:33:16.319Z","avatar_url":"https://github.com/microsoft.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# Microsoft Health Intelligence Machine Learning Toolbox\n\n[![Codecov coverage](https://codecov.io/gh/microsoft/hi-ml/branch/main/graph/badge.svg?token=kMr2pSIJ2U)](https://codecov.io/gh/microsoft/hi-ml) [![Code style: black](https://camo.githubusercontent.com/d91ed7ac7abbd5a6102cbe988dd8e9ac21bde0a73d97be7603b891ad08ce3479/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f64652532307374796c652d626c61636b2d3030303030302e737667)](https://github.com/psf/black)\n\n## Overview\n\nThis toolbox aims at providing low-level and high-level building blocks for Machine Learning / AI researchers and\npractitioners. It helps to simplify and streamline work on deep learning models for healthcare and life sciences,\nby providing tested components (data loaders, pre-processing), deep learning models, and cloud integration tools.\n\nThis repository consists of two Python packages, as well as project-specific codebases:\n\n* PyPi package [hi-ml-azure](https://pypi.org/project/hi-ml-azure/) - providing helper functions for running in AzureML.\n* PyPi package [hi-ml](https://pypi.org/project/hi-ml/) - providing ML components.\n* hi-ml-cpath: Models and workflows for working with histopathology images\n\n## Getting started\n\nFor the full toolbox (this will also install `hi-ml-azure`):\n\n* Install from `pypi` via `pip`, by running `pip install hi-ml`\n\nFor just the AzureML helper functions:\n\n* Install from `pypi` via `pip`, by running `pip install hi-ml-azure`\n\nFor the histopathology workflows, please follow the instructions [here](hi-ml-cpath/README.md).\n\nIf you would like to contribute to the code, please check the [developer guide](docs/source/developers.md).\n\n## Documentation\n\nThe detailed package documentation, with examples and API reference, is on\n[readthedocs](https://hi-ml.readthedocs.io/en/latest/).\n\n## Quick start: Using the Azure layer\n\nUse case: you have a Python script that does something - that could be training a model, or pre-processing some data.\nThe `hi-ml-azure` package can help easily run that on Azure Machine Learning (AML) services.\n\nHere is an example script that reads images from a folder, resizes and saves them to an output folder:\n\n```python\nfrom pathlib import Path\nif __name__ == '__main__':\n    input_folder = Path(\"/tmp/my_dataset\")\n    output_folder = Path(\"/tmp/my_output\")\n    for file in input_folder.glob(\"*.jpg\"):\n        contents = read_image(file)\n        resized = contents.resize(0.5)\n        write_image(output_folder / file.name)\n```\n\nDoing that at scale can take a long time. **We'd like to run that script in AzureML, consume the data from a folder in\nblob storage, and write the results back to blob storage**.\n\nWith the `hi-ml-azure` package, you can turn that script into one that runs on the cloud by adding one function call:\n\n```python\nfrom pathlib import Path\nfrom health_azure import submit_to_azure_if_needed\nif __name__ == '__main__':\n    current_file = Path(__file__)\n    run_info = submit_to_azure_if_needed(compute_cluster_name=\"preprocess-ds12\",\n                                         input_datasets=[\"images123\"],\n                                         # Omit this line if you don't create an output dataset (for example, in\n                                         # model training scripts)\n                                         output_datasets=[\"images123_resized\"],\n                                         default_datastore=\"my_datastore\")\n    # When running in AzureML, run_info.input_datasets and run_info.output_datasets will be populated,\n    # and point to the data coming from blob storage. For runs outside AML, the paths will be None.\n    # Replace the None with a meaningful path, so that we can still run the script easily outside AML.\n    input_dataset = run_info.input_datasets[0] or Path(\"/tmp/my_dataset\")\n    output_dataset = run_info.output_datasets[0] or Path(\"/tmp/my_output\")\n    files_processed = []\n    for file in input_dataset.glob(\"*.jpg\"):\n        contents = read_image(file)\n        resized = contents.resize(0.5)\n        write_image(output_dataset / file.name)\n        files_processed.append(file.name)\n    # Any other files that you would not consider an \"output dataset\", like metrics, etc, should be written to\n    # a folder \"./outputs\". Any files written into that folder will later be visible in the AzureML UI.\n    # run_info.output_folder already points to the correct folder.\n    stats_file = run_info.output_folder / \"processed_files.txt\"\n    stats_file.write_text(\"\\n\".join(files_processed))\n```\n\nOnce these changes are in place, you can submit the script to AzureML by supplying an additional `--azureml` flag\non the commandline, like `python myscript.py --azureml`.\n\nThat's it!\n\nFor details, please refer to the [onboarding page](docs/source/first_steps.md).\n\nFor more examples, please see [examples.md](docs/source/examples.md).\n\n## Issues\n\nIf you've found a bug in the code, please check the [issues](https://github.com/microsoft/hi-ml/issues) page.\nIf no existing issue exists, please open a new one. Be sure to include\n\n* A descriptive title\n* Expected behaviour (including a code sample if possible)\n* Actual behavior\n\n## Contributing\n\nWe welcome all contributions that help us achieve our aim of speeding up ML/AI research in health and life sciences.\nExamples of contributions are\n\n* Data loaders for specific health \u0026 life sciences data\n* Network architectures and components for deep learning models\n* Tools to analyze and/or visualize data\n* ...\n\nPlease check the [detailed page about contributions](.github/CONTRIBUTING.md).\n\n## Licensing\n\n[MIT License](LICENSE)\n\n**You are responsible for the performance, the necessary testing, and if needed any regulatory clearance for\n any of the models produced by this toolbox.**\n\n## Contact\n\nIf you have any feature requests, or find issues in the code, please create an\n[issue on GitHub](https://github.com/microsoft/hi-ml/issues).\n\n## Contribution Licensing\n\nThis project welcomes contributions and suggestions.  Most contributions require you to agree to a\nContributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us\nthe rights to use your contribution. For details, visit \u003chttps://cla.opensource.microsoft.com\u003e.\n\nWhen you submit a pull request, a CLA bot will automatically determine whether you need to provide\na CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions\nprovided by the bot. You will only need to do this once across all repos using our CLA.\n\nThis project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).\nFor more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or\ncontact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.\n\n## Trademarks\n\nThis project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft\ntrademarks or logos is subject to and must follow\n[Microsoft's Trademark \u0026 Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general).\nUse of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship.\nAny use of third-party trademarks or logos are subject to those third-party's policies.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrosoft%2Fhi-ml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmicrosoft%2Fhi-ml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrosoft%2Fhi-ml/lists"}