Real-Time Anomaly Detection in Trading Data Using Striim and One Class SVM

In today’s fast-paced financial markets, detecting anomalies in trading data is crucial for preventing fraudulent activities and ensuring compliance with regulatory standards. By leveraging advanced machine learning (ML) techniques, businesses can enhance their anomaly detection capabilities, leading to more robust and secure operations. In this blog, we’ll explore how to use Striim’s Change Data Capture, Stream Processing, and extensibility features to integrate an anomaly detection model built with a third-party machine learning library. We’ll use Striim’s data proximity to ensure tight integration with models, avoiding data latency and accuracy issues. For this demonstration, we’ll perform analytics using simulated day trading data, store the model in a standard Python serialization format, expose it via a REST API, and use it in Tungsten Query Language (TQL), Striim’s SQL-like language for developers to build applications.  

What is Anomaly Detection?

Anomalies are events that deviate significantly from the normal behavior in the data. Anomaly detection is an unsupervised technique used to identify these events. Anomalies can be broadly classified into three categories:

  • Outliers: Short-term patterns that appear in a non-systematic way.
  • Changes: Systematic or sudden changes from the previous normal behavior.
  • Drifts: Slow, unidirectional long-term changes in the data.

Case Study with Anti-Money Laundering App

A few years ago, Striim was hired by a financial institution to implement an app to track trader activity and detect fraud via Anti-Money Laundering (AML) rules. Recently, we extended this app by integrating an anomaly detection ML model.

The app collects trading data from an operational database, uses caches to enrich incoming events, and applies Striim’s continuous queries (CQs) and in-memory time series windows to analyze the received information. The app implements several AML rules and, once the data is processed, it is stored in final EDW targets and presented in Striim’s real-time streaming dashboards.

Trading data passed to Transaction window

ML Integration and Usage Patterns with Striim Pipelines

Integrating machine learning models with Striim pipelines allows us to enhance our analytics capabilities. In this example, we’ll use the sklearn Python library to train a model with day trading activity data.

Solution

Train the model

  1. Use sklearn python library to train a model with a collected IL data based on day trading activity of a selected stock broker. The application collects and sums trading activities for a selected person for a period of time via a time window
  2. Pick One Class SVM. One Class Classification (OCC) aims to differentiate samples of one particular class by learning from single class samples during training. It is one of the most commonly used approaches to solve Anomaly Detection, a subfield of machine learning that deals with identifying anomalous cases which the model has never seen before.
  3. Train the model: OneClassSVM(gamma=’auto’).fit(X) where X is a set of training data

Use the model 

  1. Store data via JobLib dump format providing the most efficient way to save files to disk
  2. Build a function to call model in real time via predict(K) and expose it via REST API using Flask library as an example but service can be hosted on any WSGI web server app
  3. API output comes as simple JSON string:  
    • {“anomaly”:”-1″,”inputParam”:”80″} if an anomaly is detected.
    • {“anomaly”:”1″,”inputParam”:”44″} if the behavior is normal.
  4. Access the model API via Rest API Caller OP PS built module

By integrating external ML models with Striim, you can create powerful, real-time anomaly detection systems that enhance your business operations and security measures. This approach ensures that you can quickly identify and react to unusual patterns in your data, maintaining the integrity and reliability of your systems. Ready to see how Striim can transform your data analytics and anomaly detection processes? Sign up for a free trial today and experience the power of real-time data integration and machine learning firsthand.

Real-Time Regulatory Reporting: Streamlining Compliance in Financial Institutions

In today’s fast-paced regulatory landscape, financial institutions face unprecedented pressure to comply with evolving standards. Traditional reporting methods, burdened by data silos and manual processes, are proving inadequate. Real-time regulatory reporting, powered by stream processing, offers a solution by providing timely and accurate data for compliance.

We’ll explore this transformative approach, starting with an overview of the regulatory landscape. Then, we’ll highlight the shortcomings of traditional reporting methods before diving into the efficiency enhancements of real-time reporting.

A Peek into the Regulatory Landscape for Financial Institutions

The world of regulatory compliance in the financial sector is multifaceted and demanding. Financial institutions handle a tremendous quantity of sensitive data and are subject to regulations including the Dodd-Frank Act, Basel III, the European Market Infrastructure Regulation, and the Markets in Financial Instruments Directive (MiFID).

These regulations share common goals: stringent reporting standards designed to increase transparency, market integrity, and risk management. To comply, institutions must complete tasks such as transaction reporting and anti-money laundering checks.

Non-compliance carries hefty fines and risks significant reputational damage. Consequently, financial institutions must prioritize compliance by reducing data silos, streamlining reporting, and leveraging real-time solutions for effective management of complex financial data. The end goal is to guarantee timely compliance and mitigate risks.

By leveraging real-time data, financial institutions can navigate the regulatory landscape with greater confidence and efficiency.

Challenges with Traditional Regulatory Reporting

Here are some challenges that traditional regulatory reporting is unprepared to address: 

  • Increasing Regulatory Complexity: Regulatory requirements are getting stricter. Consequently, institutions must double-down on compliance efforts. 
  • Data Availability and Quality: Many financial institutions have data silos. These silos result in disjointed, cumbersome processes that are inefficient at best and erroneous at worst. 
  • Inefficient Processes: Manually handling data exacerbates an already tedious process, resulting in reporting delays, which can have an impact on compliance timeliness. 
  • Slowdowns Due to Batch Processing: Traditionally, financial institutions have leaned on batch processing for data reporting. This method involves handling data in large, pre-scheduled batches. As a result, data becomes obsolete rapidly. It’s also time-consuming.

Real-Time Regulatory Reporting: Increasing Efficiency

Real-time regulatory reporting offers a solution to these challenges by enabling continuous monitoring and immediate submission of financial data to regulatory bodies. This approach reduces the time between data generation and regulatory oversight, promising instantaneous updates with sub-second latency. By leveraging stream processing, real-time regulatory reporting ensures that regulatory data is current and reflects the most recent market conditions and transactions.

Real-Time Anomaly Detection and Machine Learning (ML)

Additionally, real-time anomaly detection and machine learning (ML) play pivotal roles in modernizing regulatory reporting for financial institutions. 

Integrating these technologies into real-time regulatory frameworks enables institutions to enhance their ability to detect and respond to anomalies swiftly and accurately. Anomaly detection algorithms, powered by ML models such as neural networks, constantly analyze streaming financial data to identify deviations from typical patterns. This proactive approach improves fraud detection and risk management while ensuring compliance by promptly flagging suspicious activities. 

Furthermore, ML algorithms can improve over time, learning from new data to refine anomaly detection capabilities further. By leveraging these advanced analytical tools, financial institutions can maintain regulatory compliance with enhanced precision and agility in an increasingly complex regulatory landscape.

Technologies Facilitating Real-Time Regulatory Reporting

The key difference between real-time and traditional regulatory reporting lies in data processing methods. Historically, financial institutions have relied on batch processing, which collects, stores, and processes data in batches at scheduled intervals. However, batch processing is now considered obsolete due to the widespread adoption of stream processing.

Stream processing allows financial institutions to process and transmit data as it occurs, providing a more efficient and streamlined method. This approach guarantees timely compliance with regulatory requirements, minimizes latency, reduces manual processes, and eliminates data silos. It offers regulators a comprehensive, up-to-date view of a company’s financial activities in real-time.

Striim Facilitates Real-Time Regulatory Reporting to Ensure Compliance

Striim excels in facilitating real-time regulatory reporting, ensuring that financial institutions provide regulators with the timely, accurate information they require. By leveraging Striim, organizations can overcome the frustration of navigating data silos.

A defining feature of Striim is its use of Change Data Capture (CDC), which records only new events, resulting in more rapid data uploads. Striim also offers real-time analytics and continuous monitoring, enabling organizations to diagnose and respond to potential challenges as they arise, ensuring ongoing compliance.

Leverage Stream Processing to Supercharge Compliance Efforts

Real-time regulatory reporting represents a significant advancement in the financial industry’s ability to meet regulatory demands. By adopting stream processing technologies like Striim, financial institutions can enhance their compliance efforts, reduce risks, and operate with greater efficiency and confidence in a complex regulatory environment.

Book a demo with us when you’re ready to learn more about how real-time regulatory reporting can help ensure compliance.

Back to top