Chest X-rays Pneumonia Detection using Convolutional Neural Network

栏目: IT技术 · 发布时间: 5年前

内容简介:Convolutional Neural Network (CNN) might seem intimidating for a beginner. However, this project will provide an overview of how to build a model from scratch to detect pneumonia using Tensorflow and Keras.The content of the mini-project is listed as follo

A basic Tensorflow and Keras Implementation for beginners

Convolutional Neural Network (CNN) might seem intimidating for a beginner. However, this project will provide an overview of how to build a model from scratch to detect pneumonia using Tensorflow and Keras.

The content of the mini-project is listed as follows :

  • Model Building
  • Model Training
  • Model Evaluation
  • Final Model Prediction

What is Pneumonia?

Pneumonia is a lung inflammation caused by a viral or bacterial infection that can range from mild to severe cases. This inflammation makes the patient unable to breathe enough oxygen to reach the bloodstream. It happens when an infection makes the air sacs (alveoli) in the lungs fill with fluid or pus that might affect either one or both lungs. If your doctor thinks you might have pneumonia, a chest X-ray will be performed to find the infection in the patient's lungs and how far it’s spread.

Dataset

This experiment leveraging the data from Kaggle repository titled Chest X-Ray Images (Pneumonia). Check out the dataset here . The dataset composes of two classes which are normal lung and pneumonia lung as can be seen in the figure below.

Chest X-rays Pneumonia Detection using Convolutional Neural Network

Implementation

Before we start building the convolutional neural network, the following are the necessary libraries and dependencies.

Model Development

So let’s jump into the code. The model that we are going to develop composes several components which are:

  • tf.keras.layers.Conv2D() : The convolution layer which improves image recognition by isolate images features
  • tf.keras.layers.MaxPooling2D() : a layer to reduce the information in an image while maintaining features
  • tf.keras.layers.Flatten() : flatten the result into 1-dimensional array
  • tf.keras.layers.Dense() : add densely connected layer

A five-layer convolution network will be built where Conv2D() and MaxPooling2D() are stack together as one layer. Then, the output of the final convolutional layer will be flattened and fit to fully connected neurons.

Additionally, before the model is fitted for training, it is necessary to configure the specifications as follows:

  • loss: pneumonia detection is using sigmoid activation in the final step, which resulted in either 0 or 1 (normal or pneumonia). Therefore, binary_crossentropy is the most suitable loss function
  • optimizer: RMSprop (Root Mean Square Propagation) with a learning rate of 0.001 will be used
  • metrics: accuracy is the measurement metric to obtain the prediction accuracy rate on every epoch

Following is the output of model.summary() .

Chest X-rays Pneumonia Detection using Convolutional Neural Network

The overview of the model that we have built can be illustrated as below:


以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

光线跟踪算法技术

光线跟踪算法技术

萨芬 / 刘天慧 / 清华大学出版社 / 2011-3 / 98.00元

《光线跟踪算法技术》详细阐述了与光线跟踪问题相关的高效解决方案及相应的数据结构和算法,主要包括采样技术、投影视图、视见系统、景深、非线性投影、立体视觉、光照与材质、镜面反射、光泽反射、全局光照、透明度、阴影、环境遮挡、区域光照、光线与对象间的相交计算、对象变换、栅格技术以及纹理映射技术等内容。此外,《光线跟踪算法技术》还提供了相应的算法、代码以及伪代码,以帮助读者进一步理解计算方案的实现过程。 ......一起来看看 《光线跟踪算法技术》 这本书的介绍吧!

图片转BASE64编码
图片转BASE64编码

在线图片转Base64编码工具

Base64 编码/解码
Base64 编码/解码

Base64 编码/解码

html转js在线工具
html转js在线工具

html转js在线工具