A mountable toilet system for personalized health monitoring via the analysis of excreta
Technologies for the longitudinal monitoring of a person’s health are poorly integrated with clinical workflows, and have rarely produced actionable biometric data for healthcare providers. Here, we describe easily deployable hardware and software for the long-term analysis of a user’s excreta through data collection and models of human health. The ‘smart’ toilet, which is self-contained and operates autonomously by leveraging pressure and motion sensors, analyses the user’s urine using a standard-of-care colorimetric assay that traces red–green–blue values from images of urinalysis strips, calculates the flow rate and volume of urine using computer vision as a uroflowmeter, and classifies stool according to the Bristol stool form scale using deep learning, with performance that is comparable to the performance of trained medical personnel. Each user of the toilet is identified through their fingerprint and the distinctive features of their anoderm, and the data are securely stored and analysed in an encrypted cloud server. The toilet may find uses in the screening, diagnosis and longitudinal monitoring of specific patient populations.
The US Precision Medicine Initiative defines precision medicine as “an emerging approach for disease treatment and prevention taking into account individual variability in genes, environment, and life style for each person”1–4. Clinicians today can conduct panoramic molecular analyses to characterize many diseases, but current precision medicine is still primarily limited to disease treatment rather than prevention and early detection. The current manifestations of precision medicine address disease retrospectively after many symptoms have already appeared. Although clinicians are able to tailor therapies to address the disease process of each patient, they are at a considerable disadvantage owing to possible delayed treatment.Thus, equal emphasis should be given to disease prevention and early detection as well as disease treatment.
Instead of precision medicine, the rapidly evolving field of precision health has expanded efforts in the prevention and early detection of disease through risk-tailored longitudinal monitoring5. A similar idea is already realized in the aircraft industry, which implements continuous monitoring of jet engines with hundreds of sensors to prevent engine failure. Unfortunately, in contrast to the aircraft industry, the fact that a normal adult in the United States visits a healthcare provider fewer than four times per year6 implies that surveillance of the human body is limited, infrequent and possibly insufficient. Implementing precision health strategies is therefore believed to make a considerable difference to both the habits and the health of a person over a long period of time. In this regard, we previously proposed a framework for precision health5, suggesting the importance of ‘passive monitoring and the smart home’ and ‘delivering information and guidance through the health portal’.
Invasive clinical procedures are not suitable for continuous health monitoring in a non-clinical environment, as they are often distressing, costly and burdensome for the public. Even a minimally invasive blood draw, despite its great potential in diagnostics7,8, is burdensome when it comes to the healthy population. Thus, the ideal sources of diagnostic information for continuous health monitoring are the potentially information-rich molecular contents of breath9,10, sweat11,12, saliva13,14, urine and stool15–20, all of which are complex by-products that are affected by human body systems, activities and external environments that provide valuable information on an individual’s health and are naturally excreted every day. Routine medical tests for these excreta include urinalysis, uroflowmetry and stool analysis, such as microscopic examination, chemical tests and microbiological tests. Urinalysis is important for accessing the biochemical constituents of the urine and its relationship with various disease states, such as diabetes, metabolic abnormalities, liver diseases, some cancers (such as prostate, kidney and bladder), biliary and hepatic obstructions, and diseases of the kidneys and urinary tract21,22. These tests are already offered for in-home use and are commercially available on the market in the form of test strips. In addition to the biochemical analysis of urine, the standard technique for the physical and quantitative analysis of urination is known as uroflowmetry, which measures the flow of urine and tracks the velocity, volume and the duration of urination events23–26. Uroflowmetry is used as a diagnostic test to assess the function of the urinary tract. Stool analysis is also important for diagnosing gastrointestinal disorders, including poor nutrient absorption27, pancreatitis28–33, infections34–36 and cancers17,37,38. In particular, the Bristol stool form scale (BSFS; BS1–BS7) categorizes the form of stool to be used as an assessment tool for the diagnosis of various bowel diseases or evaluation of treatment efficacy (Supplementary Table 1). The use of an objective scale facilitates accurate communication of clinically useful information between patients and physicians39,40. Unfortunately, despite its demonstrated clinical use, there are no clinically approved modalities that can reliably and consistently monitor human excreta in the home setting. Even these objective scales are subject to variations in interpretation by the patient. It has been reported that there are a certain level of disparities between the descriptions of stool by patients and true stool classification41. Furthermore, BSFS results assessed by physicians were reported to be substantially superior to assessments by nurses or patients42.
The intersection of continuous health monitoring and the valuable clinical information obtained from analysing human excreta lies in the smart toilet. Aside from a handful of prototypes, limited attempts by industrial manufacturers to build a consumer-grade smart toilet have been made. A Japanese company, has pursued the smart-toilet system since the mid-1980s and has published several patents on smart-toilet implementation43–45. One of its latest products, announced in 2008, however, lacks clinical utility and is not readily integrated with a user’s electronic health record (EHR) system. Moreover, the major measurements are simple health data, such as urine temperature, diet, body fat and weight, which, unfortunately, rarely provide clinically actionable information. Moreover, with a listed price of US$6,100 per unit (with complete installation), it is probably not affordable for common household use. Similar ideas and inventions to achieve a smart toilet have been introduced in various formats; however, they have not been successfully translated into the clinic–home interface. This is primarily due to the lack of actionable clinical data and compatibility of existing smart toilet systems with clinical decision-making. Furthermore, stool sampling and analysis have proven to be logistically challenging for existing commercial toilets because the homogenization of stool before analysis is non-trivial. Finally, both current urinalysis and stool analysis require some degree of human intervention to record results, both of which can be burdensome, can cause user variability and may result in an invasion of private health information—which is yet another barrier to the widespread use of the smart toilet for healthcare.
Here we present a proof-of-concept toilet technology for the delivery of non-invasive and robust measurements of excreta for continuous monitoring and precision health. We focus on clinically relevant assays for both urinalysis and stool analysis. Standard urinalysis test strips46 were mounted within the toilet system and automatically interact with the urine stream with a motion sensor and a mechanical extender. Furthermore, video analysis of the urine stream conducted uroflowmetry to measure baselines and to identify abnormal urine flow associated with diseases. For stool analysis, images of stool in the toilet system were collected for grading on the BSFS using an automated classifier with a machine learning algorithm. It was also able to collect additional information, such as first stool dropping time and total seating time, which can potentially be acted on by clinicians to help to manage constipation and haemorrhoids. Our system also uses fingerprinting and a distinctive method of using anal creases (the distinctive feature of the anoderm, referred to here as analprint) as biometric identifiers to securely associate the collected data with the user’s identity. Together, these measurements were chosen to maximize the clinical utility (Supplementary Table 2) of the toilet while hopefully remaining affordable and widely deployable.
We developed fully automated toilet modules that can be mounted onto existing toilets (Fig. 1). Three discrete modules for the toilet system were developed—urinalysis (10-parameter urinalysis test strip), uroflowmetry using computer-vision analysis, and stool analysis (classification in BSFS and defecation timings). The initial prototype includes two-factor user identification using flush lever fingerprinting and analprint recognition, and data from the urinalysis, uroflowmetry and stool analysis were automatically transferred to a cloud system. A schematic flowchart of the toilet system is provided in the Supplementary Schematic.
Whereas traditional urinalysis includes chemical and microscopic examination of urine22, in this proof-of-concept study, we conducted biochemical urinalysis by integrating a ten-parameter urinalysis test strip46 into the toilet system. This strip provides qualitative and semi-quantitative urinalysis of ten biomarkers: erythrocytes, urobilinogen, bilirubin, protein, nitrite, ketones, glucose, pH, specific gravity and leukocytes. Two participants (one male (aged 39 years) and one female (aged 39 years)) were instructed to use test strips whenever they voided (Supplementary Fig. 1).
To implement this module in the toilet system, we salvaged the external enclosure of a commercially available electronic bidet. We assumed a urination position of an adult male aiming towards the centre of the toilet bowl (Fig. 2, Supplementary Fig. 2). A deck of test strips are loaded into a cartridge, which was designed as an insert into the toilet system. The beginning of urination is automatically detected with a passive infrared motion sensor. After motion is detected, a test strip is automatically loaded onto the deployment unit and strips are (30–60 s)47, the deployment unit is retracted into its original position, and then monitored by a video camera (Fig. 2a). Raw video data captured using a camera, with lighting conditions normalized by a white light-emitting diode (LED) strip, are analysed in real-time, including red–green–blue (RGB) kinematics and control versus active comparisons, which are then wirelessly transferred to a cloud storage facility (Fig. 2b,,c,c, Supplementary Fig. 3). After urination is complete, a strip-discarding servo motor attached to the deployment module releases the used strip such that the strip is discarded into the toilet bowl. Moreover, to make the strip environmentally-friendly and safe for septic systems, we replaced the plastic backbone of the strip with a water-soluble polysaccharide backbone. An automatic strip feeder replenishes the strip after a urination event is complete.
A standard uroflowmeter (URODYN1000, Dantec Medical), which is installed in the Stanford Urology Clinic, uses the spinning-disk principle to measure the following metrics: voiding time, time to maximum flow, maximum flow rate, average flow rate and total voided volume. Parts of these metrics were integrated into the toilet system with computer-vision analysis.
As a proof of concept, we developed a computer-vision uroflowmetry module. Two high-speed cameras (GoPro Hero 7, GoPro) were positioned at two fixed locations close to and facing away from the user to record a series of frames of the urine stream. The camera setting was set to a resolution of 960 × 1280 px, high speed (240 frames per second) and wide-angle field of view (FOV).
To assess the proposed uroflowmetry module, multiple emulated urination events within a normal physiological range48 of between 50 ml and 670 ml and multiple urinations from ten male participants (aged 19–40) were recorded and analysed using the computer-vision uroflowmetry module (Fig. 2d). Ten male participants performed a total of 31 urinations and, additionally, 68 emulated streams were tested over a period of 5 weeks. Details regarding specific algorithms as well as the setup are provided in Supplementary Fig. 4. In brief, recorded videos from two cameras were fragmented into individual frames, preprocessed to extract the urine stream and synchronized for corrections. For accurate measurement of the total voided volume using the computer-vision uroflowmetry module, depth-correction and flow-rate-correction were performed. Geometric means of the pixel values from two cameras, in addition to the depth information, represent a three-dimensional (3D) volume of the urine stream. The flow rate estimation was performed by counting pixels in both the top and bottom regions of interest (ROIs; 10% in the vertical direction) within each frame and running the cross-correlation function to estimate the frame shift between the two ROIs. The urine volume was represented as the sum of depth-corrected pixels divided by the frame shift calculated from the flow-rate estimation. Furthermore, the voiding time was estimated from the start point and the end point of the urination event with the known video frame rate.
To observe the urodynamics, we compared a micrograph generated using the standard uroflowmeter and a graph calculated using the computer-vision uroflowmetry method. In Fig. 2e, we noted that there is a significant correlation between the two. However, during the end phase of the urination—terminal dribbling, which was not detected by standard uroflowmetry but was successfully captured by computer-vision uroflowmetry—there were discrepancies in urination duration comparisons (Fig. 2f, blue arrow). Despite the discrepancies, voiding times recorded by standard uroflowmetry and computer-vision uroflowmetry had a high linear correlation with the number of video frames (Pearson’s r = 0.96). We believe that inconsistencies with regard to terminal dribbling can provide valuable information about the prostate and bladder functions49.
Our algorithm also accurately determined the total voided volume using depth- and flow-rate-corrected pixel information from synchronized video frames. This method showed a linear correlation (Pearson’s r = 0.92) between the corrected pixel sum as measured using computer-vision uroflowmetry and the total voided volume measured on the basis of standard uroflowmetry. The main discrepancies were caused by urine streams with an extremely high flow rate; nevertheless, this limitation could be resolved by using a higher-frame-rate camera to capture the stream in finer time stamps. The camera FOV can be further optimized by vertically increasing the FOV to capture more of each urine stream for better estimation of the urine volume and flow rate.
In contrast to the pathological assessment (biopsy) used in cancer diagnosis, there is no existing gold standard for BSFS classification because BSFS is based purely on visual assessment. Therefore, two board-certified general surgeons (subspecialty of coloproctology) independently annotated all of the stool images with a corresponding BSFS to assign them as the gold standard. To compare their classification concordance, we created confusion matrices, which describe the performance of a classifier on the basis of true values (Fig. 3a). The level of concordance was then measured using the Matthews correlation coefficient (MCC), which is a multiclass generalization of a classic metric that ranges from 1 (perfect classification) to −1 (asymptotic extreme misclassification). Furthermore, the confusion entropy (CEN), a measure of performance in multiclass problems, was calculated from the confusion matrices50–52, ranging from 0 (perfect classification) to 1 (complete misclassification). The MCC and CEN values were calculated as 0.70 and 0.25, respectively, showing a satisfactory agreement between the two surgeons. The calculations are provided in detail in Supplementary Table 3.
Initially, we retrained Inception v.3 on ten toilet classes comprising the seven BSFS classes plus three other toilet classes (clean state, urine state and toilet paper state; Fig. 3). Here we reduced this medically relevant classification to a trichotomous decision task—constipated stool, normal stool and diarrhoea (Fig. 3 and Supplementary Fig. 5). BS1 and BS2 of the BSFS are regarded as abnormally hard stools (indicative of constipation in conjunction with other symptoms), whereas BS6 and BS7 are regarded as abnormal liquid/soft stools (indicative of diarrhoea with other symptoms). The other types—BS3, BS4 and BS5—are generally considered to be the most normal and modal forms of stool in the healthy adult population53. As receiver operating characteristic (ROC) analysis is traditionally used for dichotomous diagnostic tasks, the corresponding ROCs were reduced to a dichotomous classification on the basis of a multiclass-classification strategy, the one versus rest approach, with the samples of the corresponding class as positive samples and all of the other samples as negative samples.
Two independent gold standards by these surgeons were used for deep convolutional neural network (CNN) training (we therefore have two independent CNNs). To benchmark the classification performance of the trained CNNs, six medical students, all of whom had completed at least 2 years of medical school training, were recruited to score the same image sets so that their performance could be directly compared with CNNs. Originally, although they were aware of BSFS, the students had not been trained specifically on grading stools with the BSFS. In Fig. 3e and Supplementary Fig. 5, the same group of medical students (six for the training set and five for the test set) produced a single prediction per image, represented by single red points. Averages of the medical students for each task are represented by green points (calculated from n = 6 (training set) and n = 5 (test set) students, for constipated stool, normal stool and diarrhoea). For each given image, the deep CNN yields a stool class probability P. The prediction ŷ is defined by ŷ = P ≥ t when a threshold probability t was fixed. To calculate the performance of the CNN, an area under the curve (AUC; represented by a blue curve in the graph), with a minimum value of 0.5 and a maximum value of 1, was calculated based on drawing blue curves by sweeping t in the interval 0–1. Regardless of the gold standard for stool classification selected, the CNN showed better performance than the untrained medical students in the training sets and demonstrated comparable results with trained medical students in the test sets. In the training sets, the AUCs for each case was over 0.97, whereas, in the test sets, the AUCs for each case had a minimum of 0.89. Twelve ROCs were generated from algorithms trained by each surgeon (Supplementary Fig. 5).
We housed the defecation-monitoring module in the external enclosure of a commercially available electronic bidet. A pressure sensor (FSR 402, Interlink Electronics) consisting of a force sensitive resistor (FSR) was installed underneath the toilet seat to detect the initiation of the defecation process (Fig. 4). When the user applies pressure onto the FSR, the decrease in resistance confirms the presence of a user. An analogue-to-digital converter (MCP3008, MicroChip Technology) is used to convert the analogue signals from the FSR to digital signals that can be read by a microcomputer (Raspberry Pi v.3). By reading the signal duration from the FSR, we are able to estimate the total seating time of a user. Once a signal from the FSR is detected, the microcomputer relays the signal to initiate LEDs and video recording of the toilet. An LED strip is installed under the toilet seat, ensuring the exact same lighting conditions during each toilet use. The video camera is installed in the rear portion of the toilet seat and housed within the commercial electronic bidet enclosure (Fig. 4a). The video camera captures the toilet image continuously while the pressure sensor returns signals above a threshold, including a grace period of an additional 30 s. After acquisition, these images are fed to the first custom-trained deep CNN, which distinguishes between the possible states of the toilet—clean, urine, stool or toilet paper. By using the first custom CNN, we are able to determine the first stool dropping time, which is significantly correlated with overall bowel function. The first stool dropping time is estimated by the duration of time between a clean or urine state and a stool state. As every image is annotated with a corresponding time-stamp, the duration can be easily calculated. In a similar manner, defecation duration can be calculated by either calculating the duration between a stool state and a toilet paper state or the duration between the first stool dropping time and null signals lasting more than 30 s from the pressure sensor. Here we assumed that the use of toilet paper or standing up indicates the user’s intention to terminate the defecation event. Once an image is determined to belong to the stool state, it is fed to the second custom trained deep CNN to determine its BSFS.
To determine the prediction accuracy of developed module, 11 participants (5 females and 6 males) were recruited for system testing over a period of 5 weeks. The research participants were instructed to use the toilet system as they would use any normal toilet. All of the participants completed multiple of defecations up to 10 events, and a total of 55 defecation events were recorded. The participants’ first stool dropping times, defecation durations, seating times and corresponding BSFSs were obtained, parts of the results of which are shown in Fig. 4. BSFSs were acquired from the toilet’s CNN prediction, the general surgeons and the users themselves. Only two research participants graded their own stool, whereas the other nine participants declined to review/grade their own stool. The CNN prediction for BSFS was quite accurate—the predictions of the CNN and the surgeons align well with one another (match rate of 76.35% between surgeon A and CNN A and 74.54% between surgeon B and CNN B). Once the CNN had been retrained using additional participant data, the match rate of the evolved CNN (CNN A) was raised to 85.45%. It should be noted that 81.81% of mismatch cases were comprised of either cases with a scale difference of 1 in BSFS (for example, CNN prediction: 3 and surgeon’s annotation: 4) or cases in which the second most prediction of the CNN matched with the surgeon’s annotation. As expected, the annotations of the participants showed a lower match rate with the annotations of the surgeons. The overall match rate between the grading of the participants and the surgeons was 64.28%.
The toilet has the ability to observe the dynamic changes of stool—that is, stool morphology and liquidity changes over time in the toilet bowl—which have not been investigated in the field. This change sometimes results in mixed types of BSFS. Furthermore, the CNN prediction for extreme BSFS (scale 1) showed poor prediction owing to the low number of training samples at the beginning; however, during the course of the toilet development, a substantial number of stool images were added, such that the CNN can be significantly improved to provide more accurate predictions. Moreover, a mobile application embedded with the retrained CNN was developed for users who want to continuously monitor their stools in an ordinary toilet environment (Supplementary Fig. 6).
User identification in the toilet system is crucial as the system is expected to be shared with housemates. Over time, it will eventually be integrated into the EHR, so that every toileting event will be recorded and associated with the user. To accomplish this, we used two methods of biometric identification. First, we designed a fingerprint scanner embedded in the flush lever. A 3D-printed flush lever containing a fingerprint scanner was attached to the toilet (Fig. 5a). At the end of each urination and/or defecation event, the fingerprint scanner prompts a user through a green light indicator. When the user actuates the flush lever, his/her fingerprint is registered by the embedded scanner. All collected data (images and videos), in their raw data formats, were annotated with respect to the user and transmitted to a cloud system through wireless communication. To validate the fingerprint identification module, we performed ‘genuine’ and ‘impostor’ judge studies54; genuine scores indicate the level of agreement between multiple samples of the one’s fingerprint and impostor scores are obtained by matching samples from different fingers. In the following analysis, ten participants (five females and five males) registered their fingerprints more than ten times (a total of 410 times from all of the participants) and a histogram of accuracy scores was plotted (Fig. 5a). Note that the negligible overlap indicates an excellent identification ability between different fingerprint samples. Furthermore, the ROC curve was generated, and AUC was 0.95 (Fig. 5a).
To ensure EHR compatibility, an additional method of biometric identification was used. Although the fingerprint scanner installed on the tank lever provides reasonable user identification, some scenarios may be misleading in an identification process. For example, if someone other than the original user flushes the toilet, it causes confounding errors in identification. Furthermore, some industry-level smart toilets are already equipped with automatic flushing without the flush lever and, therefore, require different identification methods.
Another identification method—utilizing the analprint, which is user-specific—was therefore designed and implemented into the toilet system. A scanner was installed to record a short video clip of the user’s anus. The ROI—the anus—was then identified using an image recognition algorithm (template matching; Fig. 5b). The video clip was divided into frames and then compared with a set of reference images of the user’s analprint. To test the feasibility of this approach, ani from 11 research participants were analysed and the anus morphologies were compared (Stanford Institutional Review Board (IRB) approval, 45621; Seoul Song Do Hospital IRB approval, 2018–008). Among 11 participants, two video clips of the anus per participant were acquired from 7 participants, whereas one video clip of the anus per participant was acquired from 4 participants. As stated, all of the video clips were fragmented into frames. Three algorithms were used to compare the fragmented frames with the reference frames stored in the system—the mean squared error (MSE)55, the structural similarity index measure56 (SSIM) and a CNN. The MSE is the simplest and most widely adopted full-reference-quality metric that calculates the average of the squared intensity differences in the pixels of acquired and reference images, along with the related peak signal-to-noise ratio by scaling the MSE according to the image range. An MSE value of 0 indicates perfect similarity, whereas an MSE value of greater than 100 implies less similarity and will continue to grow as the average difference between pixel intensities increases as well. Whereas the MSE measures the perceived errors from pixels, SSIM estimates the perceived change in the structural information of the image. SSIM values range from −1 to 1, where 1 stands for perfect similarity and −1 for the complete dissimilarity. The third method of the measurement is the same CNN architecture for stool analysis. We again adapted a transfer-learning technique to train the machine for classification. Detailed descriptions of all of the above algorithms are provided in the Supplementary Information. An example of biometric identification that uses analprints is demonstrated in Fig. 5 and Supplementary Table 4. All three algorithms provided a reasonable distinction of the participants by analysing their analprint. These results demonstrate that it is possible to use anus morphology as a biometric identifier.
Precision health and continuous health monitoring relies on an accurate model of human disease to predict or detect disease5. For effective continuous health monitoring, considerable progress has been made in the development of wearable devices; however, these devices still require a certain degree of conscious intervention and compliance that may hinder the implementation of precision health. To overcome these limitations, we have developed a passive human health monitoring system that can be easily incorporated into a normal daily routine requiring minimal or even no human intervention. Our current toilet system consists of several independent modules (urinalysis, uroflowmetry, defecation monitoring and biometric identification) that use sensors, machine-learning algorithms and computer-vision assays to acquire basic properties (such as temporal parameters of urination and defecation, morphology of stool, flow parameters of urination, biochemical constituents of urine) of human excreta in a convenient manner. Using the acquired parameters, the current toilet system has the potential to help diagnose/monitor irritable bowel syndrome, benign prostatic hyperplasia and/or urinary tract infection by collecting stool/voiding diaries and urine dipstick tests. In the future, we aim for our toilet system to be an all-in-one, autonomous, non-invasive and more affordable device, as well as being clinically applicable by enabling the targeting of various diseases. The toilet will ultimately function as the daily clinic for continuous monitoring of human excreta, feeding data into models of human health that can be used for screening and subsequent diagnostics. The toilet facilitates streamlined and diligent data reporting, enabling seamless collection of longitudinal data for users with consistency and detail that was not possible before the era of the internet of things and reliable machine learning.
Emerging continuous-monitoring technologies require thorough clinical trials with large populations to determine whether they improve disease detection and early intervention. However, in most cases, the technology must first be developed before it can be validated, as the validation is dependent on the final form of the technology. The current toilet system is not yet a screening or diagnostic tool as such. Although the data collected by the current version of the toilet do not directly enable the diagnosis of a disease state, they help to augment our understanding of human health and identify a baseline, or threshold, from which to identify disease.
To achieve this goal, the prototype of the toilet aims to measure very fundamental physical/biochemical parameters from human waste products. Our first criterion was smart adaptation of routine clinical tests in an ordinary toilet. The toilet therefore performs routine urinalysis on the basis of a colorimetric test strip and uroflowmetry, which are widely used and validated clinical tools22. Furthermore, our toilet system provides routine, clinically relevant stool analysis on the basis of the BSFS using a CNN. Although comprehensive stool analysis involves biochemical analysis of the stool (including microbiome analysis), it requires bulky and expensive analytical equipment as stool is inherently heterogeneous in contrast to relatively homogeneous urine. This would inevitably require a more expensive and complex biochemical analysis system, possibly hindering the widespread use of the toilet. Instead of analysing the biochemical composition of stool, analysing the morphology and liquidity of stool provides a more convenient and straightforward method to derive potential clinical insights. An evidence-based stool-analysis method based on morphology and liquidity, BSFS, has been extensively utilized in both clinical practice and research39,42,53,57. As stool morphology is directly correlated with transit time in the lower gastrointestinal tract, it can be used to obtain signs of a wide range of diseases that affect the gastrointestinal system57, such as inflammatory bowel diseases. Measuring stool on the BSFS provides insights into physiology and disease, such as bacterial growth rate, bile acid metabolism, oestrogen metabolism, irritable bowel syndrome and neoplasias57. Furthermore, as the BSFS is formulated to be purely reliant on visual assessment and described in everyday language (Supplementary Table 1), it is theoretically possible for an untrained person to classify their own stool. The BSFS classifications are especially valuable when many data points are obtained in continuous monitoring; however, classifying one’s own stool is sometimes unpleasant and requires extra effort for the participant, hampering reliable self-reporting over an extended period of time. A certain level of disparities between the descriptions of stool by patients and true stool classification41 as well as superior annotations by physicians42 lead to demand for a more objective and reliable method to measure stool classification, especially for continuous monitoring. Deep CNNs have great potential for general and highly variable classification tasks across numerous object categories. Recently, a CNN was developed that exhibited an accuracy comparable to that of a dermatologist in identifying skin cancer when presented with images of skin lesions58. In a similar manner, we adopted this strategy for precise classification of human stool using a single CNN that was trained using stool image files comprising pixel values and labelled with corresponding stool classes. In this manner, the CNN is able to identify stool class reliably during defecation. Furthermore, the combination of computer-vision image analysis, mechanical retractable cartridge and a simple computing unit can provide clinically relevant data. Point-of-care devices and tools that are commercially available and/or investigated under active research can be integrated into the future toilet system to provide a clear pipeline to clinical decision making. A list of potential disease screening that may eventually benefit from the toilet is provided in Supplementary Table 2.
User acceptance, data security and privacy protection.
Ideas similar to this toilet have been discussed for many years in the medical engineering community with few tangible outcomes to date. This impediment in scientific innovation may be in part due to the taboo on publicly broaching and discussing private matters such as human waste, excretory organs and genitalia. In other words, much like the internet of things and telemedicine, a technological innovation such as this toilet is inherently linked to the risks and uncertainties surrounding its protection of private health data and the user’s privacy. Furthermore, the widespread use of such technological innovations will be heavily dependent on user acceptance and compliance.
To gauge the user acceptance level of the proposed toilet concept, we created and distributed a short survey to the Stanford community (Stanford IRB, 51666; total respondents, 300). We note that our current survey population is biased because it represents a highly educated group from one geographical location (Supplementary Fig. 7). Despite this biased population, the overall acceptance level of the toilet system (Supplementary Fig. 8) was within an acceptable range as the majority of responses were either ‘somewhat comfortable’ (37.33%) or ‘very comfortable’ (15.33%) to use the toilet system, whereas 30.00% of the respondents feel uncomfortable to use the system (on the basis of the 5-point Likert scale). The vast majority of the concerns of participants were regarding privacy protection and data security enactment in the toilet system. Interestingly, we observed a statistically significant preference of non-camera-based modules (the urinalysis and fingerprint modules over uroflowmetry, stool analysis and analprint modules combined; P < 0.0001, two-sample t-test). The most accepted module is urinalysis, whereas the least favoured module is analprint. In this survey, no gender discrepancy was observed except for the stool analysis module (males are more favourable to this module). The survey information is provided in detail in the Supplementary Information.
Since the beginning of the project, we have taken the privacy and data security of users very seriously. For the data security, our protocols were thoroughly reviewed and approved by two institutional review boards and even further evaluated with Data Risk Assessment (DRA) by the Stanford Information Security Office and University Privacy Office. Our research protocol has strictly followed the recommendations of the Stanford DRA to ensure data security. The recommendations of the DRA are provided in detail in the Supplementary Information. As the data collected from the toilet prototype are regarded as protected health information of the research participants, the transmission and storage of such data have been compliant with the Health Insurance Portability and Accountability Act of 1996 (HIPAA).
The current version of the toilet system has been developed in a modular format, which requires industrial-level product design, process design and integration, and quality control as a healthcare product. Inherently, a toilet environment is not sterile, which may lead to false positives in biochemical assays integrated in the toilet system. Self-cleaning mechanisms therefore have to be developed, adopted and integrated after each use in the future to maximize the accuracy of any given assays in the toilet. Moreover, the current system is not compatible with squatting toilets, but with only sitting toilets (known as western style toilets). Although there is a considerable global trend towards more sitting toilets59, from an engineering viewpoint, mounting a toilet system onto a squatting toilet is not technically challenging. Nonetheless, squatting toilets often coincide with use by populations in which the most urgent need is for sanitation and the prevention of infectious diseases. Health monitoring remains important; however, it is beyond the scope of what is urgently needed by some populations. Globally, approximately 1 billion people have no access to a toilet at all and are forced to defecate in the open. Diseases transmitted through the faecal–oral route or by water, such as cholera and typhoid fever, can be spread by open defecation. They can also be spread by unkempt toilets, which cause pollution of surface water or groundwater. In this case, rather than a health monitoring functionality, sanitation will be a key functionality in squatting toilet systems. Nonetheless, we have developed a mobile phone application to minimize any disparity caused by not having a toilet system for health monitoring (Supplementary Fig. 6).
The urinalysis and uroflowmetry modules presented in this study have been tested for only standing male participants because of the differences in female and male urinary stream. Both genders will be covered in the future toilet system. For example, an extendable wand can deploy the urinalysis strip toward the potential location of the female urine stream. Another approach for implementing the uroflowmetry module is sonouroflowmetry, which uses sound to estimate the urine flow rate and volume60. Sonouroflowmetry can be implemented for both male and female users, in sitting or standing positions, while avoiding optical scans of the user’s body parts.
In future research, we aim to include multiple, clinically relevant assays in our system: (1) microfluidics observation of cellular components from urine, (2) physical, quantitative analysis of defecation and (3) sample-to-answer type biochemical analysis of stool, including genomics and microbiomics. For quantitative stool analysis, the anal scanner, which is used for analprint recognition, will be used to monitor the entire defecation processes. Using a similar algorithm as that used in the above-mentioned uroflowmetry, the total volume of defecation and the colour of stool will be measured using only image analysis. The expected result is a precise description of hydrodynamics of human defecation61. For biochemical stool analysis, a standard guaiac faecal occult blood test62–64 (gFOBT) will be used. It is used to detect the presence of faecal occult blood and is a logical choice for toilet integration. gFOBT is used to diagnose not only colorectal cancer, but also gastroesophageal cancer, gastrointestinal bleeds, diverticulosis, haemorrhoids, anal fissures, colon polyps, ulcerative colitis and Crohn’s disease. Luminol, which is similarly used in forensic investigation, is a candidate to detect this occult blood in stools. Faecal calprotectin34–36 levels may also be of importance and under surveillance as this biomarker indicates inflammatory processes. Furthermore, a great deal of progress into the understanding of the microbiome has been made65–68, and the future toilet can take advantage of this by including microbiome analysis. Finally, to implement personalized medicine, additional biochemical analysis—on the basis of biomarkers for a specific disease/illicit substance screening—will be added to the future system. For urinalysis, potential panels include screening capabilities of illegal drugs, sexually transmitted infections, urinary tract infections, alcohol abuse and maternity, all of which are already in the market. We also aim to develop nanoassays for on-demand biomarkers indicative of specific diseases. We envision that the future toilet has a customized monitoring system with personalized assays according to the opinion of healthcare professionals on the basis of the risk assessment of the user.
Biochemical analyses of human excreta in a toilet environment would require bulky and expensive analytical instruments and complex sample preparation modules for downstream analysis. Inevitably, it requires a more expensive and complex biochemical analysis system that may not fit within the dimensions of a toilet. A sample-to-answer type test is therefore more appropriate in the toilet system. To implement these types of assays within the toilet system, standard workflows for biochemical analyses of urine/stool will be developed and incorporated. This workflow includes four subprocesses regarding a point-of-care assay development, including (1) sample collection and preservation, (2) sample preparation, (3) molecular recognition, amplification and signal transduction, and (4) system integration. The implementation strategies are provided in detail in the Supplementary Information.
This toilet system is expected to have a major impact on health monitoring research, as the toilet enables longitudinal monitoring of human health with minimal interference of human behaviour. It enables patients to reliably obtain data for their own health as well as enabling investigators to conduct large clinical trials. Future large clinical studies will investigate normal baseline data to optimize the threshold for alerting abnormal results, monitoring frequency, performance accuracy and cost. One major objective will be to mitigate overdiagnosis, which can be associated with harm, such as false alerts, alert fatigue and unnecessary medical treatment5. The collected baselines will not only be used for guiding the treatment and management of specific diseases but can also serve as a ‘canary in coal mine’ for timely identification and mitigation of many serious conditions.
Synthetic urine was used for colorimetric calibration in videos. For test-strip analysis, synthetic urine was generated using 1,000 ml of 0.02 M hydrogen chloride (HCl) solution, 1.9 ml of 25% v/v solution of ammonia, 14.1 g sodium chloride (NaCl), 2.8 g potassium chloride (KCl), 17.3 g urea, 0.6 g calcium chloride (CaCl2) and 0.43 g magnesium sulfate (MgSO4). The synthesized urine was spiked with corresponding chemicals, including bovine serum albumin for proteins. A dip-and-read test strip, the Accustrip URS 10 Reagent strip (Jant Pharmacal), was used for urinalysis. The test strip delivers qualitative and semi-quantitative tests for erythrocyte, urobilinogen, bilirubin, protein, nitrite, ketones, glucose, pH, specific gravity and leukocytes by visual assessment compared with a colour chart provided for each concentration range. For accurate strip reads, the test strip was instrumentally read using the Accustrip URS reader (Jant Pharmacal) and compared with the results generated using our algorithm.
For uroflowmetry implementation, the above-mentioned synthetic urine was used for video calibration (Supplementary Information). All calibration was compared to the gold standard provided by a clinical grade uroflowmeter (URODYN1000, Dantec Medical)
Image analysis of stool.
After images were captured in the toilet, they were then classified using a machine learning algorithm58. In short, a GoogLeNet Inception v.3 (Google) CNN architecture was used because it is available as open source software and has previously been trained on approximately 1.3 million images (1,000 object categories) for the ImageNet Large Visual Recognition Challenge69,70. We retrained this architecture, using a process known as transfer learning during which insights gained while solving one specific task with a machine learning algorithm are applied to a different but related task using TensorFlow70. In our case, we retrained Inception v.3 on 10 toilet classes comprising the seven BSFS classes in addition to three other toilet classes: the clean state, the urine-only state and the toilet paper state. Our original dataset contains 2,902 stool images spanning all 7 BSFS types and 245 other images used for the three other toilet state classifications, including clean toilets, toilets with urination only and toilets filled with toilet paper. These stool images were acquired through search engines such as Google, Bing and Yahoo (keywords included ‘stool in toilet’ and ‘faeces’). Over the course of the toilet development, we collected an additional 12,226 stool images and relevant toilet status images from the research participants (n = 11). As real stool images from research participants accumulate, the performance of our CNN will be considerably enhanced.
New parts required for the toilet assembly were designed using computer aided design (CAD) software, Rhinoceros 3D (Robert McNeel & Associates). The designed parts were then exported as the .stl file format, which is compatible with numerous 3D printers and 3D printing services. The parts were then printed using a Dremel 3D45 Printer (Dremel Digilab, Robert Bosch), Ultimaker 2 (Ultimaker) or fused deposition modelling at the Stanford Product Realization Laboratory, a multi-site teaching facility at Stanford University.
Prototyping of printed circuit boards.
All of the electronic circuits were first tested on a breadboard. After validating the parts, research-grade PCBs were built by the Stanford System Prototyping Facility (SPF). Small electronic parts such as metal-oxide-semiconductor field-effect transistors, rectangular connectors (male pins, female sockets) and cable ribbons were acquired from Digi-Key. Two circuit boards were designed to control the urine module and defecation module. Initial prototype parts for the toilet system are listed and the circuit diagram of each module is provided in Supplementary Table 5 and Supplementary Fig. 9, respectively. Each module controls the proposed urination/defecation analysis process by controlling LED lighting, video recording, pressure sensor and a passive infrared motion sensor. These individual modules will be integrated.
Dropbox (a cloud file storage and syncing service) application program interface v.2 was used to establish an initial cloud system for storing non-patient health information. We used a third-party script that enables the upload, download, listing of or deletion of files from Dropbox. Acquired images, videos and biometric information from the toilet system are constantly synchronized with Dropbox using a Raspberry Pi. Similarly, for patient health information, Research Electronic Data Capture system (REDCap) and/or Stanford Medicine Box, which can be used to collect sensitive data (including 21 Code of Federal Regulation Part 11, Federal Information Security Management Act, and HIPAA-compliant environments), were established. A flowchart of the cloud system is shown in the Supplementary Schematic.
Other parts are described in Supplementary Table 5.
This study was approved by the Stanford IRB, under trial registration numbers 45621 and 51666 (Smart Toilet User Acceptance Survey) and by the Seoul Song Do Hospital IRB, under trial registration number 2018–008. The participants were recruited through flyer advertisements and e-mail lists. Once participants showed interest, a short introduction of the research study was provided, along with possible risks and benefits, participant’s rights (responsibilities and withdrawal) and financial compensation. All of the participants signed the printed consent form after we addressed all of their concerns in person.
We thank N. Baneai for insight and discussion regarding stool analysis; K. J. Chung for discussion on uroflowmetry implementation; P. Yock for discussion on overall project guidance and on managing intellectual property; C. Kim and I. Steinberg for helpful guidance on image reconstruction; C. T. Chan for the scientific proofreading of the manuscript; D. Chon (Albany High School, CA, USA) for her contribution to 3D CAD designs, and the real-time image analysis for the urinalysis module; the Stanford Clinical Laboratory for overviewing their urinalysis equipment; and staff at the Stanford Product Realization Laboratory, SPF, Stanford Byers Center for Biodesign, Stanford Urology Clinic and S. Taheri for their services. D.E. and S.-m.P. acknowledge the support of the Stanford Institutes of Medicine Summer Research Program. This work was supported in part by the Canary Foundation (to S.S.G.) and in part by NIH/NCI Training Grant T32 CA118681. The REDCap platform services are made possible by Stanford School of Medicine Research Office. The REDCap platform services at Stanford are subsidized by the National Center for Research Resources and the National Center for Advancing Translational Sciences, National Institutes of Health, through grant UL1 TR001085. The data content is solely the responsibility of the authors and does not necessarily represent the official views of the NIH.
S.-m.P., D.D.W., B.J.L., S.B., D.E. and S.S.G. are co-inventors of a patent application filed by Stanford University on the subject of this work (US patent application number 62/695326). S.S.G. is a consultant or receives funding from several companies that work in the healthcare space although none of these companies are directly involved in the current work.
Further information on research design is available in the Nature Research Reporting Summary linked to this article.
Restrictions apply to the availability of the medical training and validation data, which were used with permission of the participants for the current study, and are therefore not publicly available. Some of the data may be available from the authors on reasonable request, after permission from the Stanford University School of Medicine and/or the Seoul Song Do Hospital.
The codes may be available from the authors on reasonable request, after permission from the Stanford University School of Medicine and/or Seoul Song Do Hospital.
Supplementary information is available for this paper at https://doi.org/10.1038/s41551-020-0534-9.
Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.