{"id":18392818,"url":"https://github.com/tsmbland/andi_challenge","last_synced_at":"2026-05-01T16:35:59.565Z","repository":{"id":156383076,"uuid":"308918826","full_name":"tsmbland/andi_challenge","owner":"tsmbland","description":"Analysis of single particle tracking data for characterisation of anomalous diffusion, using convolutional neural networks. Submitted to the Anomalous Diffusion (AnDi) Challenge","archived":false,"fork":false,"pushed_at":"2023-08-01T10:46:50.000Z","size":279074,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-19T16:41:09.229Z","etag":null,"topics":["biophysics","convolutional-neural-networks","deep-learning","python","signal-processing","tensorflow","time-series-analysis"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc-by-4.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tsmbland.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":"2020-10-31T16:01:27.000Z","updated_at":"2024-12-14T15:22:31.000Z","dependencies_parsed_at":null,"dependency_job_id":"ef7e56c3-1097-4075-9414-f09837ad1283","html_url":"https://github.com/tsmbland/andi_challenge","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tsmbland/andi_challenge","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsmbland%2Fandi_challenge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsmbland%2Fandi_challenge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsmbland%2Fandi_challenge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsmbland%2Fandi_challenge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tsmbland","download_url":"https://codeload.github.com/tsmbland/andi_challenge/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsmbland%2Fandi_challenge/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32505109,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"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":["biophysics","convolutional-neural-networks","deep-learning","python","signal-processing","tensorflow","time-series-analysis"],"created_at":"2024-11-06T01:58:14.183Z","updated_at":"2026-05-01T16:35:59.548Z","avatar_url":"https://github.com/tsmbland.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Convolutional neural networks for characterisation and segmentation of anomalous diffusion trajectories\n\n[![CC BY 4.0][cc-by-shield]][cc-by]\n![TensorFlow](https://img.shields.io/badge/TensorFlow-FF6F00?style=flat\u0026logo=tensorflow\u0026logoColor=white)\n[![run with conda](http://img.shields.io/badge/run%20with-conda-3EB049?logo=anaconda)](https://docs.conda.io/en/latest/)\n\nThis repository contains code for the analysis of single particle tracking data for characterisation of anomalous diffusion, using convolutional neural networks (CNNs). \nSubmitted to the [Anomalous Diffusion (AnDi) Challenge](https://arxiv.org/abs/2003.12036).\n\nThe models in this repository perform three tasks on 1D and 2D tracks, as set out in the challenge:\n-\tTask 1: inference of anomalous exponent\n-\tTask 2: classification of diffusion model\n-\tTask 3: segmentation of trajectories\n\nThe CNN architecture used here is adapted from that used in [Granik et al., 2019](https://www.sciencedirect.com/science/article/pii/S0006349519305041/), which is itself based on a CNN architecture described in [Bai et al., 2018](https://arxiv.org/abs/1803.01271/).\nAs well as some minor changes to hyperparameters and model training (as outlined in the code), I've made some major modifications to the original methods which improve performance and applicability to real data:\n- Consideration of tracks of all lengths (5-1000+ steps) with a single model \n- Training models on tracks with variable signal to noise ratio (permitting inference without prior information about SNR)\n- Segmentation of trajectories switching between diffusion modes (currently limited to single length tracks with one switch). NB. this uses a slightly different CNN architecture (regular convolutions instead of causal convolutions)\n\nPlease see the AnDi Challenge follow-up paper (available [here](https://www.nature.com/articles/s41467-021-26320-w)) for a full description of the method and a thorough assessment of its performance (look out for team J!).\n\nNote: the code in this repository has been modified and improved somewhat since the original challenge (mostly just to improve usability). For the exact code and models used in the original challenge, please see [this fork](https://github.com/AnDiChallenge/AnDi2020_TeamJ_FCI). \n\n## Installation\n\nClone the repository:\n\n    git clone https://github.com/tsmbland/andi_challenge.git\n    cd andi_challenge\n    \nCreate conda environment:\n\n    conda env create -f environment.yml\n\nActivate conda environment:\n\n    conda activate andi_challenge\n\n\n## Generating datasets\n\nValidation and test data can be generated by running Test/Generate.py and Validation/Generate.py respectively.\nBy default, this will generate 10,000 tracks per task per dimension (1D and 2D) for test and validation, using the andi-datasets package.\n\nTraining data is generated on-the-fly during training, and does not need to be generated beforehand.\n\n\n## Training models\n\nTo train models, run the scripts in the Train folder for the respective task (E.g. Task1_Exponent/Train/1D.py for task 1 in 1D).\nPre-trained models are included as .h5 files in the Models folder for each task.\n\n\n## Analysing challenge data\n\nThe repository includes three scripts for analysing challenge data in the ‘Challenge’ folder, named Task1.py, Task2.py and Task3.py for the three tasks. \nTo perform analysis, run these scripts, specifying the path to the data folder at the top of the file. \n\nNon-challenge data (e.g. real data) can be analysed in a similar way.\n\n\n## Notebooks\n\nThere are four notebooks in the Notebooks folder that lay out some of the features of this repository and provide further instructions on performing analysis:\n\n- Notebook 1 \u003ca target=\"_blank\" href=\"https://colab.research.google.com/github/tsmbland/andi_challenge/blob/master/Notebooks/trajectory_preprocessing.ipynb\"\u003e\n  \u003cimg src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\" height=15/\u003e\n\u003c/a\u003e - Generating and preprocessing trajectories\n- Notebook 2 \u003ca target=\"_blank\" href=\"https://colab.research.google.com/github/tsmbland/andi_challenge/blob/master/Notebooks/exponent_inference.ipynb\"\u003e\n  \u003cimg src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\" height=15/\u003e\n\u003c/a\u003e - Inference of anomalous exponent using trained CNNs\n- Notebook 3 \u003ca target=\"_blank\" href=\"https://colab.research.google.com/github/tsmbland/andi_challenge/blob/master/Notebooks/model_classification.ipynb\"\u003e\n  \u003cimg src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\" height=15/\u003e\n\u003c/a\u003e- Inference of diffusion model using trained CNNs\n- Notebook 4 \u003ca target=\"_blank\" href=\"https://colab.research.google.com/github/tsmbland/andi_challenge/blob/master/Notebooks/segmentation.ipynb\"\u003e\n  \u003cimg src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\" height=15/\u003e\n\u003c/a\u003e- Segmentation of trajectories using trained CNNs\n\n\n\n## References\n\nBai, S., Kolter, J.Z., and Koltun, V. (2018). An empirical evaluation of generic convolutional and recurrent networks for sequence modeling. ArXiv.\n\nGranik, N., Weiss, L.E., Nehme, E., Levin, M., Chein, M., Perlson, E., Roichman, Y., and Shechtman, Y. (2019). Single-Particle Diffusion Characterization by Deep Learning. Biophys. J. 117, 185–192\n\nMuñoz-Gil, G., Volpe, G., García-March, M.A., Metzler, R., Lewenstein, M., and Manzo, C. (2020). The anomalous diffusion challenge: single trajectory characterisation as a competition. ArXiv\n\nMuñoz-Gil, G., Volpe, G., Garcia-March, M.A. et al. Objective comparison of methods to decode anomalous diffusion. Nat Commun 12, 6253 (2021).\n\n## License\n\nThis work is licensed under a\n[Creative Commons Attribution 4.0 International License][cc-by].\n\n[![CC BY 4.0][cc-by-image]][cc-by]\n\n[cc-by]: http://creativecommons.org/licenses/by/4.0/\n[cc-by-image]: https://i.creativecommons.org/l/by/4.0/88x31.png\n[cc-by-shield]: https://img.shields.io/badge/License-CC%20BY%204.0-lightgrey.svg \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftsmbland%2Fandi_challenge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftsmbland%2Fandi_challenge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftsmbland%2Fandi_challenge/lists"}