Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

IoT AI video device: edge vs data center

I've done some object detection with computer vision and generic videos, and now I'd like to record video of my local highway and create a dataset of the types of cars that go by on a given day. Now I'm trying to find out the best/cheapest way to implement. I am interested in building my own AI edge device with one of these new AI chips to take on this specific task.

Is there considerable savings by computing on the device rather than sending the video to a data center for analysis? If I don't need the device to react in the moment, is there any need? What additional costs (other than hardware) do I encounter?

 

Solved Solved
0 2 539
1 ACCEPTED SOLUTION

Hi twjaymes,

Welcome to Google Cloud Community!

Here's a recommendation for your highway car classification project, leveraging Google Cloud Platform (GCP) services for both edge and cloud options.

Edge-Focused Approach with GCP Integration

  • Edge Device:
    • Coral Dev Board or Coral Accelerator Module: Google's Coral ecosystem is designed for edge AI. The Coral Dev Board is a full development board, while the Accelerator Module can be integrated into custom hardware. These are highly optimized for TensorFlow Lite, making it easy to deploy your trained model. These are the best choices when developing a Google product.
  • Model Deployment and Management:
  • Data Storage and Analysis (GCP):
    • Cloud Storage: Store metadata from the edge device (timestamps, car types, confidence scores) in Cloud Storage. This is cost-effective for structured data.
    • BigQuery: Import the metadata from Cloud Storage into BigQuery for analysis. You can then perform queries to answer questions like: "What are the most common car types on weekdays vs. weekends?" or "What is the distribution of car types by hour of the day?" BigQuery is powerful for large datasets.
    • Dataflow: If you need more complex data transformations or aggregations before loading into BigQuery, use Dataflow. This is a fully managed stream and batch data processing service.
    • Vertex AI: If you need to retrain your model periodically with new data, you can use Vertex AI for model training and deployment. You could even trigger retraining based on the performance of the edge model, as measured by the data in BigQuery.
  • Connectivity:
    • Cloud IoT Core (Deprecation Note): Important: Google Cloud IoT Core has been discontinued. You'll need to use a third-party IoT platform or directly connect your edge device to other GCP services via APIs. Consider using a MQTT broker running on a Compute Engine instance or exploring alternatives such as Particle or AWS IoT Core (even if your data will ultimately reside in GCP).

Cloud-Centric Approach with GCP

  • Video Ingestion:
    • Cloud Storage: The simplest way is to upload video files directly to Cloud Storage. Consider using lifecycle policies to move older data to cheaper storage tiers (like Coldline or Archive) if you don't need frequent access.
    • Transfer Appliance: If you have very large volumes of video data, Google's Transfer Appliance can be used to physically ship data to Google for faster ingestion. This avoids bandwidth limitations.
  • Video Processing and Analysis:
    • Vertex AI: This is the central hub for AI/ML on GCP. You can use Vertex AI's pre-trained models for object detection, or you can train your own custom car classification model.
    • Vertex AI Prediction: Deploy your model to Vertex AI Prediction to make predictions on incoming video frames. You can use either CPU or GPU instances, depending on the performance you need.
    • Video Intelligence API: Google's pre-trained Video Intelligence API can automatically detect objects, track objects, and identify activities in video. It might be sufficient for your needs without requiring custom model training, although it's a paid service.
    • Cloud Run Functions: Use Cloud Run Functions to trigger the video processing pipeline when a new video is uploaded to Cloud Storage. This is a serverless way to orchestrate the workflow.
  • Data Storage and Analysis:
    • BigQuery: Store the prediction results (car types, timestamps, confidence scores) in BigQuery for analysis.
    • Looker: Use Looker (Google's data visualization tool) to create dashboards and reports based on the data in BigQuery.

Cost Considerations (GCP-Specific)

  • Cloud Storage: Cost is based on the storage class (Standard, Nearline, Coldline, Archive), the amount of data stored, and network egress. Consider using lifecycle policies to move older data to cheaper tiers.
  • Vertex AI: Costs depend on the type of compute instance (CPU or GPU), the duration of training and prediction jobs, and the amount of data processed.
  • Video Intelligence API: Pricing is based on the duration of the video analyzed.
  • BigQuery: Cost is based on the amount of data stored and the amount of data processed by queries.
  • Network Egress: Data transferred out of GCP to the internet incurs egress charges.

GCP-Specific Recommendations

  1. Evaluate the Video Intelligence API: Start by testing the Video Intelligence API with a sample of your highway video. It might be sufficient for your needs, saving you the effort of training your own model.
  2. If a custom model is needed, leverage Vertex AI: Use Vertex AI's managed training service to train your car classification model. Experiment with different model architectures and training data to optimize performance.
  3. Optimize for Cost:
    • Use Cloud Storage lifecycle policies to move older data to cheaper storage tiers.
    • Optimize your AI model for inference speed to reduce prediction costs.
    • Use committed use discounts for sustained use of compute instances.
  4. Consider Serverless: Use Cloud Functions or Cloud Run to trigger the video processing pipeline, reducing the need to manage servers.

With GCP, the edge-focused approach is likely still the more cost-effective one, particularly if bandwidth is a constraint. The Coral ecosystem offers tight integration with TensorFlow and GCP services, making it a compelling choice. However, the cloud-centric approach provides greater scalability and easier management.

You may conduct a small-scale proof-of-concept with both approaches to gather real-world data and accurately estimate costs. Use the GCP Pricing Calculator to get a more precise estimate based on your specific requirements.

Was this helpful? If so, please accept this answer as “Solution”. If you need additional assistance, reply here within 2 business days and I’ll be happy to help.

View solution in original post

2 REPLIES 2

Hi twjaymes,

Welcome to Google Cloud Community!

Here's a recommendation for your highway car classification project, leveraging Google Cloud Platform (GCP) services for both edge and cloud options.

Edge-Focused Approach with GCP Integration

  • Edge Device:
    • Coral Dev Board or Coral Accelerator Module: Google's Coral ecosystem is designed for edge AI. The Coral Dev Board is a full development board, while the Accelerator Module can be integrated into custom hardware. These are highly optimized for TensorFlow Lite, making it easy to deploy your trained model. These are the best choices when developing a Google product.
  • Model Deployment and Management:
  • Data Storage and Analysis (GCP):
    • Cloud Storage: Store metadata from the edge device (timestamps, car types, confidence scores) in Cloud Storage. This is cost-effective for structured data.
    • BigQuery: Import the metadata from Cloud Storage into BigQuery for analysis. You can then perform queries to answer questions like: "What are the most common car types on weekdays vs. weekends?" or "What is the distribution of car types by hour of the day?" BigQuery is powerful for large datasets.
    • Dataflow: If you need more complex data transformations or aggregations before loading into BigQuery, use Dataflow. This is a fully managed stream and batch data processing service.
    • Vertex AI: If you need to retrain your model periodically with new data, you can use Vertex AI for model training and deployment. You could even trigger retraining based on the performance of the edge model, as measured by the data in BigQuery.
  • Connectivity:
    • Cloud IoT Core (Deprecation Note): Important: Google Cloud IoT Core has been discontinued. You'll need to use a third-party IoT platform or directly connect your edge device to other GCP services via APIs. Consider using a MQTT broker running on a Compute Engine instance or exploring alternatives such as Particle or AWS IoT Core (even if your data will ultimately reside in GCP).

Cloud-Centric Approach with GCP

  • Video Ingestion:
    • Cloud Storage: The simplest way is to upload video files directly to Cloud Storage. Consider using lifecycle policies to move older data to cheaper storage tiers (like Coldline or Archive) if you don't need frequent access.
    • Transfer Appliance: If you have very large volumes of video data, Google's Transfer Appliance can be used to physically ship data to Google for faster ingestion. This avoids bandwidth limitations.
  • Video Processing and Analysis:
    • Vertex AI: This is the central hub for AI/ML on GCP. You can use Vertex AI's pre-trained models for object detection, or you can train your own custom car classification model.
    • Vertex AI Prediction: Deploy your model to Vertex AI Prediction to make predictions on incoming video frames. You can use either CPU or GPU instances, depending on the performance you need.
    • Video Intelligence API: Google's pre-trained Video Intelligence API can automatically detect objects, track objects, and identify activities in video. It might be sufficient for your needs without requiring custom model training, although it's a paid service.
    • Cloud Run Functions: Use Cloud Run Functions to trigger the video processing pipeline when a new video is uploaded to Cloud Storage. This is a serverless way to orchestrate the workflow.
  • Data Storage and Analysis:
    • BigQuery: Store the prediction results (car types, timestamps, confidence scores) in BigQuery for analysis.
    • Looker: Use Looker (Google's data visualization tool) to create dashboards and reports based on the data in BigQuery.

Cost Considerations (GCP-Specific)

  • Cloud Storage: Cost is based on the storage class (Standard, Nearline, Coldline, Archive), the amount of data stored, and network egress. Consider using lifecycle policies to move older data to cheaper tiers.
  • Vertex AI: Costs depend on the type of compute instance (CPU or GPU), the duration of training and prediction jobs, and the amount of data processed.
  • Video Intelligence API: Pricing is based on the duration of the video analyzed.
  • BigQuery: Cost is based on the amount of data stored and the amount of data processed by queries.
  • Network Egress: Data transferred out of GCP to the internet incurs egress charges.

GCP-Specific Recommendations

  1. Evaluate the Video Intelligence API: Start by testing the Video Intelligence API with a sample of your highway video. It might be sufficient for your needs, saving you the effort of training your own model.
  2. If a custom model is needed, leverage Vertex AI: Use Vertex AI's managed training service to train your car classification model. Experiment with different model architectures and training data to optimize performance.
  3. Optimize for Cost:
    • Use Cloud Storage lifecycle policies to move older data to cheaper storage tiers.
    • Optimize your AI model for inference speed to reduce prediction costs.
    • Use committed use discounts for sustained use of compute instances.
  4. Consider Serverless: Use Cloud Functions or Cloud Run to trigger the video processing pipeline, reducing the need to manage servers.

With GCP, the edge-focused approach is likely still the more cost-effective one, particularly if bandwidth is a constraint. The Coral ecosystem offers tight integration with TensorFlow and GCP services, making it a compelling choice. However, the cloud-centric approach provides greater scalability and easier management.

You may conduct a small-scale proof-of-concept with both approaches to gather real-world data and accurately estimate costs. Use the GCP Pricing Calculator to get a more precise estimate based on your specific requirements.

Was this helpful? If so, please accept this answer as “Solution”. If you need additional assistance, reply here within 2 business days and I’ll be happy to help.

Thanks! These are great resources! I’m guessing this is a bot?

For me it’s much easier to do the video analysis on the cluster instead of an edge device, however I think I want to make an edge device for its own sake. Now I need to find a use case!