1 Introduction

Brain tumor is a critical medical issue in the world, and many people died from brain cancer (BC) (Roser and Ritchie 2015). Brain tumor is one dangerous kind of brain cancer due to its critical nature. The brain tumors have kinds such as Meningioma, Glioma, Pituitary, Acoustic Neuroma. In medical observation, the Meningioma, Glioma, and Pituitary tumors rates are 15%, 45%, and 15%, respectively, in all tumors of brain (Swati et al. 2019b). In Internet of things (IoT) healthcare industry to classify brain tumors, and diagnosis of BC numerous non-invasive-based models have been developed in literature. In these approaches machine learning (ML) and deep earning (DL) techniques were incorporated to designed artificial Intelligence (AI) based computer-aided diagnosis (CAD) systems classify brain tumors. The classify of brain tumors and diagnosis Brain Cancer through images data mostly convolutional neural network (CNN) model is used CAD systems (Sultan et al. 2019; Tan et al. 2021) in IoT healthcare environment. In AI based CAD system the CNN model extract deep features from data for correct classification of images (Bishop 2006). Furthermore, other CNN architectures have excellent capability to extract deep feature from images for correct and efficient classification of medical images (Haq et al. 2021a; Yu et al. 2021b).

According to the literature reviewed, the existing Brain Cancer diagnosis techniques have still lack a robust predictive capability in terms of accuracy to diagnose BC correctly for proper treatment and recovery in IoT healthcare system. Due these reason the medical experts IoT healthcare industry not utilized these existing AI based CAD diagnosis systems to diagnosis disease such as BC, COVID-19, lung cancer (LC). To handle this issue, a novel robust CAD method based AI techniques is necessary to diagnosis Brain Cancer accurately for proper treatment and recovery in IoT healthcare system.

We have designed an improved multi-level CNN model (MCNN) for the classification of Brain MR images in IoT healthcare system in this research work. In the designing of the proposed AI techniques based CAD method, we incorporated a DL convolutional neural network (CNN) model employing brain MR images data to classify brain tumors types ( Meningioma, Glioma and Pituitary). The CNN deep learning model is more suitable for the Meningioma, Glioma, and pituitary classification using brain tumors images data and its extract more deep features from images data for final classification. To further enhance the CNN predictive capability, we have incorporated a transfer-learning (TL) mechanism because of proper training of the CNN architecture, the brain MRI data is insufficient. In transfer learning, we used the well-known pre-trained models including ResNet-50, VGG-16, and Inception V3 with huge ImageNet data set. For the fine-tuning process, the models were trained with brain MR images data set. The weights generated by ResNet-50, VGG-16, and Inception V3 were embedded individually to the CNN for improving final classification performance and select best model performance. Furthermore, the data augmentation method is used to increase the size of the data set for effective model training. Also cross validation method hold-out and performance evaluation metrics were used in the proposed model. The performance of the proposed method has compared with existing methods. The proposed with would be easily deployed in IoT healthcare industry for diagnosis of BC.

Main contributions as follows:

  • Improved multi-level CNN model (MCNN) is recommended for classification of Brain tumor employing MR images data in IoT healthcare environment.

  • To increase the accuracy of the CNN, TTL technique is used because the brain tumor image data is insufficient for effective training of the CNN model. Pre-trained ResNet-50, VGG-16, and Inception V3 were used to train with the well-known ImageNet data set for generating trained parameters (weights). Fine-tuning the model CNN with brain tumor images data set along with transferred weights to improve the classification performance of the CNN model.

  • The augmentation approach is incorporated to increase the size of the dataset for proper training of the model.

  • The predictive performance of our AI based CAD diagnosis method is high compared to baseline methods in IoT healthcare environment for BC diagnosis.

The remaining sections of the paper are as follows: Sect. 2 contains the literature. Section 3 delves into the dataset and proposed model. Section 4 contains the results of the experiments. Section 5 is devoted to discussion. Section 6 contains the conclusion.

2 Literature review

Artificial intelligence techniques based computer added diagnosis system is significantly necessary for accurate Guo et al. (2021) and time classification of brain tumor and detection of Brain cancer in IoT healthcare environment. AI based CAD system cloud be easily incorporated in IoT heath care system for diagnosis and treatment of Brain cancer patients. Due to CAD diagnosis system Brain MRI images can easily interpreted as compared to medical professional. Thus medical professionals use CAD diagnosis system for Brain MRI images interpretation to diagnosis the Brain cancer correctly and efficiently. Due to these significant important of AI based CAD system different researchers and medical professionals have been designed Brain cancer diagnosis systems in the literature.

In this regards here we explored most recently proposed AI based Bc diagnosis systems. Zacharaki et al. (2009) designed a brain cancer diagnosis system to classify various grades of Glioma employing SVM and KNN machine learning model and respectively achieved 85% and 88% classification accuracy. Cheng et al. (2015) developed a classification approach for brain tumor classification and augmented the tumor region for improving the classification performance. They employed three techniques for feature extraction such as Gray level co-occurrence matrix, a bag of words, and an intensity histogram. Their proposed method obtained 91.28% classification accuracy.

Sultan et al. (2019) incorporate axial brain tumor images for convolution neural network training. In the proposed method they used two convolution layers, two max-pooling layers, and lastly, two layers for the final classification process. The proposed approach obtained 91.43% classification accuracy. El-Dahshan et al. (2010) designed a brain tumors classification method for 80 brain images MRI classification. They used discrete wavelet transform and PCA algorithms for reducing dimensions of data. To classify tumors, they used ANN and KNN machine learning classifiers. The classifiers ANN and KNN, achieved 97% and 98% classification accuracy respectively.

Afshar et al. (2019) proposed a brain tumor classification method employing a capsule network that combined MRI images of the brain and coarse tumor boundaries and 90.89% accuracy achieved by the proposed method. Anaraki et al. (2019) developed an integrated framework for brain tumor classification, and in the proposed technique, they integrated CNN and GA, and designed GA-CNN framework and obtained 94.2% accuracy. Swati et al. (2019a) classify brain tumors employing transfer learning techniques (CNN-Transfer learning) and achieved 94.82% accuracy (Kang et al. 2021). The proposed multi-classification method employing ensemble of deep features and ML algorithms and obtained high performance.

The explored literature reviewed show that the existing Brain Cancer diagnosis techniques have still lack a robust predictive issue in terms of accuracy to diagnose BC correctly for proper treatment and recovery in IoT healthcare system. Considering these reasons the medical professionals IoT healthcare industry not utilized these existing AI based CAD diagnosis systems to diagnosis disease such as Brain cancer. To handle this issue, a novel robust CAD diagnosis system based AI techniques is necessary to diagnosis Brain Cancer accurately for proper treatment and recovery in IoT healthcare system.

3 Materials and method

The materials and methods used in this work are presented in bellow subsections. All methods were performed in accordance with the relevant guidelines and regulations.

3.1 Data set

In this study, we have used a brain tumor data set from Nanfang hospital and General hospital, Tianjing medical university, of China (Cheng et al. 2015), and new versions in 2017 have been published. This data set has Contrast-Enhanced T1-Weighted Images of 233 subjects Meningioma, Glioma, and Pituitary. The dataset is publically available on Kaggle repository (Repository 2021).

3.2 Convolutional neural network for brain tumors classification

The CNN model is useful in the classification of medical images (Cai et al. 2017; Wolz et al. 2013; Guo et al. 2022). For classification of brain tumors we construct the CNN networks with 4 alternating convolutional layers and max-pooling layers and a dropout layer after each Conv/pooling pair. The last pooling layer connected fully layer with 256 neurons, ReLU activation function, dropout layer, and sigmoid activation functions are employed classification of brain MR images. In addition, we have used the optimization algorithms stochastic gradient descend (SGD) (Goodfellow et al. 2016) and adaptive moment estimation (ADAM) (Kingma and Ba 2014) in the model development.

3.3 Transfer learning to improved CNN predictive performance

To enhanced CNN predictive capability, we have incorporated data augmentation (DA) and Transfer learning (TL) techniques. The data augmentation can resolve the problem of insufficient data for model training. To expand the data amount, the zooming technique is used on original image data to produce images data with the similar label. TL models are used mostly for images classification related problems (Schwarz et al. 2015; Lv et al. 2020), cancer sub-type recognition (Hajiramezanali et al. 2018), and for filtering medical images (Bickel 2006). To improve the predictive capability of the proposed CNN model, we used the transfer learning models ResNet-50, VGG-16, and Inception V3. The ResNet-50, VGG-16, and Inception V3 were trained on the ImageNet dataset, and the trained parameters weights were individually transferred to the CNN model, which was then fine-tuned with brain tumor MR images for final CNN classification. The CNN model performance with transfer learning models ResNet-50, VGG-16, and Inception V3 have compared and finally selected CNN+ResNet model with enhanced predictive output.

3.4 Model validation

We have incorporated cross validation (CV) hold out (Haq et al. 2018; Thakur et al. 2019; Li et al. 2020) technique for training and testing of the model. In hold out CV data is randomly assign to two sets \(d_0\) and \(d_1\). The \(d_0\) and \(d_1\) use for training and testing of the model respectively. In hold out CV the training data set is usually large as compare to testing data set. The model is train on \(d_0\) and testing on \(d_1\). The holdout CV is suitable validation method in case when the data set is very plenty. In this study brain tumor MRI images dataset 70 percent was used for training and 30 percent for teasing of the model. In Fig. 1 the data set is divided into two parts according to Holdout CV.

Fig. 1
figure 1

Hold out CV

3.5 Performance evaluation criteria

The performance evaluation metrics Accuracy (Acc), Sensitivity (Sn), Specificity (SP), Precision (Pr), F1-score (F1-s), Matthews correlation coefficient (MCC) and Area under the cure (AUC) (Yurttakal et al. 2018; Gallego-Ortiz and Martel 2016; Yang et al. 2015; Yu et al. 2021a; Haq et al. 2021b; Wang et al. 2021; Haq et al. 2022) were used for the evaluation of the proposed model. These metrics are mathematically expressed as follows in Eqs. 16.

$$\begin{aligned}&Acc = \frac{(TP + TN)}{(TP+TN + FP + FN)} \times 100 \end{aligned}$$
(1)
$$\begin{aligned}&Sn = \frac{TP}{(TP+FN)} \times 100 \end{aligned}$$
(2)
$$\begin{aligned}&Sp = \frac{TN}{(TN+FP)} \times 100 \end{aligned}$$
(3)
$$\begin{aligned}&Pr = \frac{TP}{(TP+FP)} \times 100 \end{aligned}$$
(4)
$$\begin{aligned}&F1-s = 2\times \frac{Pr \times Recall}{(Pr + Re)} \times 100 \end{aligned}$$
(5)
$$\begin{aligned}&MCC = \frac{T_1}{\sqrt{T_2 \times T_3 \times T_4 \times T_5}} \times 100 \end{aligned}$$
(6)

Here MCC is Matthews correlation coefficient, \(T_1=(TP\times TN-FP\times FN)\), \(T_2=(TP+FP)\), \(T_3=(TP+FN)\), \(T_4=(TN+FP)\), and \(T_5=(TN+FN)\)

AUC: The AUC show the ROC of the model and high value of AUC represent high performance model.

3.6 Proposed brain tumors classification framework

Nowadays, CNN models have gained popularity for image classification-related problems. For the CNN model’s effective training, a large images data set is more suitable for the model to extract more related features during the training process for accurate classification of images. Due to the unavailability of large image data sets, especially in the medical domain, the CNN model performance degrades. However, to enhance the proposed CNN classifier performance, data augmentation and Transfer learning (Khan et al. 2019; Schwarz et al. 2015; Shin et al. 2016) methods are incorporated. We applied pre-trained CNN architecture ResNet-50 along with data augmentation zooming. The imagesNet data set was used to pre-trainResNet-50, VGG-16, and Inception V3 models, and the resulting weights (trained parameters) of these models were individually transferred to the CNN model for training. The brain tumor MRI dataset is used to fine-tune and final classify the CNN model. Lastly compared all integrated models performance and selected best model. The proposed model pseudo-code is present in algorithm 1, and flow chart is given in Fig. 2.

figure a
Fig. 2
figure 2

Flow chart of proposed tumor classification framework

4 Experiments and analysis

4.1 Experimental setup

For the implementation of our proposed diagnosis framework, we have conducted different experiments. Brain tumor image data set was used for testing of the proposed model. To improve the proposed CNN model predictive performance, we have employed ResNet-50, VGG-16, and Inception V3, CNN architectures with ImageNet big dataset to generate high trained parameters (weights) and then transfer trained parameters weights to the CNN model individually to improve CNN model predictive performance. For fine-tuning the CNN model, the brain tumor images data set was used for final classification of tumor types (Meningioma, Glioma, and Pituitary). The brain tumor data have 233 subjects and 3064 slices, which belong to three classes, i.e., Meningioma, Glioma, and Pituitary. This data set is very Small to train CNN model. In addition to tackle the problem of small brain tumor data method of data augmentation (Goodfellow et al. 2016) have used to augment the original data set. Data augmentation technique (zooming) was used, and all three types of images were zoomed horizontally and vertically and added with existing images. The new augmented data set image size of three kinds of images is 6128. Furthermore, stochastic gradient descend (SGD) (Ketkar 2017) and Adaptive Moment Estimation (ADAM) (Kingma and Ba 2014) Optimization algorithms were used in the proposed model. For all experiments a laptop and google collaborator with GPU was used. The software requirement for all experiments was Python and the the proposed model was developed using Keras and tensor flow as the back end.

4.2 Results and analysis

4.2.1 Data pre-processing results

This data set is obtained from the Kaggle repository (Repository 2021). This data set has contrast-enhanced T1-weighted images of 233 subjects of 3 kinds of brain tumors. They included Meningioma, Glioma, and pituitary tumor. The Brain Tumor data have 233 subjects and 3064 slices in which Meningioma subjects are 82 with slices 708, Glioma subjects are 91 with slices 1426, and pituitary subjects are 60 with slices 930. Thus the total subjects in data are 233, and the total slices are 3064. In order to reduce the dimension of \(512\times 512\times 1\) into \(224\times 224\times 1\). To handle imbalance problem in data set because Brain tumor data set have the different number of three subjects slices. The distribution of the data is different, and it creates a problem over fitting the model. To balance the Meningioma, Glioma, and pituitary in the data set, we incorporate the data augmentation (Goodfellow et al. 2016) method for augmenting the original dataset with random zooming, zooming all slices, and creating a new data set with 6128 slices. The data set has three sub-folders for Meningioma, Glioma, and pituitary images.

4.2.2 Results of the proposed CNN model

The proposed CNN model has been configured with concern hyper-parameters such as optimizer SGD, ADAM with learning rate (LR) 0.0001, the number of epoch 100, batch size 120. The 70% data for training and 30% for the testing of the model has been used for both data sets (original and augmented). The output of the experimental results have been reported in Table 1.

Table 1 present that the CNN model with SGD optimizer achieved 97.40% Accuracy, 98.03% Specificity, 95.10% Sensitivity, 99.02% Precision, 97.75 percent MCC, 97.26% F1-score and 97.21% AUC on original brain tumor MR images data set. The 97.40% accuracy demonstrated that our CNN architecture accurately classifies the three classes of brain tumors (Meningioma, Glioma, and Pictutitary). The 98.03% specificity shows that the Proposed CNN model is a highly suitable detecting model for healthy subjects recognition, while 95.10% sensitivity presents that the model significantly detected the affected subjects. The MCC value was 97.75%, which gives confusion metrics a good summary. The 97.21% AUC value shows that the model accurately classified the positive and negative subjects.

The Proposed CNN model performance with ADAM optimizer also reported in Table 1 using same learning rate 0.0001 on original data set. The CNN model achieved 96.77 % Accuracy, 99.00% Specificity, 93.67% Sensitivity, 98.20 % Precision, 97.90 percent MCC, 96.78% F1-score and 98.01% AUC on original data set. The CNN model performance with SGD optimizer are higher as compared to CNN model performance with ADAM optimizer.

On the other hand, the CNN model with SGD optimizer gained very excellent performance when trained and evaluated on an augmented data set . The CNN model obtained an accuracy of 98.56%, a specificity of 100.00%, a sensitivity of 98.09%, an MCC of 98.00%, and an AUC of 98.07% when trained and evaluated on an augmented data set. The model achieved an increase in accuracy from 97.40 to 98.56% which demonstrated the importance of the data augmentation process. Also, it illustrated that model needs more data to effectively train the CNN model. The Proposed CNN model performance with ADAM optimizer also presented in Table 1 using same learning rate 0.0001 with augmented data set. The CNN model achieved 97.23% Accuracy, 98.22% Specificity, 99.09% Sensitivity, 95.33% Precision, 98.29 percent MCC, 98.78% F1-score and 97.66% AUC on augmented data set. The CNN model performance with SGD optimizer are higher as compared to CNN model performance with ADAM optimizer on augmented data set.

We concluded from the experimental outcomes that the proposed CNN model effectively classified the brain tumor types, and the augmentation process further improved the model CNN performance because the CNN model more data for extract more related features for classification. The high accuracy of the proposed CNN model might be due to the suitable architecture of the CNN model and proper fitting of essential parameters of the model and data augmentation.

Table 1 CNN model predictive outputs

4.2.3 Results of the transfer learning models

The transfer learning models including ResNet-50, VGG-16, and Inception V3, have been configured with concern hyper-parameters such as optimizer SGD, ADAM with learning rate (LR) 0.0001, number of epoch 100, batch size 120. The 70% data for training and 30% for the testing of the model has been used for both data sets (original and augmented). The input image size \(264\times 264\times 1\) was used for training and evaluation of the proposed model. The output with different performance evaluation metrics have been reported in Table 2.

Table 2 shows that using ResNet-50 model with SGD optimizer obtained 95.30% accuracy, 97.04% specificity, 93.10% sensitivity, 94.21% Precision, 93.23% MCC, 95.00% F1-score and 95.78% AUC respectively on original brain tumor data set. The 95.30% accuracy show that the ResNet-50 model accurately classifies the three classes of brain tumors (Meningioma, Glioma, and Pictutitary). The 97.04% specificity shows that the ResNet-50 model is a highly suitable detecting model for healthy subjects recognition, while 93.10% sensitivity show that the model accurately detected the affected subjects. The 95.78% AUC value demonstrated that the ResNet-50 model accurately classified the Meningioma, Glioma, and Pictutitary. The ResNet-50 model with ADAM optimizer obtained 95.00% accuracy, 96.84% specificity, 95.76% sensitivity, 96.23% Precision, 93.26% MCC, 94.78 % F1-score and 95.12% AUC respectively on original data set.

The predictive Performance of transfer learning model ResNet-50 very high when model trained and evaluated with augmented data set. According to Table 2 the transfer learning model ResNet-50 with SGD optimizer obtained an accuracy of 96.07%, a specificity of 99.30%, a sensitivity of 100.00%, a precision of 96.07%, an MCC of 96.00%, an F1-score of 97.00%, and an AUC of 96.23% when trained and evaluated on augmented data set. The ResNet-50 model with ADAM optimizer achieved 95.01% accuracy, 96.39% specificity, 99.25% sensitivity, 94.88% precision, 96.23 percent MCC, 96.80% F1-score, 96.12%AUC.

Table 2 presented that the VGG-16 model with SGD optimizer obtained 93.02% accuracy, 99.54% specificity, 94.88% sensitivity, 91.77% Precision, 94.11% MCC, 93.00% F1-score and 94.90% AUC on original brain tumor data set. Similarly VGG-16 obtained 92.67%, 96.33%, 91.22%, 90.41%, 91.99%, 93.20%, and 93.98%, accuracy, specificity, sensitivity, Precision, MCC, F1-score and AUC respectively on original data set with ADAM optimizer. Table 2 reported that VGG-16 model with SGD optimizer obtained 94.82% accuracy, 98.00% specificity, 99.10% sensitivity, 94.12% Precision, 94.06 % MCC, 97.00% F1-score and 95.21% AUC on augmented brain tumor data set. Similarly VGG-16 achieved 94.12%, 95.74%, 92.89%, 93.15%, 93.93%, 96.20% and 93.18 percent, accuracy, specificity, sensitivity, Precision, MCC, F1-score and AUC respectively on augmented data set with ADAM optimizer.

Table 2 presented that the Inception V3 model with SGD optimizer obtained 93.50% accuracy, 97.04% specificity, 93.10 % sensitivity, 94.21% Precision, 93.23% MCC, 95.00% F1-score and 95.78% AUC on original brain tumor data set. Similarly Inception V3 obtained 94.21%, 95.56%, 96.79%, 95.01%, 92.89%, 94.45%, and 94.56%, accuracy, specificity, sensitivity, Precision, MCC, F1-score and AUC respectively on original data set with ADAM optimizer. Table 2 reported that that Inception V3 model with SGD optimizer obtained 95.25% accuracy, 97.41% specificity, 99.34 % sensitivity, 95.62% Precision, 92.80% MCC, 95.70% F1-score and 93.03% AUC on augmented brain tumor data set. Similarly Inception V3 achieved 95.10%, 96.84%, 94.88%, 95.91%, 96.00%, 98.45%, and 95.02 percent, accuracy, specificity, sensitivity, Precision, MCC, F1-score and AUC respectively on augmented data set with ADAM optimizer.

As a result of the data augmentation process the accuracy of the ResNet-50 model improved from 95.30 to 96.07% with SGD optimizer. Furthermore, the ResNet-50 model performance are higher as compared to VGG-16 and Inception V3 model with augmented data set. Hence, with data augmentation, the values of the other evaluation metrics also improved. Based on the experimental results, we concluded that the data augmentation process increased the training of ResNet-50 and that the model effectively classified the brain tumor types. The higher performance of ResNet-50 model as shown in Figure 3 for better presentation.

Table 2 ResNet-50, VGG-16, and Inception V3, models individual predictive outputs
Fig. 3
figure 3

ResNet-50 higher performance

4.2.4 Results of the CNN with transfer learning models

Transfer learning pre trained models ResNet-50, VGG-16, and Inception V3 weights are individually transferred to CNN model for enhancing the training process of CNN model for effective predictive performance. The integrated framework performances have checked on original and augmented data sets. Furthermore, we have incorporated the TL ResNet-50, VGG-16, and Inception V3 CNN architectures with imageNet data set to generate high weights and then transferred trained parameters weights to the CNN model for classification. For fine-tuning of the CNN model, the brain tumor data set used for final classification. The model has been configured with concern hyper-parameters such as optimizer SGD, ADAM with learning rate 0.0001, the number of epoch 100, batch size 120. The 70% data for training and 30% for the testing of the model has been used for both data sets (original and augmented). The proposed framework performance has been evaluated employing various matrices. The input image size \(264\times 264\times 1\) has been used for training and evaluation of the proposed model. All these hyper-parameters values and the output of the experimental results of integrated frame work have been reported in Table 3.

According to Table 3 the CNN-ResNet-50 integrated frame work obtained 99.10% accuracy, 100.00% specificity, 89.60% sensitivity, 98.75% Precision, 98.66% MCC, 99.5% F1-score and 98.78 % AUC respectively on original data set with SGD optimizer. The 99.10% accuracy demonstrated that the architecture accurately classifies the three classes of brain tumors (Meningioma, Glioma, and Pictutitary). The 100% specificity shows that the Proposed model is a highly suitable detecting model for healthy subjects recognition, while 89.60% sensitivity presents that the model significantly detected the affected subjects. The 98.78 % AUC value shows that the CNN-ResNet-50 model accurately classified the Meningioma, Glioma, and Pictutitary. The ResNet-50+CNN frame work obtained 98.79% accuracy, 98.60% specificity,79.88% sensitivity, 99.01% precision, 97.87% MCC, 97.83 F1-score and 98.01% Auc with Optimizer ADAM on original data set.

On the other hand, the model obtained very high performance when it trained on the augmented data set. The integrated model (CNN-ResNet-50) with SGD optimizer obtained 99.89% accuracy, 99.08% specificity, 96.13% sensitivity, 99.10% MCC, and 99.56% AUC when trained and evaluated on augmented data set. The CNN-ResNet-50 model obtained 99.00% accuracy, 97.90 % specificity, 99.10 percent sensitivity, 97.89% precision, 99.05% MCC, 99.00% F1-Score and 98.21% AUC with ADAM optimizer on augmented data set.

The CNN-VGG-16 model with SGD optimizer on original data set obtained 98.78% accuracy, 99.80 percent specificity, 84.64% sensitivity, 94.05% precision, 97.34% MCC, 97.49 percent F1-score and 98.06% AUC and 98.20%, 97.30v%, 84.12%, 94.98%, 98.00%, 98.95% and 97.98 percent accuracy, specificity, sensitivity, Precision, MCC, F1-score and AUC respectively on original data set with ADAM optimizer. On the other side CNN-VGG-16 model with SGD optimizer on augmented data set obtained 98.98% accuracy, 100.00 percent specificity, 97.87% sensitivity, 97.98% precision, 99.67% MCC, 98.79 percent F1-score and 97.98% AUC. With ADAM optimizer the CNN-VGG-16 achieved 98.33%, 98.35%, 91.87%, 99.00%, 97.23%, 97.22%, 97.00 percent accuracy, specificity, sensitivity, Precision, MCC, F1-score and AUC respectively on augmented data set.

The results of CNN-Inception V3 model with SGD optimizer were 97.78 percent accuracy, 96.88% specificity, 92.23% sensitivity, 97.46 percent precision, 96.98% MCC, 97.39 % F1-scoe and 97.00 % AUC on original data set. The performance obtained by CNN-Inception V3 model in terms of 98.24% accuracy, 99.37% specificity, 85.70% sensitivity, 96.67 percent precision, 96.98% MCC, 98.44 % F1-score and 97.67% AUC with ADAM on original data set.

CNN-Inception V3 model with augmented data set with SGD optimizer obtained 98.50% accuracy, 100.00 percent specificity, 98.56% sensitivity, 99.00 percent precision, 99.67% MCC, 98.00 % F1-score, and 98.76% AUC. While on augmented data set the CNN-Inception V3 model achieved 98.15% accuracy, 99.06% specificity, 94.53% sensitivity, 97.67% precision, 98.01% MCC, 99.95% F1-score and 98.20% AUC with ADAM optimizer.

Table 3 present that integrated model CNN-ResNet-50 predictive results more better then the results of CNN-VGG-16 and CNN-Inception V3 models. The CNN-ResNet-50 model improved accuracy from 99.10% to 99.89% with augmented data set with SGD optimizer which is illustrated the importance of the data augmentation process. Also, it illustrated that model needs more data for effective training of CNN-ResNet-50 model. From the experimental results, we concluded that the integrated CNN-ResNet-50 model effectively classified the brain tumor types, and the augmentation process further improved the model classification performance.

The high accuracy of the integrated CNN-ResNet-50 diagnosis framework might be due to the suitable architecture of the model and proper fitting of essential parameters of the model and data augmentation. The performance of the CNN-ResNet-50 model with original and augmented data sets has shown graphically in Figure 4 for better illustration of the results values of the model. In addition, the Multi level CNN model MCNN (CNN-ResNet-50) accuracy has compared with CNN model and transfer learning ResNet-50 model in Table 4 on augmented data set and shown graphically in Fig. 5.

Fig. 4
figure 4

Integrated framework (CNN-ResNet-50) performance

Table 3 Integrated framework performance
Table 4 Accuracy of CNN, ResNet-50 and CNN-ResNet-50 on augmented data
Fig. 5
figure 5

CNN, ResNet-50 and Integrated (CNN-ResNet-50) models performance

4.2.5 Proposed method comparison with previous methods

We have compared our MCNN (CNN-ResNet-50) model performance in terms of accuracy with state-of-the-art methods in Table 5. Table 5 and Figure 6 show that the proposed mode obtained 99.89% accuracy, which is high as compared to state-of-the-art techniques. The high performance of the proposed method demonstrated that it is correctly classified brain tumors (Meningioma, Glioma, and Pictutitary), and it can easily be deployed in E-health care for the classification of brain tumors.

Table 5 Comparison of MCNN model with state of the art models
Fig. 6
figure 6

MCNN model performance comparison with baseline models

5 Discussion

The classification of brain tumors MR images have an essential role in the diagnosis of brain tumors. Artificial intelligence (AI) based computer automatic diagnostic systems (CAD) can effectively diagnose diseases (Yang et al. 2021). Deep learning techniques are widely used in CAD systems to diagnose critical diseases, especially convolutional neural networks. The CNN model is mostly used to classify medical images (Cai et al. 2017; Wolz et al. 2013; Guo et al. 2021; Haq et al. 2022). The CNN model extracts deep features from image data, and these features were crucial in final image classification. For the classification of brain tumors, various methods have been proposed by researchers using brain MR image data and deep learning models. However, these existing methods have lack of accuracy of diagnosis. In order to tackle this problem, a new method is necessary to diagnose the disease accurately and efficiently in IoT healthcare systems.

In this paper, we proposed a Multi level CNN model for accurately classifying brain tumor MR images in IoT healthcare systems. We used the deep learning CNN model for the classification of tumors Meningioma, Glioma, and pituitary in the design of the proposed method. The CNN model extracts more deep features from image data for final classification. To further improve the CNN model predictive capability, we have incorporated a transfer learning mechanism because, for proper training of the CNN architecture, the brain MR images data is insufficient. In transfer learning, we have used the well-known pre-trained models ResNet-50, VGG-16, and Inception V3 with big imageNet data set. For the fine-tuning process, the models were trained with brain MR images data set. The weights generated by pre-trained ResNet-50, VGG-16, and Inception V3 were transferred individually CNN model for improving model predictive performance. In addition, the data augmentation method was used to increase the size of the data set for effective model training. Furthermore, hold-out cross-validation and performance evaluation metrics were used in the proposed method. Among the CNN-ResNet-50, CNN-VGG-16 and CNN-Inception v3 integrated models the predictive performance of CNN-ResNet-50 are higher. Hence, multi level MCNN (CNN-ResNet-50) model effectively classify the brain tumors as compared to baseline models according Table 5. The proposed model can be easily incorporated in IoT healthcare system for diagnosis of Brain cancer.

6 Conclusion

For accurate image classification, the CNN model is played a significant role, and in most CAD systems CNN model is used for the analysis of medical image data in IoT healthcare system. We proposed a deep learning and transfer learning-based diagnosis approach for brain tumor classification in this work. We used a deep CNN model in the proposed method to classify tumor types Meningioma, Glioma, and Pituitary using brain tumor MR images data. We used transfer learning and data augmentation techniques to improve the CNN model’s predictive capability. Furthermore, the cross-validation method hold out is used for mode training and testing. Model performance evaluation metrics have been computed for the purpose of model performance evaluation.

The experimental results show that the proposed integrated diagnosis framework MCNN (CNN-ResNet-50) performed extremely well and achieved 99.89 percent accuracy when compared to baseline methods. The proposed method’s high predictive outcomes could be attributed to effective data pre-processing and the adjustment of other model parameters such as the number of layers, optimizer and activation functions, transfer learning, and data augmentation. Because of the high performance of the proposed MCNN model, it may be applicable for the classification and diagnosis of brain tumors (Meningioma, Glioma, Pituitary) in IoT-Healthcare system.

In the future, we plan to use additional brain tumor datasets and deep learning and transfer learning techniques to design a diagnose CAD system for brain tumors classification and detection of Brain cancer in IoT-healthcare system.