Skip to content

Automatic visual classification of covid-19 test results.

License

Notifications You must be signed in to change notification settings

LeafarCoder/ColorCovid

Repository files navigation

ColorCovid

A colaboration between Faculty of Pharmacy and IST, both from the University of Lisbon, for a Covid-related project. The task was to, given a photo of an array of test samples for the Covid virus, determine which ones are the positive tests.

The idea was abandoned and the project did not continue. This repository contains only the initial work for the project.

Project started in March 2020 (and abandoned shortly after).

Overview of the project pipeline



Requirements

Install OpenCV library to access the camera and take photos of the samples:

pip install opencv-python

Objectives

  1. Allow the control of any camera connected to the computer.
  2. Store snapshots of the samples in a light-controled environment.
  3. Identify the portions of the image with the samples (and index each samples uniquely).
  4. Extract the color characteristics of each sample.
  5. Train a classifier based on a large dataset (classify outcome of the test based on color features).
  6. Test on new data and assess performance.

Results

Summary

Objectives 1. to 4. where successfully accomplished.

There was never a response from the team in the lab with the dataset of samples and so the objectives 5. and 6. could not be implemented.

Detailed results

The objectives 1. and 2. were easily accomplished with the Python library OpenCV.

For the 3. objective, a couple of image processing techniques were used.

Click to expand and see an example of the processing steps

Click on the images to see a zoomed version on a new page.

Original screenshot
Step 1 First, detect the background
Step 2 Use a high saturation threshold to broadly detect the wells
Step 3 Remove the background
Step 4 Use an Euclidean distance mask
Step 5 Apply watershed and show markers

With this pipeline, samples can be detected in a variety of array displays, well shapes and light conditions. Consider the following examples:

Click to expand and see examples of detected samples

Click on the images to see a zoomed version on a new page.

original screenshot Samples detected

For objective 4., all the samples were processed and the color features stored in a csv. file:

  • A visualization tool allows to observe each individual sample and its color features.

  • It also allows to choose a type of border to show
Samples with border showing Samples cropped to region of interest (ROI)
  • It also allows to order the list of samples by any given parameter
Order by RGB value
(red channel, in this case)
Order by test result
(positive/negative)
Order by sample index

Author

Rafael Correia

About

Automatic visual classification of covid-19 test results.

Topics

Resources

License

Stars

Watchers

Forks

Languages