Model Evaluation

Now as we have our model ready let’s evaluate its performance on the validation data using different metrics. For this purpose, we will first predict the class for the validation data using this model and then compare the output with the true labels.

Python3




Y_pred = model.predict(X_val)
Y_val = np.argmax(Y_val, axis=1)
Y_pred = np.argmax(Y_pred, axis=1)


Let’s draw the confusion metrics and classification report using the predicted labels and the true labels.

Python3




metrics.confusion_matrix(Y_val, Y_pred)


Output:

Confusion Matrix for the validation data.

Python3




print(metrics.classification_report(Y_val, Y_pred,
                                    target_names=classes))


Output:

Classification Report for the Validation Data

Lung Cancer Detection using Convolutional Neural Network (CNN)

Computer Vision is one of the applications of deep neural networks that enables us to automate tasks that earlier required years of expertise and one such use in predicting the presence of cancerous cells.

In this article, we will learn how to build a classifier using a simple Convolution Neural Network which can classify normal lung tissues from cancerous. This project has been developed using collab and the dataset has been taken from Kaggle whose link has been provided as well.

The process which will be followed to build this classifier:

Flow Chart for the Project

Similar Reads

Modules Used

Python libraries make it very easy for us to handle the data and perform typical and complex tasks with a single line of code....

Importing Dataset

...

Data Visualization

The dataset which we will use here has been taken from -https://www.kaggle.com/datasets/andrewmvd/lung-and-colon-cancer-histopathological-images.  This dataset includes 5000 images for three classes of lung conditions:...

Data Preparation for Training

...

Model Development

In this section, we will try to understand visualize some images which have been provided to us to build the classifier for each class....

Model Evaluation

...

Conclusion:

...