{"id":13718790,"url":"https://github.com/zhixuhao/unet","last_synced_at":"2025-05-14T14:08:03.156Z","repository":{"id":37359364,"uuid":"87374781","full_name":"zhixuhao/unet","owner":"zhixuhao","description":"unet for image segmentation","archived":false,"fork":false,"pushed_at":"2024-04-10T02:30:43.000Z","size":45993,"stargazers_count":4713,"open_issues_count":211,"forks_count":2007,"subscribers_count":101,"default_branch":"master","last_synced_at":"2025-04-11T06:14:00.576Z","etag":null,"topics":["keras","segmentation","unet"],"latest_commit_sha":null,"homepage":null,"language":"Jupyter Notebook","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/zhixuhao.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-04-06T01:58:15.000Z","updated_at":"2025-04-09T17:06:57.000Z","dependencies_parsed_at":"2022-07-14T08:08:51.386Z","dependency_job_id":"c3fd4916-cfe9-4b62-96a0-2459221a15b0","html_url":"https://github.com/zhixuhao/unet","commit_stats":{"total_commits":16,"total_committers":1,"mean_commits":16.0,"dds":0.0,"last_synced_commit":"b45af4d458437d8281cc218a07fd4380818ece4a"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhixuhao%2Funet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhixuhao%2Funet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhixuhao%2Funet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhixuhao%2Funet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zhixuhao","download_url":"https://codeload.github.com/zhixuhao/unet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254159273,"owners_count":22024558,"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":["keras","segmentation","unet"],"created_at":"2024-08-03T01:00:37.775Z","updated_at":"2025-05-14T14:07:58.141Z","avatar_url":"https://github.com/zhixuhao.png","language":"Jupyter Notebook","funding_links":[],"categories":["Jupyter Notebook","**Vision Models**","Examples/Notebooks"],"sub_categories":[],"readme":"# Implementation of deep learning framework -- Unet, using Keras\n\nThe architecture was inspired by [U-Net: Convolutional Networks for Biomedical Image Segmentation](http://lmb.informatik.uni-freiburg.de/people/ronneber/u-net/).\n\n---\n\n## Overview\n\n### Data\n\nThe original dataset is from [isbi challenge](http://brainiac2.mit.edu/isbi_challenge/), and I've downloaded it and done the pre-processing.\n\nYou can find it in folder data/membrane.\n\n### Data augmentation\n\nThe data for training contains 30 512*512 images, which are far not enough to feed a deep learning neural network. I use a module called ImageDataGenerator in keras.preprocessing.image to do data augmentation.\n\nSee dataPrepare.ipynb and data.py for detail.\n\n\n### Model\n\n![img/u-net-architecture.png](img/u-net-architecture.png)\n\nThis deep neural network is implemented with Keras functional API, which makes it extremely easy to experiment with different interesting architectures.\n\nOutput from the network is a 512*512 which represents mask that should be learned. Sigmoid activation function\nmakes sure that mask pixels are in \\[0, 1\\] range.\n\n### Training\n\nThe model is trained for 5 epochs.\n\nAfter 5 epochs, calculated accuracy is about 0.97.\n\nLoss function for the training is basically just a binary crossentropy.\n\n\n---\n\n## How to use\n\n### Dependencies\n\nThis tutorial depends on the following libraries:\n\n* Tensorflow\n* Keras \u003e= 1.0\n\nAlso, this code should be compatible with Python versions 2.7-3.5.\n\n### Run main.py\n\nYou will see the predicted results of test image in data/membrane/test\n\n### Or follow notebook trainUnet\n\n\n\n### Results\n\nUse the trained model to do segmentation on test images, the result is statisfactory.\n\n![img/0test.png](img/0test.png)\n\n![img/0label.png](img/0label.png)\n\n\n## About Keras\n\nKeras is a minimalist, highly modular neural networks library, written in Python and capable of running on top of either TensorFlow or Theano. It was developed with a focus on enabling fast experimentation. Being able to go from idea to result with the least possible delay is key to doing good research.\n\nUse Keras if you need a deep learning library that:\n\nallows for easy and fast prototyping (through total modularity, minimalism, and extensibility).\nsupports both convolutional networks and recurrent networks, as well as combinations of the two.\nsupports arbitrary connectivity schemes (including multi-input and multi-output training).\nruns seamlessly on CPU and GPU.\nRead the documentation [Keras.io](http://keras.io/)\n\nKeras is compatible with: Python 2.7-3.5.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhixuhao%2Funet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzhixuhao%2Funet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhixuhao%2Funet/lists"}