code
code
# Global variables
global filename
global accuracy
X = [] # To store image data
Y = [] # To store labels
global classifier
disease = ['No Tumor Detected', 'Tumor Detected'] # Class labels
x_train = X[indices]
y_train = YY[indices]
accuracy = data['accuracy']
loss = data['loss']
plt.figure(figsize=(10, 6))
plt.grid(True)
plt.xlabel('Training Epoch')
plt.ylabel('Accuracy/Loss')
plt.plot(loss, 'ro-', color='red') # Plot the loss
plt.plot(accuracy, 'ro-', color='green') # Plot the accuracy
plt.legend(['Loss', 'Accuracy'], loc='upper left')
plt.title('Brain Tumor CNN Model Training Accuracy & Loss Graph')
plt.show()
# GUI Design
font = ('times', 16, 'bold')
title = Label(main, text='Identifying Brain Tumor using X-Ray Images')
title.config(bg='darkviolet', fg='gold')
title.config(font=font)
title.config(height=3, width=120)
title.place(x=0, y=5)
main.config(bg='turquoise')
main.mainloop()