Giter VIP home page Giter VIP logo

ml_defectdetection's Introduction

ML_DefectDetection

Machine learning models to detect topological defects in biological tissues. A full description of the rationale and methodology can be found online at https://arxiv.org/abs/2303.08166.

This repository contains a pre-trained convolutional neural network (CNN) model, created using TensorFlow, for detecting nematic defects in 2D biological tissues (found in 'SavedModel'). It can be run using 'detect_defects'. Each input file should contain rows of 3 columns, with each row corresponding to a different constituent/cell and the 3 columns corresponding to x position of the cell's centre of mass (CoM), its y position and the orientation of the cell's long axis direction in radians respectively. The x and y coordinates of the cell's CoM should be appropriately scaled such that one length unit corresponds to the characteristic length of one cell (e.g. if cells are ~20um in width then 20um = 1 length unit in saved files).

In detect_defects the user must set the location of the input data (data_filepath) and the desired location of the detected defect coordinates (save_filepath, posdef_path and negdef_path). The grid spacing must also be chosen such that defect cores are properly captured within 'regions of interest'. grid_spacing should be chosen such that the defect core can be captured within a window with sides of length ~8*grid_spacing

A folder with example input data, generated using an Active Vertex Model (AVM) [1], can be found at 'CellFiles'.

A ready to run jupypter notebook example can be found in the Example folder. This breaks down 'detect_defects' into step-by-step sections, with intermediate results plotted.

In addition to using the trained model, different models can be built, trained and tested using 'train_and_test_model', which uses 'nn_inputs' and correpsonding 'nn_labels' to train and test the model. These preprocessed inputs were obtained from AVM simulations.

The detected defects can also be plotted, along with the coordinates of the cells' centre of mass and orientation of their long-axes, using the 'defect_plotting.gnu'. This requires the installation of plotting software gnuplot (freely available at: https://sourceforge.net/projects/gnuplot/).

[1] Andrew Killeen, Thibault Bertrand, Chiu Fan Lee, Polar Fluctuations Lead to Extensile Nematic Behavior in Confluent Tissues, Physical Review Letters, 128, 078001 (2022).

ml_defectdetection's People

Contributors

killeena avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.