Google Gen AI Intensive Course Capstone Project – 2025 Q1

info@appfreelife.com

From March 31 to April 4, 2025, I participated in Google’s intensive five-day course, “Gen AI Intensive Course with Google,” culminating in my Capstone Project. During this rigorous program, we explored advanced generative AI capabilities, including structured outputs (JSON mode), few-shot prompting, image recognition, document understanding, agents, and function calling.

My Capstone Project: Decoding Relationships with Generative AI: A Multi-Modal Analysis Approach

For my Capstone, I developed a robust program leveraging Google Gemini API and Google Cloud Run to analyze relationship dynamics and emotional interactions between partners using multi-modal generative AI.

🎧 Prefer listening? You can explore the concept further via the podcast and article generated with NotebookLM: https://www.youtube.com/watch?v=c8XG_lDX9YA

⚠️ Note: There is a misstatement at 00:57 in the video — LoveSignal AI is currently available on iOS, with an Android version in development.

Project Overview:

My original prototype, Relationship Analysis Program for Couples Using Generative AI—initially developed on Kaggle and shared in detail at the end—served as the foundation for two refined AI-powered applications: Love Signal AI and Harassment AI Judgment.
Leveraging the power and flexibility of Google’s Gemini API and Google Cloud Run, I was able to design, build, and deploy both applications from prototype to production-ready tools in just two weeks.

1. Love Signal AI – Mobile Application

Uncover Love Potential in Just One Second — Don’t Miss the Signal! (Available in Chinese, English, and Japanese)

Powered by cutting-edge AI technology, the Love Signal AI App helps users accurately detect romantic interests hidden within texts and images.

Now available on iPhone!
👉 Download on the App Store

※Android versions are currently in development.

App Description:

  • Real-Time Sentiment Analysis: Quickly analyzes text conversations and uploaded photos to provide insightful predictions about romantic potential.
  • Simple, Instant Insights: Users can easily upload 1 to 3 photos along with chat snippets or personal notes for immediate, detailed analysis.
  • Engaging User Experience: Includes delightful heart animations and interactive love-index reports, providing personalized advice and encouragement to enhance user interactions.

Ideal for:

  • Individuals uncertain about romantic feelings
  • Couples confirming mutual affection
  • Anyone aiming to strengthen or clarify their relationships

2. Harassment AI Judgment – Web Platform

The Harassment AI Judgment website utilizes advanced multi-modal AI to detect and classify various harassment types based on uploaded conversation screenshots and text inputs.

Not sure if your experience counts as harassment?
👉 Try our free AI-powered judgment tool (Japanese only)

※Other language versions are currently in development.

Service Description:

  • Instant Harassment Classification: Identifies different harassment types, such as power harassment, moral harassment, and sexual harassment, according to Japan’s Ministry of Health, Labour and Welfare guidelines.
  • Confidential and Anonymous Analysis: Users receive detailed, confidential AI-generated evaluations and supportive advice without fear of exposure.
  • Comprehensive Support and Guidance: Provides clear visual scores and practical recommendations to help users navigate difficult situations confidently.

Workflow:

  • Users upload conversation text or screenshots.
  • Google Gemini API instantly processes and analyzes inputs.
  • Automatically classifies harassment types into structured categories.
  • Offers comprehensive feedback and access to further support resources if needed.

Technical Implementation:

Both projects use a robust backend infrastructure deployed through Google Cloud Run, allowing scalable, efficient, and secure access to the Gemini API for real-time generative AI processing. The backend prototypes and initial modeling were developed and tested using Kaggle Notebooks, ensuring rapid prototyping, iterative testing, and seamless deployment.

Potential Applications and Future Plans:

My Relationship Analysis Program prototype is envisioned as a comprehensive toolkit for:

  • Enhancing partner communications
  • Supporting professional counseling
  • Facilitating personal growth and emotional awareness

Moving forward, I plan to expand upon these prototypes, transforming them into broadly accessible applications. Updates, insights, and detailed AI implementation tips will be continually shared on this blog.

Below, you will find the detailed Kaggle Notebook code used to develop and prototype these generative AI applications.


Building a Relationship Analysis Pipeline Using Generative AI

You can check the full implementation in my Kaggle Notebook for further details.

For this Capstone Project prototype, I developed an interactive pipeline that analyzes the emotional dynamics of human relationships using state-of-the-art generative AI technologies. The system processes both images and conversation text to generate insightful interpretations.

In the following sections, I will walk through each component of the project and share the relevant code and explanations.

1. Environment Setup and Package Installation

In this project, unnecessary packages were removed to avoid conflicts with Kaggle’s base environment, and the latest required packages were installed. Mainly, LangGraph and Google Generative AI-related packages were used.

2. API Key Setup and Library Imports

The Google API Key (for Gemini models) was securely set using Kaggle’s Secrets feature. Various libraries required for analysis were also imported.

3. Data Schema Definitions

Using Pydantic, the output from models was structured to ensure data quality and consistency.

Summary Rating Image Analysis Results Conversation Analysis Results Composite Analysis Report

4. Initializing the Gemini API Client

The “gemini-2.0-flash” model was used to generate content.

5. Utility Function for Extracting JSON Responses

A utility function was implemented to safely extract JSON data from model responses and handle errors appropriately.

6. Defining Workflow Node Functions

Each node handles tasks such as uploading images and conversation data, checking requirements, analyzing images, analyzing conversations, generating reports, refining analysis, and saving the final report. Emotional scores from images and conversations are also visualized through graphs for easier interpretation.

In this project, the LangGraph framework was used to visualize the state graph. By clearly showing the connections between each node, the workflow becomes intuitive and easy to understand. The actual analysis is automatically executed according to the flow of this graph, resulting in a final output report.

What is a “State Graph”?

In this project, the process flow is designed as a “State Graph.” A State Graph represents multiple processing steps as individual “nodes,” which are connected to form a complete workflow. Each node has a specific role, and by executing them sequentially, the entire process is completed.

Below is a detailed explanation of each node used in this project.

Detailed Description of Each Node (Processing Step)

Node 1: Data Upload (upload_data)

Purpose: Allow users to specify the location of the image files and conversation logs for analysis, and load them into the system. If data already exists, ask whether to add more.

Process:

  • Prompt users to input the file paths for images and conversation history.
  • Use default paths if no input is provided.
  • Verify that the specified image and text files can be opened.
  • Store the loaded data in a dictionary object called state for use in subsequent steps.

Node 2: Use Existing Information (use_existing_info)

Purpose: If previous analysis results are saved, ask the user whether to use this information for the current analysis.

Process:

  • Search the current folder for past analysis results (JSON files).
  • If found, ask the user whether they wish to use them.
  • If the user agrees, read the selected file’s content and incorporate it into the current analysis.

Node 3: Check Requirements (check_requirements)

Purpose: Combine the uploaded image and conversation data, and use Google’s Generative AI (Gemini model) to check if the minimum data required for analysis is available.

Process:

  • Request a preliminary analysis from the AI using the image and conversation data.
  • Obtain outputs such as “comprehensive emotional index,” “confidence score,” “rating reason,” and “suggestions for supplementary input.”
  • If the confidence score falls below a certain threshold (e.g., 70 points), the system prompts the user to provide additional data.

Node 4: Image Analysis (analyze_image)

Purpose: Analyze each uploaded image using Google Gemini AI and quantify indicators related to relationships and emotions.

Process:

  • For each image, quantify indicators such as “proximity,” “eye contact,” “facial expressions,” and “physical touch.”
  • Store the analysis results in a list for use in report generation.

Node 5: Conversation Analysis (analyze_conversation)

Purpose: Analyze the conversation history to quantify emotional tendencies and relationship quality.

Process:

  • Calculate indicators such as “positive sentiment ratio,” “negative sentiment ratio,” “conversational initiative,” “value alignment score,” “relationship warmth,” and “toxicity probability.”
  • Use the extracted data for the subsequent report generation.

Node 6: Generate Comprehensive Report (generate_report)

Purpose: Integrate the results of image and conversation analysis and create a final relationship evaluation report with the help of AI.

Process:

  • Average the indicators from images and conversations to calculate a comprehensive score.
  • Create graphs to visually present the results.
  • Request the Google Gemini AI to generate a comprehensive evaluation and improvement suggestions.
  • Output a detailed and easy-to-understand report.

Node 7: Guidance for Additional Information (guidance)

Purpose: Display the generated report and ask whether the user would like to improve the analysis by adding more information.

Process:

  • If the user requests additional input, proceed to Node 8.
  • If not, proceed to Node 9 for final report saving.

Node 8: Refine Analysis (refine_analysis)

Purpose: Integrate newly provided data (new images or conversations) into the existing data and perform a more detailed analysis.

Process:

  • Merge newly added data with the existing data.
  • Conduct a re-analysis with greater emphasis on the new information.
  • Generate a more accurate and detailed final report.

Node 9: Save Report (save_report)

Purpose: Save the final analysis report locally in JSON format with a timestamp.

Process:

  • Determine the filename using the current date and time.
  • Save the analysis report in JSON format for future reference and use.

7. Defining Workflow Branching Functions

Branching functions control the workflow based on the reliability score, determining whether to request additional data or proceed with the analysis.

8. Building the State Graph

Each process is registered as a node, and conditional branching is used to control the workflow sequence.

9. Visualizing and Running the Graph

The entire workflow is visualized using Mermaid, enhancing the transparency of the analysis process. The graph is then executed to generate the final analysis report.

Through this project, I demonstrated how Generative AI technology can be effectively applied to perform deep relationship analysis.

===== Composite Analysis Report =====

Overall Emotional Rating

Your overall relationship rating is 38 out of 100.

Summary of Key Observations

Key observations:

  • Emotional Disconnect: The image shows physical proximity but a lack of eye contact and serious expressions, indicating emotional distance.
  • Unmet Expectations: Emily expresses disappointment over broken promises and feeling unimportant.
  • Defensiveness and Blame: Alex becomes defensive and blames Emily, escalating the conflict.
  • Communication Breakdown: The conversation reveals a pattern of Alex not listening and Emily feeling unheard.
  • Relationship Strain: The couple is considering a break due to exhaustion and feeling unappreciated.

Detailed Analysis & Recommendations

Current Relationship Status

The relationship is currently strained and facing significant challenges.
The image analysis suggests a lack of emotional connection despite physical closeness.
The conversation analysis reveals a pattern of unmet expectations, defensiveness, and poor communication, leading to feelings of resentment and exhaustion.

Strengths

  • Expressed Desire to Reconcile: Both Alex and Emily express a desire to improve the relationship, with Alex promising to try harder and Emily hoping to believe him.
  • Acknowledgement of Importance: Alex states that Emily is important to him, indicating underlying affection.

Issues

  • Broken Promises and Unmet Expectations: Alex’s inability to keep promises leads to Emily feeling unimportant and devalued.
  • Defensive Communication: Alex’s defensiveness and blame-shifting escalate conflicts and prevent resolution.
  • Lack of Active Listening: Emily feels unheard and believes Alex doesn’t listen to her concerns.
  • Emotional Distance: The lack of eye contact and serious expressions suggest an emotional disconnect between the partners.
  • Escalating Conflict: The conversation reveals a pattern of escalating arguments and unresolved issues.

Recommendations

  • Improve Communication Skills: Both partners should focus on active listening, empathy, and expressing their needs and feelings in a non-blaming way. Consider couples therapy to learn effective communication techniques.
  • Rebuild Trust: Alex needs to consistently follow through on his promises and commitments to rebuild Emily’s trust. Small, consistent actions can make a big difference.
  • Prioritize Quality Time: Schedule dedicated time for the couple to connect emotionally and engage in activities they both enjoy. This can help rebuild intimacy and strengthen their bond.
  • Address Underlying Issues: Explore the root causes of their communication problems and unmet expectations. Therapy can provide a safe space to address these issues and develop healthier coping mechanisms.
  • Practice Empathy: Both partners should try to understand each other’s perspectives and validate their feelings. This can help reduce defensiveness and promote a more supportive dynamic.
  • Seek Professional Help: If the issues persist despite their efforts, consider seeking professional help from a couples therapist. A therapist can provide guidance and support in navigating their challenges and improving their relationship.

Additional Notes for Readers: FAQs and Project Insights

Q1: What problem does this project aim to solve?

This project was designed to help couples or married partners analyze and improve their communication and relationship dynamics using AI technology.

For example:

  • “Lately, conversations with my partner don’t seem to go well.”
  • “I feel that the relationship captured in our photos has cooled down.”

For people with such vague concerns, this AI provides objective analysis and suggests concrete first steps for improvement.

Q2: How is AI technology used to solve this problem?

In this project, I used Google’s cutting-edge Generative AI (Gemini) to conduct two types of analysis:

  • Image Analysis: The AI analyzes couples’ photos and quantifies indicators such as “physical proximity,” “eye contact,” “facial expressions,” and “physical touch.”
  • Conversation Analysis: The AI evaluates conversation histories to calculate indicators like “positive/negative sentiment ratios,” “conversational dominance,” “value alignment,” and “relationship warmth.”

These analyses are integrated, and the AI provides a relationship evaluation and practical advice in report format.

Example codes for loading images and obtaining AI analysis results are also included in the article.

Q3: What are the challenges and limitations of the AI technology used in this project?

The limitations include:

  • If the data (photos or conversations) provided is insufficient or of poor quality, the accuracy of the evaluation decreases.
  • Human emotions and relationships are highly complex and nuanced, making complete understanding and evaluation by AI difficult.
  • The AI’s analysis results should be seen as references, and human judgment or professional support may still be necessary.

Q4: How do you plan to further develop and apply this project?

I plan to develop this project into a smartphone application that anyone can easily use.

Future goals include:

  • Allowing individuals to easily analyze and improve their relationships at home.
  • Providing counselors and therapists with a supplementary tool to support couples.

As technology advances, I hope that AI-driven relationship analysis will become even more accurate and profound.

ABOUT ME
Nagi
Nagi
アプリ開発フリーランス
現在海外在住。AIとアプリ開発、自由な働き方に関する最新情報を皆様にお届けすべく、日々挑戦中です。 趣味はアプリ制作、読書、カフェ巡り。副業・フリーランス生活についても発信中!
記事URLをコピーしました