C o AD : Automatic Diagnosis through Symptom and Disease Collaborative Generation (2023)

Abstract: Automatic diagnosis (AD), a critical application of AI in healthcare, employs machine learning techniques to assist doctors in gathering patient symptom information for precise disease diagnosis. The Transformer-based method utilizes an input symptom sequence, predicts itself through auto-regression, and employs the hidden state of the final symptom to determine the disease. Despite its simplicity and superior performance demonstrated, a decline in disease diagnosis accuracy is observed caused by 1) a mismatch between symptoms observed during training and generation, and 2) the effect of different symptom orders on disease prediction. To address the above obstacles, we introduce the CoAD, a novel disease and symptom collaborative generation framework, which incorporates several key innovations to improve AD: 1) aligning sentence-level disease labels with multiple possible symptom inquiry steps to bridge the gap between training and generation; 2) expanding symptom labels for each sub-sequence of symptoms to enhance annotation and eliminate the effect of symptom order; 3) developing a repeated symptom input schema to effectively and efficiently learn the expanded disease and symptom labels. We evaluate the CoAD framework using four datasets, including three public and one private, and demonstrate that it achieves an average 2.3% improvement over previous state-of-the-art results in automatic disease diagnosis. For reproducibility, we release the code and data at https://github.com/KwanWaiChung/coad .

## introduction the healthcare industry worldwide is facing an acute shortage of healthcare professionals such as doctors, nurses, and other staff, which results in millions of people not receiving the care they need, particularly in low-income countries @xcite . artificial intelligence (ai) has the potential to revolutionize medicine by automating tasks traditionally done by humans, reducing the time and cost of such tasks. automatic diagnosis (ad) is a valuable application of ai in healthcare that aims to improve patient outcomes. when deployed on mobile devices, the ad agent functions as a chatbot, querying patients about their symptoms and health concerns, and directing them to the appropriate care based on the diagnosis. this allows for faster treatment decisions, prompt notification of care teams, and increased communication between providers, ultimately leading to improved patient outcomes and potentially saving lives. the process of ad can be conceptualized as a series of questions and answers. as depicted in figure 1 , the diagnosis begins with the patient reporting initial symptoms (in this example, only a headache). the ad agent then determines whether to ask for additional symptoms or provide a disease diagnosis. the agent carefully selects relevant queries to gather more information about the patient's condition. in this illustration, the agent chose to inquire about two specific symptoms, "reduced or lost sense of taste" and "runny nose", and received positive responses from the patient. the ad agent has two objectives during the question-and-answer process for diagnosis. firstly, it strategically selects symptoms that provide the most information for disease discrimination. secondly, it aims to identify the disease as accurately as possible. these goals are interdependent. if the agent fails to thoroughly gather information about the patient's symptoms, it risks missing crucial information related to the un-derlying disease, resulting in an incorrect diagnosis. on the other hand, an accurate disease diagnosis enables the agent to cluster symptoms associated with the disease, thereby improving its ability to ask relevant symptom inquiries. a significant group of existing methods approaches ad as a sequential decision-making problem and employs reinforcement learning (rl) to solve it @xcite @xcite . these methods focus on enhancing the rl agent's performance in disease diagnosis by incorporating medical knowledge, fine-tuning reward functions, and utilizing hierarchical model structures. however, they often overlook the agent's ability to gather symptoms. in reality, it is challenging for an rl agent to simultaneously optimize for both accurate symptom inquiry and disease diagnosis. we observed in our experiments that there were fluctuations in the performance of diseases and symptoms and the rl agent frequently fell into local minima. additionally, many rl methods use an immediate reward of "-1" to encourage shorter turns during training, which may be beneficial for other task-oriented dialogs such as ticket-booking, but is unhelpful for training the agent in symptom inquiry. as a result, most rl-based agents only ask for one or two symptoms before prematurely moving on to disease prediction. insufficient symptom information not only leads to incorrect disease judgment but also diminishes the reliability and interpretability of the decision. to address the limitations of rl-based methods, @xcite proposed a generation model to acquire symptom inquiry logic and three training tasks to train the ad agent to master symptom generation rules. their method achieved competitive results, particularly in symptom recall, which confirms the superiority of generation-based models for diagnosis modeling. however, they did not consider the benefits of disease information. in this paper, we propose coad, a transformerdecoder-based framework for automatic diagnosis that collaboratively generates disease and symptom information. coad utilizes three key techniques to enhance performance. first, it aligns disease labels with symptom inquiry steps, bridging the gap between training and generation for improved disease diagnosis. second, it expands symptom labels to each sub-sequence with subsequent symptoms, making training more robust to varying symptom orders. lastly, it incorporates a repeated symptom input schema and an additional symptom attention module for simultaneous optimization. our main contributions include: rl-based approaches. early work in automatic diagnosis often used the markov decision process framework and employed reinforcement learning (rl) to solve the problem. for example, wei et al. (2018) approached it as a task-oriented dialog task and trained an agent using deep q-learning to collect implicit symptoms during patient interactions. to improve the poor efficiency of rl-based methods, kao et al. (2018) added contextual information to the dialog state and applied a hierarchical rl schema by dividing diseases into different body parts. similarly, zhong et al. (2022) employed a hierarchical setting, using a master model to trigger a low-level model comprised of symptom checkers and a disease classifier. peng et al. (2018) developed an rl-based diagnosis model that incorporated reward shaping to guide the search for better policies and feature rebuilding to improve the agent's ability to learn correlations between features. they also integrated domain knowledge to make more accurate decisions. similarly, xu et al. (2019) demonstrated that incorporating medical knowledge through a knowledge-routed graph improved diagnosis performance. furthermore, xia et al. (2020) applied a gan-based approach to the diagnosis problem, using the generator as a policy network, the discriminator as part of the reward function, and mutual information to encourage the model to select the most discriminative symptoms for diagnosis. generation-based approaches. generationbased diagnosis methods have shown promise in their ability to predict symptoms with stronger performance compared to reinforcement learning (rl)-based methods. for example, lin et al. (2019) used a bi-lstm to encode symptom word sequences and trained a sequence-to-sequence model with a crf decoder to recognize symptoms based on a symptom graph, document-level and corpus-level attentions. more recently, chen et al. (2022) aimed to alleviate the inefficiencies of exploration and sparse rewards in rl by formulating the diagnosis process as a sequence generation problem and using a transformer-based network to learn symptom sequences and disease classifiers through three training tasks. their model demonstrated significant improvements over rl-based counterparts. ## sequence generation based ad the process of ad involves predicting a disease by asking a series of questions about potential symptoms from a patient who has provided initial symptoms @xcite . ad aims to optimize for two goals simultaneously: 1) asking questions to gain the most information about the patient's condition, and 2) identifying the disease quickly and accurately. in this study, we approach the problem of ad as a combined task of generating a sequence of symptoms and classifying the disease. let s denote the set of symptoms and d denote the set of diseases. an ad dataset considers a set of possible symptom profiles: with the symptoms' status of true, false, uncertain, where s i e , (@xmath0, 2, • • • , n ) are the initial reported symptoms (i.e., explicit symptoms), and n is the number of explicit symptoms; s i i , (@xmath1, 2, • • • , m ) are the subsequent acquired symptoms (i.e., implicit symptoms), and m is the number of implicit symptoms. in the proposed method, coad, we represent a symptom status as 1 if the patient confirms having that symptom, 2 if the patient does not have it, or 0 if the patient is uncertain about having it or not. during diagnosis, coad will inquire about a symptom @xmath2, signaling the end of symptom checking and switching to predicting a disease @xmath3. during the diagnosis process, the ad system that interacts with a patient can be thought of as an agent. the agent's goal is to ask questions about key symptoms that will lead to a quick and accurate disease diagnosis. since symptoms are acquired in chronological order, it is common to factorize the joint probabilities of symptoms as the product of conditional probabilities: in practice, the probabilities can be approximated by a network parameterized by θ. once enough symptoms that aid in distinguishing the disease has been acquired, the agent proceeds to make a disease prediction. let d * denote the given disease label of the symptoms. the agent's goal is to learn a strategy that can select d * with a high probability p θ (d * |s 1:m i , s 1:n e ). disease accuracy, symptom recall, and combined score. enhancing symptom recall may lead to a decrease in disease accuracy, meaning that the agent's diagnostic performance could suffer when it achieves optimal symptom recall. this is because most previous models with higher symptom recall tend to have longer turns in a limitedturns setting. longer sequences are less common in the training set, resulting in a distribution mismatch between training and testing that hinders the model's ability to accurately identify diseases. consequently, disease accuracy and symptom recall tend to have an inverse correlation during testing in limited-turns settings. to comprehensively measure the diagnosis performance, we introduce a combined score, @xmath4, which indicates the tradeoff between high disease-prediction accuracy and high symptom-acquisition recall. ## symptom and disease collaborative generation framework even though the generation-based method has great potential in ad @xcite , applying this method to the disease diagnosis task faces two challenges. first, the disease classifier is trained on a complete symptom sequence but is only tested on partial symptoms, which creates a gap between the visible symptoms in training and inference. second, the order of symptoms in the training set can be inconsistent with the generated ones, which can lead to a wrong diagnosis if the symptoms in different order are incorrectly identified as different symptom sequences. to address the first challenge, we propose a disease and symptom collaborative generation framework, in which the disease label d * is expanded to multiple possible symptom steps to fill the gap of supported symptoms between training and generation. we refer to this disease label expansion procedure as d-label alignment. to tackle the second challenge, we present a symptom label augmentation mechanism (called s-label augmentation) that enriches the annotation and eliminates the impact of the symptoms order. furthermore, we design a repeated symptom input schema for efficient and effective learning from the expanded disease and symptom labels. our strategies are illustrated in figure 3 , in which a transformer decoder takes the repeated symptom embedding, symptom status embedding, and symptom mask as input. additionally, a symptom head and a disease head are equipped to predict the slabels and d-labels, respectively. we will provide more details in the following sections. ## conclusions this paper introduces coad, a symptom and disease co-generation framework, which significantly improves the state-of-the-art in symptom prediction and disease determination for automatic diagnosis. coad addresses the discrepancy between visible symptoms during training and generation through disease label alignment, mitigates the impact of symptom order on diagnosis through symptom label augmentation, and utilizes a repeated symptoms input schema to enable the model to simultaneously learn aligned diseases and expanded symptoms efficiently. coad presents a novel approach to data augmentation by reusing labels and text input, and it can be extended to other joint learning tasks for generation and classification.