Join us Sept 17 at .local NYC! Use code WEB50 to save 50% on tickets. Learn more >
MongoDB Event
Docs Menu
Docs Home
/ /
Atlas Architecture Center
/ / /

Real-Time Audio-Based AI Diagnostics

Learn how to use AI in renewable energy by leveraging MongoDB Atlas Vector Search to generate real-time audio diagnostics.

Use cases: IoT, Gen AI

Industries: Energy and Environmental, Manufacturing and Mobility

Products: MongoDB Atlas, MongoDB Atlas Vector Search

Partners: Generate audio embeddings with panns_inference

As the renewable energy sector rapidly evolves with advancements in AI and machine learning, new opportunities for efficiency gains and cost reductions are emerging. Companies are increasingly turning to predictive maintenance to increase efficiency and reduce costs. However, predictive maintenance systems face the following challenges:

  • Integrating data with diverse formats and sources.

  • Scaling the high volume of IoT signals that are generated.

  • Performing real-time analysis of vast datasets, which can be resource-intensive.

  • Acquiring and effectively utilizing unstructured data, which hinders the development of robust predictive maintenance models.

This solution uses MongoDB Atlas Vector Search to explore the application of AI in real-time anomaly detection using sound input. This approach has several benefits:

  • Document data model: MongoDB's BSON (binary JSON) format stores diverse data types, including unstructured data, which simplifies maintenance and enables faster responses to changes.

  • Time-series collections: MongoDB handles time-series data, which is crucial for real-time monitoring in predictive maintenance and ensures timely interventions.

  • Real-time data processing: MongoDB enables immediate diagnostics and responses, which is vital for proactive maintenance to prevent costly repairs.

  • Data aggregation: MongoDB's powerful aggregation capabilities provide comprehensive insights into fleet-wide performance trends.

  • Atlas Vector Search: MongoDB Atlas allows you to search unstructured data, with features like vector indexing and retrieval to enable robust predictive maintenance solutions. To create your first index, visit the Atlas Vector Search Quick Start guide.

You can implement predictive maintenance systems in other industries, such as:

  • Manufacturing: Implement real-time anomaly detection in manufacturing plants to predict equipment failures and optimize production processes, leading to reduced downtime and increased productivity.

  • Transportation: Utilize AI and Atlas Vector Search for predictive maintenance in vehicles, aircraft, and logistics equipment to anticipate maintenance needs, minimize disruptions, and improve fleet management.

  • Healthcare: Apply real-time anomaly detection in medical devices and equipment to identify potential issues early, ensure patient safety, and optimize healthcare operations.

The preceding video demonstrates MongoDB Vector Search's capabilities for anomaly detection through sound input. It uses a basic handheld fan to simulate a wind turbine. The demo performs real-time diagnosis by analyzing the emitted audio, allowing a user to diagnose whether it's operating normally, stopped, or experiencing any issues.

This solution is divided into two parts:

1. Audio Preparation

First, the solution captures the audio from the equipment in different situations, such as normal operation, high or low load, obstructed equipment, or not operating.

Once each sound is collected, use an embedding model to process the audio data and convert it into vector embeddings. By generating embeddings for each audio track, the system captures the unique characteristics of each sound.

Then, upload the vectors to MongoDB Atlas. After only a few examples of sounds have been added to the database, they are ready to be searched and compared with the sound emitted by equipment during real-time operations.

2. Real-time Audio Diagnosis

Next, put your equipment in normal operation and start capturing the sound it makes in real time. The preceding video demonstration captures one-second long clips of audio. Then, it takes audio clips and converts them to vector embeddings with the same embedding model used previously. This process happens in milliseconds, which allows you to monitor the audio in real time. The vector embeddings are then sent to MongoDB Atlas Vector Search, which searches for the most similar sound out of the ones that were recorded in the previous step. Vector Search returns the result with a percentage of similarity. The system performs this step every second by leveraging fast vector embedding and quick searches. This allows for real-time audio-based monitoring.

Real-time wind turbine diagnosis

Figure 1. Real-time wind turbine diagnosis by analyzing the emitted audio to determine whether it's operating normally, stopped, or experiencing any issues

The data model for vectorized audio collection is simple. The solution uses a collection called sounds to store documents that represent the prepared audio. These documents include an audio label and a URL for the GIF that gets displayed on the solution UI. Once the system vectorizes the reference audio for each status, it adds the embedding to the document.

Screenshot of documents including a status and the url of the related GIF to be displayed on the UI.

During the real-time audio diagnosis stage, the one-second audio clips that are recorded in real time are vectorized and sent to MongoDB Atlas Vector Search, where they are compared against embeddings from the sounds collection.

This solution uses the Wind Turbine Diagnostics GitHub repository. For more detailed instructions, see the repository's README.

1

Create a file called .env in the main directory alongside the add_audio.py file. Add your Atlas connection string to .env in the following format:

MONGO_CONNECTION_STRING=<connection string>

Then, copy this file into the nodeUI directory.

2

Install the required Python modules in the GitHub repo by running python3 -m pip install -r requirements.txt.

3
  1. Run python3 add_audio.py.

  2. Select the audio input by typing the relevant number and then press enter. Record each sound in sequence.

4

Go to MongoDB Atlas and create an Atlas Search Index in the sounds collection that includes the following content:

{
"mappings": {
"dynamic": true,
"fields": {
"emb": {
"dimensions": 2048,
"similarity": "cosine",
"type": "knnVector"
}
}
}
}
5

Run python3 live_query.py and place your microphone next to the fan.

6
  1. Open a new terminal window and cd into the nodeUI directory.

  2. Run npm install.

  3. Run node nodeui.js.

  4. Open the following link in your browser: http://localhost:3000/.

  • Understand the role of AI and machine learning in revolutionizing predictive maintenance in the renewable energy industry.

  • Explore how MongoDB Atlas Vector Search facilitates real-time anomaly detection and addresses challenges faced by businesses and development teams.

  • Create a Vector Search index in Atlas or on a local deployment.

  • Ainhoa Múgica, MongoDB

  • Arnaldo Vera, MongoDB

  • Dr. Humza Akhtar, MongoDB

  • Dr. Han Heloir, MongoDB

  • Ralph Johnson, MongoDB

Back

Power Smart Meter Solution

On this page