Imagine and create: Get started with generative AI on AWS - Part 1
Tags: aws, tutorial, generativeai, machinelearning
Published: 2023-04-10 13:21:15


## The future is bright for AI in 2023

In the latest report *HAI Stanford University Human Centered Artificial Intelligence* report [2023 State of AI in 14 Charts](https://hai.stanford.edu/news/2023-state-ai-14-charts) AI job postings in the US are most prominent in the information, professional, scientific, technical and finance industries.

![Ai job postings](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cgu7v68diqwgydau7swf.jpg)

As startups, professional services and enterprise transform with a data strategy, data governance and the right tooling there are a few key considerations for AI:

* Do I have executive sponsorship?
* Do I have qualified AI practitioners or do I need to upskill my staff?
* Do I have huge amounts of data readily available?
* Do I have enough compute power to train the models?
* Can I use AI to solve my business problem?

HAI Stanford University Human Centered Artificial Intelligence report also outline the demographic trends in AI with computer science graduate representation increasing for females at 22%.


![grad](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vqo97hr513u51huivhse.jpg)

We will focus on the exciting field of generative AI and how it can inspire human creativity with computers.

### Lesson Objectives

In this lesson you will learn about:

* Generative AI
* Why should I explore generative AI?
* The common use cases for generative AI 
* Solution Architecture
* Getting started with generative AI on AWS
* Responsible AI
* Global generative AI accelerator for startups - closing on April 17, 2023
* Amazon Research Awards call for proposals in generative AI - closing on April 26, 2023

### What is generative AI?

Generative AI includes algorithms such as *Generative Adversarial Networks (GANs)*, *Autoregressive Convolutional Neural Networks (AR-CNNs)* and *Autoregressive(AR) models*.

Generative models help computers to understand the patterns of underlying data and take the 'learning' to create new content for sound, video, image, songs and text.

Generative AI in AWS DeepComposer uses unsupervised learning techniques to understand the underlying patterns of generated music and explore algorithms such clustering to find similarities where the dataset is not labelled.

### Why should I explore generative AI?

Generative AI combines creativity to imagine future possibilities with machine learning models. You may get started on AWS using the [AWS Free Tier](https://aws.amazon.com/free/machine-learning/?trk=67eec32b-b020-4186-a9ab-3971ae4dc1de&sc_channel=ps&ef_id=Cj0KCQjwocShBhCOARIsAFVYq0iVVxoSTukadchlFgdYw4e6ZQZTOb3vmeHctTj-ZlOJyv9AUn8eS5gaAiLcEALw_wcB:G:s&s_kwcid=AL!4422!3!476956126069!e!!g!!aws%20machine%20learning%20services!11539887585!114142401042).

You may easily get started with machine learning in a fun environment with your imagination such as creating:

* New content for marketing

* Unique customer experiences 

* New data e.g. sound, videos, text, images

### What are the common use cases?

**a) Large Language Models used in Finance**

In the research paper published on [arXiv](https://arxiv.org/abs/2303.17564) on 30 March 2023 the authors propose to implement BloombergGPT a large language model trained on Bloomberg's data source a 363 billion token dataset.

**b) Virtual Fashion-styling - Image-to-text generation**

Retail businesses that provide personal styling services to their customers can take a desired input as a photo and upload it into Amazon SageMaker using pre-trained models DreamBooth to generate an AI image from learned patterns from the dataset.

You may read more about the implementation of virtual fashion styling with generative AI using Amazon SageMaker in the [AWS blog](https://aws.amazon.com/blogs/machine-learning/virtual-fashion-styling-with-generative-ai-using-amazon-sagemaker/).

**c) Text-to-image generation**

Last week at the AWS Sydney Summit 2023, keynote speaker Cameron Adams the Co-Founder of Aussie unicorn startup Canva spoke about using generative AI to weave imagination and create visuals from text inputs. You may watch on demand his keynote [here](https://twitter.com/AWSCloudANZ/status/1643025008653127680).

You may take a look at the demo of the text to image creation from the [Canva UI](https://twitter.com/canva/status/1639075081287782401)

![canva AI](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w7lta14mn07fqxtr2d9t.jpg)

You may hear from the designers, storytellers and creators on the panel speak about the future of film making from the recent *AI Film Festival* hosted by Amazon customer the startup [Runway](https://www.aboutamazon.com/news/aws/how-ai-tools-are-creating-new-possibilities-for-movies-and-visual-design-according-to-this-aws-powered-startup?sc_channel=sm&sc_campaign=Press_Releases&sc_publisher=TWITTER&sc_geo=GLOBAL&sc_outcome=awareness&trk=press_releases&linkId=207882954). Runway used a text prompt to generate images.

{% embed https://www.youtube.com/watch?v=OV0zd-bXC1k %}

Generative AI is used by NASA to design processes for space exploration, in dentistry to create 3D models from an image, compose sound and edit images for film making.

In recent times, Hollywood blockbusters have incorporated generative AI into film making such as *Shrek*, science fiction film *Everything, everywhere all at once* and *Avatar*.


Film director James Cameron incorporated generative AI into the [movie sequel](https://twitter.com/JimCameron/status/1600188323011534848) *Avatar: The Way of Water*.


> “[Dreams] are kind of like a generative AI. I think they’re making imagery from a vast dataset that’s our entire experience in life, and … then another part of our brain is supplying a narrative that goes along with it and the narrative doesn’t always make much sense.” - James Cameron speaking to [CNN](https://www.thewrap.com/james-cameron-dreams-generative-ai-avatar).


### Solution Architecture

GAN architecture includes creating new images based on learning from training real images. This network architecture is relevant for creating sound, text and new images.

Under this *unsupervised learning technique*, the network takes a corpus of training inputs such as real images and builds a generative neural network and outputs data similar to the training data.

The general architecture of GANs is shown in the image provided by AWS:



![archi](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7wvw12ltwqoxglp6oju3.jpg)

AWS DeepComposer concepts and terminology includes the following [definitions](https://docs.aws.amazon.com/deepcomposer/latest/devguide/deepcomposer-basic-concepts.html#term-transformers):

**Discriminator Network**

The [discriminator](https://docs.aws.amazon.com/deepcomposer/latest/devguide/deepcomposer-basic-concepts.html#term-transformers) classifies data as real or as generated using unsupervised learning. The discriminator is trained on real data or images. 

**Generative Network**

The generative network generates data with a [deconvolutional layer] (https://docs.aws.amazon.com/deepcomposer/latest/devguide/deepcomposer-basic-concepts.html#term-transformers) and a discriminator. 

The generative network uses backward propagation to update the parameters for generating more realistic images. Supervised learning is used to identify generated images and the real training data - Which output data or image is True or False?

### Tutorial 1: Generate music with AWS DeepComposer

* Step 1: Sign into the AWS Management Console as an IAM user. If you do not have an AWS account you may create one [here](https://dev.to/aws-builders/creating-your-first-iam-admin-user-and-user-group-in-your-aws-account-machine-learning-part-1-3cne)

* Step 2: Navigate to **AWS DeepComposer** from the search bar and start typing the word 'deep'.


![deep](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uwludz2wprl7248a31ba.jpg)

Note: Switch to **US East (N.Virginia)** region to use AWS DeepComposer because this AWS service is not available in the Asia Pacific(Sydney) ap-southeast-2 region.

If you are a first-time user, you may access the [AWS Free Tier](https://aws.amazon.com/deepcomposer/pricing/) which provides 12-months access to AWS DeepComposer sample models and this includes 30 day free trial.

* Step 3: On the AWS DeepComposer homepage click **Get Started** to start composing music.

![Icomposer](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qw25p4hx3qi4spdvlfx8.jpg)

* Step 4: You may click on **Start learning Generative AI** or **Learning Capsules**.


![learning capsules](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6oi12sh8zsoj6ytje493.jpg)

* Step 5: Click **Launch music studio** to start creating music


![music studio](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h8jkxsc5w26hpgdzyvzk.jpg)

* Step 6: Click **Start composing**


![composing](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lbnzx141xt7bb68hcail.jpg)

* Step 7: Choose an input track, record your own track or you may upload your own track.


![choose](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p5g3c451mc3xzozuxykq.jpg)

* Step 8: I chose an input track *We wish you a merry Christmas* and click **Continue**.


![merry](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/blcljktv0hey23akpqpn.jpg)

* Step 9: Under ML technique, I chose the Generative AI technique which is **GANs**. Select the **Model**, I chose pop music from the drop-down menu. Click **Continue**.


![ML](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t7obnnocm7cci8mloror.jpg)

* Step 10: You may edit the melody by changing the *Instruments*, *Instrument Type* and *Model* from the drop-down menu and click **Play** to hear the composed music and make adjustments.

Once you are satisfied with the melody, click **Continue**.


![set melody](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9mjavur5lvocn6b2hrih.jpg)

* Step 11: Music is generated. Hooray! 🎉

Click **Share composition** to publish the music on SoundCloud


![share composition](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6uch6khmz8barw7eheer.jpg)

* Step 12: You may create an account or login to SoundCloud


![connect](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ropx1s77zpovsrumndej.jpg)

* Step 13: Enter details of your generated music, you may provide a description and you may select if you would like to be included in a SoundCloud challenge.


![share](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xcbj9fwjv8czlh3gncib.jpg)

* Step 14: After you connect with SoundCloud, you will receive a status that your composed music has been uploaded successfully.

![success](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z7lc6srj218xmx62girm.jpg)

* Step 15: You will navigate to the SoundCloud page and you may listen to the music generated by other creators and also view the ranking by popularity.


* Step 16: Clean Up Resources

In AWS DeepComposer, navigate to **Music Studio** on the left-handside navigation pane and click **Delete**.


![delete composition](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4atkh02m0dm3suxmpgyi.jpg)

At the confirmation, click **Delete**.


![delete](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x55vuuqeexlvoiwksv2m.jpg)


### Responsible AI Considerations

There are other consideration before implementing AI in your organization as an AI practitioner:

* How do I store data securely?
* How do I use AI ethically with data governance sign-off?
* How do I ensure that my design is inclusive?
* How do I remove algorithmic bias?

### Conclusion

Generative AI models help creators, designers and developers to reimagine storytelling and design unique experiences. These experiences have the potential to transform space exploration, provide customer-centric experiences in retail, film-making, health care and more.

### Tutorial 2: Imagine and create with generative AI: Get started on AWS - Part 2

In the next tutorial you will learn more about generative AI.
I encourage you to explore and create your own music with AWS DeepComposer with the pre-trained AI models.

Until the next lesson, happy learning! 🙂

### References 📚

* [Bloomberg GPT](https://arxiv.org/pdf/2303.17564.pdf)

* [AWS DeepComposer terminology](https://docs.aws.amazon.com/deepcomposer/latest/devguide/deepcomposer-basic-concepts.html#term-gan)

* [AWS Machine Learning](https://aws.amazon.com/machine-learning/)

**AWS Global Generative AI accelerator program - closing on 17 April 2023**

On 4 April 2023, AWS CEO Adam Selipsky announced the global launch of generative AI for startups around the world [here](https://twitter.com/aselipsky/status/1643256796994473984 %).

If you are a startup, you are invited to apply for the global generative AI accelerator which closes on 17 April 2023.


In this program, you will have access to:

* Impactful AI models
* Customized go-to-market strategies
* ML optimization
* Networking opportunities with potential investors and customers
* $300,000 in AWS credits to build your product or service
* Dedicated business and technical mentors

### Amazon Research Awards Call for Proposals in Generative AI - Spring 2023

Are you a researcher? Amazon Research Awards for Generative AI is calling for proposals which is closing soon on April 26, 2023 you may apply [here](https://www.amazon.science/research-awards/program-updates/amazon-research-awards-issues-spring-2023-call-for-proposals).

{% embed https://www.linkedin.com/feed/update/urn:li:activity:7041768812739731456/ %}

### Hello World: Meet Generative AI - An interview with Dr. Werner Vogels, Amazon CTO and Swami Sivasubramanian, AWS VP of database, analytics, and ML

{% embed https://www.youtube.com/watch?v=dBzCGcwYCJo %}