How RapidAI Uses Edge, Kubernetes and AI to Boost Stroke Care

Until recently, the window for successfully administering treatment for a stroke patient was extremely narrow — approximately six hours — after which treatment is less effective. But RapidAI is working to change that through the use of deep clinical artificial intelligence (AI). The healthcare AI company offers image analysis for magnetic resonance imaging (MRI) and non-contrast and contrast CTA (computed tomography angiography) scans.
The core of RapidAI’s technology comes from research at Stanford Stroke Center. Dr. Greg Albers, one of RapidAI’s co-founders, and his team used advanced imaging technology to expand the treatment window for ischemic stroke, the most common type of stroke.
Their research clarified the evolution of brain ischemia and, in 2018, led to extending the ideal ischemic stroke treatment window from approximately six to 24 hours. “We say ‘time is brain’ because there are millions of brain cells and neurons dying every minute during a stroke,” says Amit Phadnis, chief innovation and technology officer at RapidAI.
How RapidAI Speeds Stroke Diagnosis
RapidAI acts as an assistant, supporting clinicians and radiologists as they make care decisions. For stroke patients specifically, RapidAI provides vital information about whether the patient is (or is at high risk for) having a stroke. If so, it offers more detailed information depending on whether the stroke is ischemic or hemorrhagic.
The first level of algorithms perform triage and notification to indicate if the AI suspects a hemorrhage. A single CT scan can have somewhere between 700 and 1,500 slices (images), and if you suspect a hemorrhage, you have to find it somewhere in that series.
“We try to localize where the problem is, then quantify width, volume or surface area, and characterize the disease state of that particular tissue,” Phadnis says. “We then create a visualization on a secondary image to show what the AI algorithm is finding. This makes the AI much clearer, so the clinician can go back to the original image, look through the slices and see what is really going on.”
Among other things, this helps the clinician identify patients that can be transferred, which has already made a huge difference in terms of successful patient outcomes, Phadnis says. “Imagine finding out that you have 24 hours to transfer a patient from a rural setting into a more comprehensive stroke center where you can intervene, remove the clot and still be able to salvage vital functions for that patient,” he says.
Original Architecture Needed Improvements
RapidAI’s flagship product is available as a platform and a mobile app, with results distributed via the app and other channels, such as email. The mobile app has built-in workflow and communication capabilities, so clinicians within a stroke team can interact and share images.
The system is deployed in around 2,250 hospitals across 100 countries. Currently, it processes around 14,000 scans per day, and scan volume is increasing 30% each year. As the company expands into new products, this could increase even more rapidly. “We have products on the roadmap where our scan volume could be 10x higher,” Phadnis says.
The original architecture was based around an on-premises server in each hospital’s data center where the AI algorithms ran. RapidAI always had a cloud footprint to distribute results to mobile devices, but all processing was done on-prem. While RapidAI owned the server, each hospital’s IT team controlled the environment the server was deployed in, including the campus network and the firewalls at the hospital perimeter.
Moreover, managing the infrastructure was a significant challenge. As they lacked automation and centralized management, to perform system upgrades they needed either VPN access or to send a field engineer out to the hospital — both of which increase costs and limit how often updates are made.
RapidAI’s Software Stack and Edge-to-Cloud Architecture
To solve this problem, RapidAI has developed what it says is the only edge-to-cloud platform in the healthcare industry. Phadnis says this gives them three key advantages. “First, it allows us to support processing of the AI models on edge and on cloud. Second, we can run multiple algorithms in parallel, both on cloud and on-prem, whereas before we had to run them one after another in series. And third, from a cybersecurity perspective, we can dynamically pull back from cloud to on-prem, or vice versa, in the case of a cyber event,” he says.
The new architecture can also integrate with third-party algorithms and direct them through the same workflow.
Phadnis emphasizes that offering such a critical medical service makes business continuity essential; you don’t want a diagnosis delayed because of an operating system upgrade, for example. “Using Palette, we can monitor everything, both on cloud and on-prem,” Phadnis says. “And we can automate deployment and upgrade the entire stack — from the operating system to all of our algorithms in the field — seamlessly, with a single click, without impacting patient care. This was absolutely critical for our customers and our operations team, given the scale of deployment.”
Privacy and Continuity
From a software perspective, the company uses a wide range of languages. “All of our cloud processing is in Go, but we have used everything from Python to C++, Java, JavaScript and TypeScript, plus Swift on the mobile side for iOS,” Phadnis explains.
The full system, including the AI algorithms, is fully containerized using Docker and Kubernetes with Spectro Cloud Palette used to deploy and manage the stack. They chose Spectro over its competitors for a number of reasons. “We were really impressed with the quality of the Spectro team,” Phadnis says. “Their solution was comprehensive and fit particularly well with our use case in healthcare.”
To prevent hardware-related downtime, Spectro Cloud forms a three- or five-node Kubernetes edge cluster, which is tolerant to hardware failure in one or more nodes. Spectro Cloud can support both physical appliances and virtual appliances form factors, although RapidAI just uses the latter.
Within the cluster, any updates happen on a rolling basis, where single nodes are consecutively detached and upgraded before they rejoin the cluster. They maintain an A/B partition, with the previous operating system and Kubernetes version on the A partition. “When we upgrade, we put the new version on the B partition and change the boot order,” Tenry Fu, CEO and co-founder of Spectro Cloud, explains. “So, if for some reason that update fails, the system will automatically roll back and reboot on the A partition. This effectively maintains a ‘last known good state.'”
To monitor the clusters, Spectro Cloud has a metrics agent built into the edge cluster, which periodically collects all the system health information. It is also customizable. “One of RapidAI’s biggest issues is running out of disk space,” Fu explains. “So when their available disk space is reaching a certain threshold, they need to be alerted.”
The data RapidAI handles is extremely sensitive from a privacy point of view, and regulations vary greatly by jurisdiction. “Every system we deploy has different policies around protected health information (PHI) as to what information can and can’t be uploaded on the cloud, what can be pushed to the mobile device and so on,” Phadnis says.
“We have configurations where there is a competency center with a Rapid server that caters to four or five hospitals. Configuration varies for each AI module — by the competency center or healthcare system and also by site. We have to be able to monitor and control that configuration on a global scale, which is a non-trivial problem. The Spectro Cloud team has been helping us get us to the point where we have a single pane of glass through which we can monitor our entire infrastructure.”
Healthcare is heavily regulated and RapidAI has approvals in 66 different countries and is deployed in 100. However, this means it can’t use scan data to continuously improve the algorithm, even though that is technically possible. “We have a very good relationship with the FDA, but from a regulatory or FDA standpoint, you can’t dynamically update an algorithm in the field and just deploy it,” Phadnis says. “If there is any change in the clinical indication, it understandably needs to be reapproved.”
Meeting Future Needs
To further strengthen their security story, the team at Spectro Cloud is working towards state-of-the-art security at the edge. In 2023 they published a white paper with Intel on Secure Edge-Native Architecture to provide end-to-end encryption and security on x86 architectures. “This covers how to handle secure device registration, secure boot, tamperproof at-rest encryption, in-memory encryption and secure updates,” says Fu. The company is also currently partnering with Intel, Qualcomm and Nvidia to deliver the same levels of support for ARM-based systems.
Spectro Cloud’s Fu firmly believes that AI processing will move increasingly to the edge, and he sees this as his company’s sweet spot. “You have so much data directly generated at the edge site — in hospitals, by CT scanners or MRI machines — and it’s not economical performance-wise to send everything to the cloud to process,” he says.
“You have to have compute stay closer to where the data is, so you can process it faster. All new applications and AI workloads need Kubernetes, and sometimes they need Kubernetes clusters to achieve high availability. Kubernetes at the edge alongside centralized management capabilities becomes an interesting combination. We also have local AI capabilities which we’re continuing to improve — for example, being able to run distributed inferencing and reduce the dependency on GPUs.”
RapidAI is continuing to strengthen its portfolio and is expanding into new geographies. The company has a lot of experience in vascular diseases more generally, and can therefore expand into multiple acute and non-acute disease states, such as pulmonary embolism and aneurysm. It also sees growing demand for its technology in clinical trials within the pharmaceutical industry.
“Our purpose is very strong,” Phadnis says. “Our employees are quite aware that every minute that they spend is going towards saving somebody’s life. We have referred more than a million patients for life-saving procedures as the result of Rapid results, and that number keeps increasing.”
Learn more about RapidAI’s research on accelerating and improving stroke care and Spectro Cloud’s solutions for managing Kubernetes infrastructure and applications at the edge.