1 Introduction

Recently, lung cancer and COVID-19 [1] are two drastic pulmonary diseases, which cause millions of death globally each year. Lung cancer is said to be the 2nd most widespread form of cancer in both women as well as men and it is the primary cause of deaths occurring due to cancer in US [2,3,4]. The finest possibilities of survival emerge from earlier detection and diagnosis that could be aided by enhanced automated malignant nodule recognition techniques. A lung nodule will be round and it is a smaller growth of tissue found in the cavity of the chest. Nodules are usually below 30 mm in size, and outsized growths are termed as masses and are assumed to be malignant [5, 6]. Nodules among 5–30 mm might be malignant or benign, with the probability of malignancy rising with size. Spiculated or lobulated nodule edges might specify malignancy whereas Smooth nodules with indications of calcifications are expected to be benign.

There are two most important chest imaging methods, fundamental X-ray imaging and CT [7, 8]. Radiographs or chest X-ray images offer a single outlook on the chest cavity. Poster anterior analysis, where the X-ray beam passes over the chest of the patient from back to front is general. CT scans are 3-D images generated by means of X-ray images obtained from several orientations and it could offer an entire view of the internals parts of the chest and can, therefore, be exploited for easily detecting the shapes, sizes, locations, and densities of lung nodules [9, 10]. Nevertheless, CT scan equipment is highly-priced and is often not obtainable in rural areas or minor hospitals. Moreover, radiographs are comparatively fast and cheap, and the patients are exposed to minute radiation, hence they are typically the initial diagnostic step for identifying any abnormalities in the chest [11, 12].

CAD methods were deployed to identify the lung nodules more precise and quicker. Nodule recognition approaches [13,14,15] are modeled by conventional image processing schemes to discover areas of the chest radiograph, which encloses a brighter object of the expected texture, shape, and size of a lung nodule [16]. With current enhancements in CNNs, certain researchers have aimed at exploiting these techniques to categorize lung nodules. Unluckily, the accessible datasets are comparatively low in medical imaging [17].

The literature on detecting and diagnosing lung nodules is extensive. To date, the general technique for lung nodule diagnosis in all existing CAD systems has been to utilize a candidate identification stage. While some of these researches use low-level appearance-based variables to drive this identification task [18], others use shape and size information. Ypsilantis et al. proposed using recurrent neural networks in a patch-based strategy to improve nodule detection [19], which is related to deep learning-based methodologies. A 2D multi-step segmentation approach was presented by Krishnamurthy et al. to discover candidates [20]. There have also been in-depth studies of high-level discriminatory information extraction employing deep networks to improve FP minimization. Setio et al. employed a fusion technique to conduct FP reduction after training 9 independent 2D convolutional neural networks on 9 different perspectives of candidates [21]. For candidate detection, another study used a modified version of Faster R-CNN, which was the state-of-the-art object detector at the time, and a patch-based 3D CNN for the FP reduction step [22]. All of these approaches, however, are computationally ineffective (e.g., exhaustive deploy of sliding windows over feature maps).

Thus, the contributions of the research work are as follows:

  • In this study, an Otsu Thresholding based segmentation process is introduced for detecting the lung nodules.

  • An optimized CNN is used for classification, where the activation functions and convolutional layers are fine-tuned with the aid of a new IMFO algorithm.

  • To enhance the global exploration capability of classic MFO algorithm, an improved MFO (IMFO) algorithm is proposed.

The structure of the article is given as below: The existing schemes on lung cancer are reviewed in Sect. 2. Section 3 depicts a development of novel lung nodule detection model and it discusses the segmentation and feature extraction stages. Section 4 briefs the optimal CNN-oriented classification for precise lung nodule detection and it clearly portrays the process of proposed IMFO algorithm. In addition, Sects. 5 and 6 discusses the results as well as conclusion.

2 Literature Review

In the existing works, an image processing approach to identify solid nodules, part solid, as well as GGO within CT of chest was established in [23]. The major procedures are, “lung segmentation, candidate detection, nodule enhancement, reduction of false positives and image pre-processing”. Furthermore, deep learning approach based lung nodule identification was presented in [24] and in this the characteristics were retrieved via utilizing patch-based multi-resolution convolutional networks as well as 4 fusion approaches are employed for classification. Gu et al. [25] designed a unique CAD structure via employing 3D DCNN combined with multi-scale prediction scenario. Additionally, for the identification of lung nodule in high & low resolution CT pictures, a DeepLN scheme was provided in [26].

A unique categorization model for lung carcinomas is introduce in [27] and a probabilistic neural network was deployed as a classifier for discriminating the true nodules. In [28], a unique CAD system with CNN was utilized in CT image segmentation scheme. Moreover, a 4-channel CNN model was introduced for identifying the lung nodules on the basis of multi-group patches of lung images [29]. A multi-resolution CNN based lung nodule patient’s categorization is established in [30] as well as the scheme was splitted into 3 stages through the knowledge transfer usage.

Table 1 reviews lung nodule recognition systems. The major drawbacks of the existing lung nodule detection system are listed as follows: In SVM, choosing the appropriate kernel function is tricky [23], CNN in [24] requires on optimization concept for further efficiency, DCNN has to concern more on FP reduction [25], robustness needs to be enhanced with more attention [26], more memory space was needed [27], insufficient detection sensitivity [28], and higher computational cost [29]. To tackle these limitations, a new lung nodule detection approach is introduced. The detailed explanation of the process is provided in underneath passages.

Table 1 The advantages and challenges of the extant lung nodule detection models

3 Development of Novel Lung Nodule Detection Model

The framework of the lung nodule recognition scheme is specified in Fig. 1. It encompasses “(1) pre-processing, (2) segmentation, (3) feature extraction and (4) classification”. At first, pre-processing is conducted. Then, segmentation is done utilizing Otsu Thresholding model. After that feature extraction performed via LBP model. The LBP features are then classified via optimized CNN model, wherein, activation function and convolutional layer counts are tuned via IMFO scheme.

Fig. 1
figure 1

Structural design of the adopted lung nodule detection scheme

3.1 Pre-processing

At first, the input images are subjected to the pre-processing phase and this process includes four steps. The detailed explanations are given below:

  1. (a)

    Read image: At first, storing the path to image dataset in a variable and then constructed a function to load folders containing images into arrays.

  2. (b)

    Resize image: Some times, the images from the dataset are varying in size, so a base size for all images is established.

  3. (c)

    Noise removal: In this step, the unwanted noises are removed from the resized images. In this work, a Gaussian smoothing is utilized for noise removal operation. The outcome of blurring an image with a Gaussian function is Gaussian smoothing.

  4. (d)

    Morphological operation: In this step, first segment the image to separate the background from the foreground objects, and then refine our segmentation with more noise removal.

3.2 Otsu Thresholding Based Segmentation

Following pre-processing, the images are submitted to an Otsu thresholding [31] segmentation algorithm. As a result of this idea, Otsu sets the threshold value, which reduces overlapping. As a result, dark as well as light zones (\(T1\),\(T0\)) are segmented. With \(T1\) as well as \(T0\), the background and object were integrated. The lowest value of pixel level has been measured after scanning all of the thresholds. Consider the probability of histogram with the noted gray value as \(hp(\overline{i})\),\(\overline{i} = 1,......,\overline{l}\) as well as shown in Eq. (1).

$$hp(\overline{i}) = \frac{{no\{ (\overline{r},\overline{c})\left| {image(\overline{r},\overline{c}) = \overline{i}\} } \right.}}{{\overline{R}.\overline{C}}}$$
(1)

Here, “index image for row and column is given by \(\overline{r}\) and \(\overline{c}\), in that order, and the count of rows and columns of the image is expressed by \(\overline{R}\) and \(\overline{C}\), respectively.

The weight, variance, and mean of class \(T0\) with intensity value lies amongst 0 to \(th\) is indicated as \(\omega_{{\overline{b}}} (th)\), \(\sigma_{{\overline{b}}} (th)\) and \(\mu_{{\overline{b}}} (th)\), respectively. The weight, variance and mean of class \(T1\) with intensity value fall among \(th + 1\) to 1 and are explicated by \(\omega_{{\overline{f}}} (th)\), \(\sigma_{{\overline{f}}} (th)\) and \(\mu_{{\overline{f}}} (th)\), correspondingly. Weighed sum of cluster variances is referred to \(\sigma_{\omega }^{2}\)”.

The values with the lowest class variances are referred to as the best threshold value \(th*\). The class variance is depicted in Eq. (2).

$$\sigma_{\omega }^{2} = \omega_{{\overline{b}}} (th)*\sigma_{{\overline{b}}}^{2} (th) + \omega_{{\overline{f}}} (th)*\sigma_{{\overline{f}}}^{2} (th)$$
(2)
$$\omega_{{\overline{b}}} (th) = \sum\nolimits_{{\overline{i} = 1}}^{th} {hp(\overline{i})}$$
(3)
$$\omega_{{\overline{f}}} (th) = \sum\nolimits_{{\overline{i} = th + 1}}^{{\overline{l}}} {hp(\overline{i})}$$
(4)
$$\mu_{{\overline{b}}} (th) = \frac{{\sum\nolimits_{{\overline{i} = 1}}^{th} {\overline{i}*hp(\overline{i})} }}{{\omega_{{\overline{b}}} (th)}}$$
(5)
$$\mu_{{\overline{f}}} (th) = \frac{{\sum\nolimits_{{\overline{i} = th + 1}}^{{\overline{l}}} {\overline{i}*hp(\overline{i})} }}{{\omega_{{\overline{f}}} (th)}}$$
(6)
$$\sigma_{{\overline{b}}}^{2} (th) = \frac{{\sum\nolimits_{{\overline{i} = 1}}^{th} {(\overline{i} - \mu_{{\overline{b}}} (th))^{2} *hp(\overline{i})} }}{{\omega_{{\overline{b}}} (th)}}$$
(7)
$$\sigma_{{\overline{f}}}^{2} (th) = \frac{{\sum\nolimits_{{\overline{i} = th + 1}}^{{\overline{l}}} {(\overline{i} - \mu_{{\overline{f}}} (th))^{2} *hp(\overline{i})} }}{{\omega_{{\overline{f}}} (th)}}$$
(8)

3.3 LBP Based Feature Extraction

LBP [32] LBP is used to extract typical characteristics, which are constantly encoded via “binomial concatenation” between the reference pixel \(K_{c}\) and its neighborhoods with radius \(\hat{R}\) as shown in Eq. (9). The neighbours of reference pixel are specified \(K_{{G,\hat{R}}}\) as well as the neighborhood index in a given local sub-region \(Q\), which surrounds \(K_{c}\) is indicated as \(\hat{g}\). The coding function \(s_{1} \left( {^{\prime},^{\prime}} \right)\) is calculated for discovering the labels. Equation (10) illustrates the threshold function, where the coding function output \(s_{1} \left( {^{\prime},^{\prime}} \right)\) denotes the binary gradient direction [32].

$$LBP_{{G,\hat{R}}} \left( {K_{c} } \right) = \left\{ {s_{1} \left( \begin{gathered} Q\left( {K_{{1,\hat{R}}} } \right), \hfill \\ ,Q\left( {K_{c} } \right) \hfill \\ \end{gathered} \right),s_{2} \left( \begin{gathered} Q\left( {K_{{2,\hat{R}}} } \right), \hfill \\ ,Q\left( {K_{c} } \right) \hfill \\ \end{gathered} \right),....,s_{1} \left( \begin{gathered} Q\left( {K_{{\hat{g},\hat{R}}} } \right), \hfill \\ Q\left( {K_{c} } \right) \hfill \\ \end{gathered} \right)} \right\}\,\,\,\,\,\,\,\,\,\,\,\,\,\,\left| {\hat{g} = 1,2,...,G;\hat{R} = 1} \right.$$
(9)
$$s_{1} \left( \begin{gathered} (Q(K_{{\hat{g},\hat{R}}} ), \hfill \\ ,Q(K_{c} ) \hfill \\ \end{gathered} \right) = \left\{ {\begin{array}{*{20}c} 1 & {if\,\left( {1 - \left( {K_{{\hat{g},\hat{R}}} } \right) - Q\left( {K_{c} } \right)} \right) \ge 0} \\ 0 & {else} \\ \end{array} } \right.$$
(10)

The features derived via LBP are signified as \(fe\) that is classified via CNN model.

4 Optimized CNN-oriented Classification for Precise Lung Nodule Detection

4.1 Optimized CNN for Classification

“CNN are a biologically inspired trainable architecture that can learn invariant features”. In CNN [33], the input feature \(fe\) is modelled as revealed in Eq. (11), with a dimension of \(m_{1} \times m_{2}\)

$${\text{Im}}_{Se} :\left\{ {1,...m_{1} } \right\} \times \left\{ {1,...m_{2} } \right\} \to A \subseteq \Re ,(i,j) \mapsto fe_{i,j}$$
(11)

Consider filter \(L \in \Re^{{2g_{1} + 1 \times 2g_{2} + 1}}\) and “discrete convolution with filter” \(L\) is represented via Eq. (12), in which \(L\) is modelled as in Eq. (13).

$$\left( {fe_{i} * L} \right)_{p,r} : = \sum\limits_{{v = - g_{1} }}^{{g_{1} }} {\sum\limits_{{u = - g_{2} }}^{{g_{2} }} {L_{v,u} } } fe_{p + v,r + u}$$
(12)
$$L = \left( {\begin{array}{*{20}c} \begin{gathered} L_{{ - g_{1} , - g_{2} }} \hfill \\ \vdots \hfill \\ L_{{g_{1} , - g_{2} }} \hfill \\ \end{gathered} & \begin{gathered} ... \hfill \\ L_{0,0} \hfill \\ .... \hfill \\ \end{gathered} & \begin{gathered} L_{{ - g_{1} , - g_{2} }} \hfill \\ \vdots \hfill \\ L_{{g_{1} ,g_{2} }} \hfill \\ \end{gathered} \\ \end{array} } \right)$$
(13)

The “discrete Gaussian filter \(L_{H\left( \sigma \right)}\)” is exposed as per Eq. (14), in which, \(\sigma\) signifies “standard deviation of Gaussian distribution”.

$$\left( {L_{H\left( \sigma \right)} } \right)_{p,r} = \left[ {\frac{1}{{\sqrt {2\pi \sigma^{2} } }}\exp \left( {\frac{{p^{2} + r^{2} }}{{2\sigma^{2} }}} \right)} \right]$$
(14)

Consider the “layer \(s\) be assumed as a convolutional layer that includes \(n_{1}^{(s)}\) feature maps with \(n_{2}^{(s)} \times n_{3}^{(s)}\) dimension at its output. Equation (15) demonstrate \(i^{th}\) feature map in \(s\) layer and \(W_{i}^{(s)}\) points out bias matrix and \(L_{i,j}^{(s)}\) indicates filter size of \(2g_{1}^{(s)} + 1 \times 2g_{2}^{(s)} + 1\) that links the \(i^{th}\) feature map in \(s\) layer with \(j^{th}\) feature map in the layer \(\left( {s - 1} \right)\)”.

$$X_{i}^{(s)} = W_{i}^{(s)} + \sum\limits_{j = 1}^{{n_{1}^{s - 1} }} {L_{i,j}^{(s)} * } X_{j}^{(s - 1)}$$
(15)

Accordingly, the output feature map has a specific size as revealed as per Eq. (16).

$$n_{2}^{(s - 1)} - 2g_{1}^{(s)} = n_{2}^{(s)} \,\& \,n_{3}^{(s - 1)} - 2g_{2}^{(s)} = n_{3}^{(s)}$$
(16)

The convolutional layer function is evaluated as per Eqs. (17) and (18). Subsequently, Eq. (18) shows output, accomplished via the calculation of unit at position \((p,r)\). Here, \(L_{i,j}^{(s)}\) indicates trainable weights and \(W_{i}^{(s)}\) indicates bias matrix.

$$\left( {X_{i}^{(s)} } \right)_{p,r} = \left( {W_{i}^{(s)} } \right)_{p,r} + \sum\limits_{j = 1}^{{{n_{1}{\left( {s - 1} \right)}} }} {\left( {L_{i,j}^{(s)} * X_{j}^{(s - 1)} } \right)_{p,r} }$$
(17)
$$\left( {W_{i}^{(s)} } \right)_{p,r} + \sum\limits_{j = 1}^{{{n_{1}{\left( {s - 1} \right)}} }} {\sum\limits_{{v = - g_{1}^{s} }}^{{g_{1}^{s} }} {\sum\limits_{{u = - g_{2}^{s} }}^{{g_{2}^{s} }} {\left( {L_{i,j}^{(s)} } \right)_{v,u} } } \left( {L_{i,j}^{(s)} \,} \right)_{p,r} \left( {X_{j}^{(s - 1)} } \right)_{p + v,r + u} }$$
(18)

Equation (19) is formed if the layer \(s - 1\) is not regarded as fully connected, where, \(We_{i,j,p,r}^{s}\) denotes the “weight that associates the unit at the position \((g,h)\) in the \(j^{th}\) feature map of layer \(s - 1\) and the \(i^{th}\) unit in \(s\)”.

$$x_{i}^{(s)} = \left[ {f(v_{i}^{s} )\,\,with\,\,v_{i}^{s} } \right] = \left[ {\sum\limits_{j = 1}^{{{n_{1}{\left( {s - 1} \right)}} }} {\sum\limits_{p = - 1}^{{{n_{2}{\left( {s - 1} \right)}} }} {\sum\limits_{r = 1}^{{{n_{3}{\left( {s - 1} \right)}} }} {We_{i,j,p,r}^{s} } } } \left( {X_{j}^{(s - 1)} } \right)_{p,r} } \right]$$
(19)

The general diagram of the optimized CNN model is depicted in Fig. 2.

Fig. 2
figure 2

General architecture of CNN model

4.2 Solution Encoding

This study focuses on the exact detection of lung nodules, for which optimization logic is used. In particular, the activation function \(\sigma\) is fine-tuned for choosing proper functions such as sigmoid, softmax, linear, relu, or tanh. Along with, the number of convolutional layers indicated as \(L\) is optimally described using a new IMFO approach. Figure 3 shows the input to the suggested method. Further, the objective of the research is given in Eq. (20), in which \(acc\) indicates accuracy.

$$obj = \max (acc)$$
(20)
Fig. 3
figure 3

Solution encoding

4.3 Proposed IMFO Algorithm

The extant MFO comprise a variety of advantage; it meets with drawbacks and to overcome those drawbacks, certain enhancements were made in extant MFO. Usually, self- enhancement is established to be capable in conventional optimization schemes [34,35,36,37,38]. MFO [39] include three phases.

4.3.1 Generation of Initial Moth Populace

Every moths flies in hyper-dimensional spaces as identified as per Eq. (21), wherein, the moth count is indicated by \(n\) and \(d\) denotes the dimension count of solution spaces.

$$R = \left[ {\begin{array}{*{20}c} {r_{1,1} } & {r_{1,2} } & {...} & {r_{1,d} } \\ {r_{2,1} } & {r_{2,2} } & {} & {r_{2,d} } \\ {...} & {} & {} & {} \\ r_{n,1} & {r_{n,2} } & {...} & {r_{n,d} } \\ \end{array} } \right]$$
(21)

Equation (22) illustrates the fitness values of moths.

$$OR = \left[ \begin{gathered} OR_{1} \hfill \\ OR_{2} \hfill \\ ... \hfill \\ OR_{n} \hfill \\ \end{gathered} \right]$$
(22)

Equations (23) and (24) demonstrate the flame in D-dimensional spaces.

$$H = \left[ {\begin{array}{*{20}c} {H_{1,1} } & {H_{1,2} } & {...} & {H_{1,d} } \\ {H_{2,1} } & {H_{2,2} } & {} & {H_{2,d} } \\ {...} & {} & {} & {} \\ {H_{n,1} } & {H_{n,2} } & {...} & {H_{n,d} } \\ \end{array} } \right]$$
(23)
$$OH = \left[ \begin{gathered} OH_{1} \hfill \\ OH_{2} \hfill \\ ... \hfill \\ OH_{n} \hfill \\ \end{gathered} \right]$$
(24)

4.3.2 Moth’s Position Update

The MFO algorithm is a three-tuple that computes the global optima of optimization difficulties, as shown as per Eq. (25), wherein, “\(I:\varphi \to \{ R,OR\}\) specifies initial random location, the motion of moth in search space is depicted as \(\ddot{P}:R \to R\) and the concluding search process is stated as \(T:R \to \{ true,false\}\)”.

$$MFO = (I,\ddot{P},T)$$
(25)

The arbitrary distribution is represented by Eq. (26), wherein, \(ub\) and \(lb\) specifies upper and lower bounds.

$$R(i,j) = \left[ {(ub(i) - lb(j))*rand() + lb(i)} \right]$$
(26)

As per IMFO algorithm, a random number \(^{\prime}r^{\prime}\) is generated and a threshold value (\(\delta\)) of 0.5 is fixed. If \(r\) is less than the threshold \(\delta\), (i.e. if \(r\) < \(\delta\)), then the logarithmic spiral update takes place as given by Eq. (27), where \(D_{i}\) is computed as mean distance of \(i^{th}\) moth with \(j^{th}\) flame (i.e.\(D_{i} = \left| {H_{j} - R_{i} } \right|\)), \(b\) symbolize logarithmic spiral shape and \(t\) lies between [− 1, 1].

$$S\left( {R_{i} ,\,H_{j} } \right) = D_{i} e^{bt} \cos (2\pi t) + H_{j}$$
(27)

On the other hand, if \(r\) > \(\delta\), a new logarithmic spiral with new distance evaluation takes place by Eq. (28). In Eq. (28), the distance parameter \(D_{i}\) is determined as per Eq. (29), where \(C = 2.a\), \(a\) represents the random number, which lies among [0, 1] as well as \(H_{j}^{ * }\) denotes the current position of jth moth and \(R_{i}\) denotes current position of ith flame.

$$S\left( {R_{i} ,\,H_{j} } \right) = D_{i} e^{bt} \cos (2\pi t)$$
(28)
$$D_{i} = \left| {H_{j}^{ * } - R_{i} } \right| \times C$$
(29)

4.3.3 Update the Flames Count

Here, the exploitation stage has been is improved via lessening the count of flames as in Eq. (30), wherein, \(G\) depicted maximal flame count, \(l\) and \(G_{I}\) delineates current and maximum iteration counts.

$$flamecount = round\left( {G - l*\frac{G - l}{{G_{I} }}} \right)$$
(30)

The flowchart of the adopted IMFO algorithm is given in Fig. 4 and the pseudo-code is provided in algorithm 1.

Fig. 4
figure 4

Flowchart of the proposed IMFO algorithm

figure a

5 Results and Discussion

5.1 Simulation Settings

The presented lung nodule detection system employing the CNN + IMFO + LBP model was conducted in Python. Here, the performances of offered method was evaluated over SVM [1], KNN [26], CNN [2], MFO [32], WTEEB [41] and GWO + FRVM [42] models. Moreover, the performance analysis was performed with respect to “accuracy, sensitivity, specificity, precision, FPR, FNR, FMS, NPV, MCC, and FDR respectively by varying the training percentages from 40, 50, 60, 70, 80 and 90”. Based upon the confusion matrix, the performance metrics are defined and it is given as follows:

(a) Accuracy “It is the closeness of the measured value to a standard true value” and it is expressed as per Eq. (31).

$${\text{Accuracy}} = \frac{{{\text{True}}\,\,{\text{negative}} + \,\,{\text{True}}\,{\text{positive}}}}{{{\text{True}}\,\,{\text{positive}} + \,\,{\text{False}}\,{\text{positive}} + \,{\text{True}}\,\,{\text{negative}}\, + \,{\text{False}}\,\,{\text{negative}}}}$$
(31)

(b) Sensitivity “Sensitivity is the proportion of true positives that are correctly predicted by the model” and it is evaluated as per Eq. (32).

$${\text{Sensitivity}} = \frac{{{\text{True}}\,\,{\text{positive}}}}{{{\text{True}}\,\,{\text{positive}} + \,\,{\text{False}}\,\,{\text{negative}}}}$$
(32)

(c) Specificity “specificity is the proportion of true negatives that are correctly predicted by the model” and it is expressed as Eq. (33).

$${\text{Specificity}} = \frac{{{\text{True}}\,\,{\text{negative}}}}{{{\text{False}}\,\,\,{\text{positive}} + {\text{True}}\,\,\,{\text{negative}}}}$$
(33)

(d) Precision “It is the fraction of relevant instances among the retrieved instances” and it is expressed as per Eq. (34).

$${\text{Precision}} = \frac{{{\text{True}}\,\,{\text{positive}}}}{{{\text{True}}\,\,{\text{positive}} + \,\,{\text{False}}\,\,{\text{positive}}}}$$
(34)

(e) Recall “It is the fraction of relevant instances that were retrieved” and it is expressed as per Eq. (35).

$${\text{Recall}} = \frac{{{\text{True}}\,\,{\text{positive}}}}{{{\text{True}}\,\,{\text{positive}} + \,\,{\text{False}}\,\,{\text{negative}}}}$$
(35)

(f) FMS “It is the weighted harmonic mean of the precision and recall of the test” and it is expressed as follows.

$${\text{FMS}}\, = \,\frac{{{2} \times \,{\text{Precision}}\, \times \,{\text{Recall}}}}{{{\text{Precision}}\, + \,{\text{Recall}}}}$$
(36)

(g) MCC “MCC is used to measure the difference between the predicted values and actual values” and it is given as follows:

$${\text{MCC = }}\frac{{{\text{True}}\,\,{\text{positive}} \times {\text{True}}\,\,{\text{negative}} - {\text{False}}\,\,{\text{positive}} \times {\text{False}}\,\,{\text{negative}}}}{{\sqrt {\begin{array}{*{20}c} {\left( {{\text{True}}\,\,{\text{positive}}\, + {\text{False}}\,\,{\text{positive}}} \right)\,\left( {{\text{True}}\,\,{\text{positive}}\, + {\text{False}}\,\,{\text{negative}}} \right)} \\ {\left( {{\text{True}}\,\,{\text{negative}} + {\text{False}}\,\,{\text{positive}}} \right)\,\left( {{\text{True}}\,\,{\text{negative}} + {\text{False}}\,\,{\text{negative}}} \right)} \\ \end{array} } }}$$
(37)

(h) NPV “The NPV is the probability that following a negative test result, that individual will truly not have that specific disease” and it is expressed as below:

$${\text{NPV}} = \frac{{\text{True negative}}}{{{\text{True negative}} + {\text{False negative}}}}$$
(38)

(i) FPR “A false positive is an outcome where the model incorrectly predicts the positive class” and it is given in Eq. (39).

$${\text{FPR}}{\mkern 1mu} = \frac{{\text{False positive}}}{{{\text{True negative}} + {\text{False positive}}}}$$
(39)

(j) FNR “A false negative is an outcome where the model incorrectly predicts the negative class” and it is given in Eq. (40).

$${\text{FNR}}\, = \,\frac{{{\text{False}}\,\,{\text{negative}}}}{{{\text{False}}\,\,{\text{negative}}\, + \,{\text{True}}\,\,{\text{positive}}}}$$
(40)

(k) FDR “It is a measure of accuracy when multiple hypotheses are being tested at once, for example when multiple metrics, or variations, are being measured in a single experiment” and it is expressed as per Eq. (41).

$${\text{FDR}}\, = \,\frac{{{\text{False}}\,\,{\text{positive}}}}{{{\text{True}}\,\,{\text{positive}} + {\text{False}}\,\,{\text{positive}}}}$$
(41)

For clear understanding,

True positive “The image results are those that detecting a disease when there is disease”.

True negative “The image results are those in which no nodule is detected as well as no disease is diagnosed”.

False positive “The images results are those that detect a disease even when it is not present”.

False negative “The image results are those that detect a disease when it does not already exist”.

5.2 Dataset Description

The dataset used in this study has been downloaded from [40]. The lung computed tomography (CT) images in the Lung Image Database Consortium image collection (LIDC-IDRI) are marked-up annotated lesions from diagnostic and lung cancer screening CT scans. It is a worldwide resource that is available online for the creation, instruction, and assessment of computer-assisted diagnostic (CAD) techniques for the early identification and diagnosis of lung cancer. This public–private partnership, which was started by the National Cancer Institute (NCI), advanced by the Foundation for the National Institutes of Health (FNIH), and supported by the Food and Drug Administration (FDA) through active participation, shows the effectiveness of a consortium built on a consensus-based method.

This data set, which includes 1018 instances, was produced in collaboration with seven academic institutions and eight medical imaging businesses. Images from a clinical lung CT scan are included for each individual, together with an attached XML file that contains the findings of a two-phase image annotation process carried out by four qualified thoracic radiologists. Each radiologist individually assessed each CT image during the initial blinded-read phase and labelled lesions as "nodule > or = 3 mm," "nodule 3 mm," or "non-nodule > or = 3 mm." Each radiologist independently assessed their marks and the anonymized marks of the three other radiologists to form a conclusion during the subsequent unblinded-read phase. This procedure was designed to identify every lung lesion in every CT scan as completely as feasible without resorting to forced consensus.

5.3 Performance Analysis: Varying Learning Percentage

Figure 5 demonstrates the performance of the CNN + IMFO + LBP model over the traditional approaches via different TP. The suggested model achieves better value than the extant ones. Due to the shortcomings of the state-of-art methods (for instance, the training time of SVM is too high, KNN is suffered from memory intensive and slow estimations, and overfitting issue in CNN), the performance of the related works are low. Compared to CNN [24], the adopted CNN model utilizes the IMFO algorithm and it provides better value than the other.

Fig. 5
figure 5figure 5

Performance analysis of the proposed and conventional models on concerning performance measures such as a accuracy b sensitivity c specificity d Precision e Recall f NPV g FMS h MCC i FPR j FNR and k FDR

From Fig. 5a, the accuracy of the suggested CNN + IMFO + LBP model at 90th TP is 3.42%, 2.21%, 1.46%, 0.73%, 1.84%, and 3.34% better than SVM, KNN, CNN, MFO, WTEEB and GWO + FRVM models. On concerning Fig. 5c, the suggested approach specificity is 3.04%, 2.26%, 1.49%, 0.74%, 1.84% as well as 13.87%, superior to SVM, KNN, CNN, MFO, WTEEB as well as GWO + FRVM models at 40th TP. The recall of the suggested CNN + IMFO + LBP approach at 90th TP is 4.04%, 2.21%, 2.07%, 0.73%, 1.84%, & 3.33% superior to SVM, KNN, CNN, MFO, WTEEB & GWO + FRVM approaches. On analysing the MCC, the adopted CNN + IMFO + LBP scheme is 45.12%, 20.31%, 3.75%, 0.72%, 1.85%, and 20.98% better than SVM, KNN, CNN, MFO, WTEEB and GWO + FRVM models at 80th TP. Also, on examining the FDR of suggested method at 90th TP is 54.18%, 46.99%, 37.15%, 22.81%, 41.81%, and 50.79% better than SVM, KNN, CNN, MFO, WTEEB and GWO + FRVM models Thus, the supremacy of CNN + IMFO + LBP method was confirmed from outcomes.

5.4 Statistical Analysis

The statistical analysis of the suggested CNN + IMFO + LBP model is given by Table 2 in terms of accuracy. Hence, the statistical measure of the adopted model is should be higher than the existing works. The proposed method with respect to best performance is 7.35%, 2.99%, 1.78%, 0.73%, 1.85%, and 3.34% better than SVM, KNN, CNN, MFO, WTEEB and GWO + FRVM models. The mean performances of implemented model for accuracy is 15.79%, 6.82%, 1.73%, 0.74%, 1.85%, and 5.73% better than SVM, KNN, CNN, MFO, WTEEB and GWO + FRVM approaches. Additionally, the median of the proposed method is 9.81%, 3.01%, 1.73%, 0.74%, 1.71%, and 5.72% better than SVM, KNN, CNN, MFO, WTEEB and GWO + FRVM models. Hence, the betterment of suggested model is established from the results.

Table 2 Statistical analysis: Proposed vs. traditional approaches

5.5 Overall Performance Analysis

The overall performance analysis of the suggested as well as extant methods in terms of various measures is discussed in this section. From Table 3, the suggested scheme for accuracy is 7.35%, 2.99%, 1.78%, 0.73%, 1.84% and 4.05% better than SVM, KNN, CNN, MFO, WTEEB and GWO + FRVM models. On considering sensitivity, the adopted CNN + IMFO + LBP model is 10.96%, 2.99%, 1.78%, 0.73%, 2.26%, and 4.46% better than SVM, KNN, CNN, MFO, WTEEB and GWO + FRVM approaches. On considering recall, the adopted CNN + IMFO + LBP model is 10.96%, 2.99%, 1.78%, 0.73%, 1.84%, and 3.35% better than SVM, KNN, CNN, MFO, WTEEB and GWO + FRVM approaches. On considering the negative measures (FPR, FDR, FNR), the adopted model acquires less value than the existing ones. As a result, the total analysis shows that the CNN + IMFO + LBP design is superior.

Table 3 Overall performances of suggested scheme over conventional schemes

5.6 Computational Time Analysis

The computation time of the adopted & extant works is determined as well as the values are tabulated in Table 4. The proposed CNN + IMFO +  + LBP model achieves small execution time that is 134.5963254 s and it is 22.66%, 1.77%, 10.26%, 7.85%, 19.05%, and 5.48% better than the existing SVM, KNN, CNN, MFO, WTEEB, and GWOFRVM approaches respectively. Therefore, this analysis proves the superiority of the adopted model.

Table 4 Computational time analysis

6 Conclusion

In this study, the pre-processed images were segmented utilizing the Otsu Thresholding approach, which resulted in a new lung cancer detection method. Further, the LBP characteristics were extracted from the segmented images. As the next process, classification takes place for which the CNN model was exploited. In addition, an enhanced version of the traditional MFO algorithm named as IMFO model was presented for optimizing the activation function and count of convolutional layers. Finally, an examination was done to evaluate the performance of the offered scheme. The adopted approach in terms of accuracy is 7.35%, 2.99%, 1.78%, 0.73%, 1.85%, and 3.34% better than SVM, KNN, CNN, MFO, WTEEB and GWO + FRVM models. On analyzing the statistical analysis, the mean performances of implemented model for accuracy was 15.79%, 6.82%, 1.73%, 0.74%, 1.85%, and 5.73% better than SVM, KNN, CNN, MFO, WTEEB and GWO + FRVM approaches. Thus, the betterment of the suggested CNN + IMFO + LBP model was proven from outcomes. However, the computation time of the mode is not too much better. In the future, we want to comprehend the features retrieved by the networks for classification by deploying various visualization tools and see if they are consistent with features utilized by radiologists for diagnosis and also utilize the proposed system for other pulmonary diseases.