The objective of this work is to demonstrate how colorization of grayscale CT scans can aid in improving model performance and interpretability in the field of medical diagnostics.
1from tensorflow.keras.models import load_model
2from tensorflow.keras.preprocessing import image
3import numpy as np
4
5# Load model
6model = load_model("brain_ct_classifier.h5")
7
8# Preprocess
9img = image.load_img("example_brain_ct.jpg", target_size=(299, 299))
10img_array = image.img_to_array(img) / 255.0
11img_array = np.expand_dims(img_array, axis=0)
12
13# Predict
14pred = model.predict(img_array)
15class_idx = np.argmax(pred)
16class_names = ["Aneurysm", "Cancer", "Tumor"]
17
18print("Predicted class:", class_names[class_idx])