Advertising and marketing groups face main challenges creating campaigns in as we speak’s digital surroundings. They need to navigate by means of complicated knowledge analytics and quickly altering client preferences to provide partaking, personalised content material throughout a number of channels whereas sustaining model consistency and dealing inside tight deadlines. Utilizing generative AI can streamline and speed up the inventive course of whereas sustaining alignment with enterprise aims. Certainly, in accordance with McKinsey’s “The State of AI in 2023” report, 72% of organizations now combine AI into their operations, with advertising rising as a key space of implementation.
Constructing upon our earlier work of advertising marketing campaign picture era utilizing Amazon Nova basis fashions, on this publish, we exhibit easy methods to improve picture era by studying from earlier advertising campaigns. We discover easy methods to combine Amazon Bedrock, AWS Lambda, and Amazon OpenSearch Serverless to create a complicated picture era system that makes use of reference campaigns to keep up model pointers, ship constant content material, and improve the effectiveness and effectivity of recent marketing campaign creation.
The worth of earlier marketing campaign data
Historic marketing campaign knowledge serves as a robust basis for creating efficient advertising content material. By analyzing efficiency patterns throughout previous campaigns, groups can determine and replicate profitable inventive components that persistently drive larger engagement charges and conversions. These patterns may embody particular shade schemes, picture compositions, or visible storytelling methods that resonate with goal audiences. Earlier marketing campaign belongings additionally function confirmed references for sustaining constant model voice and visible id throughout channels. This consistency is essential for constructing model recognition and belief, particularly in multi-channel advertising environments the place coherent messaging is important.
On this publish, we discover easy methods to use historic marketing campaign belongings in advertising content material creation. We enrich reference photos with useful metadata, together with marketing campaign particulars and AI-generated picture descriptions, and course of them by means of embedding fashions. By integrating these reference belongings with AI-powered content material era, advertising groups can remodel previous successes into actionable insights for future campaigns. Organizations can use this data-driven strategy to scale their advertising efforts whereas sustaining high quality and consistency, leading to extra environment friendly useful resource utilization and improved marketing campaign efficiency. We’ll exhibit how this systematic technique of utilizing earlier marketing campaign knowledge can considerably improve advertising methods and outcomes.
Resolution overview
In our earlier publish, we applied a advertising marketing campaign picture generator utilizing Amazon Nova Professional and Amazon Nova Canvas. On this publish, we discover easy methods to improve this resolution by incorporating a reference picture search engine that makes use of historic marketing campaign belongings to enhance era outcomes. The next structure diagram illustrates the answer:
The primary structure elements are defined within the following listing:
- Our system begins with a web-based UI that customers can entry to start out the creation of recent advertising marketing campaign photos. Amazon Cognito handles consumer authentication and administration, serving to to make sure safe entry to the platform.
- The historic advertising belongings are uploaded to Amazon Easy Storage Service (Amazon S3) to construct a related reference library. This add course of is initiated by means of Amazon API Gateway. On this publish, we use the publicly accessible COCO (Frequent Objects in Context) dataset as our supply of reference photos.
- The picture processing AWS Step Features workflow is triggered by means of API Gateway and processes photos in three steps:
- A Lambda perform (
DescribeImgFunction) makes use of the Amazon Nova Professional mannequin to explain the pictures and determine their key components. - A Lambda perform (
EmbedImgFunction) transforms the pictures into embeddings utilizing the Amazon Titan Multimodal Embeddings basis mannequin. - A Lambda perform (
IndexDataFunction) shops the reference picture embeddings in an OpenSearch Serverless index, enabling fast similarity searches.
- A Lambda perform (
- This step bridges asset discovery and content material era. When customers provoke a brand new marketing campaign, a Lambda perform (
GenerateRecommendationsFunction) transforms the marketing campaign necessities into vector embeddings and performs a similarity search within the OpenSearch Serverless index to determine probably the most related reference photos. The descriptions of chosen reference photos are then integrated into an enhanced immediate by means of a Lambda perform (GeneratePromptFunction). This immediate powers the creation of recent marketing campaign photos utilizing Amazon Bedrock by means of a Lambda perform (GenerateNewImagesFunction). For detailed details about the picture era course of, see our earlier weblog.
Our resolution is obtainable in GitHub. To deploy this challenge, comply with the directions accessible within the README file.
Process
On this part, we study the technical elements of our resolution, from reference picture processing by means of remaining advertising content material era.
Analyzing the reference picture dataset
Step one in our AWS Step Features workflow is analyzing reference photos utilizing the Lambda Operate DescribeImgFunction. This useful resource makes use of Amazon Nova Professional 1.0 to generate two key elements for every picture: an in depth description and a listing of components current within the picture. These metadata elements will likely be built-in into our vector database index later and used for creating new marketing campaign visuals.
For implementation particulars, together with the entire immediate template and Lambda perform code, see our GitHub repository. The next is the structured output generated by the perform when offered with a picture:
Producing reference picture embeddings
The Lambda perform EmbedImgFunction encodes the reference photos into vector representations utilizing the Amazon Titan Multimodal Embeddings mannequin. This mannequin can embed each modalities right into a joint area the place textual content and pictures are represented as numerical vectors in the identical dimensional area. On this unified illustration, semantically related objects (whether or not textual content or photos) are positioned nearer collectively. The mannequin preserves semantic relationships inside and throughout modalities, enabling direct comparisons between any mixture of photos and textual content. This allows highly effective capabilities resembling text-based picture search, picture similarity search, and mixed textual content and picture search.
The next code demonstrates the important logic for changing photos into vector embeddings. For the entire implementation of the Lambda perform, see our GitHub repository.
with open(image_path, "rb") as image_file:
input_image = base64.b64encode(image_file.learn()).decode('utf8')
response = bedrock_runtime.invoke_model(
physique=json.dumps({
"inputImage": input_image,
"embeddingConfig": {
"outputEmbeddingLength": dimension
}
}),
modelId=model_id
)
json.hundreds(response.get("physique").learn())
The perform outputs a structured response containing the picture particulars and its embedding vector, as proven within the following instance.
Index reference photos with Amazon Bedrock and OpenSearch Serverless
Our resolution makes use of OpenSearch Serverless to allow environment friendly vector search capabilities for reference photos. This course of includes two foremost steps: organising the search infrastructure after which populating it with reference picture knowledge.
Creation of the search index
Earlier than indexing our reference photos, we have to arrange the suitable search infrastructure. When our stack is deployed, it provisions a vector search assortment in OpenSearch Serverless, which routinely handles scaling and infrastructure administration. Inside this assortment, we create a search index utilizing the Lambda perform CreateOpenSearchIndexFn.
Our index mappings configuration, proven within the following code, defines the vector similarity algorithm and the marketing campaign metadata fields for filtering. We use the Hierarchical Navigable Small World (HNSW) algorithm, offering an optimum steadiness between search velocity and accuracy. The marketing campaign metadata consists of an goal area that captures marketing campaign targets (resembling clicks, consciousness, or likes) and a node area that identifies goal audiences (resembling followers, clients, or new clients). By filtering search outcomes utilizing these fields, we can assist be sure that reference photos come from campaigns with matching aims and goal audiences, sustaining alignment in our advertising strategy.
For the entire implementation particulars, together with index settings and extra configurations, see our GitHub repository.
Indexing reference photos
With our search index in place, we will now populate it with reference picture knowledge. The Lambda perform IndexDataFunction handles this course of by connecting to the OpenSearch Serverless index and storing every picture’s vector embedding alongside its metadata (marketing campaign aims, target market, descriptions, and different related data). We are able to use this listed knowledge later to rapidly discover related reference photos when creating new advertising campaigns. Under is a simplified implementation, with the entire code accessible in our GitHub repository:
# Initialize the OpenSearch shopper
oss_client = OpenSearch(
hosts=[{'host': OSS_HOST, 'port': 443}],
http_auth=AWSV4SignerAuth(boto3.Session().get_credentials(), area, 'aoss'),
use_ssl=True,
verify_certs=True,
connection_class=RequestsHttpConnection
)
# Put together doc for indexing
doc = {
"id": image_id,
"node": metadata['node'],
"goal": metadata['objective'],
"image_s3_uri": s3_url,
"image_description": description,
"img_element_list": components,
"embeddings": embedding_vector
}
# Index doc in OpenSearch
oss_response = oss_client.index(
index=OSS_EMBEDDINGS_INDEX_NAME,
physique=doc
)
Combine the search engine into the advertising campaigns picture generator
The picture era workflow combines marketing campaign necessities with insights from earlier reference photos to create new advertising visuals. The method begins when customers provoke a brand new marketing campaign by means of the net UI. Customers present three key inputs: a textual content description of their desired marketing campaign, its goal, and its node. Utilizing these inputs, we carry out a vector similarity search in OpenSearch Serverless to determine probably the most related reference photos from our library. For these chosen photos, we retrieve their descriptions (created earlier by means of Lambda perform DescribeImgFunction) and incorporate them into our immediate engineering course of. The ensuing enhanced immediate serves as the inspiration for producing new marketing campaign photos that align with each: the consumer’s necessities and profitable reference examples. Let’s study every step of this course of intimately.
Get picture suggestions
When a consumer defines a brand new marketing campaign description, the Lambda perform GetRecommendationsFunction transforms it right into a vector embedding utilizing the Amazon Titan Multimodal Embeddings mannequin. By remodeling the marketing campaign description into the identical vector area as our picture library, we will carry out exact similarity searches and determine reference photos that carefully align with the marketing campaign’s aims and visible necessities.
The Lambda perform configures the search parameters, together with the variety of outcomes to retrieve and the ok worth for the k-NN algorithm. In our pattern implementation, we set ok to 5, retrieving the highest 5 most related photos. These parameters may be adjusted to steadiness end result variety and relevance.
To assist guarantee contextual relevance, we apply filters to match each the node (target market) and goal of the brand new marketing campaign. This strategy ensures that advisable photos should not solely visually related but in addition aligned with the marketing campaign’s particular targets and target market. We showcase a simplified implementation of our search question, with the entire code accessible in our GitHub repository.
physique = {
"measurement": ok,
"_source": {"exclude": ["embeddings"]},
"question":
{
"knn":
{
"embeddings": {
"vector": embedding,
"ok": ok,
}
}
},
"post_filter": {
"bool": {
"filter": [
{"term": {"node": node}},
{"term": {"objective": objective}}
]
}
}
}
res = oss_client.search(index=OSS_EMBEDDINGS_INDEX_NAME, physique=physique)
The perform processes the search outcomes, that are saved in Amazon DynamoDB to keep up a persistent file of campaign-image associations for environment friendly retrieval. Customers can entry these suggestions by means of the UI and choose which reference photos to make use of for his or her new marketing campaign creation.
Enhancing the meta-prompting method with reference photos
The immediate era part builds upon our meta-prompting method launched in our earlier weblog. Whereas sustaining the identical strategy with Amazon Nova Professional 1.0, we now improve the method by incorporating descriptions from user-selected reference photos. These descriptions are built-in into the template immediate utilizing XML tags (, as proven within the following instance.
The immediate era is orchestrated by the Lambda perform GeneratePromptFunction. The perform receives the marketing campaign ID and the URLs of chosen reference photos, retrieves their descriptions from DynamoDB, and makes use of Amazon Nova Professional 1.0 to create an optimized immediate from the earlier template. This immediate is used within the subsequent picture era part. The code implementation of the Lambda perform is obtainable in our GitHub repository.
Picture era
After acquiring reference photos and producing an enhanced immediate, we use the Lambda perform GenerateNewImagesFunction to create the brand new marketing campaign picture. This perform makes use of Amazon Nova Canvas 1.0 to generate a remaining visible asset that includes insights from profitable reference campaigns. The implementation follows the picture era course of we detailed in our earlier weblog. For the entire Lambda perform code, see our GitHub repository.
Creating a brand new advertising marketing campaign: An end-to-end instance
We developed an intuitive interface that guides customers by means of the marketing campaign creation course of. The interface handles the complexity of AI-powered picture era, solely requiring customers to supply their marketing campaign description and primary particulars. We stroll by means of the steps to create a advertising marketing campaign utilizing our resolution:
- Customers start by defining three key marketing campaign components:
- Marketing campaign description: An in depth temporary that serves as the inspiration for picture era.
- Marketing campaign goal: The advertising goal (for instance, Consciousness) that guides the visible technique.
- Goal node: The precise viewers phase (for instance, Prospects) for content material focusing on.
- Based mostly on the marketing campaign particulars, the system presents related photos from earlier profitable campaigns. Customers can overview and choose the pictures that align with their imaginative and prescient. These choices will information the picture era course of.
- Utilizing the marketing campaign description and chosen reference photos, the system generates an enhanced immediate that serves because the enter for the ultimate picture era step.
- Within the remaining step, our system generates visible belongings primarily based on the immediate that might doubtlessly be used as inspiration for a whole marketing campaign briefing.
How Bancolombia is utilizing Amazon Nova to streamline their advertising marketing campaign belongings era
Bancolombia, one in all Colombia’s main banks, has been experimenting with this advertising content material creation strategy for greater than a yr. Their implementation supplies useful insights into how this resolution may be built-in into established advertising workflows. Bancolombia has been capable of streamline their inventive workflow whereas making certain that the generated visuals align with the marketing campaign’s strategic intent. Juan Pablo Duque, Advertising and marketing Scientist Lead at Bancolombia, shares his perspective on the affect of this expertise:
“For the Bancolombia staff, leveraging historic imagery was a cornerstone in constructing this resolution. Our objective was to straight deal with three main trade ache factors:
- Lengthy and expensive iterative processes: By implementing meta-prompting methods and making certain strict model pointers, we’ve considerably diminished the time customers spend producing high-quality photos.
- Issue sustaining context throughout inventive variations: By figuring out and locking in key visible components, we guarantee seamless consistency throughout all graphic belongings.
- Lack of management over outputs: The suite of methods built-in into our resolution supplies customers with a lot larger precision and management over the outcomes.
And that is just the start. This train permits us to validate new AI creations in opposition to our present library, making certain we don’t over-rely on the identical visuals and preserving our model’s look contemporary and fascinating.”
Clear up
To keep away from incurring future fees, you must delete all of the assets used on this resolution. As a result of the answer was deployed utilizing a number of AWS CDK stacks, you must delete them within the reverse order of deployment to correctly take away all assets. Comply with these steps to wash up your surroundings:
- Delete the frontend stack:
- Delete the picture era backend stack:
- Delete the picture indexing backend stack:
- Delete the OpenSearch roles stack:
The cdk destroy command will take away most assets routinely, however there is likely to be some assets that require handbook deletion resembling S3 buckets with content material and OpenSearch collections. Ensure to verify the AWS Administration Console to confirm that every one assets have been correctly eliminated. For extra details about the cdk destroy command, see the AWS CDK Command Line Reference.
Conclusion
This publish has offered an answer that enhances advertising content material creation by combining generative AI with insights from historic campaigns. Utilizing Amazon OpenSearch Serverless and Amazon Bedrock, we constructed a system that effectively searches and makes use of reference photos from earlier advertising campaigns. The system filters these photos primarily based on marketing campaign aims and goal audiences, serving to to make sure strategic alignment. These references then feed into our immediate engineering course of. Utilizing Amazon Nova Professional, we generate a immediate that mixes new marketing campaign necessities with insights from profitable previous campaigns, offering model consistency within the remaining picture era.
This implementation represents an preliminary step in utilizing generative AI for advertising. The whole resolution, together with detailed implementations of the Lambda features and configuration information, is obtainable in our GitHub repository for adaptation to particular organizational wants.
For extra data, see the next associated assets:
Concerning the authors
María Fernanda Cortés is a Senior Information Scientist on the Skilled Providers staff of AWS. She’s centered on designing and growing end-to-end AI/ML options to deal with enterprise challenges for patrons globally. She’s keen about scientific information sharing and volunteering in technical communities.
David Laredo is a Senior Utilized Scientist at Amazon, the place he helps innovate on behalf of consumers by means of the applying of state-of-the-art methods in ML. With over 10 years of AI/ML expertise David is a regional technical chief for LATAM who continually produces content material within the type of blogposts, code samples and public talking classes. He at present leads the AI/ML knowledgeable group in LATAM.
Adriana Dorado is a Laptop Engineer and Machine Studying Technical Subject Neighborhood (TFC) member at AWS, the place she has been for five years. She’s centered on serving to small and medium-sized companies and monetary companies clients to architect on the cloud and leverage AWS companies to derive enterprise worth. Exterior of labor she’s keen about serving because the Vice President of the Society of Ladies Engineers (SWE) Colombia chapter, studying science fiction and fantasy novels, and being the proud aunt of a wonderful niece.
Yunuen Piña is a Options Architect at AWS, specializing in serving to small and medium-sized companies throughout Mexico to remodel their concepts into modern cloud options that drive enterprise progress.
Juan Pablo Duque is a Advertising and marketing Science Lead at Bancolombia, the place he merges science and advertising to drive effectivity and effectiveness. He transforms complicated analytics into compelling narratives. Enthusiastic about GenAI in MarTech, he writes informative weblog posts. He leads knowledge scientists devoted to reshaping the advertising panorama and defining new methods to measure.








