Cancer Prediction Model Application
Cancer Prediction Model Application
I have developed an application for a cancer prediction model that uses a convolutional neural network (CNN). The code first loads the images and labels from the dataset, then it splits the data into training, validation, and test sets. The training set is used to train the CNN model, the validation set is used to evaluate the model's performance during training, and the test set is used to evaluate the model's performance after training.
The CNN model is a sequence of layers that process the images and extract features from them. The features are then used to classify the images as either cancerous or non-cancerous. The model is trained using the backpropagation algorithm, which adjusts the weights of the model's layers to minimize the error between the predicted labels and the actual labels.
After the model is trained, it is evaluated on the test set. The evaluation metrics used are accuracy, precision, and recall. Accuracy is the percentage of images that were correctly classified. Precision is the percentage of images that were classified as cancerous that were actually cancerous. Recall is the percentage of images that were actually cancerous that were classified as cancerous.
The model is then saved to a file so that it can be used later. The code also defines a function that can be used to predict the class of a new image. The function takes an image as input and returns a dictionary with the probability of the image being cancerous and non-cancerous.
The code also defines a Gradio interface that can be used to interact with the model. The interface allows users to upload images and the model will predict the class of the image.
I hope that this application is helpful for others who are interested in building cancer prediction models.
Test Accuracy: 88.8%
Model architecture
Layer (type) Output Shape Param #
=================================================================
conv2d (Conv2D) (None, 98, 98, 64) 1792
max_pooling2d (MaxPooling2D (None, 49, 49, 64) 0
)
conv2d_1 (Conv2D) (None, 47, 47, 128) 73856
max_pooling2d_1 (MaxPooling (None, 23, 23, 128) 0
2D)
conv2d_2 (Conv2D) (None, 21, 21, 256) 295168
max_pooling2d_2 (MaxPooling (None, 10, 10, 256) 0
2D)
conv2d_3 (Conv2D) (None, 8, 8, 512) 1180160
max_pooling2d_3 (MaxPooling (None, 4, 4, 512) 0
2D)
flatten (Flatten) (None, 8192) 0
dense (Dense) (None, 512) 4194816
dropout (Dropout) (None, 512) 0
dense_1 (Dense) (None, 256) 131328
dropout_1 (Dropout) (None, 256) 0
dense_2 (Dense) (None, 128) 32896
dropout_2 (Dropout) (None, 128) 0
dense_3 (Dense) (None, 2) 258
=================================================================
Total params: 5,910,274
Trainable params: 5,910,274
Non-trainable params: 0
Link to APP: Active for limited time(72 hours). I need to run code again after that. In case Link is not active please email me rudragod5@gmail.com.
Test the model here..and do provide feedback-
Other Indicators of the App