This publish is cowritten with Dr. Mikkel Hansen from Qbtech.
The evaluation and prognosis of consideration deficit hyperactive dysfunction (ADHD) has historically relied on medical observations and behavioral evaluations. Whereas these strategies are priceless, the method may be advanced and time-intensive. Qbtech, based in 2002 in Stockholm, Sweden, enhances ADHD prognosis by integrating goal measurements with medical experience, serving to clinicians make extra knowledgeable diagnostic choices. With over a million checks accomplished throughout 14 international locations, the corporate’s FDA-cleared and CE-marked merchandise—QbTest (clinic-based) and QbCheck (distant)— have established themselves as widely-adopted instruments for goal ADHD testing. Now, Qbtech goals at extending their capabilities with QbMobile, a smartphone-native evaluation that makes use of Amazon Internet Providers (AWS) to carry clinical-grade ADHD testing on to sufferers’ gadgets.
On this publish, we discover how Qbtech streamlined their machine studying (ML) workflow utilizing Amazon SageMaker AI, a totally managed service to construct, prepare and deploy ML fashions, and AWS Glue, a serverless service that makes information integration less complicated, sooner, and less expensive. Qbtech developed and deployed a mannequin that effectively processes information from smartphone cameras, movement sensors, and take a look at outcomes. This new resolution lowered their function engineering time from weeks to hours, whereas sustaining the excessive medical requirements required by healthcare suppliers.
The problem: Democratizing entry to goal ADHD evaluation
ADHD impacts hundreds of thousands worldwide, but conventional prognosis usually includes prolonged wait occasions and a number of clinic visits. Whereas Qbtech’s present options superior in-clinic and distant webcam-based testing, the corporate recognized a possibility to increase entry by way of smartphone know-how. Qbtech wanted to rework uncooked digicam feeds and movement sensor information from numerous smartphone {hardware} into clinically validated ADHD assessments that might present the identical goal diagnostic worth as their established medical instruments. This required processing advanced multimodal information streams, extracting significant options, and coaching fashions that might preserve accuracy throughout 1000’s of system variations—all whereas assembly stringent healthcare regulatory necessities.
Constructing the factitious intelligence (AI) mannequin: From uncooked information to medical insights
Qbtech’s strategy to cell ADHD evaluation makes use of machine studying strategies to course of and analyze a number of information streams concurrently. The staff chosen Binary LightGBM as their major algorithm for the ADHD evaluation mannequin.
Determine 1: Finish-to-end information processing and have engineering pipeline for QbMobile ADHD evaluation mannequin
The ultimate mannequin makes use of 24 enter options derived from face monitoring, head motion measurements, error patterns throughout checks, patterns in how customers deal with their telephones, and demography data. This scale was essential to seize the nuanced patterns in consideration, hyperactivity, and impulsivity that characterize ADHD throughout numerous affected person populations. The staff utilized three key frameworks: LightGBM as their major machine studying algorithm, Scikit-learn (sklearn) as their machine studying software library for information processing and mannequin growth, and SHAP (SHapley Additive exPlanations) as their methodology to evaluate function significance. These instruments had been chosen for his or her flexibility in dealing with multimodal information and sturdy deployment capabilities. The staff used roughly 2,000 samples, with every pattern containing about 50MB of knowledge. Inside this dataset, there was a category imbalance with the minority class representing round 20% of the samples. The info was rigorously cut up into prepare and take a look at units utilizing stratification based mostly on each prognosis and demographic options, making certain equal illustration throughout intersectional teams. Further consideration was given to grouping since some take a look at takers accomplished a number of checks. The staff carried out a five-fold cross-validation technique utilizing the identical stratification and group approaches. This complete dataset, derived from Qbtech’s decade-plus medical testing expertise, offered the inspiration for coaching fashions that might generalize throughout completely different demographics and system sorts.
Coaching efficiency and analysis
Whereas the precise mannequin coaching requires solely about one minute of computation time, the resource-intensive part was the transformation of uncooked samples into structured options. This preprocessing stage is the place SageMaker AI managed processing jobs offered substantial acceleration, lowering the processing time for function extraction and enabling environment friendly iteration all through the event lifecycle. To assist guarantee medical validity, Qbtech employed rigorous analysis metrics together with sensitivity (85.7%), specificity (74.9%), and PR-AUC (73.2%). The staff carried out nested cross-validation with Optuna for hyperparameter tuning throughout every analysis fold, optimizing for the sum of sensitivity and specificity fairly than PR-AUC to attain extra balanced errors. These metrics and optimization methods had been rigorously chosen to align with medical diagnostic standards and regulatory necessities for medical gadgets. The staff famous that within the medical sector, there is no such thing as a absolute floor fact in diagnosing ADHD—the gold customary is when a number of docs agree on a prognosis. The actual worth of Qbtech’s resolution is offering constant, goal information that brings confidence to clinicians’ diagnostic choices.
Scaling function engineering with Amazon SageMaker AI
A key enchancment in Qbtech’s growth course of got here from implementing parallel processing capabilities on cloud infrastructure. By implementing asynchronous processing that allows every take a look at to run in parallel fairly than sequentially, the staff may carry out downloading, JSON parsing, and have transformation in parallel throughout a number of processes. The function engineering pipeline begins by changing uncooked information into time collection for every information supply, then producing varied options from these time collection. For example, face place information is processed to compute statistics corresponding to minimal, most, and imply motion inside 30-second home windows. To realize the discount in processing time from 2 days to half-hour, Qbtech carried out a parallel processing strategy utilizing Python’s multiprocessing capabilities on Amazon Sagemaker AI:
This perform creates a pool of staff equal to the variety of central processing unit (CPU) cores accessible on the compute occasion—for instance, on an ml.m5.8xlarge occasion with 32 cores, this implies 32 recordsdata may be processed concurrently. Every employee calls uuid_to_features, which handles retrieving the JSON take a look at file from Amazon S3, parsing the 50MB of accelerometer and face monitoring information, and performing the precise function computation to extract the medical indicators. The outcomes from all staff are then mixed right into a single dataset utilizing pandas’ concat perform.
This parallel processing strategy enabled a 96% discount in computation time, permitting the staff to iterate quickly throughout mannequin growth whereas sustaining the reliability wanted for healthcare purposes. Qbtech reported no {hardware} failures or interruptions throughout their growth course of, permitting them to concentrate on mannequin enchancment fairly than infrastructure administration.
Information pipeline: From smartphone to medical choice
The info pipeline begins with uncooked smartphone sensor information in varied codecs. The uncooked ADHD take a look at information is available in JSON format, containing accelerometer readings, face monitoring information, and checks outcomes. AWS Glue jobs deal with the preliminary extraction and transformation of this heterogeneous information right into a standardized format appropriate for evaluation. These transformations assist preserve information high quality and consistency throughout completely different system sorts and working programs, a essential requirement for preserving evaluation accuracy. Glue jobs rework codecs from uncooked recordsdata into a normal one, changing legacy codecs to new codecs and making the file construction extra pleasant for evaluation (e.g., calculating common values from arrays).
Function extraction and choice
The function engineering course of extracts significant medical indicators from uncooked sensor information. Qbtech extracts roughly 200 options from the uncooked information, with solely 24 making it to the ultimate mannequin. This discount from uncooked options to mannequin inputs was achieved by way of a scientific guide choice course of, the place histograms per label had been analyzed to test for separation between lessons. The staff carried out an iterative strategy, including essentially the most promising options incrementally whereas monitoring enhancements in cross-validation efficiency. SHAP evaluation was used to confirm that options interacted with the prognosis in clinically significant methods—for instance, confirming that increased values in motion options corresponded to elevated probability of ADHD. The staff additionally eradicated options with excessive correlation as one other approach to make sure the chosen options had been independently contributing to the prognosis. This methodical function choice course of displays the area data encoded into the mannequin growth. A key problem was lowering very long time collection into tabular options whereas nonetheless capturing the important indicators. The staff developed strategies to extract clinically related patterns from face monitoring and movement sensor information, specializing in indicators that correlate with ADHD signs.
Finish-to-end latency
For a medical software to be sensible, outcomes have to be accessible rapidly. Qbtech’s pipeline delivers ends in underneath a minute from information assortment to mannequin inference. This fast turnaround helps real-time medical decision-making and improves the affected person expertise.
Quantifiable affect: Improvement effectivity positive aspects
The first enchancment got here in time-to-result for function engineering, dropping from two days to simply half-hour by way of parallel processing. This 96% discount in wall time enabled the staff to finish 20 growth iterations far more effectively, considerably accelerating the mannequin growth cycle.
Medical affect: Comparative medical efficiency
The medical validation of QbMobile towards Qbtech’s established merchandise reveals promising outcomes. Efficiency metrics point out that the smartphone-based evaluation maintains the excessive medical requirements of Qbtech’s present options. The shift to cell evaluation has modified the care supply mannequin. For suppliers which are solely remote-based, QbMobile permits for a 100% distant diagnostic course of. It permits sufferers who would in any other case not have the ability to take part in an in-clinic evaluation resulting from logistical challenges to obtain correct analysis. This transition reduces limitations to prognosis and permits extra frequent monitoring of remedy effectiveness.
Deployment and steady enchancment
The manufacturing deployment makes use of AWS companies for reliability and scale. Qbtech packages the educated mannequin, along with Python code, right into a Docker picture. The Docker picture is then deployed to AWS ECR by way of GitHub releases that set off a GitHub Motion. Lastly, the SageMaker AI endpoint is deployed by Terraform along with the remainder of their backend infrastructure. To keep up constant efficiency throughout gadgets, Qbtech conducts common validation checks throughout growth, inspecting whether or not system fashions have an effect on evaluation efficiency in any unintended methods.
Safety and monitoring for healthcare compliance
Qbtech’s deployment on AWS incorporates complete safety and monitoring measures important for healthcare purposes. All information is encrypted at relaxation, and the system maintains affected person privateness by preserving information nameless —no particular person may be recognized with information saved at Qbtech. The system enforces multi-factor authentication and constantly screens service availability, efficiency metrics, and potential safety threats. All system entry is logged and monitored, with computerized flagging of suspicious exercise. This strategy helps meet healthcare safety necessities whereas sustaining the reliability wanted for medical workflows.
Wanting Ahead: Scaling for international affect
Qbtech’s infrastructure technique anticipates QbMobile’s rising adoption worldwide. The staff plans to make use of the elastic scaling capabilities of SageMaker AI to handle any efficiency bottlenecks that emerge with elevated utilization. For mannequin enhancement, Qbtech is implementing annual replace cycles that transcend easy retraining. As their dataset expands, they’ll incorporate new options that seize extra behavioral patterns, constantly enhancing diagnostic accuracy and robustness.
Future analysis instructions
Constructing on their present work, Qbtech is exploring extra information streams and sensor inputs to additional improve evaluation accuracy and increase diagnostic capabilities. They’re additionally in dialogue with regulatory authorities on tips on how to implement a steady enchancment plan in mannequin efficiency, which may probably embrace utilizing completely different fashions like neural networks. The insights from over 1 million accomplished checks present a singular basis for function calibration and threshold definitions. This data-driven strategy permits cell assessments to learn from the corporate’s in depth medical expertise.
Wanting past ADHD, the platform reveals promise for broader purposes. Qbtech believes that QbMobile permits researchers to entry information sorts they haven’t had earlier than or had difficulties acquiring. By analysis collaborations, they purpose to discover the complete potential of QbMobile, Machine Studying, and extra options to affect ADHD and probably different circumstances sooner or later.
Conclusion
Qbtech’s implementation of QbMobile on AWS demonstrates significant progress in direction of accessible, goal ADHD evaluation. By leveraging the parallel processing capabilities of Amazon SageMaker AI, and the information transformation capabilities of AWS Glue, they’ve lowered function engineering time by 96% whereas constructing a clinically validated AI mannequin that runs on smartphones worldwide.
The affect extends past technical metrics: sufferers can now entry clinical-grade ADHD assessments from their gadgets, lowering wait occasions and enhancing entry to care. For healthcare suppliers, the standardized, goal information permits extra assured diagnoses and higher remedy monitoring.
As psychological well being challenges proceed to develop globally, Qbtech’s use of cloud-based AI reveals how fashionable infrastructure can increase entry to specialised healthcare companies. Their strategy gives insights for different healthcare organizations trying to make use of AI and cloud computing to enhance affected person outcomes at scale.
To be taught extra about constructing healthcare AI options on AWS, discover Amazon SageMaker AI and AWS Glue documentation, or contact AWS healthcare specialists to debate your particular use case.
Concerning the authors
Antonio Martellotta is a Senior Options Architect at AWS. He advices Personal Fairness corporations and their portfolio firms on digital worth creation leveraging cloud and AI. His principal areas of experience are information technique, information analytics, and Generative AI. He holds a bachelor’s diploma in Biomedical Engineering and a triple grasp diploma in Sensible Techniques Integrations.
Dr. Mikkel Hansen is a Danish-trained medical physician and seasoned healthcare govt. Since October 2020, he has served as Medical Director and CMO at Qbtech, spearheading the combination of goal, data-driven applied sciences—corresponding to QbTest and QbCheck—into ADHD prognosis and administration. Dr. Hansen is dedicated to enhancing diagnostic confidence and effectivity in ADHD care worldwide. Past medical digital well being innovation, Dr. Hansen engages immediately with authorities—together with the U.S. DEA, NICE, FDA, and EMA—serving to to form coverage round protected ADHD prognosis and stimulant use.
