{"id":18057615,"url":"https://github.com/bring-shrubbery/st-andrews-dissertation","last_synced_at":"2025-04-05T10:25:39.696Z","repository":{"id":112731265,"uuid":"273334866","full_name":"bring-shrubbery/st-andrews-dissertation","owner":"bring-shrubbery","description":"Code for my MSc Artificial Intelligence dissertation at the University of St Andrews","archived":false,"fork":false,"pushed_at":"2021-09-12T21:03:57.000Z","size":2976,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-17T21:18:06.493Z","etag":null,"topics":["cnn-keras","computed-tomography","deep-learning","medical-image-analysis","medical-imaging"],"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/bring-shrubbery.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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,"publiccode":null,"codemeta":null},"funding":{"github":["bring-shrubbery"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2020-06-18T20:35:06.000Z","updated_at":"2021-09-12T21:03:59.000Z","dependencies_parsed_at":"2023-06-16T16:15:36.644Z","dependency_job_id":null,"html_url":"https://github.com/bring-shrubbery/st-andrews-dissertation","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/bring-shrubbery%2Fst-andrews-dissertation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bring-shrubbery%2Fst-andrews-dissertation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bring-shrubbery%2Fst-andrews-dissertation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bring-shrubbery%2Fst-andrews-dissertation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bring-shrubbery","download_url":"https://codeload.github.com/bring-shrubbery/st-andrews-dissertation/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247320914,"owners_count":20919872,"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":["cnn-keras","computed-tomography","deep-learning","medical-image-analysis","medical-imaging"],"created_at":"2024-10-31T02:08:24.863Z","updated_at":"2025-04-05T10:25:39.679Z","avatar_url":"https://github.com/bring-shrubbery.png","language":"Jupyter Notebook","funding_links":["https://github.com/sponsors/bring-shrubbery"],"categories":[],"sub_categories":[],"readme":"# St Andrews MSc Artificial Intelligence Dissertation\n\nThis is the code to go with my dissertation at the University of St Andrews.\n\nDue to not having git-lfs storage the `generated-features` folder and the model are not included. These can be genrated again from the full dataset using the provided scripts or downloaded from the links below.\n\nThe generated features folder is zipped and uploaded to Google Drive for that reason and uploaded to this [link](https://drive.google.com/file/d/1EL8BSWqIdEAcSaIS6aXdHkAw1u8tbCnZ/view?usp=sharing). The folders from inside of the downloaded zip file should be put into the `generated-features` directory in the project\n\nThe model is also not uploaded due to size restrictions, it was uploaded to Google Drive and is available through this [link](https://drive.google.com/file/d/19u8PWfp-Mywomg_gZmSgc7kzaSt8xhnW/view?usp=sharing). The downloaded `.h5` model should be put into the `models` directory.\n\n## Description\n\nSince the full dataset is too big to provide with the code, there is a smaller version, with just the right images extracted into separate filles. These images are stored in `generated-features` folder. The images are stored in numpy file format. There are 3 separate folders for training, validation and testing datasets and each folder contains another 2 folders for positive and negative samples. These images are loaded automatically by the `loadAugmentedBinaryDatasetFromFiles` with an option to normalise the loaded images by providing 'normalize=True' parameter.\n\n## Running the code\n\nAll the code should be executed from inside `src` folder.\n\nThere are multiple things you can do with the provided code. You can train the baseline network by running:\n\n```python3 main.py```\n\nYou can train the custom VGG16 model by running:\n\n```python3 vgg16.py```\n\nYou can run one of the transfer learning models by running:\n\n```python3 transfer_models.py```\n\nYou can evaluate the model saved in the `models` folder by running following command and providing name of the model as the parameter, for example, to run the best model that was achieved, run:\n\n```python3 main_evaluate.py baseline-model.h5```\n\n## File structure\n\nIn `features` folder: Annotations in CSV format.\n\nIn `generated-features` folder: Extracted smaller datasets from the full one.\n\nIn `models` folder: contains best models that were trained.\n\nIn results folder:\n- `baseline` - contains the graphs, logs, etc. for the baseline model\n- `filters` - contains filters extracted by `visualise_filters.py` script\n- `vgg16` - contains graphs, logs, etc. for the custom VGG16 model\n\nIn `src` folder:\n- `augmentation.py` - Contains functions that augment data samples as described in the report\n- `constants.py` - Contains constants that are imported throughout the project\n- `createBaseline.py` - Contains function which creates the baseline Keras model\n- `createVGG16.py` - Contains function which create the custom VGG16 model\n- `extract_images.ipynb` - Is a jupyter notebook which generates the files in `generated-features` if the full dataset is available\n- `loading.py` - Contains all the loading functions\n- `main.py` - Contains training script for the baseline model\n- `main_evaluate` - Evaluates provided model on all 3 sets\n- `plot_history` - Plots the graph that can be seen in the results fodler\n- `transfer_models.py` - Will train the transfer learning models\n- `vgg16.py` -  Will train the custom VGG16 model\n- `visualise_filters.py` - Will visualise the first layer filters of the provided model and save them into `./results/filters` directory\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbring-shrubbery%2Fst-andrews-dissertation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbring-shrubbery%2Fst-andrews-dissertation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbring-shrubbery%2Fst-andrews-dissertation/lists"}