arrow_back

Use Vertex AI Studio for Healthcare

Sign in Join
Get access to 700+ labs and courses

Use Vertex AI Studio for Healthcare

Lab 1 hour universal_currency_alt 1 Credit show_chart Introductory
info This lab may incorporate AI tools to support your learning.
Get access to 700+ labs and courses

GSP1252

Disclaimer: The information in this course is for educational purposes only, and does not serve as Google's approval for use of its generative AI service for any diagnostic or therapeutic purpose, or for direct patient care.

Overview

Vertex AI is a powerful machine learning platform designed to enhance healthcare applications with both predictive and generative AI capabilities. Vertex AI Studio serves as an intuitive interface, allowing healthcare practitioners and researchers to easily experiment with and customize generative AI models without extensive machine learning expertise. This user-friendly platform provides a variety of tools and resources, including UI-based interactions and code examples, making it simple to harness the power of generative AI for healthcare applications.

In this hands-on lab, you'll delve into Vertex AI Studio, where you'll explore the capabilities of cutting-edge generative AI models like Gemini multimodal. With Gemini, you'll experiment with prompt design techniques to summarize text, answer questions, and classify sentiments. All of this can be done directly within the Google Cloud console, without the need for complex APIs or Python SDKs, making it accessible to healthcare professionals with varying levels of technical expertise.

Objectives

In this lab, you will learn how to:

  • Analyze images with Gemini
  • Analyze videos with Gemini
  • Design text prompts for zero-shot, one-shot, and few-shot prompting
Note: Please do not enter any Personally identifiable information (PII) in this educational lab. PII can include a person's name, address, phone number, email address, Social Security number, date of birth, driver's license number, financial information, and medical records. It can also include biometrics, photographs, and internet protocol (IP) addresses.

Setup and requirements

Before you click the Start Lab button

Read these instructions. Labs are timed and you cannot pause them. The timer, which starts when you click Start Lab, shows how long Google Cloud resources are made available to you.

This hands-on lab lets you do the lab activities in a real cloud environment, not in a simulation or demo environment. It does so by giving you new, temporary credentials you use to sign in and access Google Cloud for the duration of the lab.

To complete this lab, you need:

  • Access to a standard internet browser (Chrome browser recommended).
Note: Use an Incognito (recommended) or private browser window to run this lab. This prevents conflicts between your personal account and the student account, which may cause extra charges incurred to your personal account.
  • Time to complete the lab—remember, once you start, you cannot pause a lab.
Note: Use only the student account for this lab. If you use a different Google Cloud account, you may incur charges to that account.

How to start your lab and sign in to the Google Cloud console

  1. Click the Start Lab button. If you need to pay for the lab, a dialog opens for you to select your payment method. On the left is the Lab Details pane with the following:

    • The Open Google Cloud console button
    • Time remaining
    • The temporary credentials that you must use for this lab
    • Other information, if needed, to step through this lab
  2. Click Open Google Cloud console (or right-click and select Open Link in Incognito Window if you are running the Chrome browser).

    The lab spins up resources, and then opens another tab that shows the Sign in page.

    Tip: Arrange the tabs in separate windows, side-by-side.

    Note: If you see the Choose an account dialog, click Use Another Account.
  3. If necessary, copy the Username below and paste it into the Sign in dialog.

    {{{user_0.username | "Username"}}}

    You can also find the Username in the Lab Details pane.

  4. Click Next.

  5. Copy the Password below and paste it into the Welcome dialog.

    {{{user_0.password | "Password"}}}

    You can also find the Password in the Lab Details pane.

  6. Click Next.

    Important: You must use the credentials the lab provides you. Do not use your Google Cloud account credentials. Note: Using your own Google Cloud account for this lab may incur extra charges.
  7. Click through the subsequent pages:

    • Accept the terms and conditions.
    • Do not add recovery options or two-factor authentication (because this is a temporary account).
    • Do not sign up for free trials.

After a few moments, the Google Cloud console opens in this tab.

Note: To access Google Cloud products and services, click the Navigation menu or type the service or product name in the Search field.

Task 1. Analyze images with Gemini

In this section, you will analyze an image with Gemini. You will design prompts to extract information from the image and observe the model's response.

Enable the Vertex AI API

  1. In the Google Cloud Console, enter Vertex AI API in the top search bar.

  2. Click on the result for Vertex AI API under Marketplace & APIs.

  3. Click Enable.

Click Check my progress to verify the objectives.

Enable the Vertex AI API.

Analyze images with Gemini

  1. In the Google Cloud console, from the Navigation menu (), select Vertex AI > Vertex AI Studio > Create prompt.

The UI contains three main sections:

  • System Instructions (located at the top): a set of instructions that the model processes before it processes prompts. When a system instruction is set, it applies to the entire request. It works across multiple user and model turns when included in the prompt. We recommend that you use system instructions to tell the model how you want it to behave and respond to prompts.
  • Configuration (located on the right): This section allows you to select models (including 3rd party models), configure parameters, use Tools (such as grounding), and set advanced options.
  • Prompt (located at the bottom): Here, you can create a prompt that utilizes multimodal capabilities.
  1. On the top left, click Untitled Prompt and rename your prompt as Medical Image Analysis.

  2. In the Configuration section on the right, ensure the model name gemini-2.0-flash-001 is selected. You can click switch model to change the model if needed, or browse other available models.

  3. Download the sample image. Right-click the chest x-ray image and then save it to your desktop.

  1. On the bottom right of the Prompt section, click the Insert Media > Upload button. Upload the x-ray image you downloaded. The media can be in the form of an image, video, text, or audio file.

  1. The image will be displayed inside of the Prompt section. Copy the following text and paste it under the image and click on the Submit button on the bottom right of the Prompt section.
Title the image.

Or be more specific:

Title the image in 4 words.

Does the title meet your expectations? Try to modify the prompt to see if you get different results.

  1. Describe the image. Replace the previous prompt with the following and click Submit.
Describe the image in detail.
  1. Tune the parameter. In the Configuration section, adjust the temperature by scrolling from left (0) to right (2). Resubmit the prompt to observe any changes in the outcome compared to the previous result.
Note: Temperature controls the degree of randomness in token selection. Lower temperatures are good for prompts that expect a true or correct response, while higher temperatures can lead to more diverse, unexpected, or potentially biased results. With a temperature of 0 the highest probability token is always selected.
  1. Extract information from the image. Replace the previous prompt with the following:
What conditions could this image indicate?

Further on, if you want to format the output to a list, replace the previous prompt with the following:

What conditions could this image indicate? Format the output as a list from greatest to least likely.

Your turn - try out some different prompts! How do these results differ from before?

Does the result meet your expectations? You are highly encouraged to try different prompts for various tasks. You are also encouraged to experiment with different temperature settings to observe the changes in the result.

  1. Once you finish the prompt design, save the prompt by clicking Save on the top right of the Configuration section. For the region, select from the dropdown and then confirm by clicking Save.

  2. To find your saved prompts, on the left-hand navigation menu, navigate to Prompt Management.

Note: After selecting Save, give the prompts a few seconds to properly save and then proceed further with the lab. Click "Try again" if prompted "failed to update history."

Click Check my progress to verify the objectives.

Extract the content of the image.

Task 2. Analyze videos with Gemini

In addition to images and text, Gemini multimodal is capable of accepting videos as inputs and generating text as an output. To obtain the video, you will click on a link to a lung animation video, save the video to your desktop and upload the video into Vertex AI Studio.

  1. Click this link to the lung animation video. The video should appear in your web browser. Right-click on the video to save the video to your computer.
  1. Navigate back to the Vertex AI Studio > Create prompt.

  2. In the Configuration section on the right, ensure the model name gemini-2.0-flash-001 is selected.

  3. Click Insert Media > Upload. Select the lung animation video you downloaded and click Open.

  4. Generate any information about the video by inserting your own prompt. For example, to describe the video in detail, copy the following into the Prompt section and click the Submit button.

Describe this video in detail.
  1. On the top left, click Untitled Prompt and rename your prompt as Medical Video Analysis.

  2. Once you finish the prompt design, save the prompt by clicking Save on the top right of the Configuration section. For the region, select from the dropdown and then confirm by clicking Save.

Note: If your prompt is already saved with the Autosave functionality, ensure the name of the prompt is correct and you can see it in the Prompt Management page.

Multimodal powered by Gemini offers many capabilities such as writing simple explanations of complex images, analyzing videos, and generating educational multimedia visual aids. Check out more information about design multimodal prompts.

Click Check my progress to verify the objectives.

Extract the content of the video.

Task 3. Design text prompts

In this section, you will explore designing text prompts in Vertex AI Studio. You will explore zero-shot, one-shot, and few-shot prompting, as well as generate text summarization, answer questions, and classify text.

Prompt design

You can feed your desired input text, e.g. a question, to the model. The model will then provide a response based on how you structured your prompt. The process of figuring out and designing the best input text (prompt) to get the desired response back from the model is called Prompt Design.

Prompt design methods

There are three main methods to design prompts:

  • Zero-shot prompting - This is a method where the LLM is given only a prompt that describes the task and no additional data. For example, if you want the LLM to answer a question, you just prompt "what is prompt design?".
  • One-shot prompting - This is a method where the LLM is given a single example of the task that it is being asked to perform. For example, if you want the LLM to write a poem, you might give it a single example poem.
  • Few-shot prompting - This is a method where the LLM is given a small number of examples of the task that it is being asked to perform. For example, if you want the LLM to write a news article, you might give it a few news articles to read.

Parameters

Temperature and Token limit are two important parameters that you can adjust to influence the model's response.

  • Temperature controls the randomness in token selection. A lower temperature is good when you expect a true or correct response. A temperature of 0 means the highest probability token is always selected. A higher temperature can lead to diverse, unexpected, or potentially biased results. The gemini-2.0-flash-001 model has a temperature range of 0 - 2 and a default of 1.
  • Output token limit determines the maximum amount of text output from one prompt. A token is approximately four characters.

Zero-shot prompting

  1. Navigate back to the Vertex AI Studio > Create prompt.

  2. In the Configuration section on the right, ensure the model name gemini-2.0-flash-001 is selected.

Note: The model name and version may change with the release of new models.
  1. Copy the following over to the prompt input field:
Generate a list of common medical conditions.
  1. Click on the Submit button.

The model will respond with a list of common medical conditions.

Here are some exploratory exercises to explore. In the Configuration section on the right, click the Advanced section to explore the below options

  • Adjust the Output Token limit parameter to 1024 and click the SUBMIT button.
  • Adjust the Temperature parameter to 0.5 and click the SUBMIT button.
  • Adjust the Temperature parameter to 2.0 and click the SUBMIT button.

Inspect how the responses change with different parameters.

  1. Copy the following over to the prompt input field.
Describe the underlying mechanism of Type 1 diabetes.
  1. Click on the Submit button.

The model will respond with a detailed explanation of the underlying mechanism of Type 1 diabetes.

  1. Next, copy the following over to the prompt input field.
Describe common treatments for a sprained ankle.
  1. Click on the Submit button.

The model will respond with a list of common treatments for a sprained ankle.

One-shot prompting

In one-shot prompting, you provide a single example to the model to generate a response.

  1. Click the Clear icon on the toolbar to clear the prompt.

  2. On the bottom right of the Prompt section, click the Add Examples button.

  1. In the Examples window, copy the following in the INPUT field.
Arthritis
  1. Add the following to the OUTPUT field:
When your joints get swollen and sore
  1. Click on the Add examples button.

  2. Once you've added your example, you should see two sections that need to be filled: {Input} and Prompt. To submit your prompt, you will need to provide another example input, as well as the prompt.

  3. In the {INPUT} field, write the following:

Diabetes
  1. In the Prompt field, write the following:
Generate explanations of medical conditions. Simplify them to a 6th grade reading level.
  1. Click on the Submit button.

The model will respond with an explanation of diabetes simplified to a 6th grade reading level.

Few-shot prompting

This time around, add a few examples for the model to base its output from.

  1. Click the Edit button, then click the Examples window, add the following examples, keeping your existing arthritis example from the previous section.
INPUT OUTPUT
Asthma When your airways get tight, making it hard to breathe
Eczema When your skin gets dry, itchy, and red
  1. In the {INPUT} field, write the following:
Cancer
  1. In the Prompt box, edit your prompt to:
Generate explanations of medical conditions. Simplify them to a 6th grade reading level. Display them in a table.
  1. Once you are finished, click on the Add examples button.

  2. Click on the Submit button.

You have successfully influenced the way the model produces response. Your model now generates an explanation of cancer simplified to a 6th grade reading level, displayed in a table.

Text Summarization

For the next practice, you will use the model to summarize a paragraph into a single sentence.

  1. In the Prompt field, click Clear to delete your existing text and examples.

  1. Copy the following paragraph into the Prompt field:
Explain this paragraph in one sentence: Antibiotics are a type of medication used to treat bacterial infections. They work by either killing the bacteria or preventing them from reproducing, allowing the body's immune system to fight off the infection. Antibiotics are usually taken orally in the form of pills, capsules, or liquid solutions, or sometimes administered intravenously. They are not effective against viral infections, and using them inappropriately can lead to antibiotic resistance.
  1. Click on the Submit button.

The model will respond with the answer to the question (your response may vary):

Antibiotics are medications that fight bacterial infections by killing or stopping the growth of bacteria, allowing the body's immune system to eliminate the infection.

Question Answering

  1. In the Prompt field, enter the following:
Answer the question based on the context below. Keep the answer short and concise. Respond "Unsure about answer" if not sure about the answer. Context: In 1847, Ignaz Semmelweis, a doctor in Vienna, noticed a significant difference in death rates between two maternity clinics. He observed that doctors in one clinic often went directly from autopsies to deliveries. Semmelweis suspected that "cadaverous particles" from autopsies were transferred to maternity patients via their hands, causing puerperal fever. He introduced a handwashing protocol using a chlorinated lime solution before patient contact. This intervention reduced mortality rates in the affected clinic. Question: What was the solution used for handwashing?
  1. Click on the Submit button.

The model will respond with the answer to the question (your response may vary):

Chlorinated lime solution.

Text Classification

  1. In the Prompt field, enter the following:
Classify the text into neutral, negative or positive. Text: I think the hospital staff was ok.
  1. Click on the Submit button.

The model will respond with the answer to the question (your response may vary):

Neutral. The statement "I think the hospital staff was ok" does not express a clear positive or negative sentiment. It is a neutral statement that indicates the speaker's opinion on the hospital staff is neither particularly good nor bad.
  1. On the top left, click Untitled Prompt and rename your prompt as Text Classification.

  2. Save the prompt by clicking Save on the top right of the Configuration section. For the region, select from the dropdown and then confirm by clicking Save.

Note: If your prompt is already saved with the Autosave functionality, ensure the name of the prompt is correct and you can see it in the Prompt Management page.

The saved prompt will appear in the Prompt Management section.

Click Check my progress to verify the objectives.

Create prompts with text.

Congratulations!

Congratulations! In this lab, you explored the capabilities of Vertex AI Studio for Healthcare. You analyzed an image and video with Gemini multimodal and designed text prompts. You also explored zero-shot, one-shot, and few-shot prompting, as well as learned how to generate text summarization, question answering, and text classification. You are now ready to leverage the power of generative AI models.

Google Cloud training and certification

...helps you make the most of Google Cloud technologies. Our classes include technical skills and best practices to help you get up to speed quickly and continue your learning journey. We offer fundamental to advanced level training, with on-demand, live, and virtual options to suit your busy schedule. Certifications help you validate and prove your skill and expertise in Google Cloud technologies.

Manual Last Updated April 10, 2025

Lab Last Tested April 10, 2025

Copyright 2025 Google LLC All rights reserved. Google and the Google logo are trademarks of Google LLC. All other company and product names may be trademarks of the respective companies with which they are associated.

Before you begin

  1. Labs create a Google Cloud project and resources for a fixed time
  2. Labs have a time limit and no pause feature. If you end the lab, you'll have to restart from the beginning.
  3. On the top left of your screen, click Start lab to begin

This content is not currently available

We will notify you via email when it becomes available

Great!

We will contact you via email if it becomes available

One lab at a time

Confirm to end all existing labs and start this one

Use private browsing to run the lab

Use an Incognito or private browser window to run this lab. This prevents any conflicts between your personal account and the Student account, which may cause extra charges incurred to your personal account.