Transitioning Kagglers to TPU with TF 2.x - Build What's Next

3159

Of your peers have already watched this video.

11:30 Minutes

The most insightful time you'll spend today!

Explainer

Transitioning Kagglers to TPU with TF 2.x

Kaggle has, historically, become synonymous with machine learning competitions but it’s much more than that. Kaggle is a data science platform. Over 5 million data scientists from all over the world come to Kaggle to not only not only participate in machine learning competitions but to learn data science build their skills, polish their portfolios and share data sets and code.

Earlier on Kaggle introduced TPU support through its competition platform. In this video, Addison Howard, Program Manager, Google Cloud and Phil Culliton, Kaggle Data Scientist, Google Cloud talk about how Kaggler competitors transition from GPU to TPU use – first in Colab, and then in Kaggle notebooks.

Research Reports

Post-COVID: Times Driven by Data Analytics and Intelligence

4571

Of your peers have already read this article.

1:30 Minutes

The most insightful time you'll spend today!

A Google-commissioned study by IDG points at the growing relevance of data analytics and intelligence tools in empowering businesses to not just overcome the aftermath of the global pandemic, but also build a competitive edge using data.

As we think about economic recovery from COVID-19—both inside Google and outside through working with Google Cloud customers—we’ve made many important observations. Among them is the recognition that the ways software developers and IT practitioners work together will shift in the post COVID-19 world. Our economic recovery today will look different than past recoveries, and on a fundamental level, the way we innovate will be different than it’s ever been before.

Right now, we’re entering a new phase of cloud computing, where businesses have shifted from making tactical infrastructure decisions, to making larger IT decisions with an eye towards enabling transformation throughout the company. Data, and what we can do with that data, is key to this transformation. And how companies put data in the hands of every employee to help catalyze transformation and solve the most important and impactful opportunities in their industries is at the core.  

A recent Google-commissioned study by IDG highlighted the role of data analytics and intelligent solutions when it comes to helping businesses separate from their competition. The survey of 2,000 IT leaders across the globe reinforced the notion that the ability to derive insights from data will go a long way towards determining which companies win in this new era.

Data analytics and intelligence were prioritized during COVID-19

The results of the IDG study show a separation amongst those organizations that embrace the capabilities of today’s data analytics and AI/ML tools and those that do not. When COVID-19 hit, many organizations cancelled IT initiatives, with 55% of respondents delaying or cancelling at least one technology project. However, 32% of respondents accelerated or introduced initiatives around building out or improving the use of data analytics and intelligence. IT leaders realize how critical data is to their future success, even when resources are scarce.

Digital-focused companies are faster to embrace advanced intelligence tools

Furthermore, enthusiasm for big data analytics, AI, and ML technologies is highest among companies who are further along in their digital transformation journeys. Fifty-four percent of companies who identify as “Fully digitally transformed” or “Digital native” are using or considering using these tools, vs. the global average of 37%. And, these same organizations are embracing the promise of AI more than their peers. Forty-eight percent felt that “Embedded AI across our full stack of cloud solutions will be critical” vs 39% of digital conservatives. These companies realize these digital tools enable them to be more resilient, agile, and prepared for whatever the future brings.

digital transformation maturity.jpg
Click to enlarge

Companies are turning to cloud to maximize insights from data

As companies tap into the promise of data analytics and AI/ML, they are turning to cloud for help. When considering which cloud providers to work with, 78% of respondents said big data analysis is a “must have” or a “major consideration,” which placed this capability at the top of the list of consideration factors. This is not surprising, as cloud solutions address the most common pain points and barriers to innovation. Three of the respondents’ top four areas impeding innovation are addressed by cloud: Insufficient IT & developer skill sets (1st), security risks and concerns (2nd), and legacy systems and technologies (4th). Plus, cloud makes it easier to quickly launch a project, scale up or scale down, and pay for only what you use.

top pain points impeding innovation.jpg
Click to enlarge

COVID-19 changed the very nature of business, and of IT. It forced IT leaders to decide where to put their scarce resources and big data analytics and AI/ML were, understandably, at the top of the list. To learn more about the findings, download the IDG report “No turning back: How the pandemic reshaped digital business agendas.”

Blog

Unified, Flexible and Accessible: How Companies’ Data Help Them Achieve More on Google Cloud

4886

Of your peers have already read this article.

1:30 Minutes

The most insightful time you'll spend today!

Many tech companies have their journey of unlocking insights and analysis from unstructured data to make it accessible across organizational value-chain using relevant tech stack. This whitepaper breaks down exactly why clients prefer Google Cloud!

As the volume of data that people and businesses produce continues to grow exponentially, it goes without saying that data-driven approaches are critical for tech companies and startups across all industries. But our conversations with customers, as well as numerous industry commentaries, reiterate that managing data and extracting value from it remains difficult, especially with scale.

Numerous factors underpin the challenges, including access to and storage of data, inconsistent tools, new and evolving data sources and formats, compliance concerns, and security considerations. To help you identify and solve these challenges, we’ve created a new whitepaper, “The future of data will be unified, flexible, and accessible,” which explores many of the most common reasons our customers tell us they’re choosing Google Cloud to get the most out of their data.

For example, you might need to combine data in legacy systems with new technologies. Does this mean moving all your data to the cloud? Should it be in one cloud or distributed across several? How do you extract real value from all of this data without creating more silos?

You might also be limited to analyzing your data in batch instead of processing it in real-time, adding complexity to your architecture and necessitating expensive maintenance to combat latency. Or you might be struggling with unstructured data, with no scalable way to analyze and manage it. Again, the factors are numerous—but many of them accrue to inadequate access to data, often exacerbated by silos, and insufficient ability to process and understand it.

The modern tech stack should be a streaming stack that scales with your data, provides real-time analytics, incorporates and understands different types of data, and lets you use AI/ML to predictively derive insights and operationalize processes. These requirements mean that to effectively leverage your data assets:

  • Data should be unified across your entire company, even across suppliers, partners, and platforms., eliminating organizational and technology silos.
  • Unstructured data should be unlocked and leveraged in your analytics strategy.
  • The technology stack should be unified and flexible enough to support use cases ranging from analysis of offline data to real-time streaming and application of ML without maintaining multiple bespoke tech stacks.
  • The technology stack should be accessible on-demand, with support for different platforms, programming languages, tools, and open standards compatible with your employees’ existing skill sets.

With these requirements met, you’ll be equipped to maximize your data, whether that means discerning and adapting to changing customer expectations or understanding and optimizing how your data engineers and data scientists spend their time. In coming weeks, we’ll explore aspects of the whitepaper in additional blog posts—but if you’re ready to dive in now, and to steer your tech company or startup towards success by making your data better work for you, click here to download your copy, free of charge.

Blog

Unlocking the Power of Computer Vision: Vision AI Made Easy with Spring Boot and Java

1197

Of your peers have already read this article.

1:30 Minutes

The most insightful time you'll spend today!

Discover how to create a Computer Vision application using Spring Boot and Java. Unlock the potential of image recognition and analysis in your projects by leveraging the Vision API to extract and translate text from images. Read on to learn more!

In today’s era of data-driven applications, leveraging advanced machine learning and artificial intelligence services like computer vision has become increasingly important. One such service is the Vision API, which provides powerful image analysis capabilities. In this blog, we will explore how to create a Computer Vision application using Spring Boot and Java, enabling you to unlock the potential of image recognition and analysis in your projects. The application UI will accept as input, public URLs of images that contain written or printed text, extract the text, detect the language and if it is one of the supported languages, it will generate the English translation of that text.

Spring Boot and Google Cloud

Spring Boot is a powerful open-source framework for creating Spring-based applications. It simplifies development by providing auto-configuration, starter dependencies, and embedded servers. It also offers production-ready features like metrics and health checks. With Spring Boot, you can focus on writing code and deploying efficient applications without worrying about complex configuration or dependencies. Apart from the well-known features that make it an ideal choice for enterprise apps, a new exciting development is the official support for Native Image Builder using GraalVM, enabling the creation of native standalone executables without the need for a Java Runtime and are leaner and offer a super fast startup experience. Try Spring Native on Google Cloud.

The Spring Cloud GCP library makes it easy for Spring Boot applications to use Google Cloud services. It provides Spring Boot APIs for over a dozen Google Cloud services. This means you can take advantage of the benefits of Google Cloud services without having to learn separate Google Cloud client libraries. It is very easy to migrate or create a new Spring Boot application in Google Cloud. With just one command, you can bootstrap your production-ready Spring Boot project structure and start making code changes for your requirement. Refer to the documentation for a full list of features. 

Prerequisites

Before diving into the development process, make sure you have the following prerequisites in place:

  1. Google Cloud account with a project created and billing enabled 
  2. Vision API, Translation, Cloud Run, and Artifact Registry APIs enabled
  3. Cloud Shell activated
  4. Cloud Storage API enabled with a bucket created and images with text or handwriting in local supported languages uploaded (or you can use the sample image links provided in this blog)

Refer to the documentation for steps on how to enable Google Cloud APIs.

Bootstrapping a Spring Boot project

To get started, create a new Spring Boot project using your preferred IDE or Spring Initializr. Include the necessary dependencies, such as Spring Web, Spring Cloud GCP, and Vision AI, in your project’s configuration. Alternatively, you can use Spring Initializr from Cloud Shell using the below steps to bootstrap your Spring Boot application easily:

1. Open a Cloud Shell terminal and make sure it is pointing to the correct project and that you are authorized (if not you can use the command below to set the right project):

gcloud config set project <PROJECT_ID>

2. Run the following command to create your Spring Boot project:

curl https://start.spring.io/starter.tgz -d packaging=jar -d dependencies=cloud-gcp,web,lombok -d baseDir=spring-vision -d type=maven-project -d bootVersion=3.0.1.RELEASE | tar -xzvf -

spring-vision is the name of your project, change it per your requirement.
bootVersion is the version of Spring Boot, make sure to update it if required at the time of your implementation.
type is the version of project build tool type, you can change it to gradle if preferred.

https://storage.googleapis.com/gweb-cloudblog-publish/images/1_HAvUg7S.max-1500x1500.JPG

This creates a project structure under “spring-vision” as below:

https://storage.googleapis.com/gweb-cloudblog-publish/images/2_GBASO36.max-700x700.JPG

pom.xml contains all the dependencies for the project (dependencies you configured using this command are already added in your pom.xml).
src/main/java/com/example/demo has the source classes .java files.
resources contain the images, XML, text files and the static content the project uses that are maintained independently.
application.properties enable you to maintain the admin features to define profile specific properties of the application.

Configuring the Vision API

Once you have the Vision API enabled, you have the option to configure the API credentials in your application. You can optionally use Application Default Credentials for setting up authentication. In this demo implementation however I have not implemented the use of credentials.

Implementing the vision and translation services

Create a service class that interacts with the Vision API. Inject the necessary dependencies and use the Vision API client to send image analysis requests. You can implement methods to perform tasks like image labeling, face detection, recognition, and more, based on your application’s requirements. In this demo, we will use handwriting extraction and translation methods. For this make sure you include the following dependencies in pom.xml

<dependency>
      <groupId>org.springframework.cloud</groupId>
      <artifactId>spring-cloud-gcp-starter-vision</artifactId>
</dependency>
<dependency>
      	      <groupId>com.google.cloud</groupId>
            	<artifactId>google-cloud-translate</artifactId>
   	</dependency>

Clone / Replace the following files from the repo and add them to the respective folders / path in the project structure:

  1. Application.java (/src/main/java/com/example/demo)
  2. TranslateText.java (/src/main/java/com/example/demo)
  3. VisionController.java (/src/main/java/com/example/demo)
  4. index.html (/src/main/resources/static)
  5. result.html (/src/main/resources/templates)
  6. pom.xml

The method extractTextFromImage in the service org.springframework.cloud.gcp.vision.CloudVisionTemplate lets you extract text from your image input. The method getTranslatedText from the service com.google.cloud.translate.v3 lets you pass the extracted text from your image and get the translated text in the desired target language as response (if the source is in one of the supported languages list). 

Building the REST API

Design and implement the REST endpoints that will expose the Vision API functionalities. Create controllers that handle incoming requests and utilize the Vision API service to process the images and return the analysis results.

In this demo, our VisionController class implements the endpoint, handles the incoming request, invokes the Vision API and Cloud Translation services and returns the result to the view layer. Implementation of the GET method for the REST endpoint is as follows:

@GetMapping("/extractText")
  public String extractText(String imageUrl) throws IOException {
    String textFromImage =
   this.cloudVisionTemplate.extractTextFromImage(this.resourceLoader.getResource(imageUrl));


    TranslateText translateText = new TranslateText();
    String result = translateText.translateText(textFromImage);
    return "Text from image translated: " + result;
  }

The TranslateText class in the above implementation has the method that invokes the Cloud Translation service:

String targetLanguage = "en";
 TranslateTextRequest request =
         TranslateTextRequest.newBuilder()
             .setParent(parent.toString())
             .setMimeType("text/plain")
             .setTargetLanguageCode(targetLanguage)
             .addContents(text)
             .build();
     TranslateTextResponse response = client.translateText(request);
     // Display the translation for each input text provided
     for (Translation translation : response.getTranslationsList()) {
       res = res + " ::: " + translation.getTranslatedText();
        System.out.printf("Translated text : %s\n", res);
     }

With the VisionController class, we have the GET method for the REST implemented.

Integrating Thymeleaf for frontend development

When building an application with Spring Boot, one popular choice for frontend development is to leverage the power of Thymeleaf. Thymeleaf is a server-side Java template engine that allows you to seamlessly integrate dynamic content into your HTML pages. Thymeleaf provides a smooth development experience by allowing you to create HTML templates with embedded server-side expressions. These expressions can be used to dynamically render data from your Spring Boot backend, making it easier to display the results of image analysis performed by the Vision API service.

To get started, ensure that you have the necessary dependencies for Thymeleaf in your Spring Boot project. You can include the Thymeleaf Starter dependency in your pom.xml:

<dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-thymeleaf</artifactId>
    </dependency>

In your controller method, retrieve the analysis result from the Vision API service and add it to the model. The model represents the data that will be used by Thymeleaf to render the HTML template. Once the model is populated, return the name of the Thymeleaf template that you want to render. Thymeleaf will take care of processing the template, substituting the server-side expressions with the actual data, and generating the final HTML that will be sent to the client’s browser. Example:

return new ModelAndView("result", <<YOUR RESULT>>);

In the case of the extractText method in VisionController, we have returned the result as a String to and not added to the model. But we have invoked the GET method extractText method on the index.html on page submit.

<form action="/extractText">

        Web URL of image to analyze:

        <input type="text"

               name="imageUrl"

               value=""

        <input type="submit" value="Read and Translate" />

</form>

With Thymeleaf, you can create a seamless user experience, where users can upload images, trigger Vision API analyses, and view the results in real-time. Unlock the full potential of your Vision AI application by harnessing the power of Thymeleaf for frontend development.

Deploying your Spring Boot application with Cloud Run

Write unit tests for your service and controller classes to ensure proper functionality under the /src/test/java/com/example folder. Once you’re confident in its stability, package it into a deployable artifact, such as a JAR file, and deploy it to Cloud Run,  a serverless compute platform on Google Cloud. In this step, we will focus on deploying your containerized Spring Boot application using Cloud Run.

a. Package your application by executing the following steps from Cloud Shell(make sure the terminal is prompting at the project root folder)

Build:

./mvnw package

Once the build is successful, run locally to test:

./mvnw spring-boot:run

b. Containerize your Spring Boot Application with Jib:

Instead of manually creating a Dockerfile and building the container image, you can use the Jib utility to simplify the containerization process. Jib is a plugin that integrates directly with your build tool (such as Maven or Gradle) and allows you to build optimized container images without writing a Dockerfile. Before proceeding, you need to enable the Artifact Registry API (Use of Artifact Registry is encouraged over container registry). Then Run Jib to build a Docker image and publish to the Registry:

$ ./mvnw com.google.cloud.tools:jib-maven-plugin:3.1.1:build -Dimage=gcr.io/$GOOGLE_CLOUD_PROJECT/vision-jib

Note: In this experiment, we did not configure the Jib Maven plugin in pom.xml, but for advanced usage, it is possible to add it in pom.xml with more configuration options

c. Deploy the container (that we pushed to Artifact Registry in the previous step) to Cloud Run. This is again a one-command step:

gcloud run deploy vision-app --image gcr.io/$GOOGLE_CLOUD_PROJECT/vision-jib --platform managed --region us-central1 --allow-unauthenticated --update-env-vars

You can alternatively do this from the UI as well. Navigate to the Google Cloud Console and locate the Cloud Run service. Click on “Create Service” and follow the on-screen instructions. Specify the container image you previously pushed to the registry, configure the desired deployment settings (such as CPU allocation and autoscaling), and choose the appropriate region for deployment. You can set environment variables specific to your application. These variables can include authentication credentials (API keys etc.), database connection strings, or any other configuration needed for your Vision AI application to function correctly. When the deployment is completed successfully, you should get an endpoint to your application.

For our demo, the endpoint Cloud Run created for us is: https://vision-app-********-uc.a.run.app

Playing with your Vision AI app

For demo purposes, you can use the image URL below for your app to read and translate: 
https://storage.googleapis.com/img_public_test/tamilwriting1.jfif

https://storage.googleapis.com/gweb-cloudblog-publish/original_images/Cloud_Vision_AI.gif

Conclusion

Congratulations! You have successfully created a Vision AI application using Spring Boot and Java. With the power of Vision AI, your application can now perform sophisticated image analysis, including labeling, face detection, and more. The integration of Spring Boot provides a solid foundation for building scalable and robust Google Cloud Native applications. Continue exploring the vast capabilities of Vision AI, Cloud Run, Cloud Translation and more to enhance your application with additional features and functionalities. To learn more, check out the Vision APICloud Translation, and GCP Spring docs. Try out the same experiment with the Spring Native option!! Also as a sneak-peak to Gen-AI world, checkout how this API shows up in Model Garden.

3305

Of your peers have already watched this video.

38:24 Minutes

The most insightful time you'll spend today!

How-to

Using Google BigQuery for Marketing Analytics: How the7stars Saved Time and Money Using Google Cloud and Matillion

“Businesses that integrate multiple sources of customer and marketing data significantly outperform other companies in terms of sales, profits, and margin. They also had dramatically higher total shareholder returns.”
-HBR Study

For most marketers, this is not news. The challenge is in bringing together multiple silos of customer data—from CRM, EPR, POS, social, online transactions, etc—and gleaning intelligence.

According to Google Cloud, marketing teams use as many as 30+ tools to track customers, but most exist in isolation.

“If you want to unlock the power of your data, you need a customer data platform, not just new tools,” says Andrea Russell, Program Manager, Cloud for Marketing, Google Cloud.

Marketers should ask themselves:

  • What are the top 3 data silos that could be combined to get a better view of the customer’s journey?
  • What new customer insight could be unlocked by combining customer data?
  • How can I connect audience insights to media activation and drive better performance?

In this video, you’ll learn how Google Cloud simplifies the process of bringing multiple silos of data together easily (no IT help needed!), and how it enables marketing teams to query large sets of data in seconds—as opposed to hours using non-Google Cloud platforms.

You’ll also find out how the7Stars, the UK’s largest Independent Media Agency, used the Google Cloud platform to overhaul its reporting and data visualization approach—which entailed extracting data from multiple tools and bringing it together on a spreadsheet—saving hundreds of hours in work.

Explainer

Google’s Lesson on Leveraging AI and More to Optimize Cloud Value for Innovation

DOWNLOAD EXPLAINER

4850

Of your peers have already downloaded this article

1:30 Minutes

The most insightful time you'll spend today!

Google has managed to stay ahead of the curve and demonstrate its ‘growth while staying innovative’ approach using advanced open technologies, AI/ML based analytics solutions, as well as tools for team collaboration and skill development, automation and storage security. Businesses too can achieve the same by deriving maximum value from its people and technology by following Google’s simple guide to stay innovative. Download to learn more.

More Relevant Stories for Your Company

Case Study

Home Depot’s Interconnected Retail Experience by Virtue of Google Cloud Migration for SAP Applications

With nearly 2,300 stores, The Home Depot is the world’s largest home-improvement chain — a brand that professional contractors and DIYers alike have come to depend on. The home improvement industry continues to experience unprecedented demand and dramatic increases in online ordering accompanied by expanding consumer expectations for things like

Blog

Transforming the Contact Center Experience with Artificial Intelligence

We meet daily with contact center owners and customer experience (CX) execs across all industries, geographies, and business sizes. Looking back at these conversations, it’s crystal clear that 2022 was a high-stakes year for call centers, with three primary challenges trending across all customers and continuing in 2023: Many organizations

How-to

Prototyping Language Applications Made Easy with Generative AI

Did you know generative AI allows developers to prototype applications quickly? With Generative AI Studio on Google Cloud, developers can quickly explore and customize AI models that can be leveraged in Google Cloud applications. Watch along and see how developers, with the right tools, can experiment with new ideas in

Blog

Google Cloud VMware Engine Achieves HIPAA Compliance

We are excited to announce that as of April 1, 2021, Google Cloud VMware Engine is covered under the Google Cloud Business Associate Agreement (BAA), meaning it has achieved HIPAA compliance. Healthcare organizations can now migrate and run their HIPAA-compliant VMware workloads in a fully compatible VMware Cloud Verified stack running natively

SHOW MORE STORIES