Addressing Data Scarcity in the Medical Domain: A GPT-Based Approach for Synthetic Data Generation and Feature Extraction

: This research confronts the persistent challenge of data scarcity in medical machine learning by introducing a pioneering methodology that harnesses the capabilities of Generative Pre-trained Transformers (GPT). In response to the limitations posed by a dearth of labeled medical data, our approach involves the synthetic generation of comprehensive patient discharge messages, setting a new standard in the field with GPT autonomously generating 20 fields. Through a meticulous review of the existing literature, we systematically explore GPT’s aptitude for synthetic data generation and feature extraction, providing a robust foundation for subsequent phases of the research. The empirical demonstration showcases the transformative potential of our proposed solution, presenting over 70 patient discharge messages with synthetically generated fields, including severity and chances of hospital re-admission with justification. Moreover, the data had been deployed in a mobile solution where regression algorithms autonomously identified the correlated factors for ascertaining the severity of patients’ conditions. This study not only establishes a novel and comprehensive methodology but also contributes significantly to medical machine learning, presenting the most extensive patient discharge summaries reported in the literature. The results underscore the efficacy of GPT in overcoming data scarcity challenges and pave the way for future research to refine and expand the application of GPT in diverse medical contexts


Introduction
The burgeoning field of medical machine learning confronts an ardent challenge-the paucity of comprehensive and clinically labeled training data [1,2].The intricate nature of medical data, coupled with stringent privacy regulations, results in a scarcity that hampers the efficacy of machine learning models in healthcare applications.In particular, the insufficiency of labeled data exacerbates the predicament, impeding the ability to develop robust models capable of meaningful clinical insights [1,2].
This research endeavors to alleviate the constraints posed by the limited availability of labeled medical data by harnessing the unparalleled capabilities of Generative Pretrained Transformers (GPT).In this study, we propose a novel approach that utilizes GPT to synthetically generate medical data, thereby circumventing the challenges associated with data scarcity.Moreover, GPT's intrinsic ability to analyze and comprehend the synthetic data it generates opens avenues for the extraction of new features, offering a solution to the dearth of labeled data in the medical domain.
The first phase of our investigation involves a meticulous and systematic review of the existing literature, delving into the capabilities of GPT in synthetic data generation.By scrutinizing prior studies, we aim to provide a comprehensive understanding of GPT's prowess in generating synthetic data for training machine learning models, thereby laying the groundwork for the subsequent phases of our research.Building upon the insights gleaned from the literature, our study proceeds to explore how GPT can not only generate Information 2024, 15, 264 2 of 31 synthetic data but also engage in the analysis of these datasets to extract novel features.Through a critical examination of existing methodologies, we seek to elucidate the potential of GPT in addressing the challenge of data scarcity from a holistic perspective.
As a practical demonstration of our proposed approach, we present a method for synthetically generating patient discharge messages using GPT, as conceptually represented in Figure 1.This pragmatic application serves as a testament to the feasibility and effectiveness of our proposed solution in tackling the limited availability of training data in the medical domain.Furthermore, we showcase how GPT can play a pivotal role in feature extraction from these synthetic patient discharge messages, illustrating its capability to mitigate the scarcity of labeled data (as shown in Figure 1).Through these empirical demonstrations, we aim to establish a robust foundation for the integration of GPT into the realm of medical machine learning, paving the way for enhanced model development in the face of data scarcity.Within the scope of this study, more than 70 patient discharge messages were automatically generated by the proposed GPT prompt.For all these discharge messages, seventeen fields were synthetically generated first, and then three more fields were generated for labeling these discharge message (e.g., severity, chances of hospital re-admission with justificaiton).
Information 2024, 15, x FOR PEER REVIEW 2 of 46 gleaned from the literature, our study proceeds to explore how GPT can not only generate synthetic data but also engage in the analysis of these datasets to extract novel features.Through a critical examination of existing methodologies, we seek to elucidate the potential of GPT in addressing the challenge of data scarcity from a holistic perspective.
As a practical demonstration of our proposed approach, we present a method for synthetically generating patient discharge messages using GPT, as conceptually represented in Figure 1.This pragmatic application serves as a testament to the feasibility and effectiveness of our proposed solution in tackling the limited availability of training data in the medical domain.Furthermore, we showcase how GPT can play a pivotal role in feature extraction from these synthetic patient discharge messages, illustrating its capability to mitigate the scarcity of labeled data (as shown in Figure 1).Through these empirical demonstrations, we aim to establish a robust foundation for the integration of GPT into the realm of medical machine learning, paving the way for enhanced model development in the face of data scarcity.Within the scope of this study, more than 70 patient discharge messages were automatically generated by the proposed GPT prompt.For all these discharge messages, seventeen fields were synthetically generated first, and then three more fields were generated for labeling these discharge message (e.g., severity, chances of hospital re-admission with justificaiton).This study contributes to the current body of knowledge in the following ways:


Conducted a comprehensive review of existing literature to explore the utilization of GPT in the medical domain.Among twenty identified works, this study highlighted seven distinct research endeavors that employed GPT to generate or enhance medically relevant data [3][4][5][6][7][8][9].


Unlike previous studies that relied on manual utilization of GPT's web interface (as shown in [3][4][5][6][7][8][9]), this research autonomously leveraged the GPT Application This study contributes to the current body of knowledge in the following ways: • Conducted a comprehensive review of existing literature to explore the utilization of GPT in the medical domain.Among twenty identified works, this study highlighted seven distinct research endeavors that employed GPT to generate or enhance medically relevant data [3][4][5][6][7][8][9].

•
Unlike previous studies that relied on manual utilization of GPT's web interface (as shown in [3][4][5][6][7][8][9]), this research autonomously leveraged the GPT Application Programming Interface (API) alongside automation tools, enabling the efficient generation of a large volume of medically significant data.

•
Employing innovative prompt engineering techniques, this study generated 70 synthetic patient discharge messages encompassing seventeen fields and autonomously labeled these messages using GPT technology, resulting in the addition of three augmented fields.• The generated data underwent evaluation by medical professionals, yielding an im- pressive average precision, recall, and F1-score of 0.95, 0.97, and 0.96, respectively.• Furthermore, the synthetically generated medical data were subjected to machine learning algorithms such as regression to uncover hidden correlations among various parameters.
In essence, this research seeks to contribute a novel and comprehensive methodology to the growing body of knowledge addressing the challenges posed by data scarcity in the medical domain [1,2,10].According to the literature and to the best of our knowledge, this is the first study to generate higly accurate (with F1-score of up to 97%) patient dischage summaries using GPT technology.

Literature Review
A recent study in [11] reviews the use of ChatGPT in various aspects of medical research.It evaluates the evidence of ChatGPT's application in areas including but not limited to treatment, diagnosis, medication provision, drug development, medical report improvement, literature review writing, research conduct, data analysis, and personalized medicine.The review follows the PRISMA guidelines and encompasses studies published between 2022 and 2023.The paper in [12] explores the use of ChatGPT in the systematic review and meta-analysis process in medical research.The paper discusses how ChatGPT can be used for tasks like Risk of Bias analysis and data extraction from randomized controlled trials, highlighting the tool's ability to reduce the time and effort required for these tasks.It directly addresses the use of ChatGPT in streamlining the process of conducting systematic reviews and meta-analyses, which are integral components of evidence-based decision making in healthcare [12].The paper illustrates how AI, specifically ChatGPT, can assist in various steps of the systematic review process, including evaluating methodologies and extracting data.The study in [13] focuses on the application of ChatGPT in streamlining the literature selection process for meta-analysis in medical research.It outlines a methodology for using ChatGPT to facilitate the screening of titles and abstracts during meta-analysis, aiming to reduce workload while maintaining recall efficiency.The study includes a glioma meta-analysis for validation and discusses the development of a pipeline called LARS (Literature Records Screener) to assess the performance of ChatGPT in this context [13].It deals directly with improving the efficiency and effectiveness of literature selection and screening in the context of meta-analysis, a crucial step in systematic reviews and research synthesis [13].The research work in [14] discusses the potential public health risks posed by large language models like ChatGPT, specifically focusing on the spread of misinformation (infodemic).It explores the evolution of these models, their impact on scientific literature production, and the need for policies to mitigate misinformation risks.It focuses on the broader public health impact and ethical considerations of AI technology in disseminating information [14].The paper in [15] focuses on evaluating the use of large language models (LLMs) in healthcare.It addresses the need for a comprehensive evaluation framework that assesses LLMs not just for their natural language processing performance but also for their translational value in healthcare.The paper discusses various aspects of LLMs in healthcare, ethical concerns, and proposes a framework for evaluating their application in this field.It goes beyond just the technical aspects of LLMs and delves into the ethical, governance, and practical implications of their use in healthcare [15].This paper emphasizes a comprehensive evaluation that includes translational value assessment and ethical considerations [15].The publication in [16] examines the potential influence of large language models like ChatGPT on the field of nuclear medicine.It discusses the capabilities of these models in generating human-like text, their impact on academic publishing, and the potential risks associated with their use in the context of nuclear medicine.It highlights issues like academic integrity, misinformation, and the challenges posed by AI in producing reliable medical content [16].The focus is on the broader implications of using AI tools like ChatGPT in nuclear medicine, particularly concerning the reliability of the content produced and the ethical considerations surrounding their use in academic and clinical settings [16].The discussion includes the potential for AI-generated content to influence academic integrity and the spread of misinformation, which are key concerns in the context of public health and ethical use of AI in medicine [16].
The paper in [3] explores the potential of AI, particularly large language models (LLMs) like GPT-4, in generating original scientific research.It discusses the use of GPT-4 to write an original pharmaceutics manuscript, including formulating a research hypothesis, defining an experimental protocol, producing photo-realistic images, generating analytical data, and writing a publication-ready manuscript.This study also examines the limitations of LLMs in referencing literature and emphasizes the need for human input in interpretation and data validation [3].It focuses on the innovative use of LLMs to generate and augment data, such as creating believable analytical data and images for pharmaceutical research [3].The emphasis on the AI model's ability to conceive and execute a research hypothesis and generate multimodal data aligns with the aspects of data generation and augmentation [3].Research work in [17] explores the applications of ChatGPT and other large language models in various aspects of orthopedics, including education, surgery, and research [17].The study discusses how these AI tools can assist orthopedic clinicians and surgeons in tasks like disease diagnosis, surgical planning, and educational support.The focus is on the practical applications of ChatGPT in providing assistance to medical professionals in orthopedics, including aiding in diagnosis, surgery, and medical education, which aligns with the aspects of decision support and medical inquiry assistance [17].The study in [18] presents a systematic review of the applications, benefits, and limitations of ChatGPT in healthcare education, research, and practice.The review includes an analysis of the potential benefits of ChatGPT in scientific writing, healthcare research, and practice, along with concerns regarding ethical, copyright, transparency, and legal issues [18].Recent work in [19] examines the potential of AI systems, specifically large language models, in generating health awareness messages.The study uses the Bloom model for generating messages about folic acid, comparing them to highly retweeted human-generated messages in terms of quality and clarity.It also involves human and computational evaluations to assess the effectiveness of AI-generated messages in health communication.It focuses on the empirical assessment of AI-generated health messages, analyzing their effectiveness and comparing them to human-generated content [19].The emphasis on computational and human evaluations of the messages aligns with the aspects of data analysis in medical research [19].The study in [4] focuses on using GPT-3.5 for data augmentation to address vaccine hesitancy classification in the Dutch language.The study leverages the language model for generating realistic examples of anti-vaccination tweets and evaluates the impact of this augmentation on various machine learning models [4].It also examines the ability of the synthetic data to generalize to human data in classification tasks.It illustrates the use of GPT-3.5 for generating synthetic data to balance an imbalanced dataset in vaccine hesitancy monitoring, highlighting its capabilities in data augmentation and labeling [4].
Recent work in [5] focuses on enhancing medical question answering systems using GPT-2 for question augmentation and T5-Small for topic extraction.The paper details a model that employs BERT, GPT-2, and T5-Small to improve medical question answering performance, demonstrating the effectiveness of these techniques through experiments [5].It highlights the use of AI models for augmenting medical question data, a crucial aspect in improving the quality and coverage of datasets used in medical question answering systems [5].The study in [6] examines the use of GPT-3 in generating synthetic data for Human-Computer Interaction (HCI) research.It explores the ability of GPT-3 to produce believable accounts of HCI experiences and discusses the potential benefits and risks associated with using synthetic data generated by language models.It highlights the use of GPT-3 for generating synthetic user research data, focusing on the model's ability to create realistic and believable responses in an HCI context [6].The paper in [7] presents a study on using GPT-2 for data augmentation in the context of patient outcome prediction.
The focus is on generating artificial clinical notes in Electronic Health Records (EHRs) to improve the training of machine learning models for predicting patient outcomes, such as readmission rates.The paper discusses a novel textual data augmentation method and evaluates its effectiveness in enhancing predictive performance of deep learning models in healthcare [7].It explores the use of GPT-2 to augment medical datasets, specifically focusing on generating textual data that can be used to train models for predicting patient outcomes, aligning with data augmentation and labeling aspects [7].The research work in [8] focuses on using GPT-2 to generate synthetic biological signals, specifically EEG (electroencephalography) and EMG (electromyography), to enhance data classification.The study demonstrates that models trained on synthetic data generated by GPT-2 can classify real EEG and EMG datasets with significant accuracy and that the inclusion of synthetic data during training improves classification performance [8].It emphasizes the use of AI for generating synthetic biological signals, which augments the available data for training machine learning models in the field of biological signal processing [8].The paper in [9] focuses on using Transformer-based models, particularly GPT-2, for generating synthetic medical text to augment datasets.The study experiments with these models for data augmentation in clinically relevant NLP tasks such as unplanned readmission prediction and phenotype classification.It evaluates the effectiveness of synthetic data in improving the performance of deep learning models in these healthcare contexts [9].It highlights the application of AI models in creating synthetic medical text data, aiming to augment existing datasets for improved model training and performance in specific medical tasks [9].Finally, the paper in [20] discusses the potential of ChatGPT in various medical applications.It examines ChatGPT's ability to develop AI programs for medicine, its limitations and challenges, ethical concerns like biases and patient confidentiality, and compliance with healthcare regulations.The paper highlights ChatGPT's potential in democratizing coding and developing AI in medicine, leading to breakthroughs in the medical AI sector [20].The focus on ethical concerns, patient autonomy, and the responsible use of AI in medicine, along with the exploration of AI's potential to revolutionize medical research and practice, aligns with this category [20].These existing research works could be categorized into six distinct categores, as described in Figure 2.

•
Data Analysis: As demonstrated in [21][22][23][24][25][26], GPT assists in analyzing research data and generating critical insights.Within the medical domain, research works in [11,19] demonstrate AI's utility in analyzing complex datasets, including patient outcomes and health message effectiveness, enhancing predictive modeling and comprehension of medical data.

•
Medical Question Answering and Decision Support Systems: Studies like [11,17,18] show the role of AI in assisting medical professionals with accurate information, aiding diagnosis, and providing decision support in clinical settings.

•
Drug Discovery and Clinical Trial Analysis: While not directly covered in the reviewed articles, this category involves using AI to accelerate drug discovery processes and analyze clinical trial data, potentially enhancing the efficiency and efficacy of pharmaceutical development [11].

•
Ethical and Public Health Implications of AI in Medicine: Several recent studies like [11,[14][15][16]18,20] discuss the broader ethical implications and public health concerns of AI in medicine, including misinformation and academic integrity.
After generating new features, the augmented data can be used to effectively train the machine learning models [27][28][29][30][31][32][33][34].However, with the advent of GPT, new features could be generated either from synthetic data or from existing data, without using traditional feature extraction approaches, as shown in .Even within the medical domain, synthetic data creation, data augmentation, and labelling have been proven to be crucial in recent times [3][4][5][6][7][8][9].These papers illustrate the use of AI for creating and enhancing medical datasets, crucial for training robust machine learning models.
Information 2024, 15, x FOR PEER REVIEW 6 of 46 generating new features, the augmented data can be used to effectively train the machine learning models [27][28][29][30][31][32][33][34].However, with the advent of GPT, new features could be generated either from synthetic data or from existing data, without using traditional feature extraction approaches, as shown in .Even within the medical domain, synthetic data creation, data augmentation, and labelling have been proven to be crucial in recent times [3][4][5][6][7][8][9].These papers illustrate the use of AI for creating and enhancing medical datasets, crucial for training robust machine learning models.Finally, Table 1 clearly depicts how existing research works on using GPT in the medical domain could be categorized.As shown in Table 1, most of the existing liturature falls under the category of "Data Generation, Augmentation, and Labeling".Within the next section, a practical scenario of how GPT could be used to generate synthetic medical data as well as how to generate labels for these synthetic data will be detailed.
Table 1.Categorization of existing studies on the use of GPT in medical domain (X denotes "Topic of Interest").

Reference
Literature Review and Meta-Analysis Data Generation, Augmentation, and Labeling

Medical Question Answering and Decision
Support Systems Finally, Table 1 clearly depicts how existing research works on using GPT in the medical domain could be categorized.As shown in Table 1, most of the existing liturature falls under the category of "Data Generation, Augmentation, and Labeling".Within the next section, a practical scenario of how GPT could be used to generate synthetic medical data as well as how to generate labels for these synthetic data will be detailed.

Ethical and Public Health Implications of AI in Medicine
X [20] X

Methods
The GPT model is based on the Transformer architecture, which involves several key components, like Input Embedding and Positional Encoding, Transformer Blocks, Feed-Forward Neural Network, Normalization and Residual Connections, and Output layer [71].

•
Each input token (word or sub-word) is converted into a vector through an embedding layer.

•
Positional encodings are added to these embeddings to provide information about the position of each token in the sequence.• The combined embedding, E, is given by Equation ( 1).

Transformer Blocks
Each block consists of two main parts, the Multi-Head Self-Attention mechanism and the Feed-Forward Neural Network.
The attention mechanism can be described by Equation (2).
In Equation (2), Q, K, V are the query, key, and value matrices, and d k is the dimension of the keys.c.
In multi-head attention, this process is carried out in parallel multiple times with different, learned linear projections of the queries, keys, and values.The outputs are then concatenated and linearly transformed.
Each layer contains a fully connected feed-forward network, which is applied to each position separately and identically.This typically involves two linear transformations with a ReLU activation in between.It is represented with Equation (3).

Normalization and Residual Connections
• Each sub-layer (self-attention, feed-forward) in a transformer block has a residual connection around it, followed by layer normalization.• The output of each sub-layer is LayerNorm(x + Sublaer(x)), where Sublaer(x) is the function implemented by the sub-layer itself.

Output Layer
• The final layer is a linear transformation followed by a softmax function to predict the probability of the next token in the sequence.• The output probabilities for a token are computed as so f tmax(xW + b), where W and b are the weights and biases of the output layer.
This mathematical framework enables GPT to capture complex patterns and relationships in sequential data [71] and is used in this study to generate synthetic patient discharge messages and even perform analysis on those discharge messages for assessing severity and chances of hospital readmission.

The Process of Automating Synthetic Medical Data Generation
In the conventional approach, users of GPT technology access the model through its web interface, initiating interactions via specific prompts to derive outputs from the system (as shown in Figure 3).This traditional approach has been demonstrated by research works [3][4][5][6][7][8][9].Employing such a traditional methodology to produce synthetic medical data necessitates substantial user involvement, which can be time-consuming.To circumvent the need for manual intervention in querying the GPT interface, the current study integrates the GPT API with Microsoft Power Automate to fully automate the process of generating patient discharge summaries, as shown in Figure 3. Microsoft Power Automate orchestrates the interactions with the GPT through its API, facilitating a seamless automated workflow.Consequently, this novel automation strategy enhances the efficiency and effectiveness of generating synthetic patient discharge messages, thus streamlining the process significantly.As seen from Figure 3, the proposed approach of interacting with ChatGPT API is automated, fast, and efficient.
This mathematical framework enables GPT to capture complex pa erns and relationships in sequential data [71] and is used in this study to generate synthetic patient discharge messages and even perform analysis on those discharge messages for assessing severity and chances of hospital readmission.

The Process of Automating Synthetic Medical Data Generation
In the conventional approach, users of GPT technology access the model through its web interface, initiating interactions via specific prompts to derive outputs from the system (as shown in Figure 3).This traditional approach has been demonstrated by research works [3][4][5][6][7][8][9].Employing such a traditional methodology to produce synthetic medical data necessitates substantial user involvement, which can be time-consuming.To circumvent the need for manual intervention in querying the GPT interface, the current study integrates the GPT API with Microsoft Power Automate to fully automate the process of generating patient discharge summaries, as shown in Figure 3. Microsoft Power Automate orchestrates the interactions with the GPT through its API, facilitating a seamless automated workflow.Consequently, this novel automation strategy enhances the efficiency and effectiveness of generating synthetic patient discharge messages, thus streamlining the process significantly.As seen from Figure 3, the proposed approach of interacting with ChatGPT API is automated, fast, and efficient.

Figure 3.
Traditional approach of manual interaction with Chat GPT web interface vs. fully automated interaction via GPT API.
As seen in Figure 4, the orchestration of GPT API communication is performed using Microsoft Power Automate.The HTTP request component of Microsoft Power Automate can autonomously invoke multiple API calls.As shown in Figure 4, the first HTTP post call to GPT API generates 70 discharge messages.The second HTTP post call then critically evaluates these messages and labels them in terms of (1) severity, (2) chances of hospital readmission, and (3) reasoning.The details of both these calls are shown in Figure 5.It should be noted that Microsoft Power Automate allows the second prompt to investigate the previously generated synthetic message through the variable "Output", as shown in Figure 5b.Thus, the contextual background of the previously generated messages could be efficiently analyzed in the second prompt, along with augmenting the previous messages with newer labels (i.e., severity, chances of hospital readmission, and reasoning).The reasoning information would be validated by expert doctors at a later stage.As seen in Figure 4, the orchestration of GPT API communication is performed using Microsoft Power Automate.The HTTP request component of Microsoft Power Automate can autonomously invoke multiple API calls.As shown in Figure 4, the first HTTP post call to GPT API generates 70 discharge messages.The second HTTP post call then critically evaluates these messages and labels them in terms of (1) severity, (2) chances of hospital readmission, and (3) reasoning.The details of both these calls are shown in Figure 5.It should be noted that Microsoft Power Automate allows the second prompt to investigate the previously generated synthetic message through the variable "Output", as shown in Figure 5b.Thus, the contextual background of the previously generated messages could be efficiently analyzed in the second prompt, along with augmenting the previous messages with newer labels (i.e., severity, chances of hospital readmission, and reasoning).The reasoning information would be validated by expert doctors at a later stage.As shown in Figures 1 and 5, a specially engineered GPT prompt can be used for generating patient discharge messages.Microsoft Power Automate with GPT API automatically generates patient discharge summaries with specifically guided headings, like Diagnosis, Treatment, Patient Instructions, Medications on Discharge, etc.The complete list can be seen from Appendix A using the prompt of Box 1.Many of these headings (presented in Appendix A) are required for assessment of severity and predicting the chances of hospital readmission, which would be performed in the next stage.As seen from Figures 6-9, GPT generated the discharge summaries synthetically (i.e., not real patient information).As shown in Figures 1 and 5, a specially engineered GPT prompt can be used for generating patient discharge messages.Microsoft Power Automate with GPT API automatically generates patient discharge summaries with specifically guided headings, like Diagnosis, Treatment, Patient Instructions, Medications on Discharge, etc.The complete list can be seen from Appendix A using the prompt of Box 1.Many of these headings (presented in Appendix A) are required for assessment of severity and predicting the chances of hospital readmission, which would be performed in the next stage.As seen from Figures 6-9, GPT generated the discharge summaries synthetically (i.e., not real patient information).As shown in Figures 1 and 5, a specially engineered GPT prompt can be used for generating patient discharge messages.Microsoft Power Automate with GPT API automatically generates patient discharge summaries with specifically guided headings, like Diagnosis, Treatment, Patient Instructions, Medications on Discharge, etc.The complete list can be seen from Appendix A using the prompt of Box 1.Many of these headings (presented in Appendix A) are required for assessment of severity and predicting the chances of hospital readmission, which would be performed in the next stage.As seen from Figures 6-9, GPT generated the discharge summaries synthetically (i.e., not real patient information).Based on the description of the generated discharge summary, generate an image of that patient For Alex Johnson (Figure 6), the GPT response before generating the synthetic patient image is "Based on this summary, I will create an artistic representation of Alex Johnson, a 38-year-old male who has just recovered from an appendectomy.Let's visualize Alex as having short brown hair, a medium build, and a friendly appearance, reflecting his recovery phase".
As shown earlier in Figure 1 from the synthetically generated discharge summaries, GPT can effectively be used for generating new features.Figures 5b and 10 illustrate this process further.As seen from Figure 10, critical information (e.g., nature of their medical  Based on the description of the generated discharge summary, generate an image of that patient For Alex Johnson (Figure 6), the GPT response before generating the synthetic patient image is "Based on this summary, I will create an artistic representation of Alex Johnson, a 38-year-old male who has just recovered from an appendectomy.Let's visualize Alex as having short brown hair, a medium build, and a friendly appearance, reflecting his recovery phase".
As shown earlier in Figure 1 from the synthetically generated discharge summaries, GPT can effectively be used for generating new features.Figures 5b and 10 illustrate this process further.As seen from Figure 10, critical information (e.g., nature of their medical  Based on the description of the generated discharge summary, generate an image of that patient. For Alex Johnson (Figure 6), the GPT response before generating the synthetic patient image is "Based on this summary, I will create an artistic representation of Alex Johnson, a 38-year-old male who has just recovered from an appendectomy.Let's visualize Alex as having short brown hair, a medium build, and a friendly appearance, reflecting his recovery phase".
As shown earlier in Figure 1 from the synthetically generated discharge summaries, GPT can effectively be used for generating new features.Figures 5b and 10 illustrate this process further.As seen from Figure 10, critical information (e.g., nature of their medical conditions, treatments received, and the instructions provided upon discharge) are used for generating new features like severity of condition and change of hospital readmission.Box 3 shows the GPT prompt used for this feature augmentation process (as previously demonstrated in Figure 5b).Rate the severities of these patients along with their chance of hospital readmission for each of these patients As seen from Figure 10, for Alex Johnson (i.e., discharge summary presented in Figure 6), GPT assessed the severity of his condition to be "Moderate" and the changes of hospital readmission to be "Low to Moderate".This process can be effectively used to label the synthetic data as low, moderate, high, etc., and could be efficiently used to train machine learning models at a later stage.The same methodology could be used for generating synthetic electrocardiogram signals or other bio-signals as well as labelling these signals.Hence, GPT to solve GPT is presented as an effective solution towards solving data scarcity as well as fewer labels in the medical domain.

Results
Using the methodology detailed in the previous section, within this study, 70 patient discharge summaries were synthetically generated.As seen from As mentioned in the previous section, the first 17 fields were generated with GPT Prompt 1 and then labelling information (i.e., Severity Level, Probability of Hospital Re-admission, and Reasoning) was generated with Prompt 2. Appendix A shows the details of these 70 generated discharge summaries.Out of these 20 fields, only Age was numeric in nature, and as a result, Table 3 provides various statistics on this numeric field.The value of Age ranged between 23 and 89.There were two date fields, namely date of admission and date of discharge.Rate the severities of these patients along with their chance of hospital readmission for each of these patients.
As seen from Figure 10, for Alex Johnson (i.e., discharge summary presented in Figure 6), GPT assessed the severity of his condition to be "Moderate" and the changes of hospital readmission to be "Low to Moderate".This process can be effectively used to label the synthetic data as low, moderate, high, etc., and could be efficiently used to train machine learning models at a later stage.The same methodology could be used for generating synthetic electrocardiogram signals or other bio-signals as well as labelling these signals.Hence, GPT to solve GPT is presented as an effective solution towards solving data scarcity as well as fewer labels in the medical domain.

Results
Using the methodology detailed in the previous section, within this study, 70 patient discharge summaries were synthetically generated.As seen from Table 2, these patient discharge summaries had 20 fields comprising Patient Name, Age, Gender, Date of Admission, Date of Discharge, Admitting Physician, Discharging Physician, Reason for Admission, Treatment and Surgical Procedures, Patient's Response to Treatment, Medical History, Hospital Course, Follow-up, Patient Instructions, Final Diagnosis, Discharge Condition, Discharge Medications, Severity Level, Probability of Hospital Re-admission, and Reasoning.As mentioned in the previous section, the first 17 fields were generated with GPT Prompt 1 and then labelling information (i.e., Severity Level, Probability of Hospital Readmission, and Reasoning) was generated with Prompt 2. Appendix A shows the details of these 70 generated discharge summaries.Out of these 20 fields, only Age was numeric in nature, and as a result, Table 3 provides various statistics on this numeric field.The value of Age ranged between 23 and 89.There were two date fields, namely date of admission and date of discharge.Date of admission ranged from 12 January 2021 to 20 December 2021.Date of discharge ranged from 20 January 2021 to 30 December 2021.From these date fields, the duration of hospital stay could be calculated.Hospital stay ranged from 3 (for Sophie Duncan) to 334 days (Maria Johnson).Finally, Figure 11 shows the distributions of labeling data (i.e., Severity level and Chances of Hospital Re-admission).As seen from Figure 11, 12.86% of the discharge summaries were labeled with the severity level of high and 67.14% of the discharge summaries were labeled with severity level being low.In terms of hospital re-admission, 60% of cases were moderate, 24.29% of cases were low, and 15.71% of the cases were flagged as "moderate to high".
The last three columns in Table 3, namely Severity Level, Probability of Hospital Re-admission, and Reasoning, were generated anew using Prompt 3.This additional information was autonomously generated by GPT, as demonstrated in Figure 5b.Given that GPT was instructed to act as a medical professional in generating these details, the augmented data underwent evaluation by two medical experts.
The evaluation results are depicted in Table 4, revealing an average precision, recall, and F1-score of 0.95, 0.97, and 0.96, respectively, across all three labeled tasks.This indicates GPT's capability to automatically label medical data with a high level of accuracy.Notably, in Table 4, the F1-Score was highest, at 97% for reasoning, followed by severity and likelihood of hospital admission.This manual validation process underscores the potential for utilizing GPT and related technologies with confidence in generating and enhancing synthetic medical data.The last three columns in Table 3, namely Severity Level, Probability of Hospital Readmission, and Reasoning, were generated anew using Prompt 3.This additional information was autonomously generated by GPT, as demonstrated in Figure 5b.Given that GPT was instructed to act as a medical professional in generating these details, the augmented data underwent evaluation by two medical experts.
The evaluation results are depicted in Table 4, revealing an average precision, recall, and F1-score of 0.95, 0.97, and 0.96, respectively, across all three labeled tasks.This indicates GPT's capability to automatically label medical data with a high level of accuracy.Notably, in Table 4, the F1-Score was highest, at 97% for reasoning, followed by severity and likelihood of hospital admission.This manual validation process underscores the potential for utilizing GPT and related technologies with confidence in generating and enhancing synthetic medical data.Other than manually evaluating the validity of generated information, machine learning algorithms could also be used on the generated synthetic data for obtaining AI-driven insights [72].The next section will discuss how machine learning algorithms could be used on these synthetic data for obtaining AI-driven insights.

Discussion and Concluding Remarks
This research introduces a groundbreaking methodology to address the challenge of data scarcity in medical machine learning by leveraging the capabilities of GPT.The study proposes a comprehensive approach that utilizes GPT for synthetic data generation and subsequent feature extraction, offering a transformative solution to the limitations imposed by the scarcity of labeled medical data.The empirical demonstration involving the synthetic generation of patient discharge messages serves as a practical testament to the feasibility and effectiveness of the proposed methodology, showcasing its potential to revolutionize the integration of GPT into the realm of medical machine learning.Figure 12 shows the deployment of the GPT-based solution in the latest Samsung Galaxy S23 Ultra mobile phone using Microsoft Power BI's deployed App.The application of this deployment process has been showcased in recent studies through the utilization of low-code platforms [27,[30][31][32]34].Other than manually evaluating the validity of generated information, machine learning algorithms could also be used on the generated synthetic data for obtaining AI-driven insights [72].The next section will discuss how machine learning algorithms could be used on these synthetic data for obtaining AI-driven insights.

Discussion and Concluding Remarks
This research introduces a groundbreaking methodology to address the challenge of data scarcity in medical machine learning by leveraging the capabilities of GPT.The study proposes a comprehensive approach that utilizes GPT for synthetic data generation and subsequent feature extraction, offering a transformative solution to the limitations imposed by the scarcity of labeled medical data.The empirical demonstration involving the synthetic generation of patient discharge messages serves as a practical testament to the feasibility and effectiveness of the proposed methodology, showcasing its potential to revolutionize the integration of GPT into the realm of medical machine learning.Figure 12 shows the deployment of the GPT-based solution in the latest Samsung Galaxy S23 Ultra mobile phone using Microsoft Power BI's deployed App.The application of this deployment process has been showcased in recent studies through the utilization of low-code platforms [27,[30][31][32]34].As this study exclusively solved the labeled data scarcity for training machine learning models within medical domain (as discussed in [1,2,10]), it needs to be demonstrated how the generated synthetic data could be used in machine leanirng.Figure 12 shows that automated regression identified "Hospital Stays" to be highly corelated with the severity of the patient.The AI-driven insight shown in Figure 12 (within Samsung Galaxy S23 Ultra Mobile) shows that out of the 19 fields, Patient's Age, Chance of Hospital readmission, and Hospital stays are correlated with severity.This automated regression using "Key Influencer" visualization of Microsoft Power BI has been reported in [73].The previous section evaluated the validity of the generated medical data using manual evaluation by an expert medical professional.Now, this section demonstrates the use of the automated machine learning algorithm (i.e., regression to obtain the correlated variables) on the synthetic data.regression identified "Hospital Stays" to be highly corelated with the severity of the patient.The AI-driven insight shown in Figure 12 (within Samsung Galaxy S23 Ultra Mobile) shows that out of the 19 fields, Patient's Age, Chance of Hospital readmission, and Hospital stays are correlated with severity.This automated regression using "Key Influencer" visualization of Microsoft Power BI has been reported in [73].The previous section evaluated the validity of the generated medical data using manual evaluation by an expert medical professional.Now, this section demonstrates the use of the automated machine learning algorithm (i.e., regression to obtain the correlated variables) on the synthetic data.In summary, this study presents a pioneering and thorough methodology designed to address the data scarcity issues faced by researchers and scientists in the medical field.Leveraging this approach, automation tools such as Microsoft Power Automate were employed alongside the ChatGPT API to not only generate synthetic medical data automatically but also to label these datasets autonomously.The labeling process conducted by GPT was manually assessed by medical experts, yielding an impressive F1-score of 97%.Additionally, machine learning techniques, including regression analysis, were applied to In summary, this study presents a pioneering and thorough methodology designed to address the data scarcity issues faced by researchers and scientists in the medical field.Leveraging this approach, automation tools such as Microsoft Power Automate were employed alongside the ChatGPT API to not only generate synthetic medical data automatically but also to label these datasets autonomously.The labeling process conducted by GPT was manually assessed by medical experts, yielding an impressive F1-score of 97%.Additionally, machine learning techniques, including regression analysis, were applied to the synthetic data, affirming the validity of the generated information.The integration of ChatGPT API's synthetic data generation and feature extraction capabilities not only facilitates the development of more robust machine learning models for healthcare applications but also sets the stage for future research endeavors.Future works should explore the application of GPT across diverse medical datasets, optimize its capabilities for specific contexts, and delve into the ethical implications of deploying synthetic data in medical research.This study lays the foundation for a trajectory of research that promises to redefine the landscape of medical machine learning, ultimately benefiting both researchers and clinicians in their pursuit of improved healthcare outcomes.

Figure 1 .
Figure 1.Conceptual diagram of GPT-based training data generation, feature extraction, and labelling.

Figure 1 .
Figure 1.Conceptual diagram of GPT-based training data generation, feature extraction, and labelling.

Figure 2 .
Figure 2. Six distinct areas of research for "GPT in Medical Domain".

Figure 2 .
Figure 2. Six distinct areas of research for "GPT in Medical Domain".

Figure 3 .
Figure 3. Traditional approach of manual interaction with Chat GPT web interface vs. fully automated interaction via GPT API.

Figure 4 .Figure 5 .
Figure 4. Microsoft Power Automate invoking API calls to GPT API in an automated manner using HTTP requests.

Figure 4 .
Figure 4. Microsoft Power Automate invoking API calls to GPT API in an automated manner using HTTP requests.

Figure 4 .Figure 5 .
Figure 4. Microsoft Power Automate invoking API calls to GPT API in an automated manner using HTTP requests.

Figure 5 .
Figure 5.The process of passing specially designed prompts through Microsoft Power Automate (HTTP post method).* preceding Method and URI denotes mandatory fields.(a) Generating 70 patient discharge messages.(b) Labelling each of the 70 messages with severity and chances of hospital readmission.

Box 1 .
Generating Synthetic Patient Discharge Summaries.Generate patient discharge summary with following fields: Patient Name, Age, Gender, Date of Admission, Date of Discharge, Admitting Physician, Discharging Physician, Reason for Admission, Treatment and Surgical Procedures, Patient's Response to Treatment, Medical History, Hospital Course, Follow-up, Patient Instructions, Final Diagnosis, Discharge Condition, and Discharge Medications.Detailed single line response with each field separated with "|" character.Information 2024, 15, x FOR PEER REVIEW 10 of 46

Box 1 .
Generating Synthetic Patient Discharge Summaries.Generate patient discharge summary with following fields: Patient Name, Age, Gender, Date of Admission, Date of Discharge, Admitting Physician, Discharging Physician, Reason for Admission, Treatment and Surgical Procedures, Patient's Response to Treatment, Medical History, Hospital Course, Follow-up, Patient Instructions, Final Diagnosis, Discharge Condition, and Discharge Medications.Detailed single line response with each field separated with "|" character.

Figure 6 .
Figure 6.Synthetic patient discharge summary generated for Alex Johnson using GPT prompt.

Figure 7 .
Figure 7. Synthetic patient discharge summary generated for Sophia Martinez using GPT prompt.

Figure 6 .
Figure 6.Synthetic patient discharge summary generated for Alex Johnson using GPT prompt.

Box 1 .
Generating Synthetic Patient Discharge Summaries.Generate patient discharge summary with following fields: Patient Name, Age, Gender, Date of Admission, Date of Discharge, Admitting Physician, Discharging Physician, Reason for Admission, Treatment and Surgical Procedures, Patient's Response to Treatment, Medical History, Hospital Course, Follow-up, Patient Instructions, Final Diagnosis, Discharge Condition, and Discharge Medications.Detailed single line response with each field separated with "|" character.

Figure 6 .
Figure 6.Synthetic patient discharge summary generated for Alex Johnson using GPT prompt.

Figure 7 .
Figure 7. Synthetic patient discharge summary generated for Sophia Martinez using GPT prompt.Figure 7. Synthetic patient discharge summary generated for Sophia Martinez using GPT prompt.

Figure 7 .
Figure 7. Synthetic patient discharge summary generated for Sophia Martinez using GPT prompt.Figure 7. Synthetic patient discharge summary generated for Sophia Martinez using GPT prompt.

Figure 8 .
Figure 8. Synthetic patient discharge summary generated for Emily Thompson using GPT prompt.

Figure 9 .Box 2 .
Figure 9. Synthetic patient discharge summary generated for Michael Roberts using GPT prompt.

Figure 8 . 46 Figure 8 .
Figure 8. Synthetic patient discharge summary generated for Emily Thompson using GPT prompt.

Figure 9 .Box 2 .
Figure 9. Synthetic patient discharge summary generated for Michael Roberts using GPT prompt.

Figure 9 .
Figure 9. Synthetic patient discharge summary generated for Michael Roberts using GPT prompt.Images of the patients could also be generated by adding prompt of Box 2 along with Box 1.

Box 2 .
Generating the Images of the Patients Using the Information from Discharge Summaries.
Information 2024,15,  x FOR PEER REVIEW 12 of 46 conditions, treatments received, and the instructions provided upon discharge) are used for generating new features like severity of condition and change of hospital readmission.Box 3 shows the GPT prompt used for this feature augmentation process (as previously demonstrated in Figure5b).

Figure 10 .Box 3 .
Figure 10.Feature extraction process using GPT for labelling the discharge messages.

Figure 10 .Box 3 .
Figure 10.Feature extraction process using GPT for labelling the discharge messages.Box 3. Generating New Features for Labeling the Discharge Messages.

Figure 11 .
Figure 11.Results of labeling patient discharge summaries with GPT.

Figure 11 .
Figure 11.Results of labeling patient discharge summaries with GPT.

Figure 12 .
Figure 12.GPT-based patient discharge summary viewed and analyzed with machine learning algorithms in Samsung Galaxy S23 Ultra.

Figure 12 .
Figure 12.GPT-based patient discharge summary viewed and analyzed with machine learning algorithms in Samsung Galaxy S23 Ultra.

Table 1 .
Categorization of existing studies on the use of GPT in medical domain (X denotes "Topic of Interest").

Table 2 ,
these patient discharge summaries had 20 fields comprising Patient Name, Age, Gender, Date of Admission, Date of Discharge, Admitting Physician, Discharging Physician, Reason for Admission, Treatment and Surgical Procedures, Patient's Response to Treatment, Medical History, Hospital Course, Follow-up, Patient Instructions, Final Diagnosis, Discharge Condition, Discharge Medications, Severity Level, Probability of Hospital Re-admission, and Reasoning.

Table 2 .
Seventy synthetically generated patient discharge summaries with 20 fields each.

Table 3 .
Statistics on Age field.

Table 4 .
Evaluation of the augmented data by GPT.

Table 4 .
Evaluation of the augmented data by GPT.

Table A1 .
Seventy patient discharge summaries generated with GPT.