Giter Club home page Giter Club logo

medical-image-processing's Introduction

Medical Image Processing

An implementation of an image processing pipeline and using machine learning algorithims capable of identify acanthocytes on blood. The first simple implementation follows the method described in the following paper. Actually, the code is being improved to a more complete aproach to detect and classify these abnormal cells, to produce results more precious.

The pre-processing pipeline apply the following steps:

  1. Convert image to gray scale
  2. Apply 9x9 median filter to remove noise
  3. Convert to binary using Otsu thresholding method
  4. Filling operation to remove holes
  5. Apply morphological reconstruction (elliptic shaped 9x9 kernel) to remove remove the medium-sized noise
  6. Finally, canny edge detector is to apply to extract region contours

Features extracted:

  1. Histogram from the chain code
  2. Circularity
  3. Roundness
  4. Aspect-ratio
  5. Solidity

Algorithms implemented:

  1. kNN
  2. Logistic Regression

Other algorithms used to compare results (future implementation):

  1. Naive Bayes
  2. Decision Tree
  3. Random Forest
  4. Support Vector Machine
  5. Neural Network

The published paper is available on this link.

Requirements

The code requires the following libraries:

  1. OpenCV 4.2

The code also uses two other libraries, however they are distributed as single header dropin:

  1. nlohmann/json for json manipulation
  2. adishavit/argh for argument manipulation

Finally the code was written with C++17 features, that allow us to have access to filesystem functionalities independent from the operative system.

There was special care to improve the protability of the code.

Compile

The code provide a Makefile for compiling the code. It should work on must of the Linux distribution.

Execute

The code is comprise of two main programs:

  1. train: used to create a kNN model
  2. main: uses the previsouly learned model to classify several medical images.

In order to facilite the execution of the code the project already provides a file structure:

.
+-- resources
|   +-- model    -> where the kNN models are stored
|   +-- test     -> where the images used for testing are stored
|   +-- train
|       +-- bad  -> where the anomalous instances are stored
|       +-- good -> where the healthy instances are stored

Finally, each main programs has several parameters. The help message of each one of them is printed bellow:

$ ./train -h
Program used to train a kNN model to identify anomalous blood cells.
usage: train [-p] [-k] [-i] [-o] [-h]

Parameters:
  -p, the preprocessig method               [default = 0]
  -m, ML model (0 - ARFF; 1 - KNN; 2 - LR)  [default = 0]
  -k, the number of nearest neighbors       [default = 1]
  -d, Minkowski distance of order p         [default = 2]
  -i, the input folder with images to train [default = './resources/train/']
  -o, the output model                      [default = './resources/model/model.json']
  -v, verbose
  -h, this help message
$ ./main -h
Program used to identify anomalous blood cells.
usage: main [-p] [-k] [-i] [-o] [-h]

Parameters:
  -p, the preprocessig method            [default = 0]
  -m, the classification model           [default = './resources/model/model.json']
  -i, the folder with images to classify [default = './resources/test/']
  -v, verbose
  -h, this help message

Authors

License

This project is licensed under the MIT License - see the LICENSE file for details

medical-image-processing's People

Contributors

catarinaacsilva avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

mariolpantunes

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.