Brain Tumor Classification in MRI Images Using Combined Transfer Learning and Convolutional Neural Networks.
One block of code here has a permanent identifier (oscr:b:…), listed with the matches below: citable for good, with a page of its own. Select a match and press Cite to copy it. What a block identifier is.
The 8 matches
- [1] § 3. Materials and Methods ↔ custom_cnn.ipynb.ipynb, lines 1 to 55 · score 0.74 · EfficientNetV2L, MobileNetV2, ResNet152V2, Custom CNN, InceptionV3, pre · block
oscr:b:ZTZVWQG7XPE7P-B· Report a mismatch - [2] § 4. Experimental Results and Analysis ↔ custom_cnn.ipynb.ipynb, lines 1 to 55 · score 0.73 · Custom CNN model, MobileNetV2, ResNet152V2, InceptionV3, meningioma, pituitary · block
oscr:b:ZTZVWQG7XPE7P-B· Report a mismatch - [3] § 4. Experimental Results and Analysis › 4.1. Evaluation Metrics and Strategy ↔ pretrained_ensemble.ipynb.ipynb, lines 501 to 538 · score 0.67 · Squared Error, Absolute Error, F1 score, Recall, MAE, RMSE · Report a mismatch
- [4] § 3. Materials and Methods › 3.6. Design and Implementation of the Proposed Ensemble Model ↔ pretrained_ensemble.ipynb.ipynb, lines 554 to 572 · score 0.65 · EfficientNetV2L, MobileNetV2, ResNet152V2, InceptionV3, trained models, Xception · Report a mismatch
- [5] § 4. Experimental Results and Analysis › 4.4. Classification Results › 4.4.4. Training and Validation Accuracy and Loss Comparison ↔ pretrained_ensemble.ipynb.ipynb, lines 705 to 757 · score 0.62 · EfficientNetV2L, MobileNetV2, ResNet152V2, InceptionV3, validation, VGG16 · Report a mismatch
- [6] § 3. Materials and Methods › 3.6. Design and Implementation of the Proposed Ensemble Model ↔ pretrained_ensemble.ipynb.ipynb, lines 612 to 648 · score 0.57 · MobileNetV2, ResNet152V2, InceptionV3, EfficientNetV2, trained models, Xception · Report a mismatch
- [7] § 3. Materials and Methods ↔ pretrained_ensemble.ipynb.ipynb, lines 157 to 185 · score 0.57 · dense layers, convolutional layers, softmax, class, models · Report a mismatch
- [8] § 3. Materials and Methods › 3.3. Customized CNN and Base Models for Feature Extraction ↔ pretrained_ensemble.ipynb.ipynb, lines 157 to 185 · score 0.54 · convolutional layers, flattened, ReLU, softmax, activated, ensemble · Report a mismatch
Paper
Loaded from Europe PMC by your browser; OSCR does not store it: doi.org · Europe PMC
The paper is loaded when this pane is shown.
The authors' code
Jupyter notebook · 1,078 lines · 37 KB · no license · 6 matches
- # %%
- import sys
- import os
- import math
- import time
- import pathlib
- import pickle
- import numpy as np
- import pandas as pd
- import seaborn as sns
- import tensorflow as tf
- import matplotlib.pyplot as plt
- from tensorflow.keras import layers
- from tensorflow.keras.models import Model
- from tensorflow.keras.optimizers import Adam
- from tensorflow.keras.callbacks import ModelCheckpoint, ReduceLROnPlateau
- from tensorflow.keras.applications import InceptionV3
- from tensorflow.keras.applications import EfficientNetV2L
- from tensorflow.keras.applications import ResNet152V2
- from tensorflow.keras.applications import Xception
- from tensorflow.keras.applications import VGG16
- from tensorflow.keras.applications import MobileNetV2
- from sklearn.utils.class_weight import compute_class_weight
- from tensorflow.keras.models import load_model
- from sklearn.metrics import accuracy_score, f1_score, precision_score, recall_score, confusion_matrix, mean_absolute_error, mean_squared_error
- # %% [markdown]
- # # Dataset paths
- # %%
- # Dataset paths
- train_dir = pathlib.Path('/kaggle/input/brain-tumor-mri-dataset/Training')
- test_dir = pathlib.Path('/kaggle/input/brain-tumor-mri-dataset/Testing')
- img_height = 224
- img_width = 224
- batch_size = 32
- epochs = 50
- # %% [markdown]
- # # Data augmentation
- # %%
- # Dataset loading
- train_ds = tf.keras.utils.image_dataset_from_directory(
- train_dir,
- validation_split=0.2,
- subset="training",
- seed=123,
- image_size=(224, 224),
- batch_size=batch_size,
- shuffle=True,
- interpolation="bilinear",
- label_mode="int",
- )
- # Get class names
- class_names = train_ds.class_names
- print("Classes in the dataset:", class_names)
- # Normalize and apply data augmentation
- normalization_layer = tf.keras.layers.Rescaling(1./255)
- data_augmentation = tf.keras.Sequential([
- tf.keras.layers.RandomFlip("horizontal"),
- tf.keras.layers.RandomRotation(0.2),
- tf.keras.layers.RandomZoom(0.2),
- tf.keras.layers.RandomContrast(0.2),
- tf.keras.layers.RandomTranslation(0.1, 0.1),
- ])
- train_ds = train_ds.map(lambda x, y: (normalization_layer(x), y))
- train_ds = train_ds.map(lambda x, y: (data_augmentation(x, training=True), y))
- # Validation dataset
- val_ds = tf.keras.utils.image_dataset_from_directory(
- train_dir,
- validation_split=0.2,
- subset="validation",
- seed=123,
- image_size=(224, 224),
- batch_size=batch_size,
- )
- val_ds = val_ds.map(lambda x, y: (normalization_layer(x), y))
- # Test dataset
- test_ds = tf.keras.utils.image_dataset_from_directory(
- test_dir,
- image_size=(224, 224),
- batch_size=batch_size,
- )
- test_ds = test_ds.map(lambda x, y: (normalization_layer(x), y))
- # %%
- def get_class_weights(train_ds, class_names):
- print("Calculating class weights...")
- labels = []
- for image_batch, label_batch in train_ds:
- labels.append(label_batch.numpy())
- labels = np.concatenate(labels)
- class_weights = compute_class_weight('balanced', classes=np.unique(labels), y=labels)
- class_weight_dict = {i: class_weights[i] for i in range(len(class_names))}
- print("Class weights calculated.")
- return class_weight_dict
- class_weight_dict = get_class_weights(train_ds, class_names)
- # %%
- # General Imports
- import matplotlib.pyplot as plt
- import seaborn as sns
- import numpy as np
- import os
- from sklearn.metrics import confusion_matrix
- # Neural Network imports
- import tensorflow as tf
- from tensorflow.keras.models import Sequential
- from tensorflow.keras.models import load_model
- from tensorflow.keras.layers import MaxPooling2D
- from tensorflow.keras.layers import Conv2D
- from tensorflow.keras.layers import Dense
- from tensorflow.keras.layers import Dropout
- from tensorflow.keras.layers import Flatten
- from tensorflow.keras.layers import Input
- from tensorflow.keras.optimizers import Adam
- # Image augmentation importrs
- from tensorflow.keras.utils import load_img
- from tensorflow.keras.preprocessing import image
- from tensorflow.keras.layers import RandomRotation
- from tensorflow.keras.layers import RandomContrast
- from tensorflow.keras.layers import RandomZoom
- from tensorflow.keras.layers import RandomFlip
- from tensorflow.keras.layers import RandomTranslation
- # Training Model callbacks
- from tensorflow.keras.callbacks import ReduceLROnPlateau
- from tensorflow.keras.callbacks import ModelCheckpoint
- # Check if GPU is available
- print(f'Tensorflow Version: {tf.__version__}')
- print("GPU Available:", tf.config.list_physical_devices('GPU')[0])
- # %%
- for image, label in train_ds.take(1):
- print("Label shape:", label.shape)
- print("Label:", label)
- # %%
- # # Building model
- image_size=(224, 224,3)
- model = Sequential([
- # Input tensor shape
- Input(image_size),
- # Convolutional layer 1
- Conv2D(64, (5, 5), activation="relu"),
- MaxPooling2D(pool_size=(3, 3)),
- # Convolutional layer 2
- Conv2D(64, (5, 5), activation="relu"),
- MaxPooling2D(pool_size=(3, 3)),
- # Convolutional layer 3
- Conv2D(128, (4, 4), activation="relu"),
- MaxPooling2D(pool_size=(2, 2)),
- # Convolutional layer 4
- Conv2D(128, (4, 4), activation="relu"),
- MaxPooling2D(pool_size=(2, 2)),
- Flatten(),
- # Dense layers
- Dense(512, activation="relu"),
- Dense(len(class_names), activation="softmax")
- ])
- # Model summary
- model.summary()
- # COompilng model with Adam optimizer
- optimizer = Adam(learning_rate=0.001, beta_1=0.85, beta_2=0.9925)
- model.compile(optimizer=optimizer, loss='categorical_crossentropy', metrics= ['accuracy'])
- import os
- import json
- import time
- import tensorflow as tf
- from tensorflow.keras.callbacks import ModelCheckpoint, ReduceLROnPlateau
- def train_custom_model(model, model_name, train_ds, val_ds, test_ds,
- learning_rate=0.001, epochs=50, class_weight=None,
- extra_callbacks=None):
- # Create save directory
- save_dir = '/kaggle/working/'
- os.makedirs(save_dir, exist_ok=True)
- # Compile model (if not compiled already)
- optimizer = tf.keras.optimizers.Adam(learning_rate=learning_rate, beta_1=0.85, beta_2=0.9925)
- # model.compile(optimizer=optimizer, loss='categorical_crossentropy', metrics=['accuracy'])
- model.compile(optimizer=optimizer, loss='sparse_categorical_crossentropy', metrics=['accuracy'])
- print(f"\nSummary of {model_name}:")
- model.summary()
- # File paths
- model_path = os.path.join(save_dir, f'{model_name}.keras')
- best_model_path = os.path.join(save_dir, f'{model_name}_best.keras')
- history_path = os.path.join(save_dir, f'{model_name}_history.json')
- eval_path = os.path.join(save_dir, f'{model_name}_evaluation.json')
- time_path = os.path.join(save_dir, f'{model_name}_computation_time.txt')
- # Default callbacks
- model_checkpoint = ModelCheckpoint(best_model_path, monitor='val_loss', save_best_only=True, verbose=False)
- reduce_lr = ReduceLROnPlateau(monitor='val_loss', factor=0.8, patience=4, min_lr=1e-4, verbose=False)
- # Merge with extra callbacks if any
- callbacks = [model_checkpoint, reduce_lr]
- if extra_callbacks:
- callbacks.extend(extra_callbacks)
- # Train model with timing
- start_time = time.time()
- history = model.fit(
- train_ds,
- validation_data=val_ds,
- epochs=epochs,
- class_weight=class_weight,
- callbacks=callbacks,
- shuffle=True,
- verbose=True
- )
- end_time = time.time()
- computation_time = end_time - start_time
- print(f"Model training took {computation_time:.2f} seconds.")
- print(f"\nEvaluating {model_name}...")
- print(f"\nClass Weights used in training {model_name}: {class_weight}")
- # Evaluate model
- evaluation = model.evaluate(test_ds)
- loss, accuracy = evaluation
- print('Loss:', loss)
- print(f'Test Accuracy: {accuracy * 100:.2f}%')
- # Save final model
- model.save(model_path)
- print(f"Model saved to {model_path}")
- # Save training history
- with open(history_path, 'w') as f:
- history_dict = {key: [float(val) for val in values] for key, values in history.history.items()}
- json.dump(history_dict, f, indent=4)
- print(f"Training history saved to {history_path}")
- # Save evaluation
- eval_dict = {
- 'loss': float(loss),
- 'accuracy': float(accuracy),
- 'metrics': {
- 'loss': float(loss),
- 'accuracy': float(accuracy)
- }
- }
- with open(eval_path, 'w') as f:
- json.dump(eval_dict, f, indent=4)
- print(f"Evaluation results saved to {eval_path}")
- # Save computation time
- with open(time_path, 'w') as f:
- f.write(f"Training time: {computation_time:.2f} seconds\n")
- f.write(f"Training time: {computation_time / 60:.2f} minutes\n")
- f.write(f"Training time: {computation_time / 3600:.2f} hours\n")
- print(f"Computation time saved to {time_path}")
- return model, history, evaluation, computation_time
- # Custom callback for reducing learning rate at accuracy values
- class ReduceLROnMultipleAccuracies(tf.keras.callbacks.Callback):
- def __init__(self, thresholds, factor, monitor='val_accuracy', verbose=1):
- super(ReduceLROnMultipleAccuracies, self).__init__()
- self.thresholds = thresholds # List of accuracy thresholds
- self.factor = factor # Factor to reduce the learning rate
- self.monitor = monitor
- self.verbose = verbose
- self.thresholds_reached = [False] * len(thresholds) # Track each threshold
- def on_epoch_end(self, epoch, logs=None):
- current_accuracy = logs.get(self.monitor)
- for i, threshold in enumerate(self.thresholds):
- if current_accuracy >= threshold and not self.thresholds_reached[i]:
- optimizer = self.model.optimizer
- old_lr = optimizer.learning_rate.numpy()
- new_lr = old_lr * self.factor
- optimizer.learning_rate.assign(new_lr)
- self.thresholds_reached[i] = True # Mark this threshold as reached
- if self.verbose > 0:
- print(f"\nEpoch {epoch+1}: {self.monitor} reached {threshold}. Reducing learning rate from {old_lr} to {new_lr}.")
- # Try a custom callback
- thresholds = [0.96, 0.99, 0.9935]
- lr_callback = ReduceLROnMultipleAccuracies(thresholds=thresholds, factor=0.75, monitor='val_accuracy', verbose=False)
- model_name = "custom_cnn_model"
- model_rlr = ReduceLROnPlateau(monitor='val_loss', factor=0.8, min_lr=1e-4, patience=4, verbose=False)
- model_mc = ModelCheckpoint('custom_cnn_model_updated.keras', monitor='val_accuracy', mode='max', save_best_only=True, verbose=False)
- # Include your custom callback if needed
- model, history, evaluation, computation_time = train_custom_model(
- model=model,
- model_name=model_name,
- train_ds=train_ds,
- val_ds=test_ds,
- test_ds=test_ds,
- learning_rate=0.001,
- epochs=epochs,
- extra_callbacks=[model_rlr, model_mc],
- )
- # %% [markdown]
- # # Balancing using class weights
- # %%
- # %% [markdown]
- # # Create and train model
- # %%
- # def create_and_train_model(base_model, model_name, train_ds, val_ds, test_ds, num_classes=4, learning_rate=0.0001, epochs=epochs, class_weight=None):
- # for layer in base_model.layers[:10]:
- # layer.trainable = False
- # x = layers.GlobalAveragePooling2D()(base_model.output)
- # x = layers.Dense(512, activation='relu', kernel_regularizer=tf.keras.regularizers.l2(0.01))(x)
- # x = layers.Dropout(0.4)(x)
- # predictions = layers.Dense(num_classes, activation='softmax')(x)
- # model = Model(inputs=base_model.inputs, outputs=predictions)
- # model.compile(
- # optimizer=Adam(learning_rate=learning_rate, beta_1=0.9, beta_2=0.999),
- # loss=tf.losses.SparseCategoricalCrossentropy(),
- # metrics=['accuracy']
- # )
- # print(f"\nSummary of {model_name}:")
- # model.summary()
- # model_checkpoint = ModelCheckpoint(f'{model_name}.keras', monitor='val_loss', save_best_only=True)
- # reduce_lr = ReduceLROnPlateau(monitor='val_loss', factor=0.1, patience=5, min_lr=1e-6)
- # start_time = time.time()
- # history = model.fit(
- # train_ds,
- # shuffle=True,
- # validation_data=val_ds,
- # epochs=epochs,
- # class_weight=class_weight,
- # callbacks=[model_checkpoint, reduce_lr]
- # )
- # # End time tracking
- # end_time = time.time()
- # # Calculate computation time
- # computation_time = end_time - start_time
- # print(f"Model training took {computation_time:.2f} seconds.")
- # print(f"\nEvaluating {model_name}...")
- # print(f"\nClass Weights used in training {model_name}: {class_weight}")
- # loss, accuracy = model.evaluate(test_ds)
- # print('Loss:', loss)
- # print(f'Test Accuracy: {accuracy * 100:.2f}%')
- # model.save(f'{model_name}.keras')
- # evaluation = model.evaluate(test_ds)
- # return model, history, evaluation, computation_time
- import os
- import json
- import time
- import tensorflow as tf
- from tensorflow.keras.layers import Dense, Dropout, GlobalAveragePooling2D
- from tensorflow.keras.models import Model
- from tensorflow.keras.optimizers import Adam
- from tensorflow.keras.callbacks import ModelCheckpoint, ReduceLROnPlateau
- def create_and_train_model(base_model, model_name, train_ds, val_ds, test_ds, num_classes=4,
- learning_rate=0.0001, epochs=50, class_weight=None):
- # Create save directory if it doesn't exist
- save_dir = '/kaggle/working/'
- os.makedirs(save_dir, exist_ok=True)
- # Freeze early layers
- for layer in base_model.layers[:10]:
- layer.trainable = False
- # Build model architecture
- x = GlobalAveragePooling2D()(base_model.output)
- x = Dense(512, activation='relu', kernel_regularizer=tf.keras.regularizers.l2(0.01))(x)
- x = Dropout(0.4)(x)
- predictions = Dense(num_classes, activation='softmax')(x)
- model = Model(inputs=base_model.inputs, outputs=predictions)
- # Compile model
- model.compile(
- optimizer=Adam(learning_rate=learning_rate, beta_1=0.9, beta_2=0.999),
- loss=tf.losses.SparseCategoricalCrossentropy(),
- metrics=['accuracy']
- )
- print(f"\nSummary of {model_name}:")
- model.summary()
- # Create file paths for saving
- model_path = os.path.join(save_dir, f'{model_name}.keras')
- best_model_path = os.path.join(save_dir, f'{model_name}_best.keras')
- history_path = os.path.join(save_dir, f'{model_name}_history.json')
- eval_path = os.path.join(save_dir, f'{model_name}_evaluation.json')
- time_path = os.path.join(save_dir, f'{model_name}_computation_time.txt')
- # Set up callbacks
- model_checkpoint = ModelCheckpoint(best_model_path, monitor='val_loss', save_best_only=True)
- reduce_lr = ReduceLROnPlateau(monitor='val_loss', factor=0.1, patience=5, min_lr=1e-6)
- # Train model with time tracking
- start_time = time.time()
- history = model.fit(
- train_ds,
- shuffle=True,
- validation_data=val_ds,
- epochs=epochs,
- class_weight=class_weight,
- callbacks=[model_checkpoint, reduce_lr]
- )
- end_time = time.time()
- computation_time = end_time - start_time
- print(f"Model training took {computation_time:.2f} seconds.")
- print(f"\nEvaluating {model_name}...")
- print(f"\nClass Weights used in training {model_name}: {class_weight}")
- # Evaluate the model
- evaluation = model.evaluate(test_ds)
- loss, accuracy = evaluation
- print('Loss:', loss)
- print(f'Test Accuracy: {accuracy * 100:.2f}%')
- # Save model
- model.save(model_path)
- print(f"Model saved to {model_path}")
- # Save history
- with open(history_path, 'w') as f:
- history_dict = {key: [float(val) for val in values] for key, values in history.history.items()}
- json.dump(history_dict, f, indent=4)
- print(f"Training history saved to {history_path}")
- # Save evaluation
- eval_dict = {
- 'loss': float(loss),
- 'accuracy': float(accuracy),
- 'metrics': {
- 'loss': float(evaluation[0]),
- 'accuracy': float(evaluation[1])
- }
- }
- with open(eval_path, 'w') as f:
- json.dump(eval_dict, f, indent=4)
- print(f"Evaluation results saved to {eval_path}")
- # Save computation time
- with open(time_path, 'w') as f:
- f.write(f"Training time: {computation_time:.2f} seconds\n")
- f.write(f"Training time: {computation_time/60:.2f} minutes\n")
- f.write(f"Training time: {computation_time/3600:.2f} hours\n")
- print(f"Computation time saved to {time_path}")
- return model, history, evaluation, computation_time
- # %%
- def evaluate_model(model, test_ds, model_name):
- y_true = []
- y_pred = []
- for images, labels in test_ds:
- predictions = model.predict(images)
- y_pred.extend(np.argmax(predictions, axis=1))
- y_true.extend(labels.numpy())
- y_true = np.array(y_true)
- y_pred = np.array(y_pred)
- accuracy = accuracy_score(y_true, y_pred)
- precision = precision_score(y_true, y_pred, average='weighted')
- recall = recall_score(y_true, y_pred, average='weighted')
- f1 = f1_score(y_true, y_pred, average='weighted')
- mae = mean_absolute_error(y_true, y_pred)
- rmse = mean_squared_error(y_true, y_pred, squared=False)
- cm = confusion_matrix(y_true, y_pred)
- print(f"\nModel Evaluation Metrics for {model_name}:")
- print(f"Accuracy: {accuracy:.4f}")
- print(f"Precision: {precision:.4f}")
- print(f"Recall: {recall:.4f}")
- print(f"F1 Score: {f1:.4f}")
- print(f"MAE: {mae:.4f}")
- print(f"RMSE: {rmse:.4f}")
- plt.figure(figsize=(6, 6))
- sns.heatmap(cm, annot=True, fmt='d', cmap='Blues', xticklabels=range(4), yticklabels=range(4))
- plt.xlabel('Predicted Label')
- plt.ylabel('True Label')
- plt.title(f'Confusion Matrix - {model_name}')
- plt.show()
- return accuracy, precision, recall, f1, mae, rmse, cm
- # %%
- from tensorflow.keras.applications import InceptionV3
- # Path to your uploaded weights file
- weights_path = '/kaggle/input/inception_v3/tensorflow2/default/1/inception_v3_weights_tf_dim_ordering_tf_kernels_notop.h5'
- # Initialize the model without downloading weights
- base_model1 = InceptionV3(weights=None, include_top=False, input_shape=(224, 224, 3))
- # Load the weights from your uploaded file
- base_model1.load_weights(weights_path)
- print("InceptionV3 model loaded successfully with local weights!")
- # %% [markdown]
- # # Train all models with 30 epochs
- # %%
- # # Define the base models
- # base_model1 = InceptionV3(weights='imagenet', include_top=False, input_shape=(224, 224, 3))
- # # base_model2 = EfficientNetV2L(weights='imagenet', include_top=False, input_shape=(224, 224, 3))
- # # base_model3 = ResNet152V2(weights='imagenet', include_top=False, input_shape=(224, 224, 3))
- # # base_model4 = Xception(weights='imagenet', include_top=False, input_shape=(224, 224, 3))
- # # base_model5 = VGG16(weights='imagenet', include_top=False, input_shape=(224, 224, 3))
- # # base_model6 = MobileNetV2(weights='imagenet', include_top=False, input_shape=(224, 224, 3))
- # %%
- model1, history1, evaluation1, time1 = create_and_train_model(base_model1, 'model1_inceptionv3_class_weights', train_ds, val_ds, test_ds, epochs=epochs, class_weight=class_weight_dict)
- # # model2, history2, evaluation2, time2 = create_and_train_model(base_model2, 'model2_efficientnetv2l_class_weights', train_ds, val_ds, test_ds, epochs=epochs, class_weight=class_weight_dict)
- # # model3, history3, evaluation3, time3 = create_and_train_model(base_model3, 'model3_resnet152v2_class_weights', train_ds, val_ds, test_ds, epochs=epochs, class_weight=class_weight_dict)
- # # model4, history4, evaluation4, time4 = create_and_train_model(base_model4, 'model4_xception_class_weights', train_ds, val_ds, test_ds, epochs=epochs, class_weight=class_weight_dict)
- # # model5, history5, evaluation5, time5 = create_and_train_model(base_model5, 'model5_vgg16_class_weights', train_ds, val_ds, test_ds, epochs=epochs, class_weight=class_weight_dict)
- # # model6, history6, evaluation6, time6 = create_and_train_model(base_model6, 'model6_mobilenetv2_class_weights', train_ds, val_ds, test_ds, epochs=epochs, class_weight=class_weight_dict)
- # %%
- # from tensorflow.keras.applications import (
- # InceptionV3, EfficientNetV2L, ResNet152V2,
- # Xception, VGG16, MobileNetV2
- # )
- # # InceptionV3 (which you already have)
- # base_model1 = InceptionV3(weights=None, include_top=False, input_shape=(224, 224, 3))
- # base_model1.load_weights('/kaggle/input/inception_v3/tensorflow2/default/1/inception_v3_weights_tf_dim_ordering_tf_kernels_notop.h5')
- # # For EfficientNetV2L
- # base_model2 = EfficientNetV2L(weights=None, include_top=False, input_shape=(224, 224, 3))
- # base_model2.load_weights('/kaggle/input/efficientnet/tensorflow2/default/1/efficientnetv2-l_notop.h5')
- # # For ResNet152V2
- # base_model3 = ResNet152V2(weights=None, include_top=False, input_shape=(224, 224, 3))
- # base_model3.load_weights('/kaggle/input/resnet/tensorflow2/default/1/resnet152v2_weights_tf_dim_ordering_tf_kernels_notop.h5')
- # # For Xception
- # base_model4 = Xception(weights=None, include_top=False, input_shape=(224, 224, 3))
- # base_model4.load_weights('/kaggle/input/xception/tensorflow2/default/1/xception_weights_tf_dim_ordering_tf_kernels_notop.h5')
- # # For VGG16
- # base_model5 = VGG16(weights=None, include_top=False, input_shape=(224, 224, 3))
- # base_model5.load_weights('/kaggle/input/vgg16/tensorflow2/default/1/vgg16_weights_tf_dim_ordering_tf_kernels_notop.h5')
- # # For MobileNetV2
- # base_model6 = MobileNetV2(weights=None, include_top=False, input_shape=(224, 224, 3))
- # base_model6.load_weights('/kaggle/input/mobilenet/tensorflow2/default/1/mobilenet_v2_weights_tf_dim_ordering_tf_kernels_1.0_224_no_top.h5')
- # # Now you can train your models
- # model1, history1, evaluation1, time1 = create_and_train_model(base_model1, 'model1_inceptionv3_class_weights', train_ds, val_ds, test_ds, epochs=epochs, class_weight=class_weight_dict)
- # model2, history2, evaluation2, time2 = create_and_train_model(base_model2, 'model2_efficientnetv2l_class_weights', train_ds, val_ds, test_ds, epochs=epochs, class_weight=class_weight_dict)
- # model3, history3, evaluation3, time3 = create_and_train_model(base_model3, 'model3_resnet152v2_class_weights', train_ds, val_ds, test_ds, epochs=epochs, class_weight=class_weight_dict)
- # model4, history4, evaluation4, time4 = create_and_train_model(base_model4, 'model4_xception_class_weights', train_ds, val_ds, test_ds, epochs=epochs, class_weight=class_weight_dict)
- # model5, history5, evaluation5, time5 = create_and_train_model(base_model5, 'model5_vgg16_class_weights', train_ds, val_ds, test_ds, epochs=epochs, class_weight=class_weight_dict)
- # model6, history6, evaluation6, time6 = create_and_train_model(base_model6, 'model6_mobilenetv2_class_weights', train_ds, val_ds, test_ds, epochs=epochs, class_weight=class_weight_dict)
- # %%
- from tensorflow.keras.applications import (
- InceptionV3, EfficientNetV2L, ResNet152V2,
- Xception, VGG16, MobileNetV2
- )
- # InceptionV3 (which you already have)
- base_model1 = InceptionV3(weights=None, include_top=False, input_shape=(224, 224, 3))
- base_model1.load_weights('/kaggle/input/inception_v3/tensorflow2/default/1/inception_v3_weights_tf_dim_ordering_tf_kernels_notop.h5')
- # For EfficientNetV2L
- base_model2 = EfficientNetV2L(weights=None, include_top=False, input_shape=(224, 224, 3))
- base_model2.load_weights('/kaggle/input/efficientnet/tensorflow2/default/1/efficientnetv2-l_notop.h5')
- # For ResNet152V2
- base_model3 = ResNet152V2(weights=None, include_top=False, input_shape=(224, 224, 3))
- base_model3.load_weights('/kaggle/input/resnet/tensorflow2/default/1/resnet152v2_weights_tf_dim_ordering_tf_kernels_notop.h5')
- # For Xception
- base_model4 = Xception(weights=None, include_top=False, input_shape=(224, 224, 3))
- base_model4.load_weights('/kaggle/input/xception/tensorflow2/default/1/xception_weights_tf_dim_ordering_tf_kernels_notop.h5')
- # For VGG16
- base_model5 = VGG16(weights=None, include_top=False, input_shape=(224, 224, 3))
- base_model5.load_weights('/kaggle/input/vgg16/tensorflow2/default/1/vgg16_weights_tf_dim_ordering_tf_kernels_notop.h5')
- # For MobileNetV2
- base_model6 = MobileNetV2(weights=None, include_top=False, input_shape=(224, 224, 3))
- base_model6.load_weights('/kaggle/input/mobilenet/tensorflow2/default/1/mobilenet_v2_weights_tf_dim_ordering_tf_kernels_1.0_224_no_top.h5')
- # Now you can train your models
- # model1, history1, evaluation1, time1 = create_and_train_model(base_model1, 'model1_inceptionv3_class_weights', train_ds, val_ds, test_ds, epochs=epochs, class_weight=class_weight_dict)
- model2, history2, evaluation2, time2 = create_and_train_model(base_model2, 'model2_efficientnetv2l_class_weights', train_ds, val_ds, test_ds, epochs=epochs, class_weight=class_weight_dict)
- model3, history3, evaluation3, time3 = create_and_train_model(base_model3, 'model3_resnet152v2_class_weights', train_ds, val_ds, test_ds, epochs=epochs, class_weight=class_weight_dict)
- model4, history4, evaluation4, time4 = create_and_train_model(base_model4, 'model4_xception_class_weights', train_ds, val_ds, test_ds, epochs=epochs, class_weight=class_weight_dict)
- model5, history5, evaluation5, time5 = create_and_train_model(base_model5, 'model5_vgg16_class_weights', train_ds, val_ds, test_ds, epochs=epochs, class_weight=class_weight_dict)
- model6, history6, evaluation6, time6 = create_and_train_model(base_model6, 'model6_mobilenetv2_class_weights', train_ds, val_ds, test_ds, epochs=epochs, class_weight=class_weight_dict)
- # %%
- # # Define model names
- # model_names = [
- # "InceptionV3"
- # ]
- # # Store histories in a list
- # histories = [history1]
- # # Plot Training Accuracy
- # plt.figure(figsize=(12, 6))
- # for i, history in enumerate(histories):
- # plt.plot(history.history['accuracy'], label=f'{model_names[i]} Training')
- # plt.title('Training Accuracy over Epochs')
- # plt.xlabel('Epochs')
- # plt.ylabel('Accuracy')
- # plt.legend()
- # plt.grid()
- # plt.show()
- # # Plot Validation Accuracy
- # plt.figure(figsize=(12, 6))
- # for i, history in enumerate(histories):
- # plt.plot(history.history['val_accuracy'], label=f'{model_names[i]} Validation')
- # plt.title('Validation Accuracy over Epochs')
- # plt.xlabel('Epochs')
- # plt.ylabel('Accuracy')
- # plt.legend()
- # plt.grid()
- # plt.show()
- # # Plot Training Loss
- # plt.figure(figsize=(12, 6))
- # for i, history in enumerate(histories):
- # plt.plot(history.history['loss'], label=f'{model_names[i]} Training Loss')
- # plt.title('Training Loss over Epochs')
- # plt.xlabel('Epochs')
- # plt.ylabel('Loss')
- # plt.legend()
- # plt.grid()
- # plt.show()
- # # Plot Validation Loss
- # plt.figure(figsize=(12, 6))
- # for i, history in enumerate(histories):
- # plt.plot(history.history['val_loss'], label=f'{model_names[i]} Validation Loss')
- # plt.title('Validation Loss over Epochs')
- # plt.xlabel('Epochs')
- # plt.ylabel('Loss')
- # plt.legend()
- # plt.grid()
- # plt.show()
- # %%
- # Define model names
- model_names = [
- "InceptionV3", "EfficientNetV2L", "ResNet152V2",
- "Xception", "VGG16", "MobileNetV2"
- ]
- # Store histories in a list
- histories = [history1, history2, history3, history4, history5, history6]
- # Plot Training Accuracy
- plt.figure(figsize=(12, 6))
- for i, history in enumerate(histories):
- plt.plot(history.history['accuracy'], label=f'{model_names[i]} Training')
- plt.title('Training Accuracy over Epochs')
- plt.xlabel('Epochs')
- plt.ylabel('Accuracy')
- plt.legend()
- plt.grid()
- plt.show()
- # Plot Validation Accuracy
- plt.figure(figsize=(12, 6))
- for i, history in enumerate(histories):
- plt.plot(history.history['val_accuracy'], label=f'{model_names[i]} Validation')
- plt.title('Validation Accuracy over Epochs')
- plt.xlabel('Epochs')
- plt.ylabel('Accuracy')
- plt.legend()
- plt.grid()
- plt.show()
- # Plot Training Loss
- plt.figure(figsize=(12, 6))
- for i, history in enumerate(histories):
- plt.plot(history.history['loss'], label=f'{model_names[i]} Training Loss')
- plt.title('Training Loss over Epochs')
- plt.xlabel('Epochs')
- plt.ylabel('Loss')
- plt.legend()
- plt.grid()
- plt.show()
- # Plot Validation Loss
- plt.figure(figsize=(12, 6))
- for i, history in enumerate(histories):
- plt.plot(history.history['val_loss'], label=f'{model_names[i]} Validation Loss')
- plt.title('Validation Loss over Epochs')
- plt.xlabel('Epochs')
- plt.ylabel('Loss')
- plt.legend()
- plt.grid()
- plt.show()
- # %%
- # %%
- # %%
- # %%
- # After training models
- evaluate_model(model1, test_ds, 'model1_inceptionv3_class_weights')
- evaluate_model(model2, test_ds, 'model2_efficientnetv2l_class_weights')
- evaluate_model(model3, test_ds, 'model3_resnet152v2_class_weights')
- evaluate_model(model4, test_ds, 'model4_xception_class_weights')
- evaluate_model(model5, test_ds, 'model5_vgg16_class_weights')
- evaluate_model(model6, test_ds, 'model6_mobilenetv2_class_weights')
- # %% [markdown]
- # # Load models
- # %%
- from tensorflow.keras.models import load_model
- import os
- base_path = "/kaggle/input/custom_models/tensorflow2/default/1"
- print("Files in directory:")
- print(os.listdir(base_path))
- # %%
- model1 = load_model('/kaggle/input/custom_models/tensorflow2/default/1/model1_inceptionv3_class_weights_best.keras')
- model3 = load_model('/kaggle/input/custom_models/tensorflow2/default/1/model3_resnet152v2_class_weights.keras')
- model4 = load_model('/kaggle/input/custom_models/tensorflow2/default/1/model4_xception_class_weights.keras')
- model5 = load_model('/kaggle/input/custom_models/tensorflow2/default/1/model5_vgg16_class_weights_best.keras')
- model6 = load_model('/kaggle/input/custom_models/tensorflow2/default/1/model6_mobilenetv2_class_weights_best.keras')
- model7 = load_model('/kaggle/input/custom_cnn_updated/tensorflow2/default/1/custom_cnn_model_best.keras')
- # model2 = load_model('/kaggle/input/custom_models/tensorflow2/default/1/model2_efficientnetv2l_class_weights_best.keras')
- # %%
- # Define ensembles
- # ensemble1 = [model2, model4, model3]
- # ensemble2 = [model1, model2, model4]
- # ensemble3 = [model2, model3, model6]
- ensemble1 = [model7, model4, model3]
- ensemble2 = [model1, model7, model4]
- ensemble3 = [model7, model3, model6]
- # %%
- def ensemble_predict(models, test_ds):
- all_predictions = []
- y_true = []
- for images, labels in test_ds:
- y_true.extend(labels.numpy())
- preds = [model.predict(images, verbose=0) for model in models]
- all_predictions.append(np.mean(preds, axis=0))
- avg_predictions = np.vstack(all_predictions)
- final_predictions = np.argmax(avg_predictions, axis=1)
- return np.array(y_true), final_predictions, avg_predictions
- # %%
- # Function to evaluate ensemble and save results
- def evaluate_and_save_ensemble(models, test_ds, model_name):
- y_true, y_pred, avg_probs = ensemble_predict(models, test_ds)
- # Calculate metrics
- accuracy = accuracy_score(y_true, y_pred)
- precision = precision_score(y_true, y_pred, average='macro')
- recall = recall_score(y_true, y_pred, average='macro')
- f1 = f1_score(y_true, y_pred, average='macro')
- # Confusion Matrix
- cm = confusion_matrix(y_true, y_pred)
- sensitivity = np.mean(np.diag(cm) / np.sum(cm, axis=1))
- specificity = np.mean(np.diag(cm) / np.sum(cm, axis=0))
- # Additional metrics
- mae = mean_absolute_error(y_true, y_pred)
- rmse = np.sqrt(np.mean((y_true - y_pred) ** 2))
- # Print evaluation metrics
- print(f"\n=== Model Evaluation Metrics for {model_name} ===")
- print(f"Accuracy: {accuracy:.4f}")
- print(f"Precision: {precision:.4f}")
- print(f"Recall: {recall:.4f}")
- print(f"F1 Score: {f1:.4f}")
- print(f"Sensitivity: {sensitivity:.4f}")
- print(f"Specificity: {specificity:.4f}")
- print(f"MAE: {mae:.4f}")
- print(f"RMSE: {rmse:.4f}")
- # Save results
- with open(f'{model_name}_results.pkl', 'wb') as f:
- pickle.dump({'y_true': y_true, 'y_pred': y_pred, 'avg_probs': avg_probs}, f)
- print(f"Ensemble '{model_name}' results saved successfully!")
- # Plot confusion matrix
- plt.figure(figsize=(6, 6))
- sns.heatmap(cm, annot=True, fmt='d', cmap='Blues', xticklabels=range(4), yticklabels=range(4))
- plt.xlabel('Predicted Label')
- plt.ylabel('True Label')
- plt.title(f'Confusion Matrix - {model_name}')
- plt.show()
- # %%
- # Run evaluation for all ensembles
- evaluate_and_save_ensemble(ensemble1, test_ds, "ensemble1")
- evaluate_and_save_ensemble(ensemble2, test_ds, "ensemble2")
- evaluate_and_save_ensemble(ensemble3, test_ds, "ensemble3")
- # %%
- ensembles = ["Ensemble 1", "Ensemble 2", "Ensemble 3"]
- accuracy = [0.9947, 0.9924, 0.9908]
- precision = [0.9945, 0.9920, 0.9904]
- recall = [0.9946, 0.9921, 0.9905]
- f1_score = [0.9945, 0.9921, 0.9904]
- sensitivity = [0.9946, 0.9921, 0.9905]
- specificity = [0.9945, 0.9920, 0.9904]
- mae = [0.0076, 0.0137, 0.0130]
- rmse = [0.1172, 0.1747, 0.1487]
- colors = ["#203f85", "#1eb4cb", "#fdf6de", "#f03c29", "#fbd022"]
- plt.figure(figsize=(8, 5))
- plt.bar(ensembles, accuracy, color=colors[1])
- plt.xlabel("Ensemble Models")
- plt.ylabel("Accuracy")
- plt.title("Accuracy Comparison of Ensemble Models")
- plt.ylim(0.98, 1.0)
- for i, v in enumerate(accuracy):
- plt.text(i, v, f"{v:.4f}", ha='center', va='bottom', fontsize=12, color='black')
- plt.show()
- metrics = [precision, recall, f1_score]
- labels = ["Precision", "Recall", "F1 Score"]
- metric_colors = [colors[0], colors[3], colors[4]]
- plt.figure(figsize=(8, 5))
- bar_width = 0.25
- x = np.arange(len(ensembles))
- for i, metric in enumerate(metrics):
- plt.bar(x + i * bar_width, metric, width=bar_width, label=labels[i], color=metric_colors[i])
- plt.xlabel("Ensemble Models")
- plt.ylabel("Score")
- plt.title("Precision, Recall, and F1 Score Comparison")
- plt.xticks(x + bar_width, ensembles)
- plt.legend()
- plt.ylim(0.98, 1.0)
- plt.show()
- plt.figure(figsize=(8, 5))
- bar_width = 0.25
- x = np.arange(len(ensembles))
- plt.bar(x, mae, width=bar_width, label="MAE", color=colors[3])
- plt.bar(x + bar_width, rmse, width=bar_width, label="RMSE", color=colors[1])
- plt.xlabel("Ensemble Models")
- plt.ylabel("Error")
- plt.title("MAE and RMSE Comparison")
- plt.xticks(x + bar_width / 2, ensembles)
- plt.legend()
- plt.show()
- # %%
- ensembles = ["Ensemble 1", "Ensemble 2", "Ensemble 3"]
- accuracy = [0.9947, 0.9924, 0.9908]
- precision = [0.9945, 0.9920, 0.9904]
- recall = [0.9946, 0.9921, 0.9905]
- f1_score = [0.9945, 0.9921, 0.9904]
- sensitivity = [0.9946, 0.9921, 0.9905]
- specificity = [0.9945, 0.9920, 0.9904]
- mae = [0.0076, 0.0137, 0.0130]
- rmse = [0.1172, 0.1747, 0.1487]
- colors = ["#203f85", "#1eb4cb", "#fdf6de", "#f03c29", "#fbd022"]
- plt.figure(figsize=(8, 5))
- plt.bar(ensembles, accuracy, color=colors[1])
- plt.xlabel("Ensemble Models")
- plt.ylabel("Accuracy")
- plt.title("Accuracy Comparison of Ensemble Models")
- plt.ylim(0.98, 1.0)
- for i, v in enumerate(accuracy):
- plt.text(i, v, f"{v:.4f}", ha='center', va='bottom', fontsize=12, color='black')
- plt.show()
- metrics = [precision, recall, f1_score]
- labels = ["Precision", "Recall", "F1 Score"]
- metric_colors = [colors[0], colors[3], colors[4]]
- plt.figure(figsize=(8, 5))
- bar_width = 0.25
- x = np.arange(len(ensembles))
- for i, metric in enumerate(metrics):
- plt.bar(x + i * bar_width, metric, width=bar_width, label=labels[i], color=metric_colors[i])
- plt.xlabel("Ensemble Models")
- plt.ylabel("Score")
- plt.title("Precision, Recall, and F1 Score Comparison")
- plt.xticks(x + bar_width, ensembles)
- plt.legend()
- plt.ylim(0.98, 1.0)
- plt.show()
- plt.figure(figsize=(8, 5))
- bar_width = 0.25
- x = np.arange(len(ensembles))
- plt.bar(x, mae, width=bar_width, label="MAE", color=colors[3])
- plt.bar(x + bar_width, rmse, width=bar_width, label="RMSE", color=colors[1])
- plt.xlabel("Ensemble Models")
- plt.ylabel("Error")
- plt.title("MAE and RMSE Comparison")
- plt.xticks(x + bar_width / 2, ensembles)
- plt.legend()
- plt.show()
- # %%
- !zip -r /kaggle/working/all_outputs.zip /kaggle/working/
- # %%
- ensembles = ["Ensemble 1", "Ensemble 2", "Ensemble 3"]
- accuracy = [0.9947, 0.9924, 0.9908]
- precision = [0.9945, 0.9920, 0.9904]
- recall = [0.9946, 0.9921, 0.9905]
- f1_score = [0.9945, 0.9921, 0.9904]
- sensitivity = [0.9946, 0.9921, 0.9905]
- specificity = [0.9945, 0.9920, 0.9904]
- mae = [0.0076, 0.0137, 0.0130]
- rmse = [0.1172, 0.1747, 0.1487]
- colors = ["#203f85", "#1eb4cb", "#fdf6de", "#f03c29", "#fbd022"]
- plt.figure(figsize=(8, 5))
- plt.bar(ensembles, accuracy, color=colors[1])
- plt.xlabel("Ensemble Models")
- plt.ylabel("Accuracy")
- plt.title("Accuracy Comparison of Ensemble Models")
- plt.ylim(0.98, 1.0)
- for i, v in enumerate(accuracy):
- plt.text(i, v, f"{v:.4f}", ha='center', va='bottom', fontsize=12, color='black')
- plt.show()
- metrics = [precision, recall, f1_score]
- labels = ["Precision", "Recall", "F1 Score"]
- metric_colors = [colors[0], colors[3], colors[4]]
- plt.figure(figsize=(8, 5))
- bar_width = 0.25
- x = np.arange(len(ensembles))
- for i, metric in enumerate(metrics):
- plt.bar(x + i * bar_width, metric, width=bar_width, label=labels[i], color=metric_colors[i])
- plt.xlabel("Ensemble Models")
- plt.ylabel("Score")
- plt.title("Precision, Recall, and F1 Score Comparison")
- plt.xticks(x + bar_width, ensembles)
- plt.legend()
- plt.ylim(0.98, 1.0)
- plt.show()
- plt.figure(figsize=(8, 5))
- bar_width = 0.25
- x = np.arange(len(ensembles))
- plt.bar(x, mae, width=bar_width, label="MAE", color=colors[3])
- plt.bar(x + bar_width, rmse, width=bar_width, label="RMSE", color=colors[1])
- plt.xlabel("Ensemble Models")
- plt.ylabel("Error")
- plt.title("MAE and RMSE Comparison")
- plt.xticks(x + bar_width / 2, ensembles)
- plt.legend()
- plt.show()
- # %%
- # %%
- # %%
- # %%
- # %%
- # %%
pretrained_ensemble.ipynb.ipynb at commit 78bfc24, no license · at the source
Overview
- Department of Computer Science and Engineering, Yuan Ze University, Yuandong Rd. Zhongli District, Taoyuan 32003, Taiwan; (M.A.); (M.H.)
- Department of Information Communication, Yuan Ze University, Yuandong Rd. Zhongli District, Taoyuan 32003, Taiwan
Abstract
Early and accurate brain tumor detection is vital for effective treatment. We propose a deep learning framework for MRI-based brain tumor classification, featuring a novel Custom CNN evaluated independently alongside six pre-trained models for comparative analysis (InceptionV3, EfficientNetV2L, ResNet152V2, Xception, VGG16, and MobileNetV2). Additionally, three separate ensemble models are constructed to analyze whether model combination improves performance. Experiments conducted on the Kaggle-Multiclass brain MRI dataset show that the proposed Custom CNN achieves the best performance, with an accuracy of 99.54%, and features a task-specific architecture (0.57M parameters) that achieves superior performance through domain-specific feature learning and computational efficiency, thus outperforming both individual pre-trained models and ensemble approaches. Among pre-trained models, EfficientNetV2L (99.47%) and InceptionV3 (99.39%) show competitive results, while the best ensemble model achieves 99.47% accuracy, indicating clinical deployment potential pending external validation. These results demonstrate that the proposed Custom CNN provides superior performance without requiring ensemble complexity, thus highlighting its effectiveness and efficiency for automated brain tumor classification.
Reproduced under the paper's license (CC BY), from the paper cited above.
Repository
Its files are read in the Code ↔ Paper reader above, with 8 matches between paragraphs and lines of code.
Maisamilens/brain-tumor-classification
78bfc245eb09943c3788e28d95b4002705faf88b, 23 July 2026Availability: 1 check, the latest on 28 September 2026: the link answers
- 28 September 2026: the link answers
3 files
- custom_cnn.ipynb.ipynb, Jupyter, 621 lines, 2 matches
- pretrained_ensemble.ipyn
b.ipynb , Jupyter, 1,078 lines, 6 matches - README.md, Text, 126 lines
The paper's code and data availability statement is in the Data section.
Tracing map
Proposed by the machine: these links were found in the paper and verified at the source, without human review. The map will receive a Zenodo DOI once one of the paper's authors has validated it with their ORCID.
What the map holds:
- 1 repository of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
- 2 scripts, each with its path and the digest of its content;
- 8 matches between paragraphs of the paper and lines of the code (method lexical-v1);
- neither the text of the paper nor the code itself.
Its JSON (tracing-map.json) is deposited on Zenodo with its DOI once the map is validated.
Data
Datasets cited
- figshare:1512427, at figshare; found in the references
- kaggle.com/
datasets/ , at Kaggle; found in the referencesahmedhamada0 - kaggle.com/
datasets/ , at Kaggle; found in the referencesmasoudnickparvar - kaggle.com/
datasets/ , at Kaggle; found in the referencessartajbhuvaji
Data Availability Statement
The datasets analyzed and utilized in this study are publicly available. The brain tumor MRI dataset by Jun Cheng can be accessed via Figshare [51]. Additional datasets used include the Brain Tumor Classification (MRI) dataset by Sartaj Bhuvaji [52], the Br35H Brain Tumor Detection dataset by Ahmed Hamada [53], and the Kaggle multiclass Brain Tumor MRI dataset by Masoud Nickparvar [54]. The source code for this work is publicly available at: https://
Reproduced under the paper's license (CC BY), from the paper cited above.
Versions
The history of this record: each version stored by the harvester or made by a correction of its authors or of the maintainers of its code, and what changed in its facts. The texts of the paper (its abstract, its availability statements) are not part of it; versions that changed only those are not listed.
Version 1, 28 September 2026: the first record
Recorded: type, language, journal, volume, issue, pages, dates, 4 authors, 5 keywords, 53 references.
Cite
This paper
Abbas, M., Hassan, M., Wang, R.-Z., & Teng, C.-H. (2026). Brain Tumor Classification in MRI Images Using Combined Transfer Learning and Convolutional Neural Networks. Journal of imaging, 12(6), 233. https://
BibTeX
@article{abbas2026brain,
author = {Abbas, Maisam and Hassan, Muhammad and Wang, Ran-Zan and Teng, Chin-Hung},
title = {{Brain Tumor Classification in MRI Images Using Combined Transfer Learning and Convolutional Neural Networks}},
journal = {Journal of imaging},
year = {2026},
month = may,
volume = {12},
number = {6},
pages = {233},
publisher = {Multidisciplinary Digital Publishing Institute (MDPI)},
issn = {2313-433X},
doi = {10.3390/
url = {https://
pmid = {42346896},
pmcid = {PMC13301762}
}
RIS
TY - JOUR
AU - Abbas, Maisam
AU - Hassan, Muhammad
AU - Wang, Ran-Zan
AU - Teng, Chin-Hung
TI - Brain Tumor Classification in MRI Images Using Combined Transfer Learning and Convolutional Neural Networks
T2 - Journal of imaging
J2 - J Imaging
PY - 2026
DA - 2026/
VL - 12
IS - 6
SP - 233
SN - 2313-433X
PB - Multidisciplinary Digital Publishing Institute (MDPI)
DO - 10.3390/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.3390/
"type": "article-journal",
"title": "Brain Tumor Classification in MRI Images Using Combined Transfer Learning and Convolutional Neural Networks",
"container-title": "Journal of imaging",
"author": [
{
"family": "Abbas",
"given": "Maisam"
},
{
"family": "Hassan",
"given": "Muhammad"
},
{
"family": "Wang",
"given": "Ran-Zan"
},
{
"family": "Teng",
"given": "Chin-Hung"
}
],
"container-title-short":
"volume": "12",
"issue": "6",
"page": "233",
"DOI": "10.3390/
"PMID": "42346896",
"PMCID": "PMC13301762",
"ISSN": "2313-433X",
"publisher": "Multidisciplinary Digital Publishing Institute (MDPI)",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
5,
28
]
]
}
}
The tracing map gets a citation of its own once an author has validated it and it has a DOI.
Similar papers
The papers with a page that share the most with this one: the tools found in their code, their categories, datasets, cited references and authors, the rarest counting most.
- [1] doi:10.1371/journal.pone.0310748 [code]
- An explainable ensemble approach for advanced brain tumor classification applying Dual-GAN mechanism and feature extraction techniques over highly imbalanced data.Journal: PloS oneIn common: Keras, TensorFlow, seaborn, 4 other tools, kaggle.com/datasets/ahmedhamada0, kaggle.com/datasets/sartajbhuvaji, 2 other datasets, structural MRI / diffusion, other condition
- [2] doi:10.3390/brainsci13091320
- Brain Tumor Classification from MRI Using Image Enhancement and Convolutional Neural Network Techniques.Journal: Brain sciencesIn common: kaggle.com/datasets/ahmedhamada0, kaggle.com/datasets/sartajbhuvaji, 2 other datasets, structural MRI / diffusion, other condition, 4 references
- [3] doi:10.7717/peerj-cs.2425 [code]
- Enhancing brain tumor MRI classification with an ensemble of deep learning models and transformer integration.Journal: PeerJ. Computer scienceIn common: Keras, TensorFlow, seaborn, 4 other tools, kaggle.com/datasets/ahmedhamada0, kaggle.com/datasets/sartajbhuvaji, 1 other dataset, structural MRI / diffusion, other condition, 2 references
- [4] doi:10.1186/s40708-026-00325-x
- CAE-BrainNet: a statistically validated class-adaptive attention ensemble model for explainable brain tumor classification from MRI.Journal: Brain informaticsIn common: kaggle.com/datasets/ahmedhamada0, kaggle.com/datasets/sartajbhuvaji, 2 other datasets, structural MRI / diffusion, other condition, 3 references
- [5] doi:10.3390/bioengineering11070701
- Integrating Convolutional Neural Networks with Attention Mechanisms for Magnetic Resonance Imaging-Based Classification of Brain Tumors.Journal: Bioengineering (Basel, Switzerland)In common: kaggle.com/datasets/ahmedhamada0, kaggle.com/datasets/sartajbhuvaji, 2 other datasets, structural MRI / diffusion, other condition, 3 references
- [6] doi:10.1002/brb3.70520
- Fusion-Brain-Net: A Novel Deep Fusion Model for Brain Tumor Classification.Journal: Brain and behaviorIn common: kaggle.com/datasets/ahmedhamada0, kaggle.com/datasets/sartajbhuvaji, 2 other datasets, other condition, 2 references
- [7] doi:10.1371/journal.pone.0361135
- A method for brain tumor detection and localization by means of deep learning and reliable prediction explainability.Journal: PloS oneIn common: kaggle.com/datasets/ahmedhamada0, kaggle.com/datasets/sartajbhuvaji, 1 other dataset, structural MRI / diffusion, other condition, 3 references
- [8] doi:10.3390/diagnostics14040383
- A Novel Ensemble Framework for Multi-Classification of Brain Tumors Using Magnetic Resonance Imaging.Journal: Diagnostics (Basel, Switzerland)In common: kaggle.com/datasets/sartajbhuvaji, kaggle.com/datasets/masoudnickparvar, 1 other dataset, structural MRI / diffusion, other condition, 3 references
- [9] doi:10.3390/biomedicines13102571 [code]
- Brain Tumor Classification in MRI Scans Using Edge Computing and a Shallow Attention-Guided CNN.Journal: BiomedicinesIn common: scikit-learn, Matplotlib, NumPy, kaggle.com/datasets/ahmedhamada0, kaggle.com/datasets/sartajbhuvaji, 1 other dataset, structural MRI / diffusion, other condition, 1 reference
- [10] doi:10.3390/diagnostics15111392
- A Hybrid Model of Feature Extraction and Dimensionality Reduction Using ViT, PCA, and Random Forest for Multi-Classification of Brain Cancer.Journal: Diagnostics (Basel, Switzerland)In common: kaggle.com/datasets/ahmedhamada0, kaggle.com/datasets/sartajbhuvaji, 2 other datasets, structural MRI / diffusion, other condition
Contribute
The authors of this paper can claim it, correct its record and validate its tracing map, and the maintainers of its code (its owner, or a public member of its organization) correct what it says of their repository; anyone signed in can ask for its removal. Every request goes to OSCR's own machine, which answers it; your account page follows them.
Sign in with ORCID to claim this paper as one of its authors, correct its record or validate its tracing map: when the paper's metadata lists your ORCID iD, you are recognized at once. Maintainers of its code: sign in with GitHub, then claim the repository on your account page.
Claim this paper
Correct its record
Say what each link of this record is, remove the ones that are not the paper's, add the ones that are missing. The correction becomes a new version of the record, in its Versions section.
Validate its tracing map
You validate the map as this page shows it: 1 repository of the authors' code, each at its verified commit and with its license, 2 scripts, and 8 matches between paragraphs and code (see the Code and Map sections). It then receives a DOI on Zenodo, with you (your ORCID iD) and OSCR as its creators; the code itself is not deposited.
The map's fingerprint: sha256:e76be4490ba39e60…
Add the badge to the code's README
If you are an author or a maintainer of this paper's code, you can add this badge. It says what OSCR knows of the paper (its code, its validated tracing map) and links the code to this page. Paste one of these snippets under the README's title. Keep the two marks around it, so that the badge can be replaced in place and is never added twice. OSCR changes nothing in your repository.
Markdown
<!-- oscr-badge:start -->
[](https://openscicode.org/badge/doi/10.3390/jimaging12060233)
<!-- oscr-badge:end -->reStructuredText
.. oscr-badge:start
.. image:: https://openscicode.org/badge/doi/10.3390/jimaging12060233.svg
:target: https://openscicode.org/badge/doi/10.3390/jimaging12060233
:alt: OSCR
.. oscr-badge:endHTML
<!-- oscr-badge:start -->
<a href="https://openscicode.org/badge/doi/10.3390/jimaging12060233"><img src="https://openscicode.org/badge/doi/10.3390/jimaging12060233.svg" alt="OSCR"></a>
<!-- oscr-badge:end -->On GitHub, open the README, choose Edit (the pencil), paste the snippet under the title, then "Commit changes".
If you choose to, you can have the badge kept up to date for you, with oscr badge --write from the command line or with the GitHub Action in your repository's workflows. Every other form and option (a card, AsciiDoc, LaTeX, shields.io) is on the badge page.
Request its removal
To ask OSCR to remove this record, the copies of its authors' scripts or its tracing map, use the removal request page: signed in, you say who you are, what to remove and why, then review and confirm the request. Published rules decide every request (how).
Discussion, reproductions, activity
Discussion: code errors and mismatches between the code and the paper about this paper and its code, from readers and its authors, beside the paper and its tracing map.
Report a mismatch between the code and the paper · Report a code error (signed in)
Reproductions: reports from readers who ran the authors' code and did not get the paper's result, what they ran, with which environment, commit and data.
Report a reproduction failure (signed in)
Versions of its code: the releases of its code tied to a version of this paper (the preprint, the accepted manuscript, the version of record…), each with the tracing map versioned with it.
Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.
