{"id":21444230,"url":"https://github.com/ahmedbesbes/mrnet","last_synced_at":"2025-07-14T18:31:19.553Z","repository":{"id":43283176,"uuid":"181914920","full_name":"ahmedbesbes/mrnet","owner":"ahmedbesbes","description":"Building an ACL tear detector to spot knee injuries from MRIs with PyTorch (MRNet)","archived":false,"fork":false,"pushed_at":"2021-04-15T18:30:26.000Z","size":80100,"stargazers_count":119,"open_issues_count":5,"forks_count":39,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-05-08T00:26:05.937Z","etag":null,"topics":["acl","cnn","computer-vision","convolutional-neural-networks","data-augmentation","deep-learning","knee-injuries","medical-imaging","mri-applications","mri-exams","mri-images","mrnet","paper-implementations","pytorch","pytorch-tutorial","sagittal-plane","stanford","stanford-ml-group","tears","transfer-learning"],"latest_commit_sha":null,"homepage":"https://ahmedbesbes.com","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/ahmedbesbes.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":"2019-04-17T15:02:41.000Z","updated_at":"2024-05-01T12:46:39.000Z","dependencies_parsed_at":"2022-08-30T17:01:03.599Z","dependency_job_id":null,"html_url":"https://github.com/ahmedbesbes/mrnet","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmedbesbes%2Fmrnet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmedbesbes%2Fmrnet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmedbesbes%2Fmrnet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmedbesbes%2Fmrnet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ahmedbesbes","download_url":"https://codeload.github.com/ahmedbesbes/mrnet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225990427,"owners_count":17556155,"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","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":["acl","cnn","computer-vision","convolutional-neural-networks","data-augmentation","deep-learning","knee-injuries","medical-imaging","mri-applications","mri-exams","mri-images","mrnet","paper-implementations","pytorch","pytorch-tutorial","sagittal-plane","stanford","stanford-ml-group","tears","transfer-learning"],"created_at":"2024-11-23T02:16:44.628Z","updated_at":"2024-11-23T02:16:45.170Z","avatar_url":"https://github.com/ahmedbesbes.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![MIT](https://img.shields.io/badge/license-MIT-5eba00.svg)](https://github.com/ahmedbesbes/character-based-cnn/blob/master/LICENSE)\n[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/ahmedbesbes/mrnet)\n[![Twitter](https://img.shields.io/twitter/follow/ahmed_besbes_.svg?label=Follow\u0026style=social)](https://twitter.com/ahmed_besbes_)\n[![Stars](https://img.shields.io/github/stars/ahmedbesbes/character-based-cnn.svg?style=social)](https://github.com/ahmedbesbes/mrnet/stargazers)\n\n\n# Deep learning in medical imaging: How to automate the detection of knee injuries in MRI exams ? \n\nThis repository contains an implementation of a convolutional neural network that classifies specific knee injuries from MRI exams.\n\nIt also contains the matieral of a series of posts I wrote on \u003ca href=\"http://ahmedbesbes.com\"\u003e my blog\u003c/a\u003e.\n\n## Dataset: MRNet \n\nThe data comes from Stanford ML Group research lab. It consits of 1,370 knee MRI exams performed at Stanford University Medical Center to study the presence of Anterior Cruciate Ligament (ACL) tears.\n\nFor more information about the ACL tear problem and the MRNet data please refer to my blog post where you can investigate the data and build the following data visualization in jupyter notebook:\n\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"./images/mri.gif\"\u003e\n\u003c/p\u003e\n\nTo learn more about the data and how to realize this visualization widget, read \u003ca href=\"https://ahmedbesbes.com/automate-the-diagnosis-of-knee-injuries-with-deep-learning-part-1-an-overview-of-the-mrnet-dataset.html\"\u003emy first post.\u003c/a\u003e\n\n## Code structure:\n\nThis charts summarizes the architecture of the project:\n\n\u003cimg src=\"./images/pipeline.png\"\u003e\n\nFor more details about the code, please refer to my second \u003ca href=\"https://ahmedbesbes.com/automate-the-diagnosis-of-knee-injuries-with-deep-learning-part-2-building-an-acl-tear-classifier.html\"\u003eblog post \u003c/a\u003e.\n\n## How to use the code:\n\nIf you want to retrain the network on your own you have to ask for the data from Stanford via this \u003ca href=\"https://stanfordmlgroup.github.io/competitions/mrnet/\"\u003elink\u003c/a\u003e.\n\nOnce you download the data, create a `data` folder and place it at the root of the project. You should have two folders inside: `train` and `valid` as well as a bunch of csv files.\n\nTo run the script you can execute it with the following arguments:\n\n```python\nparser = argparse.ArgumentParser()\nparser.add_argument('-t', '--task', type=str, required=True,\n                    choices=['abnormal', 'acl', 'meniscus'])\nparser.add_argument('-p', '--plane', type=str, required=True,\n                    choices=['sagittal', 'coronal', 'axial'])\nparser.add_argument('--augment', type=int, choices=[0, 1], default=1)\nparser.add_argument('--lr_scheduler', type=int, choices=[0, 1], default=1)\nparser.add_argument('--epochs', type=int, default=50)\nparser.add_argument('--lr', type=float, default=1e-5)\nparser.add_argument('--flush_history', type=int, choices=[0, 1], default=0)\nparser.add_argument('--save_model', type=int, choices=[0, 1], default=1)\nparser.add_argument('--patience', type=int, choices=[0, 1], default=5)\n```\n\nexample to train a model to detect acl tears on the sagittal plane for a 20 epochs:\n\n`python -t acl -p sagittal --epochs=20`\n\nNote: Before running the script, add the following (empty) folders at the root of the project:\n- models\n- logs\n\n\n## Results:\n\nI trained an ACL tear classifier on a sagittal plane and got the following AUC scores:\n\n- on train: 0.8669\n- on validation: 0.8850\n\nLogs on Tensorboard:\n\n\u003cimg src=\"./images/sagittal_tensorboard.png\"\u003e\n\n\n## Contributions - PR are welcome:\n\nIf you feel that some functionalities or improvements could be added to the project, don't hesitate to submit a pull request.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahmedbesbes%2Fmrnet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fahmedbesbes%2Fmrnet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahmedbesbes%2Fmrnet/lists"}