Real-Time Streaming and Event-driven Control of Scientific Experiments

Jakob R. Elias, Ryan Chard, Maksim Levental, Zhengchun Liu, Ian T. Foster, Santanu ChaudhuriarXiv 2022 · DOI

Introduction

Next-generation laboratories and advanced manufacturing facilities, often referred to as Industry 4.0, are increasingly equipped with high-speed cameras, spectrometers, and a vast array of IoT sensors. These instruments generate a continuous "firehose" of heterogeneous data, presenting a significant challenge for real-time analysis and experimental steering. While scientists aim to leverage Machine Learning (ML) to detect anomalies and optimize parameters autonomously, a substantial infrastructure gap exists. High-performance computing (HPC) resources and GPUs required for complex ML models are rarely co-located with experimental hardware. Furthermore, existing data streaming tools often struggle with the diverse volumes and velocities of scientific data, hindering the low-latency feedback necessary for closed-loop automated science.

The MDML Platform Architecture

To address these challenges, the Manufacturing Data and Machine Learning (MDML) platform was developed. MDML is an event-driven cyberinfrastructure designed to bridge the gap between edge instruments and remote compute resources.

Overview of the MDML platform architecture, illustrating the flow of data from edge instruments through the central Kafka-based service to various compute and storage resources.

The platform's core is the MDML Service, built on Apache Kafka, which manages data routing, partitioning, and replication via a publish/subscribe model. MDML Agents—lightweight Python clients—are deployed at the edge to publish sensor data and consume inference results. For heavy computational tasks, MDML integrates with funcX (now Globus Compute), a serverless platform that triggers remote analysis on HPC or GPU nodes as data arrives. Additionally, a Replay Service allows researchers to re-stream historical data with original timing, facilitating the safe testing of ML models on "digital twins" before live deployment.

Overcoming Scientific Data Constraints

A primary technical hurdle in using standard IT tools like Apache Kafka for science is the default 1MB message size limit. While sufficient for web telemetry, this limit is inadequate for high-resolution scientific images, such as 10MB Planar Laser Induced Fluorescence (PLIF) frames. To resolve this, MDML implements an automated chunking and reassembly mechanism within its Python clients. This allows the system to bypass Kafka's internal limits and maximize throughput for large files.

Throughput performance of the MDML platform across different chunk sizes and file types, demonstrating the effectiveness of the chunking mechanism in achieving high data transfer rates.

Experimental Evaluation and Results

The MDML platform was evaluated using three real-world manufacturing experiments at Argonne National Laboratory:

  1. Flame Spray Pyrolysis (FSP): Monitoring droplet size and flame chemistry via 10MB PLIF images at 10Hz.
  2. Electrospinning: Monitoring nanoscale fiber quality using 1.2MB TIF images streamed at 24 MB/s from the Advanced Photon Source (APS).
  3. Continuous Flow Reactor (CFR): Optimizing chemical yields using in-line NMR spectroscopy.

Key Performance Metrics

  • Throughput: As shown in the performance analysis, the chunking strategy enabled MDML to achieve streaming throughputs exceeding 50 MB/s for large scientific datasets.
  • Scalability: In the electrospinning use case, the platform demonstrated near-linear compute scaling. Increasing funcX analysis workers from one to four improved processing speeds from 11.67 MB/s to 38.72 MB/s.
  • Real-Time Inference: For the FSP experiment, a GPU-accelerated blob detection algorithm maintained constant runtime regardless of droplet count, allowing MDML to process images faster than the 10Hz generation rate.
  • Autonomous Control: In the CFR experiment, MDML successfully orchestrated a closed-loop Bayesian Optimization routine, automatically adjusting reactor parameters based on NMR data without human intervention.

Conclusion and Future Work

The MDML platform demonstrates that an event-driven, serverless architecture can effectively manage the high-velocity data streams of modern science. By decoupling data generation from compute, MDML enables elastic scaling and real-time experimental steering. Future work will focus on enhancing security through encryption and fine-grained access control, as well as integrating continuous parameter space optimization tools to better support continuous flow chemistry.

Summary updated

BibTeX
@misc{elias2022real,
  author = {Jakob R. Elias and Ryan Chard and Maksim Levental and Zhengchun Liu and Ian T. Foster and Santanu Chaudhuri},
  title = {{Real-Time Streaming and Event-driven Control of Scientific Experiments}},
  year = {2022},
  eprint = {2205.01476},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2205.01476},
}
Figure