Background

In the clinical trial and drug discovery process, the role of statistical analytics and machine learning has been shown to be significant, especially in biological imaging and analysis, commonly used at various stages, from preclinical R&D to clinical trials, solving problems like sputum detection [1], image augmentation [2] and other applications, such as nucleus counting [3]. In the recent past, substantial research work have been proposed studying various classical machine learning and deep learning methods applied to an image that assists scientists and medical practitioners in analyzing and seeing inorganic growth or accumulation of tissues, cells, and subcellular components in CT scans, along with a more technology-oriented solution in the space of wearable technology [4] and tele-health care services to discover COVID-19 [5]. An example of detecting brain tumors through deep learning methods has been studied by researchers [6] and diverse COVID-19 diagnosis research work using deep learning and traditional machine learning methods as shown in Table 1. Currently, with evolving COVID-19 mutants it is now becoming extremely important to leverage faster and accurate solutions for clinical discovery, prompting therefore our study to understand the evolution in terms of offering medical imaging solutions for factor detection of mutant variants [7].

Table 1 Empirical research for detecting COVID-19 using deep learninga

There has been active research in biomedical image analysis using deep learning methods, whereby deep learning seems to have outperformed most computer vision problems for instance [8]. Nevertheless, computer vision techniques have shown vast opportunities in numerous application areas, especially in medical research and healthcare [9]. Medical imaging does provide better visibility than standard medical records’ data assessment, such as solving for Diabetic Retinopathy [10]. High-resolution images analyzed can provide any growth details on actuals, on a day-to-day basis, helping a medical practitioner to evaluate the situation quickly and provide a better treatment. It is apparent to be mentioned that the success of leveraging deep learning over traditional machine learning methods have been studied along with wide area of application in the medical domain [11]. Moreover, recent developments of quantum computing, vis a vis its application of quantum algorithm in varied domains, has now opened up new research areas for further optimizing classical machine learning problems [12]. In fact, recently, researchers from Massachusetts Institute of Technology (MIT) created an algorithm to overcome the challenges of developing computationally efficient and performing algorithms in order to solve several medical imaging problems [13].

The domain of medical science needs significant development for making sense of an analysis generated from an image. Previous studies dealing with this topic, have discussed the varied applications of machine learning, deep learning, and quantum algorithms in drug discovery and screening process, thereby solving problems that include compound property and activity prediction, using multitask DNN on 12,000 compounds [14]. Importantly, Quantum is a new paradigm today, with multiple applications being evaluated to solve problems in the fields of optimizing deep learning or machine learning tasks, finance [15], drug discovery [16], along with helping in shedding light on various clinical research [17]. Table 2 enlists extant literature that has dealt with drug discovery.

Table 2 Previously studied applications of machine learning in drug discovery and medical diagnosis

Although, there have been other studies that have deliberated upon the success of employing deep learning in drug discovery [16] and MRI image analysis for brain tumors, and for detecting and segmenting pneumonia traces using classical machine learning models [6] or leveraging deep learning in biomedical image segmentation applications [18]. The core purpose of this paper is to evaluate and provide empirical evidence for applying Quantum algorithms in medical imaging and drug discovery problems.

Quantum machine learning

The recent developments of Quantum Enhanced Learning [19], fusing AI and ML to obtain significant optimal solutions for boosting algorithmic performance has given rise to a new area of research termed ‘Quantum Machine Learning’ (QML), which has effectively evolved from the theory of quantum computing. The concept behind leveraging quantum computing for machine learning tasks is to inherently achieve solution parallelism [20], achieved for optimal constraint solving, using Moore’s law [21]. Quantum algorithms are centered on the concept of Boolean algebra (e.g., OR, AND, and NOT gates) and quantum physics. The data storage layout is established from Quantum bit (Qb) or qubitsFootnote 1 that depends on theoretical foundations of electron spin [22]. Importantly, quantum methods in addition can translate other than 1’s or 0’s such as complex information or negative values. A typical model development flow diagram is demonstrated in Fig. 1, explaining the basic control flow difference of classical machine learning versus Quantum machine learning algorithms.

Fig. 1
figure 1

Execution block diagram of classical machine learning/deep learning versus quantum machine learning algorithm designing (refer to Table 4. for algorithmic details on QML)

The need for quantum algorithms

QML is considered as one of the future areas of research in deep learning algorithms. The two key tasks QML can better perform when compared to classical deep learning techniques include:

  1. 1.

    Optimization [23] and Gibbs Sampling [24].

  2. 2.

    Enhance learning algorithms like Bayesian networks [25], Tensors, and search.

QML’s ability to deal with large-scale biased datasets yield faster complexity factors for major classical computing and machine learning tasks, consuming thereby less space and time. Effectively, it uses quantum annealers and tunneling for loss function minimization tasks, solving thereby complex problems of finding super-local minima, and a close approximation of global minima. In fact, multiple methods within the QML strategy are based on fast quantum algorithms for linear algebra, and semi-definitive or constraint-specific problems like optimization, as in the case of neural network models for weight adjustment, during both search and optimization tasks, similar to gradient descent-based optimizer. Assuming the task is to optimize a linear function of MxM matrix(X), over a parallel space with constraints(c), the solver has runtime complexity of O(c(c2 + nω + cns)logO(1)(cnR/ϵ)) [26]. Notably, herein, ϵ is denoted as an approximation factor, while s denotes sparsity, and R represents a range that is bound to yield an optimal matrix(X). Notably, these proven methods outperform classical optimization methods, yielding thereby complexity of O (ncs(Rr/ϵ)4 + ns(Rr/ϵ)7) as proposed by Arora and Kale [27]. The proposed optimizers in turn, tend to improve the overall solution convergence for any machine learning problems.

This paper looks to address two major research questions, while evaluating the application of QML in specific practice, specifically focusing upon medical image diagnostics and/or drug discovery,

RQ1

Are quantum algorithms suited for large-scale classification problems in medical image diagnostics dealing and industrial applications?

RQ2

Can quantum algorithms outperform classification or segmentation tasks in comparison with classical deep learning methods w.r.t model efficacy, biased training, and inferencing performance on high-resolution clinical image data?

The research questions would further provide support to exemplify the application of quantum theory in optimizing deep learning techniques to achieve superior performance in solution convergence and quality of the model. Another important aspect to emphasize on supporting production deployment is selecting appropriate quantum hardware for training, while deploying the model for real-time inferencing in health informatics applications, which is discussed later in this paper under the experiment section.

Application of quantum machine learning

The foundation of QML targets to solve research foundation problems in mathematical analysis to generalize quantum to improve classical learning tasks with potential optimization to speed of execution. Some of the task’s researchers are leveraging includes quantum techniques in Quantum Simulation [28], applied around nanotech, bio-medical imaging, physical chemistry, and with quantum systems tasks, such as search [29], which further provides polynomial speed, as compared to classical algorithms for other varied scenarios.

Method

The section discusses the methodology followed for building the model, provide details on overall data collection process followed, key modeling process imbibed for the study, and analysis performed with quantum networks.

Quantum neural network model

This study conducted an experimental analysis with a new variant of a learning model to further take advantage of quantum computing devices to perform learning tasks with quantum data [30]. We assumed that Quanvolutional neural network or Quantum neural network (QNN) would solve classical deep learning problems to be computationally faster from the design paradigm. Figure 2a illustrates the QNN architecture, which would help in understanding the Quantum network design methodology. Further, for simulation, we benchmarked the QNN model across other studies from extant literature. The rationale behind this exercise was to help in exploring varied application scenarios in the medical image analysis task that is presented in subsequent sections. Notably, the process of designing QNN has been described in Table 3 and has been elaborated upon in the subsequent sections.

Fig. 2
figure 2

a QNN Architecture [31]. b The proposed model

Table 3 Algorithm design stages for quanvolutional neural network

The proposed system is illustrated below in Fig. 2b. From a practical implementation perspective, the model accepts input image rescaled to 4 × 4 size before being fed into the Unitary matrix to obtain features at different channel. Further the features were leveraged to create a quantum circuit model, thereafter, followed by compiling the model using a loss function and optimizer using TensorFlow Keras model utility library.

Data and pre-processing

This section discusses the data collection process and the pre-processing activities that were conducted during the experiments. Notably herein, the relative transformation measures were required for modeling a QML algorithm. Additionally, this section consists of two sub-sections; the first, describes the data collection process, along with the larger data schema, while the second, discusses the affirmative steps that are taken for pre-processing in pre-modeling stages.

Data collection

The model development and verification for quantum deep learning-based image classification would require a large sample set for the quantum machine to perform. As a pre-requisite step, learning models require a significant amount of training dataset for building an efficient model [32], thus a through process was followed for sampling the image files to eliminate any representational biases. Hereafter, this study combined data shared by semanticscholar.com, along with the research work done by Chen et al. [33], and Jin et al. [34].

The data collection process adopted a strategy to collect CT scan samples of varied age groups, ranging from 20–30, 30–45, 45–60, and above 60 years of age, with both positive and negative samples. Key sources were identified, based on represented data statistics (Table 4), along with other open dataset sources from Microsoft open research database, Google dataset search, Stanford, and MIT datasets. Notably, the data search process ensured that the data resolutions were consistent across all the sources. The preferred resolution range of images were chosen (256 × 256 and 448 × 448), because image resolution does play a vital role in deep learning space, and often, high-resolution images do go on to impact model training performance and efficacy to a great extent [35].

Table 4 Dataset

Figures 3a, b and 4, adopted from Shi et al. [36]; Li et al. [37]; and Hani et al. [38] represent classical CoViD-19 and non-COVID-19 (influenzas and virus pneumonia) scans. Based on this, we discuss the overall finding that was observed from CT scans taken through a specific time duration.

Fig. 3
figure 3

a Sample CT scan image illustrating small to medium patches forming with each week's diagnosis. b Sample CT scan image of CoViD-19 diagnosed

Fig. 4
figure 4

CT scan of two patients of 45-year and 48-years of age with influenza virus pneumonia and Goodpasture syndrome shows bilateral ground-glass opacities in contrast to COVD-19 patients (Hani et al. 2020)

The sample data illustrated in Fig. 3a is identified as CoViD-19 positive. A significant growth in building patches was observed in the lungs over 10 days during quarantine (day 5 and day 15 scan). The scan of day 20 showed the formation of a dense mucus that was concentrated across the lungs. Figure 3b illustrates mucus, segmented across a small patch growth across two weeks of supervision. An evaluation dataset of non-CoViD-19 suffering from pneumonia and influenza was also sourced for validation of the model results.

Pre-processing and normalization

Importantly, the datasets that were used come from multiple sources; the process of data normalization included comparing the homogeneity of data sources, while further calibrating the images to the required scale for modeling. The study leveraged upon color models of an abstract mathematical model, describing the way colors can effectively be represented as tuples of numbers that are useful in viewing conditions. Once the image was thoroughly analyzed, the dataset was normalized using erosion and dilation [39], leveraging upon OpenCV library, a morphological transformation method, primarily used for handling noise, or detecting intensity collisions. Further, image de-noising (Buades et al. 2011) and scaling was done, using Python-OpenCV library, which in turn, was implemented to the entire dataset for standardization, with the help of fast Nl Means Denoising function for colored images, where the source image input of 8-bit 3-channel images were provided with template window size of 7 pixels and 21-pixel, and hColor of 10 in order to remove the colored noise; post this, they were kept into consideration for the completion of the de-noising process. Notably herein, de-noising generally impacts the image segmentation process in the overall modeling situation.

Handling representation and measuring bias in image dataset

The section discusses the impact of measuring bias that depicts the systematic value distortion, which takes place when an issue with a specific device is utilized to visualize and observe an image quality from a training perspective. Importantly, this type of bias is hard to replicate with sampling technique, and thus requires a manual review of the colored images, being used for training [40]. This study further leverages upon bootstrapping resampling technique [41] with different ratios to assemble the required representation of the dataset for experiments.

Experiments

In this section, the data pre-processing, model implementation, and evaluation methods have been explained. The experiment processes involved choosing a base model for initial trials and develop the same using the data collected. Based on various performance criteria compared between QNN, QCNN,Footnote 2 Hybrid CNN with a single filter and Hybrid CNN with multiple filters (Fig. 5) from the simplicity of circuit design and performance measurement, QNN was chosen for remaining benchmarking during the trials. Furthermore, the experiments were performed using TensorFlow Quantum (TFQ), and a python framework for QML development. Notably, we leveraged upon D-wave Leap and TensorFlow Quantum Framework as a platform for training and evaluating the experimental setup. The estimated wait time for problem submission was 1–10 s on a 2041 qubits system, under 13.5 qubit temperature (mK). Detailed specifications of the platform may be referred from D-wave and TensorFlow.Footnote 3

Fig. 5
figure 5

A quantum CNN: hybrid Convolution with multiple quantum filters

TFQ's core focus area is generally on quantum data, and a hybrid quantum-classical model. Various components that need to be followed to build a quantum circuit within the TensorFlow environment have been described below,

  1. a.

    Circuit—Cirq is used to design the quantum circuit (Fig. 6). CirqFootnote 4 is a python framework for writing, optimizing quantum circuits executing in quantum hardware.

  2. b.

    Pauli Sum—the linear combinations of tensor products of Pauli operatorsFootnote 5 defined in Cirq is represented by Pauli sum, operations like circuits, create batches of operators of varying size are of such type.

Fig. 6
figure 6

A quantum circuit

The experiments performed, involved various feature engineering and transformation stages applied to design. Since the quantum machine cannot handle the large size of the image, we re-scaled it to 4 × 4 at the data processing stage. The overall image calibration steps performed are stated as below,

  1. 1.

    Input raw data using Keras

  2. 2.

    Filtering the dataset to only 3 s and 6 s

  3. 3.

    Downscales the images to fit in a quantum hardware.

  4. 4.

    Treating and removing contradictory examples

  5. 5.

    Convert binary images to Cirq circuits

  6. 6.

    Convert the Cirq circuits to a TensorFlow quantum circuits

In QML, a pixel is represented as a qubit, wherein each stage would actually depend on the pixel value. The process of encoding the data into the Quantum circuit was iterated at multiple threshold values, in the range [0.5, 0.6, 0.7]. A circuit at 0.5 threshold is represented in Fig. 7, and which effectively is a form of 2-layer circuit design for binary classification problems. In terms of model development, various iterations were performed to optimize the general performance of the model through a range of hyper-parametrization testing at various epochs.

Fig. 7
figure 7

The circuit from the training samples in the first iteration of the 2-layer circuit

Finally, the experiment encompassed creating a 2-layered model (Fig. 7) fitting the data-circuit size, including both preparation and readout operations. In fact, this method could possibly be compared to running a small recurring neural network across pixels. Notably herein, each layer uses n instances of the same gate, with each of the data qubits acting on the readout qubit. Additionally, the model building process further used hinge loss as a loss function, along with adaptive learning rate optimization (ADAM) optimizer instead of stochastic gradient descent-based optimizer, which was computationally inexpensive, and possibly even easier to implement. The experimentation process was conducted with different epoch and batch sizes, and the results are presented in the following sections; notably, the overall model parameters are shown in Table 5 below.

Table 5 QNN parameter

Evaluation criteria

This paper presents validation loss and validation accuracy as evaluation criteria for the QNN model, whereby the selected metric is ‘hinge loss’ for the experiment, as the problem formulation alludes to a binary classification problem [42]. Importantly, the ‘hinge loss’ represents the difference in prediction from actuals. Moreover, since validation loss is not used to update weights in general, it possibly serves as the right measure of any neural network model. A hinge lossFootnote 6 i.e., l(y) is calculated by comparing prediction (y) with the actual target for prediction (t), followed by subtracting the value from 1, while computing thereafter the maximum value between 0 and the result of the earlier computation.

Results

To conclude the experimentation process and benchmarking with other relevant methods adopted for detecting COVID-19 patients, the model built, used a 9500-training dataset, encompassing an evaluation conducted over 1500 validation sample sets. The efficacy and the performance evaluation criteria are based on experiments performed with three, five and ten epochs and similar batch sizes. The key metrices taken into the consideration are loss and hinge accuracy shown in Table 6 and confusion matrix shown in Table 7.

Table 6 Loss score and hinge accuracy
Table 7 Confusion matrix

The change in epoch lowers the loss score, while improving the overall hinge accuracy. The change in accuracy score sees a significant lift after the third epoch, and gradually improves, reducing thereby the loss to 0.1559; notably, the percentage score of the change of loss is shown in the analysis in Fig. 8. The overall precision of the implemented model is 97.11%, whereas recall is 97.76% respectively.

Fig. 8
figure 8

Change in loss per epoch (training and validation)

Fig. 9
figure 9

Comparison of various DL models versus QNN

While comparing the traditional deep learning model with QNN (Fig. 9), the latter obtained a 2.92% lift from the 2D CNN model, trained for classification problems in the CT scan data set of COVID-19 patients. The analysis further describes the efficiency of the overall system to scale classification models, whereby the total time to train the model with 9500 images was observed to be 52 min on quantum optimized hardware, while compared to an experiment using CNN on K80 GPU Instance.

Discussion

The study does entail certain limitations; for instance, the dataset and the training time comparison were limited to available samples. The images collected were limited to CT-Scan with a focus on identifying discoverable patches denoting COVID-19 infection. Further, a detailed study is required to incorporate signals that may occur in a CT-Scan image tending to non-COVID signals to make the model more robust on detection. Further, this study is limited to a minimum viable solution model that would possibly need additional research to take the present version of the model into readily deployable services mode, within the ambit of the biomedical device ecosystem from an end-to-end technology implementation standpoint, supporting thereby large-scale usage in clinical trials.

The crucial point of discussion from a future research standpoint would be around how to leverage the power of quantum algorithms on hardware and localize it to biomedical devices for seamless analysis. This study did demonstrate a substantial advantage to overall medical imaging problems, using quantum learning techniques, while also implementing classical learning models in the context for performance and efficacy in improved model implementations. The model demonstrates robustness while comparing the overall recall value, as any incorrect misclassification of CoViD-19 infected patient could lead to reduction in the overall significances of the predicted outcome further deferring accurate medical diagnosis when compared to a wrongly classified patient with pneumonia or other viral infection that may show similar strains.

While the study also discussed the aspects of hardware requirements for training and evaluation of such models, significant research is still under process, whereby there has been an attempt to launch an economical cloud platform for quantum hardware simulation and modeling. Further, this study provides scope for new development area of edge-quantum computing, and opens up research dialogues around faster diagnostics, and easy interpretation of quantum algorithms in the medical world.

Conclusion

In this study, we proposed a quantum neural learning model to classify patients with COVID-19 infection, leveraging upon computed tomography scan images in medical diagnosis. The suggested model attained optimal degree of model efficacy during an experimental comparison, yielding 96.92% of accuracy overall, leveraging 9500 + CT-Scan sample images. Additionally, the overall computation time for training the model recorded was 52 min, with the entire sample, along with the inferencing time recorded, which was a minute per image. This overall model training time was significantly less as compared to classical CNN model building with similar samples, using quantum hardware. Our results thereby yield not only a significant lift in the overall accuracy, but also optimizes upon the execution time. The model could be further deployed in clinical trials and medical diagnoses, which have a significant impact on overall decision support for treating patients with early symptoms. Moreover, a medical practitioner could also leverage upon our framework for quicker diagnostics, helping him/her to follow-up with the right treatment, and thereby save a life.

The impact of this paper not only quantifies the ability of QML, but also would help clinical scientists build diagnostic tools applied to drug discovery and disease identification problems with much faster analytical capability using quantum hardware. The study further provides prospects to evaluate quantum algorithms for more complex problems pertaining to image segmentation.