Twitter
Facebook
Hatena
【速報:AWS re:Invent 2023レポート】生成系AI(Amazon Bedrock)でIoTアーキテクチャを設計するワークショップを体験

IoTクラウド基盤アーキテクトの森⽥です。お客様のIoTサービスを実現するAWSアーキテクチャの検討、提案、構築を行っています。
昨年に引き続き、ラスベガスで開催されている「AWS re:Invent 2023」に参加しています。
2023年11月28日(火)に参加した生成系AIでIoTアーキテクチャを設計するワークショップについてレポートします。

ワークショップ概要

• タイトル:Using generative AI on AWS to accelerate energy solution development (ENU301-R)
• 登壇者:Antoine Hom、Jelena Uzunovic
• 概要:自然言語クエリを作成し、大規模言語モデルを使用して、実世界のソリューションを設計します。

ラボは2部構成で提供されます。
• ラボ1:生成系AIによるソリューション設計
• ラボ2:ソリューションの実装

ラボ1の内容について紹介します。

ワークショップ手順

このラボでは、Amazon BedrockのPlaygroundを使用して風力タービンセンサーデータの異常検知システムの設計を行います。
まずは、以下の内容で会話を始めます。要望を明確にし、主要な要件を提示します。
注釈:以下のサンプルでは入力したプロンプトをHumanとし翻訳を併記、Amazon Bedrockからの回答をAssistantとして記載します。

・Human

I need your advice as an AI assistant skilled in cloud architecture. 
I need an AWS cloud solution for ingesting sensor data from wind turbines to detect anomalies like drops in power or vibrations. 
It needs to be cost-effective and use serverless services. 
Can you walk me through the architecture?

(訳)
クラウドアーキテクチャに熟練したAIアシスタントとしてのアドバイスが必要です。
風力タービンからセンサーデータを取り込み、電力低下や振動などの異常を検出するためのAWSクラウドソリューションが必要です。
費用対効果が高く、サーバーレスサービスを使用する必要があります。
アーキテクチャを説明してもらえますか?

• Assistant

Here is one approach for an AWS cloud architecture to ingest wind turbine sensor data and detect anomalies using serverless services:

1. Use IoT Core as the IoT hub to connect the wind turbines and ingest the sensor data. Configure IoT rules to transform/validate the data as it comes in.

2. Send the IoT data to Kinesis Data Firehose for stream processing. This handles high volume ingestion in a serverless way.

3. Data Firehose can deliver the data directly to S3 for storage. Configure it to write to a dedicated bucket for turbine data. 

4. Set up a Lambda function triggered by S3 events to process new files as they arrive. The Lambda function can extract features from the raw data to detect anomalies. 

5. For anomaly detection, use SageMaker Processing and Model Monitoring. Process can prepare training data from S3, train candidate models, and Model Monitoring can evaluate them for drift over time.

6. Store detected anomalies or enriched data back in S3. Option to also write to DynamoDB or Redshift for querying.

7. Build out dashboards in Quicksight for operations teams to monitor turbine behavior and receive alerts on anomalies. Integrate with services like SNS.

This serverless approach leverages services like IoT, Lambda, Kinesis, SageMaker etc. to build a scalable solution with no servers to manage. Cost depends on usage but there's no idle infrastructure. Let me know if any part of the architecture needs more explanation!

AWS IoT Core、Kinesis Data Firehose、Amazon S3、AWS Lambda、Amazon SageMaker、Amazon QuickSightを使用したクラウドアーキテクチャが提案されました。

Amazon BedrockのPlaygroundではチャット形式でやり取りができるため、以下のような問い合わせを続けることで、提案されたアーキテクチャについて具体的な質問をしたりフィードバックを行ったりできます。

  • ストリーミングデータを大規模に取り込むためにお勧めの AWS のサービスはどれですか?
  • データパイプラインの設定方法を、初心者にもわかるように、もう少し詳しく教えていただけますか?ステップバイステップのワークフローは、私がよりよく理解するのに役立ちます。

続いて、Amazon Bedrockでソリューションのアーキテクチャ図を生成させます。

• Human

Can you give me a draft XML document I can import into draw.io to visualize the cloud architecture?

• Assistant

Here is a draft XML document that can be imported into draw.io to visualize the AWS cloud architecture for ingesting wind turbine sensor data and detecting anomalies:

<?xml version="1.0" encoding="UTF-8"?>
<mxfile>

...省略...

</mxfile>

This captures the key cloud components and data/processing flow. Let me know if you need any other details added to the diagram. You can import this XML file into draw.io to visualize and modify the architecture as needed.

生成されたXMLを読み込むと、以下のようなダイアグラムとなりました。

IoT Coreの前段に風力タービンを緑の四角形で追加します。

• Human

Add Wind Turbine using the green rectangle in front of IoT Core.

指示通り緑の四角形が追加されました。

IoT Coreだけでなくアーキテクチャ全体を出力して欲しいので、追加で指示します。

Also outputs a series of architecture from Turbine to QuickSight

想定通りの出力ができました。

最後に作成したアーキテクチャをAWS CloudFormationテンプレートで出力します。

• Human

Can you provide an AWS CloudFormation template for the architecture you proposed?

ワークショップではテンプレートを出力するところまでしか実施しないため、正しく構築されているかどうかの検証はできていません。しかし、テンプレートの生成までできるということが驚きです。

まとめ

Amazon Bedrockを使用することで、AWSのアーキテクチャ設計の支援ができました。チャット形式で問い合わせができるので、一歩ずつ進めながら検討できます。 また、アーキテクチャ図やAWS CloudFormationテンプレートが生成できることもわかりました。 複数のアーキテクチャを検討するうちの一つとして活用可能で、近い将来、プロダクションにそのまま利用できるようになるのではないかと期待が膨らむセッションでした。

Amazon Bedrock導入ソリューションについて、詳しくはこちら
Amazon Bedrock導入ソリューション

 

 

この記事の執筆者

森田 和明Kazuaki Morita

エリア事業本部
西日本支社
インテグレーション&
ソリューション部
ITアーキテクトグループ
主任 / フェロー

AWS IoT クラウド アプリ開発