{"id":17643841,"url":"https://github.com/clementapa/cots_detection","last_synced_at":"2025-05-07T00:46:10.912Z","repository":{"id":96806381,"uuid":"435665381","full_name":"clementapa/COTS_detection","owner":"clementapa","description":"Building an object detector to protect the Great Barrier Reef: Kaggle challenge TensorFlow - Help Protect the Great Barrier Reef. ","archived":false,"fork":false,"pushed_at":"2022-02-10T22:25:45.000Z","size":59764,"stargazers_count":6,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-31T04:41:12.824Z","etag":null,"topics":["computer-vision","deep-learning","faster-rcnn","kaggle-competition","object-detection","python","retinanet"],"latest_commit_sha":null,"homepage":"","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/clementapa.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":"2021-12-06T22:20:04.000Z","updated_at":"2024-08-14T02:44:37.000Z","dependencies_parsed_at":"2023-04-09T06:03:34.533Z","dependency_job_id":null,"html_url":"https://github.com/clementapa/COTS_detection","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/clementapa%2FCOTS_detection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clementapa%2FCOTS_detection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clementapa%2FCOTS_detection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clementapa%2FCOTS_detection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/clementapa","download_url":"https://codeload.github.com/clementapa/COTS_detection/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252793564,"owners_count":21805054,"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":["computer-vision","deep-learning","faster-rcnn","kaggle-competition","object-detection","python","retinanet"],"created_at":"2024-10-23T09:43:04.728Z","updated_at":"2025-05-07T00:46:10.906Z","avatar_url":"https://github.com/clementapa.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Building an object detector to protect the Great Barrier Reef :ocean:\n\n\u003e Author : Clément Apavou\n\n![Python](https://img.shields.io/badge/Python-green.svg?style=plastic)\n![PyTorch](https://img.shields.io/badge/PyTorch-orange.svg?style=plastic)\n\nKaggle Research Code Competition: [TensorFlow - Help Protect the Great Barrier Reef](https://www.kaggle.com/c/tensorflow-great-barrier-reef/leaderboard)\n\n## :tropical_fish: Introduction\nThe Australia’s Greet Barrier Reef is threatened by outbreaks of crown-of-thorns starfish that devour corals too quickly. To protect the reef, the Great Barrier Reef foundation and the Australia’s national science agency has partnered with Google to improve ineffective traditional survey methods. A Kaggle research code competition was created to expedite the research for an effective video survey method. The goal is to build an object detector capable of predicting the presence and position of crown-of-thorns starfish in underwater image sequences. This object detector will be used to determine the locations of outbreaks, so that physical intervention reducing their propagation can be launched at these locations.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"assets/readme/seq_60754.gif\" width=\"900\" height=\"400\"/\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n\u003cem\u003e Part of the sequence 60754 (COTS annotations) of the COTS dataset.\u003c/em\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"assets/readme/imageRD.png\" width=\"400\" height=\"200\"/\u003e\n  \u003cimg src=\"assets/readme/COTS_outbreak.jpg\" width=\"400\" height=\"200\"/\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n\u003cem\u003e Crown-of-thorns starfishs (left) - A Crown-of-thorns starfish outbreak (right)\u003c/em\u003e\n\u003c/p\u003e\n\n## :tropical_fish: Dataset\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"assets/readme/freq_seq_video.png\" width=\"400\" height=\"200\"/\u003e\n  \u003cimg src=\"assets/readme/bb_seq_video.png\" width=\"400\" height=\"200\"/\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n\u003cem\u003e Number of frames per video and per sequence in the COTS dataset (left) - Number of bounding boxes per video and per sequence in the COTS dataset. (right)\u003c/em\u003e\n\u003c/p\u003e\n\n## :fish: Features of this repository\n- Analyse dataset (split train/validation) : ```data_analysis.ipynb ```\n- Dataset PyTorch for the COTS dataset : ```datasets/ReefDataset.py```\n- Data augmentation with albumentation : ```datasets/transforms.py```\n- Wandb logger to log experiments:  ```utils/WandbLogger.py```\n    - log metrics \n    - log images (predictions/annotations)   \n- Implementation of the F2-score metrics of the competition with [torchmetrics](https://torchmetrics.readthedocs.io/en/latest/) : ```utils/metrics.py```\n- Beautiful terminal logger : ```utils/logger.py```\n- Implementation of callbacks for early stopping and save weights by monitoring a metric : ```utils/callbacks.py```\n- Faster R-CNN \u0026 RetinaNet from torchvision models (fine tuning implementation): ```model/FasterRCNN.py``` \u0026 ```model/RetinaNet.py```\n- Possibility to use any optimizer and scheduler (following the config file template)\n- Option fast dev run to debug (only 1 batch of train and validation are processed)\n\n## :pushpin: How does it work?  \n\n1. Create a config file in ```config/``` by following templates\n2. Launch the script ```main.py``` with the config file : \n``` \npython main.py --config_file config/config.yaml\n```\n3. Also, you can change use options to change launching configuration :\n``` \npython main.py --config_file config/config.yaml --batch_size 2 --num_workers 2 --epoch 20 --csv_file path --root_path path\n```\nAnd you can use the ```--fast_dev_run``` option\n\nThe config file is read by the ```Trainer``` in ```agents/trainer.py``` which launch the training.\n\n## :dolphin: Experiments\nAll experiments are available on wandb : [![](https://github.com/wandb/assets/blob/main/wandb-github-badge-gradient.svg)](https://wandb.ai/cots-detection/COTS_detection?workspace=user-clementapa)\n\nFaster R-CNN:\n- gallant-morning : without negative samples =\u003e 0.354 F2-score competition score (detection threshold 0.5) \u0026 0.4027 F2-score validation (video 2)\n- dry-microwave : with negative samples\n- volcanic-water : without negative samples\n\nRetinaNet: (different data augmentation and hyperparameters)\n- dry-armadillo\n- fallen-sun \n- smart-music \n- fiery-yogurt\n\n## :ambulance: Fix albumentation error in bbox_utils.py on kaggle \nOn kaggle :\n```\ncp albumentations/bbox_utils.py /opt/conda/lib/python3.7/site-packages/albumentations/augmentations/bbox_utils.py\n```\n\n## :hammer: Work in progress ...\n- [X] MAP metric\n- [ ] YOLOX\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclementapa%2Fcots_detection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclementapa%2Fcots_detection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclementapa%2Fcots_detection/lists"}