Breast Cancer Detection using AI
- Shriya Shukla
- Sep 2, 2020
- 4 min read
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.

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.



88AA mình mới lướt thử vì thấy nhiều người nhắc, chủ yếu tò mò xem trang trông ra sao. Vào cái là thấy bố cục khá dễ chịu, kiểu chia từng khối nội dung nên kéo xuống không bị rối mắt. Mình có ghé qua phần FAQ một chút, thấy họ nói rõ chuyện rút lần đầu có thể phải xác minh thông tin cá nhân, đọc vậy cũng đỡ lăn tăn hơn. Thử mở bằng điện thoại qua trình duyệt thì vẫn ổn, không bị bắt tải app hay pop-up khó chịu, bấm qua lại cũng mượt. Nói chung mình thích cách họ để câu hỏi đáp án thành từng ô riêng, nhìn phát là biết đang đọc mục…
keo nha cai dạo này thấy mấy ông bạn hay nói nên mình ghé thử cho biết, kiểu vào xem giao diện có dễ nhìn không thôi chứ không phải dân soi kèo. Vừa mở ra là thấy bảng tỷ lệ cập nhật theo thời gian thực, nhìn khá sạch sẽ, chia cột rõ nên mình lướt cái là hiểu kèo đang nhích lên hay tụt xuống. Mình cũng để ý mấy bài nội dung họ chia thành từng khối, tiêu đề to đùng nên cuộn xuống không bị lạc, khỏi phải bấm menu nhiều. Tổng thể cảm giác trang làm theo hướng dữ liệu bóng đá trực tuyến, bố cục hiện đại mà không rối mắt. Nói chung mình…
f168vip mình thấy mấy đứa bạn hay nhắc nên cũng bấm vào coi thử cho biết thôi. Không có ý ngồi đọc kỹ gì đâu, chủ yếu xem giao diện có dễ nhìn không. Vừa vào là thấy trang làm khá gọn, khoảng trắng nhiều nên nhìn không bị rối mắt. Mình thích kiểu họ chia nội dung theo từng khối rõ ràng, lướt xuống là biết đang ở phần nào chứ không bị dính một cục chữ dài. Mấy thông tin quan trọng họ để dạng cột bảng nên nhìn cái là bắt được ý chính, khỏi phải căng mắt dò từng dòng. Menu cũng đặt chỗ dễ thấy nên chuyển qua lại giữa các mục khá nhanh, không…
Hit club hôm bữa mình thấy mấy đứa bạn nói hoài nên cũng bấm vào nghía thử cho biết. Mình không rảnh đọc kỹ nội dung đâu, chủ yếu xem giao diện với cách họ sắp xếp trang thế nào thôi. Ấn tượng đầu là nhìn khá thoáng, không bị nhồi chữ, kéo xuống cũng dễ theo dõi. Mấy phần thông tin được chia thành từng khối riêng nên mắt mình bắt nhịp nhanh, kiểu nhìn phát là biết chỗ nào là gì. Mình cũng thích cái menu để khá dễ thấy, chuyển qua lại giữa các mục không phải mò hay bấm lòng vòng. Nói chung lướt vài phút là quen tay, vì bố cục chia khối rõ ràng…
https://u888j.net/ bữa mình thấy người ta nhắc nên bấm vào coi thử cho biết, chủ yếu xem giao diện chứ không có ngồi đọc kỹ từng bài. Cảm giác đầu tiên là trang load khá nhanh, lướt trên điện thoại cũng ổn, chữ không bị nhỏ quá nên khỏi phải zoom qua zoom lại. Nội dung nhìn kiểu được chia theo mảng rõ ràng nên kéo một đoạn là biết mình đang ở phần nào. Mình có thấy họ nói đây là nền tảng giải trí trực tuyến cho thị trường châu Á, nên cách trình bày cũng thiên về gọn gàng, dễ bấm hơn là rườm rà. Mấy tiêu đề bài viết để ngắn, nhìn lướt phát là hiểu…