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

Detect Car Damages // Image Processing

Hi Team,

We want to build a solution to detect and draw the bounding boxes or ploygon of damaged area (scratches and dents) and integrate with .NET application. After a long google search, i found following aspects:

As per my understanding, There are two plateforms available to perform this operation:

1. Vision API: This is used for detecting objects within images. The Vision API offers multiple features, including Label Detection, Text Detection, Face Detection, Object Localization, etc. However, there are limitations, as the Vision API provides general-purpose image analysis rather than specialized damage detection.

2. Vertex AI: This platform is designed to simplify the process of building, deploying, and managing machine learning models.

With this in mind, I have created a project and completed the following steps:

  1. Dataset Preparation: Labeled images with bounding boxes.
  2. Model Training: Trained the model using 136 images.
  3. Deployment: Deployed the model and obtained the endpoint URL.

Am I heading in the right direction? Please advise.

Additionally, I have following questions:

1. What are the costs of using both platforms? I reviewed the Google Pricing Calculator, but I am unsure which solution or product to select. Do we require any additional cloud solutions to implement them?

2. In Vertex AI, are there any pre-built models available for detecting car dents, scratches, and dislocations?

Thank you in advance.

0 1 1,148
1 REPLY 1

Hi @deepakkataria08,

Welcome to Google Cloud Community!

Vision API is good for general-purpose object detection but lacks specialization for specific defects like dents and scratches. While,Vertex AI is the right choice for creating custom models tailored to your specific use case (damage detection).

Your decision to use Vertex AI to train a custom model is the correct one. This is important for achieving the accuracy you need for detecting car dents and scratches.

Here are the answers to your questions:

1. Costs and Cloud Solutions:

    • Vision API Costs: The Vision API charges per image analyzed. The cost depends on the feature you use (e.g., object detection, label detection) and the number of images processed per month. It's billed based on a tiered pricing model.
    • Vertex AI Costs: Vertex AI pricing is more nuanced. It involves:
      • Training: Cost depends on the compute resources you use (machine type, training time).
      • Prediction: Cost is tied to the compute resources needed to serve predictions.
      • Storage: Storage costs for your datasets and models.
      • Data Labeling: If you used Vertex AI Data Labeling for your 136 images, that's an additional cost.
    • For a pricing calculator, the most important thing is to understand which services you are using in the calculator.
    • For Vertex AI, you'll likely need to look at these categories:
      • Vertex AI Training: Choose the appropriate compute and accelerator options for model training.
      • Vertex AI Prediction: This calculates costs associated with hosting and serving your model.
      • Cloud Storage: Costs associated with storing a dataset.
    • For Vision API, select the Vision API product and choose appropriate features.
    • Additional Cloud Solutions:
      • You will need Google Cloud Storage (GCS) to store your dataset and trained model for both Vision API and Vertex AI.
      • You may use Vertex AI Workbench (managed Jupyter Notebooks) for experimentation and model development but its not essential
      • If you store data on Cloud Sql or Bigquery, then there will be additional cost for storage and retrieval of data.
      • For .NET integration, you'll use client libraries that interact with the API endpoints. These libraries are freely available.

Additionally, to gain insight into the pricing of Google Cloud Services, you have the option to utilize the Google Cloud Calculator, connect with our sales team to obtain a custom quote for your organization's unique needs, or visit the pricing page.

You may consider these recommendations as well:

  • Start Small: Begin with small training and serving experiments using less costly compute options. Scale up only if needed.
  • Monitor Usage: Regularly monitor your Google Cloud Console to track resource consumption and costs.
  • Experiment: Use smaller training runs to experiment with different model architectures and hyperparameters before committing to large expensive runs.

2. Pre-built Models in Vertex AI:

No, there are NO pre-built models for car dents, scratches, or dislocations in Vertex AI directly. Vertex AI offerings include:

      • Pre-trained object detection models for common objects, but these won't be specific enough for damage detection.
      • AutoML Vision: You can use AutoML Vision with custom datasets to automate training but it still requires a dataset
    • Why custom models are necessary: Damage detection is highly specific to the type of damage, lighting, car type, etc. You need to train a model on your own data to achieve satisfactory results.
    • The approach you are taking (training a custom model) is the correct one.

Here are the next steps and recommendations you could consider:

1. Refine your Dataset:

    • 136 images are a good starting point for experimentation. However, to build a robust and accurate model, you would typically need thousands of images with diverse examples.
    • Ensure your images have good quality, good lighting, and variety in types and severity of damage, car models and angles.
    • Consider using augmentation to increase the diversity of your training set.

2. Evaluate Model Performance:

    • Use appropriate metrics such as mAP (mean Average Precision) for object detection to assess the accuracy of your trained model.
    • Create a good testing strategy. Use test data that was never used during the training.

3. Integration with .NET:

Once you have a good model, explore how to use Google Cloud client libraries to make prediction calls from your .NET application. This typically involves:

  • Authenticating with your Google Cloud project.
  • Constructing the appropriate prediction request with the image.
  • Parsing the prediction results (bounding boxes or polygons).

4. Optimization:

    • If you encounter performance or cost issues, optimize your model using techniques like quantization or pruning.

5. Monitoring:

    • Monitor model performance in production and retrain if necessary.

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.