{"id":21646545,"url":"https://github.com/magnuss0/agarvision_2024","last_synced_at":"2026-05-17T15:33:43.411Z","repository":{"id":224443260,"uuid":"763242886","full_name":"MagnusS0/AgarVision_2024","owner":"MagnusS0","description":"Project from Novo Nordisk's AgarVision hackathon, utilizing DenseNet-121 \u0026 YOLOv8 for agar plate analysis and colony counting.","archived":false,"fork":false,"pushed_at":"2024-03-05T10:43:54.000Z","size":25998,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-19T23:43:41.934Z","etag":null,"topics":["computer-vision","densenet121","pytorch"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","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/MagnusS0.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,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-02-25T22:47:15.000Z","updated_at":"2024-11-12T12:25:52.000Z","dependencies_parsed_at":"2024-03-03T00:38:39.678Z","dependency_job_id":null,"html_url":"https://github.com/MagnusS0/AgarVision_2024","commit_stats":null,"previous_names":["magnuss0/agarvision_2024"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/MagnusS0/AgarVision_2024","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MagnusS0%2FAgarVision_2024","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MagnusS0%2FAgarVision_2024/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MagnusS0%2FAgarVision_2024/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MagnusS0%2FAgarVision_2024/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MagnusS0","download_url":"https://codeload.github.com/MagnusS0/AgarVision_2024/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MagnusS0%2FAgarVision_2024/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279012186,"owners_count":26085079,"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-10-12T02:00:06.719Z","response_time":53,"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":["computer-vision","densenet121","pytorch"],"created_at":"2024-11-25T06:45:32.793Z","updated_at":"2025-10-12T17:24:00.062Z","avatar_url":"https://github.com/MagnusS0.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hackathon Agarvision\n![image](https://github.com/MagnusS0/AgarVision_2024/assets/97634880/1e03337a-e5a6-4277-a505-5aea750fbb8e)\n\n\nThis project was developed as part of the AgarVision hackathon hosted by Novo Nordisk at ITU (Denmark). There are two subtasks. \n\n\u003efirst subtask: binary classification of agar plates to determine whether they are empty or not\n\n  Utilizing a pre-trained DenseNet-121 model, originally trained on ImageNet, the project adapts the model for a binary classification task by modifying the last layer. This approach achieved a score of 0.98 (98%) on the final test set based on a combined metric of accuracy and recall.\n\n\u003esecond subtask: how many colonies are on each agar plates\n\nUtilizing a pre-trained YOLOv8 model, the project adapts the model for object detection and localization.  The model achieved a score of 0.054 on the final test set based on mean squared log error.\n\n## First subtask: Binary classification\n### Setup\n\n1. Clone this repository.\n2. Install the required packages by running `poetry install`.\n3. Download the dataset [https://agar.neurosys.com/]\n\n### Usage\n\nOpen the `binary_classifier.ipynb` notebook and it will go through loading data, preprocessing, model training, and evaluation.\n\n### Performance\nThe primary goal of the model was to minimize false negatives to ensure that agar plates with bacteria are accurately identified, avoiding the risk of misclassifying contaminated plates as clean. In the validation set, out of 198 agar plates that were truly empty, the model correctly identified 187, resulting in 11 false negatives. This translates to an approximately 4% misclassification rate for the empty class.\n\n\n![image](https://github.com/MagnusS0/AgarVision_2024/assets/97634880/4cacb10e-8389-4f25-b5aa-7716c0af47ff)\n\n## Second Subtask: Object detection\n### Setup\nInstall the required packages\n```bash\npip install ultralytics\n```\n### Usage \nSince we run models on a cluster, we have to submit jobs to the cluster. The following scripts are used to submit jobs to the cluster. You might need to change the paths to the data and the model as well as the required resources in the bash scripts.\n- **Process the data:**\nWe turn all the images into grayscale and resize them since they are in different lighting conditions and sizes.\n```bash\nsbatch data.sh\n```\n- **Train the model**: you might need to change the setting in `novo.yaml`.\n```bash\nsbatch sbatch.sh\n```\n- **Evaluate the model**\n```bash\nsbatch eval.sh\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagnuss0%2Fagarvision_2024","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmagnuss0%2Fagarvision_2024","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagnuss0%2Fagarvision_2024/lists"}