top of page

Breast Cancer Detection using AI

Updated: Aug 30, 2021

Breast cancer is when there is a lump in the breast and the cells are growing at an abnormal rate. This destroys the connective tissues in the breast and can spread up lymph nodes under the arm that are vital for our bodies immunity. An AI service that can read images and predict whether the image is of healthy or cancerous cells in the breast can help detect breast cancer at early stages.

Student builds AI that detects breast cancer
Breast Cancer Detection using AI

Breast cancer is when there is a lump in the breast and the cells are growing at an abnormal rate. This destroys the connective tissues in the breast and can spread up lymph nodes under the arm. That is why breast cancer needs to be detected in its early stages, but that doesn’t happen all the time. However, advances in computer science can help with early detection of breast cancer. AI or Artificial intelligence is something I used to help solve this problem.


How do you Build An AI?

To build an AI service that can read images and predict whether the image is of healthy or cancerous cells in the breast, you need to collect lots of example images of healthy and malignant or cancerous histopathology images. Fortunately, there are resources that provide you with such images. I found a resource on Kaggle. This dataset consists of 277,524 images of which 78,786 out of the 277,524 where cancerous and the remaining 198,738 images were healthy.

Once you have lots of histopathology images of cancerous and benign images, the next step is to train the AI for image classification. The residual neural network is a very popular image classification algorithm. It is known to have a high performance. I used it in Navigator (it’s a free tool available at this website) to train this image classifier. Navigator provides you with a REST API that will accept any image as an input and provide you with a prediction. The cool thing about this is that all you need is an internet connection and an image you want to predict. You can use it anywhere! If you would like to try out the AI I build using Navigator on a web interface, you can do that here.



Improving and Evaluating the AI

The next step is to evaluate how well the AI you built is doing. Fortunately, Navigator reports the accuracy and in my case, I got accuracies that ranged from 75%-90%. However, in cases like cancer, just having a high accuracy is not enough. There are two errors that can happen in the classification of cancer. You may detect a healthy person as having cancer or you may detect a sick person as not having cancer. It is always better to misdiagnose a healthy person than to misdiagnose a sick person.

One reason for this was the benign and malignant images were difficult to tell apart. This made it a little difficult since there were only slight differences as you can see in the diagram below. Once I analyzed the results, I saw that finding the pattern was a little difficult for the AI. To fix this I worked on it by adding more images to further improve the service along with tuning several hyper-parameters of the deep neural network to tune it for high performance.



In parallel to tuning the AI, I took a look at the confusion matrix of the classifier and found that there were many cases in which the AI misdiagnosed sick person as healthy. A confusion matrix has

  • True positives are cases in which the AI predicted the image is cancerous and it was a cancerous histopathology image

  • True negatives are cases that the AI predicted the image as healthy, and the image is cancerous.

  • False positives are cases in which the image was predicted as cancerous, but it wasn’t cancerous

  • False negatives are cases that were predicted as healthy, but they actually do have the disease.

The goal is to reduce the false negatives and true negatives because you don’t want to miss even a single person having cancer. In addition, to using the confidence values output by the AI service, I also plotted something called the ROC curve-which is a very popular and highly used metric for analyzing this kind of binary classification.


The process of calculating a ROC curve involves mathematical operations on the confidence outcome of the algorithm which I did use python. The code for this is linked here. I learned that the most accurate AI service is not always the best! The ROC curve is one piece of evidence along with the confusion matrix.


As I continued analyzing the data and working on it for several weeks, I learned that it is very hard to tune a deep neural network, especially when the two categories are hard to tell apart. So to fix it I would like to make this service available to the public for feedback and make it available to some physicians, to get their feedback. I would also like to spend more time collecting more images and tuning my service for better accuracy and performance.

37 Comments


75bd.app showed up in a couple posts, so I poked around out of curiosity more than anything. First thing I noticed is it doesn’t make you work to find your way around—stuff is laid out pretty clearly and the menu is right where you expect it to be. I’m also a fan of how the page isn’t just one big wall of text; everything sits in its own little section so your eyes can actually scan without getting lost. It’s not trying to be flashy or overloaded, which is honestly kind of refreshing when you’re just clicking through. The spacing between the on-page blocks and the way the navigation is grouped into obvious sections is what stood out most.

Like

https://888b.soccer/ mình cũng kiểu nghe người ta nhắc hoài nên bấm vô xem thử cho biết chứ không có ngồi chơi hay tìm hiểu sâu. Vừa vào là thấy họ chia nội dung thành từng mảng riêng nhìn khá thoáng, lướt xuống một chút là biết chỗ nào nằm ở đâu, không bị rối mắt. Mình thích nhất là mấy phần trình bày theo dạng cột/bảng nhìn gọn gàng, đọc liếc vẫn hiểu ý chứ không phải zoom hay căng mắt. Với người chỉ ghé xem nhanh như mình thì cảm giác thao tác khá nhẹ, bấm qua lại không bị lạc vì menu để ngay chỗ dễ thấy. Nói chung giao diện nhìn thân thiện, các khối nội dung…

Like

vb88.com dạo này thấy bạn bè nhắc hoài nên mình cũng bấm vào coi thử cho biết. Mình không có đọc kỹ hay tìm hiểu gì sâu, chỉ lướt nhanh xem giao diện có dễ nhìn không thôi. Ấn tượng đầu là trang nhìn khá thoáng, kiểu chia nội dung thành từng khối nên kéo xuống không bị rối. Mình để ý cái menu đặt ngay chỗ dễ thấy, bấm qua lại vài mục thấy cũng nhanh, không phải mò mẫm. Mấy phần thông tin trình bày dạng cột nên nhìn phát là hiểu, không bị chữ chồng chữ. Nói chung mình chỉ cần vậy để xem sơ sơ, chủ yếu là cách họ chia khối rõ ràng và để…

Like

rr88.com mình cũng chỉ ghé thử vì thấy bạn bè nhắc hoài. Vào cái là thấy trang làm khá thoáng, nhìn không bị rối mắt như nhiều chỗ khác. Mình thích nhất là họ chia nội dung thành mấy khối rõ ràng nên kéo xuống một chút là biết đang ở phần nào, không phải đoán. Với lại mấy bảng dạng cột nhìn gọn ghẽ, chữ không bị dính vào nhau nên lướt nhanh vẫn đọc được. Menu thì để ngay chỗ dễ thấy, bấm qua lại giữa các mục khá mượt, không phải mò. Nói chung cảm giác dùng nhẹ nhàng, kiểu mở lên là hiểu cách họ sắp xếp luôn, nhất là phần bố cục theo khối và…

Like

BALL88 dạo này thấy bạn bè nhắc hoài nên mình cũng ghé thử cho biết, kiểu vào xem giao diện có dễ dùng không thôi chứ chưa kịp “chiến” gì. Cảm giác đầu tiên là trang nhìn khá sạch và hiện đại, các khối nội dung chia rõ nên lướt một vòng không bị rối mắt. Mình để ý họ gom nhiều thứ trong cùng một hệ sinh thái giải trí chứ không chỉ mỗi cá cược thể thao, nên nhìn tổng quan khá “đủ món” cho ai thích đổi gió. Thông tin trên trang cũng hay trình bày dạng bảng ô gọn gàng, đọc lướt là hiểu mình đang ở mục nào. Nói chung trải nghiệm lướt nhanh khá…

Like
bottom of page