

Project 1: Real-Time Fraud Detection API
Overview:
Developed an end-to-end, real-time fraud detection system, deployed as a serverless API on AWS, with a strong focus on maintaining zero operational costs within the AWS Free Tier. This project showcases proficiency in machine learning, robust API development, scalable cloud deployment, and meticulous cost optimization for production-ready AI solutions.
Project Description
Developed a robust Real-Time Fraud Detection API by training an XGBoost model, incorporating preprocessing and basic hyperparameter optimization for better accuracy. The core solution features a performant FastAPI prediction endpoint, containerized with Docker for deployment as a serverless function to AWS Lambda via Amazon API Gateway using AWS Serverless Application Model (SAM). This project meticulously adheres to a zero-cost operational limitations, leveraging AWS Free Tier limits and implementing strict cost monitoring. An interactive Streamlit application, now deployed on Streamlit Community Cloud (after initial EC2 learning), provides a live demonstration and incorporates SHAP for crucial model explainability, offering insights into each prediction.
Problem Statement
In an increasingly digital economy, the rapid and accurate identification of fraudulent transactions is paramount. The persistent threat of financial fraud demands robust and proactive countermeasures, yet existing detection systems frequently face limitations in processing high volumes of real-time data or adapting to new and emerging fraud patterns. This creates a critical gap, necessitating the development of advanced, scalable, and intelligent real-time analytical systems to mitigate financial risks effectively and provide comprehensive identification of evolving fraud schemes.

Methodologies & Project Workflow
Level 1: Core ML Model Development
Objective: Establish a fundamental fraud detection model capable of baseline performance.
Key Methodologies & Steps:
Data Preprocessing: Focused on cleaning and preparing the sampled transactional data.
Feature Selection: Identified and removed irrelevant or leakage-prone columns like
nameOrig,nameDest, andisFlaggedFraud.Categorical Encoding: Applied one-hot encoding to categorical features (e.g., 'type') for model compatibility.
Data Split: Separated features (X) and target (y), then performed stratified train-test splitting to maintain class distribution.
Class Imbalance Handling: Utilized SMOTE on the training set only to synthesize minority (fraud) class examples, addressing severe data imbalance.
Baseline Model Training: Trained an XGBoost classifier on the resampled training data.
Model Evaluation: Assessed the baseline model's performance on the original, imbalanced test set, with a focus on Recall for the fraud class using a confusion matrix and classification report.
Level 2: Refined Model with Hyperparameter Tuning & Pipelines
Objective: Enhance the fraud detection model's performance, particularly Recall, through structured feature engineering and automated hyperparameter tuning.
Key Methodologies & Steps:
Feature Engineering: Developed new features (e.g.,
balance_diff_orig,balance_diff_dest,flow) to provide richer context for the model.Scikit-learn Pipelines: Structured the preprocessing and model training into robust pipelines for streamlined workflow and reproducibility.
Hyperparameter Tuning: Employed RandomizedSearchCV from scikit-learn to efficiently search for optimal hyperparameters for the XGBoost model within the pipeline. (Note:
RandomizedSearchCVwas used instead of Ray due to implementation constraints).Refined Model Evaluation: Re-evaluated the pipeline's performance on the test set, comparing metrics against the Level 1 baseline.
Level 3: Real-Time API Deployment (AWS Lambda & API Gateway)
Objective: Expose the trained fraud detection model as a secure, scalable, and zero-cost API endpoint accessible over the internet.
Key Methodologies & Steps:
FastAPI Development: Built a high-performance Python API for real-time predictions.
Containerization with Docker: Packaged the FastAPI application into a Docker image for consistent deployment.
Serverless Deployment (AWS SAM): Utilized AWS Serverless Application Model (SAM) CLI to define and deploy the serverless infrastructure (Lambda function and API Gateway endpoint).
Model Loading from S3: Implemented a strategy to load the
best_fraud_pipeline.joblibmodel from Amazon S3 into Lambda to overcome deployment package size limits.Manual ECR Push: Addressed SAM CLI's Docker image build/push issues by manually building and pushing the Docker image to Amazon ECR before SAM deployment, gaining granular control.
API Testing: Thoroughly tested the live API endpoint to ensure functionality and debug deployment issues via CloudWatch logs.
Zero-Cost Adherence: Ensured strict adherence to AWS Free Tier limits using AWS Budgets and Cost Explorer for monitoring.
Level 4: Interactive Demo UI & Deployment
Objective: Provide an intuitive, interactive web application to demonstrate the API's functionality and model explainability, accessible globally.
Key Methodologies & Steps:
Streamlit Application Development: Created a user-friendly Streamlit web application for real-time interaction.
Temporary EC2 Demo: Deployed a full version of the Streamlit app (including local SHAP explainability) to a temporary AWS EC2
t2.microinstance for testing full-stack VM deployment and ensuring immediate termination for cost control.Permanent Streamlit Community Cloud Deployment: Refactored a lighter version of the Streamlit app (without local SHAP, calling the live API) for free, permanent hosting on Streamlit Community Cloud.
SHAP Explainability Integration: Incorporated SHAP (SHapley Additive exPlanations) to provide crucial model interpretability, offering insights into individual predictions.
GitHub Integration: Managed code versioning and deployment triggers via GitHub, connecting with Streamlit Community Cloud for continuous deployment.
Comprehensive README: Updated the project's
README.mdwith detailed project descriptions, architecture, and a prominent link to the live demo.
Key Results & Model Performance
Key Features & Technical Details
Machine Learning Core: Implemented a highly accurate fraud detection model utilizing XGBoost as the core algorithm. The model underwent extensive local development and hyperparameter tuning (e.g., using Ray Tune). Crucially, SHAP (SHapley Additive exPlanations) was integrated for local model explainability, providing vital insights into feature contributions for each prediction, enhancing trust and auditability.
Robust API Development: Built a high-performance, real-time prediction API using FastAPI, a modern Python framework. This API is designed to efficiently receive transaction features, process them through the trained ML pipeline, and return fraud predictions with low latency.
Serverless Cloud Deployment: The API was deployed as a serverless function on AWS Lambda, exposed securely via Amazon API Gateway as an HTTP endpoint. AWS Serverless Application Model (SAM) was extensively used for defining, building, and deploying the infrastructure as code (IaC), ensuring scalability and maintainability. A strict, non-negotiable adherence to
AWS Free Tier limits was maintained to incur absolutely zero ($0.00) cost.
Interactive Demo & User Interface: Developed an interactive web application using Streamlit to provide a user-friendly interface for demonstrating the API's real-time fraud detection capabilities. The demo was initially hosted temporarily on
Amazon EC2 for learning and testing purposes, with a permanent, cost-free solution deployed to Streamlit Community Cloud for ongoing portfolio showcase.
Strict Cost Management: A core mandate for this project was to achieve and maintain zero ($0.00) operational cost. This was accomplished through rigorous selection of AWS Free Tier services (Lambda, API Gateway, S3, IAM, CloudFormation, SAM CLI) and vigilant monitoring. Mandatory
AWS Budgets were configured with zero-spend alerts, and daily usage was monitored via AWS Cost Explorer to prevent any accidental charges.
Technical Stack
Machine Learning: Python, XGBoost, scikit-learn, Ray Tune, SHAP, Pandas, NumPy
API: FastAPI, Uvicorn, Mangum
Cloud & Serverless: AWS Lambda, Amazon API Gateway, AWS SAM CLI, Docker, Amazon ECR, AWS IAM, AWS CloudFormation, AWS Budgets, AWS Cost Explorer, AWS IAM
UI/Demo: Streamlit, Streamlit Community Cloud, Amazon EC2
Version Control: Git, GitHub
Challenges & Solutions
Throughout the project, several significant challenges were encountered and overcome, leading to a deeper understanding of MLOps and cloud deployment practices.
Challenge: Overcoming AWS Lambda's Deployment Package Size Limit
The Problem: Initial attempts to deploy the FastAPI application failed because the total size of the deployment package—which included all code, dependencies, and the
best_fraud_pipeline.joblibmodel file—exceeded AWS Lambda's 250 MB unzipped size limit. The deployment would result in an "Internal Server Error" andCREATE_FAILEDstatus in CloudWatch logs.The Solution: The strategy was pivoted to separate the model artifact from the code. The large
.joblibmodel file was uploaded to Amazon S3. The Lambda function's code was then modified to use theboto3library to download and load the model directly from S3 at runtime, which kept the deployment package size within the acceptable limits.
Challenge: Unexpected Issues with AWS SAM's Automated Image Deployment
The Problem: The AWS Serverless Application Model (SAM) CLI's internal logic for automatically building, pushing, and deploying a Docker image to Amazon ECR failed. The
sam deploy --guidedcommand would report "No images found to deploy," even though the Docker image was built locally. This bug prevented a streamlined, single-command deployment.The Solution: An alternative, more robust, and manual approach was adopted. The Docker image was manually built and tagged locally using
docker buildanddocker tag, then manually pushed to the ECR repository usingdocker push. Thetemplate.yamlfile was updated to explicitly reference the image's URI in ECR, and thesam deploycommand was run without the--guidedflag, effectively bypassing the buggy part of the SAM CLI. This approach gave more control and ensured a successful deployment.
Challenge: Managing Costs and Ensuring Zero-Cost Operation
The Problem: A core mandate for the project was to incur absolutely zero cost by strictly adhering to the AWS Free Tier. Using services like Amazon EC2 for the full Streamlit demo posed a high risk of accidental charges if instances were not terminated promptly.
The Solution: A two-part strategy was implemented. First, AWS Budgets were set up with mandatory alerts for any spend over $0.01 to act as a safety net. Second, for the long-term demo, the Streamlit app was refactored and deployed to Streamlit Community Cloud, which provides a permanent, free hosting solution that doesn't rely on AWS Free Tier limits. The EC2 instance was used only as a temporary learning step and was always terminated immediately after use to avoid costs.
Challenge: Correctly Installing Python Packages on the EC2 Instance
The Problem: When deploying the Streamlit demo to an EC2 instance, the
pip installcommand failed with "ERROR: Could not find a version that satisfies the requirement...". This was caused by a mismatch between the package versions in the local Python 3.11 development environment and the EC2 instance's default Python 3.9 environment.The Solution: The solution was to explicitly install Python 3.11 on the EC2 instance and create a virtual environment with it, ensuring the Python version on the deployment target matched the development environment. This allowed the project's exact package versions to be installed successfully.




Future Enhancements & Improvements
Pipeline Automation: Implement a full CI/CD pipeline using GitHub Actions (GHA) to automatically train the model and deploy the API whenever new code is pushed to the repository. This would automate the entire MLOps lifecycle.
Database Integration: Replace the simple API with a more robust system that interacts with a database (Amazon RDS or DynamoDB) to log all prediction requests and their outcomes. This would enable data versioning and ongoing model monitoring.
Advanced Model Monitoring: Implement a monitoring solution to track model performance drift in a production environment. This would involve comparing the model's predictions over time against actual outcomes to identify when the model needs to be retrained.
Extended Feature Set: Expand the project to handle additional data types, such as location data, device information, or historical user spending patterns, to create a more comprehensive fraud detection model.
Cost & Performance Optimization: Fine-tune the Lambda function's memory and CPU allocation for better performance, and explore using a single endpoint for both model inference and explainability to reduce latency and resource usage.
Refactor for Explainable AI (XAI) on Streamlit Cloud: Implement a solution to run SHAP on the Streamlit Community Cloud without exceeding free tier limitations, perhaps by sending a request to the API with an
explainflag or by using a less resource-intensive explainability method.
More Works
(GQ® — 02)
©2024
More Works
(GQ® — 02)
©2024

Project 2: Automated MLOps CI/CD Pipeline
2025 - Completed
MLOps
CI/CD
Docker
Spark
Serverless Deployment
AWS Cloud

Project 2: Automated MLOps CI/CD Pipeline
2025 - Completed
MLOps
CI/CD
Docker
Spark
Serverless Deployment
AWS Cloud

Project 3: QA Bot with Multi-turn RAG for e-Commerce
2025 - Completed
RAG
Multilingual
FastAPI
Gemini API
Hugging Face
Pinecone

Project 3: QA Bot with Multi-turn RAG for e-Commerce
2025 - Completed
RAG
Multilingual
FastAPI
Gemini API
Hugging Face
Pinecone

Mini 1: OCR Text Extractor with GCP Vision API & Streamlit
2025 - Completed
GCP Vision API
Streamlit
OCR
Data Extraction
Cloud

Mini 1: OCR Text Extractor with GCP Vision API & Streamlit
2025 - Completed
GCP Vision API
Streamlit
OCR
Data Extraction
Cloud

Mini 2: Serverless ETL Pipeline on GCP for CSV Automated Processing to BigQuery
2025 - Completed
Data Engineering
ETL
Serverless
GCP
BigQuery
Cloud Functions

Mini 2: Serverless ETL Pipeline on GCP for CSV Automated Processing to BigQuery
2025 - Completed
Data Engineering
ETL
Serverless
GCP
BigQuery
Cloud Functions

Mini 3: Sentiment Analysis API
2025 - Completed
NLP
Sentiment Analysis
Hugging Face
Transformer
RoBERTa
Streamlit

Mini 3: Sentiment Analysis API
2025 - Completed
NLP
Sentiment Analysis
Hugging Face
Transformer
RoBERTa
Streamlit


Project 1: Real-Time Fraud Detection API
Overview:
Developed an end-to-end, real-time fraud detection system, deployed as a serverless API on AWS, with a strong focus on maintaining zero operational costs within the AWS Free Tier. This project showcases proficiency in machine learning, robust API development, scalable cloud deployment, and meticulous cost optimization for production-ready AI solutions.
Project Description
Developed a robust Real-Time Fraud Detection API by training an XGBoost model, incorporating preprocessing and basic hyperparameter optimization for better accuracy. The core solution features a performant FastAPI prediction endpoint, containerized with Docker for deployment as a serverless function to AWS Lambda via Amazon API Gateway using AWS Serverless Application Model (SAM). This project meticulously adheres to a zero-cost operational limitations, leveraging AWS Free Tier limits and implementing strict cost monitoring. An interactive Streamlit application, now deployed on Streamlit Community Cloud (after initial EC2 learning), provides a live demonstration and incorporates SHAP for crucial model explainability, offering insights into each prediction.
Problem Statement
In an increasingly digital economy, the rapid and accurate identification of fraudulent transactions is paramount. The persistent threat of financial fraud demands robust and proactive countermeasures, yet existing detection systems frequently face limitations in processing high volumes of real-time data or adapting to new and emerging fraud patterns. This creates a critical gap, necessitating the development of advanced, scalable, and intelligent real-time analytical systems to mitigate financial risks effectively and provide comprehensive identification of evolving fraud schemes.

Methodologies & Project Workflow
Level 1: Core ML Model Development
Objective: Establish a fundamental fraud detection model capable of baseline performance.
Key Methodologies & Steps:
Data Preprocessing: Focused on cleaning and preparing the sampled transactional data.
Feature Selection: Identified and removed irrelevant or leakage-prone columns like
nameOrig,nameDest, andisFlaggedFraud.Categorical Encoding: Applied one-hot encoding to categorical features (e.g., 'type') for model compatibility.
Data Split: Separated features (X) and target (y), then performed stratified train-test splitting to maintain class distribution.
Class Imbalance Handling: Utilized SMOTE on the training set only to synthesize minority (fraud) class examples, addressing severe data imbalance.
Baseline Model Training: Trained an XGBoost classifier on the resampled training data.
Model Evaluation: Assessed the baseline model's performance on the original, imbalanced test set, with a focus on Recall for the fraud class using a confusion matrix and classification report.
Level 2: Refined Model with Hyperparameter Tuning & Pipelines
Objective: Enhance the fraud detection model's performance, particularly Recall, through structured feature engineering and automated hyperparameter tuning.
Key Methodologies & Steps:
Feature Engineering: Developed new features (e.g.,
balance_diff_orig,balance_diff_dest,flow) to provide richer context for the model.Scikit-learn Pipelines: Structured the preprocessing and model training into robust pipelines for streamlined workflow and reproducibility.
Hyperparameter Tuning: Employed RandomizedSearchCV from scikit-learn to efficiently search for optimal hyperparameters for the XGBoost model within the pipeline. (Note:
RandomizedSearchCVwas used instead of Ray due to implementation constraints).Refined Model Evaluation: Re-evaluated the pipeline's performance on the test set, comparing metrics against the Level 1 baseline.
Level 3: Real-Time API Deployment (AWS Lambda & API Gateway)
Objective: Expose the trained fraud detection model as a secure, scalable, and zero-cost API endpoint accessible over the internet.
Key Methodologies & Steps:
FastAPI Development: Built a high-performance Python API for real-time predictions.
Containerization with Docker: Packaged the FastAPI application into a Docker image for consistent deployment.
Serverless Deployment (AWS SAM): Utilized AWS Serverless Application Model (SAM) CLI to define and deploy the serverless infrastructure (Lambda function and API Gateway endpoint).
Model Loading from S3: Implemented a strategy to load the
best_fraud_pipeline.joblibmodel from Amazon S3 into Lambda to overcome deployment package size limits.Manual ECR Push: Addressed SAM CLI's Docker image build/push issues by manually building and pushing the Docker image to Amazon ECR before SAM deployment, gaining granular control.
API Testing: Thoroughly tested the live API endpoint to ensure functionality and debug deployment issues via CloudWatch logs.
Zero-Cost Adherence: Ensured strict adherence to AWS Free Tier limits using AWS Budgets and Cost Explorer for monitoring.
Level 4: Interactive Demo UI & Deployment
Objective: Provide an intuitive, interactive web application to demonstrate the API's functionality and model explainability, accessible globally.
Key Methodologies & Steps:
Streamlit Application Development: Created a user-friendly Streamlit web application for real-time interaction.
Temporary EC2 Demo: Deployed a full version of the Streamlit app (including local SHAP explainability) to a temporary AWS EC2
t2.microinstance for testing full-stack VM deployment and ensuring immediate termination for cost control.Permanent Streamlit Community Cloud Deployment: Refactored a lighter version of the Streamlit app (without local SHAP, calling the live API) for free, permanent hosting on Streamlit Community Cloud.
SHAP Explainability Integration: Incorporated SHAP (SHapley Additive exPlanations) to provide crucial model interpretability, offering insights into individual predictions.
GitHub Integration: Managed code versioning and deployment triggers via GitHub, connecting with Streamlit Community Cloud for continuous deployment.
Comprehensive README: Updated the project's
README.mdwith detailed project descriptions, architecture, and a prominent link to the live demo.
Key Results & Model Performance
Key Features & Technical Details
Machine Learning Core: Implemented a highly accurate fraud detection model utilizing XGBoost as the core algorithm. The model underwent extensive local development and hyperparameter tuning (e.g., using Ray Tune). Crucially, SHAP (SHapley Additive exPlanations) was integrated for local model explainability, providing vital insights into feature contributions for each prediction, enhancing trust and auditability.
Robust API Development: Built a high-performance, real-time prediction API using FastAPI, a modern Python framework. This API is designed to efficiently receive transaction features, process them through the trained ML pipeline, and return fraud predictions with low latency.
Serverless Cloud Deployment: The API was deployed as a serverless function on AWS Lambda, exposed securely via Amazon API Gateway as an HTTP endpoint. AWS Serverless Application Model (SAM) was extensively used for defining, building, and deploying the infrastructure as code (IaC), ensuring scalability and maintainability. A strict, non-negotiable adherence to
AWS Free Tier limits was maintained to incur absolutely zero ($0.00) cost.
Interactive Demo & User Interface: Developed an interactive web application using Streamlit to provide a user-friendly interface for demonstrating the API's real-time fraud detection capabilities. The demo was initially hosted temporarily on
Amazon EC2 for learning and testing purposes, with a permanent, cost-free solution deployed to Streamlit Community Cloud for ongoing portfolio showcase.
Strict Cost Management: A core mandate for this project was to achieve and maintain zero ($0.00) operational cost. This was accomplished through rigorous selection of AWS Free Tier services (Lambda, API Gateway, S3, IAM, CloudFormation, SAM CLI) and vigilant monitoring. Mandatory
AWS Budgets were configured with zero-spend alerts, and daily usage was monitored via AWS Cost Explorer to prevent any accidental charges.
Technical Stack
Machine Learning: Python, XGBoost, scikit-learn, Ray Tune, SHAP, Pandas, NumPy
API: FastAPI, Uvicorn, Mangum
Cloud & Serverless: AWS Lambda, Amazon API Gateway, AWS SAM CLI, Docker, Amazon ECR, AWS IAM, AWS CloudFormation, AWS Budgets, AWS Cost Explorer, AWS IAM
UI/Demo: Streamlit, Streamlit Community Cloud, Amazon EC2
Version Control: Git, GitHub
Challenges & Solutions
Throughout the project, several significant challenges were encountered and overcome, leading to a deeper understanding of MLOps and cloud deployment practices.
Challenge: Overcoming AWS Lambda's Deployment Package Size Limit
The Problem: Initial attempts to deploy the FastAPI application failed because the total size of the deployment package—which included all code, dependencies, and the
best_fraud_pipeline.joblibmodel file—exceeded AWS Lambda's 250 MB unzipped size limit. The deployment would result in an "Internal Server Error" andCREATE_FAILEDstatus in CloudWatch logs.The Solution: The strategy was pivoted to separate the model artifact from the code. The large
.joblibmodel file was uploaded to Amazon S3. The Lambda function's code was then modified to use theboto3library to download and load the model directly from S3 at runtime, which kept the deployment package size within the acceptable limits.
Challenge: Unexpected Issues with AWS SAM's Automated Image Deployment
The Problem: The AWS Serverless Application Model (SAM) CLI's internal logic for automatically building, pushing, and deploying a Docker image to Amazon ECR failed. The
sam deploy --guidedcommand would report "No images found to deploy," even though the Docker image was built locally. This bug prevented a streamlined, single-command deployment.The Solution: An alternative, more robust, and manual approach was adopted. The Docker image was manually built and tagged locally using
docker buildanddocker tag, then manually pushed to the ECR repository usingdocker push. Thetemplate.yamlfile was updated to explicitly reference the image's URI in ECR, and thesam deploycommand was run without the--guidedflag, effectively bypassing the buggy part of the SAM CLI. This approach gave more control and ensured a successful deployment.
Challenge: Managing Costs and Ensuring Zero-Cost Operation
The Problem: A core mandate for the project was to incur absolutely zero cost by strictly adhering to the AWS Free Tier. Using services like Amazon EC2 for the full Streamlit demo posed a high risk of accidental charges if instances were not terminated promptly.
The Solution: A two-part strategy was implemented. First, AWS Budgets were set up with mandatory alerts for any spend over $0.01 to act as a safety net. Second, for the long-term demo, the Streamlit app was refactored and deployed to Streamlit Community Cloud, which provides a permanent, free hosting solution that doesn't rely on AWS Free Tier limits. The EC2 instance was used only as a temporary learning step and was always terminated immediately after use to avoid costs.
Challenge: Correctly Installing Python Packages on the EC2 Instance
The Problem: When deploying the Streamlit demo to an EC2 instance, the
pip installcommand failed with "ERROR: Could not find a version that satisfies the requirement...". This was caused by a mismatch between the package versions in the local Python 3.11 development environment and the EC2 instance's default Python 3.9 environment.The Solution: The solution was to explicitly install Python 3.11 on the EC2 instance and create a virtual environment with it, ensuring the Python version on the deployment target matched the development environment. This allowed the project's exact package versions to be installed successfully.




Future Enhancements & Improvements
Pipeline Automation: Implement a full CI/CD pipeline using GitHub Actions (GHA) to automatically train the model and deploy the API whenever new code is pushed to the repository. This would automate the entire MLOps lifecycle.
Database Integration: Replace the simple API with a more robust system that interacts with a database (Amazon RDS or DynamoDB) to log all prediction requests and their outcomes. This would enable data versioning and ongoing model monitoring.
Advanced Model Monitoring: Implement a monitoring solution to track model performance drift in a production environment. This would involve comparing the model's predictions over time against actual outcomes to identify when the model needs to be retrained.
Extended Feature Set: Expand the project to handle additional data types, such as location data, device information, or historical user spending patterns, to create a more comprehensive fraud detection model.
Cost & Performance Optimization: Fine-tune the Lambda function's memory and CPU allocation for better performance, and explore using a single endpoint for both model inference and explainability to reduce latency and resource usage.
Refactor for Explainable AI (XAI) on Streamlit Cloud: Implement a solution to run SHAP on the Streamlit Community Cloud without exceeding free tier limitations, perhaps by sending a request to the API with an
explainflag or by using a less resource-intensive explainability method.
More Works
(GQ® — 02)
©2024

Project 2: Automated MLOps CI/CD Pipeline
2025 - Completed
MLOps
CI/CD
Docker
Spark
Serverless Deployment
AWS Cloud

Project 3: QA Bot with Multi-turn RAG for e-Commerce
2025 - Completed
RAG
Multilingual
FastAPI
Gemini API
Hugging Face
Pinecone

Mini 1: OCR Text Extractor with GCP Vision API & Streamlit
2025 - Completed
GCP Vision API
Streamlit
OCR
Data Extraction
Cloud

Mini 2: Serverless ETL Pipeline on GCP for CSV Automated Processing to BigQuery
2025 - Completed
Data Engineering
ETL
Serverless
GCP
BigQuery
Cloud Functions

Mini 3: Sentiment Analysis API
2025 - Completed
NLP
Sentiment Analysis
Hugging Face
Transformer
RoBERTa
Streamlit


Project 1: Real-Time Fraud Detection API
Overview:
Developed an end-to-end, real-time fraud detection system, deployed as a serverless API on AWS, with a strong focus on maintaining zero operational costs within the AWS Free Tier. This project showcases proficiency in machine learning, robust API development, scalable cloud deployment, and meticulous cost optimization for production-ready AI solutions.
Project Description
Developed a robust Real-Time Fraud Detection API by training an XGBoost model, incorporating preprocessing and basic hyperparameter optimization for better accuracy. The core solution features a performant FastAPI prediction endpoint, containerized with Docker for deployment as a serverless function to AWS Lambda via Amazon API Gateway using AWS Serverless Application Model (SAM). This project meticulously adheres to a zero-cost operational limitations, leveraging AWS Free Tier limits and implementing strict cost monitoring. An interactive Streamlit application, now deployed on Streamlit Community Cloud (after initial EC2 learning), provides a live demonstration and incorporates SHAP for crucial model explainability, offering insights into each prediction.
Problem Statement
In an increasingly digital economy, the rapid and accurate identification of fraudulent transactions is paramount. The persistent threat of financial fraud demands robust and proactive countermeasures, yet existing detection systems frequently face limitations in processing high volumes of real-time data or adapting to new and emerging fraud patterns. This creates a critical gap, necessitating the development of advanced, scalable, and intelligent real-time analytical systems to mitigate financial risks effectively and provide comprehensive identification of evolving fraud schemes.

Methodologies & Project Workflow
Level 1: Core ML Model Development
Objective: Establish a fundamental fraud detection model capable of baseline performance.
Key Methodologies & Steps:
Data Preprocessing: Focused on cleaning and preparing the sampled transactional data.
Feature Selection: Identified and removed irrelevant or leakage-prone columns like
nameOrig,nameDest, andisFlaggedFraud.Categorical Encoding: Applied one-hot encoding to categorical features (e.g., 'type') for model compatibility.
Data Split: Separated features (X) and target (y), then performed stratified train-test splitting to maintain class distribution.
Class Imbalance Handling: Utilized SMOTE on the training set only to synthesize minority (fraud) class examples, addressing severe data imbalance.
Baseline Model Training: Trained an XGBoost classifier on the resampled training data.
Model Evaluation: Assessed the baseline model's performance on the original, imbalanced test set, with a focus on Recall for the fraud class using a confusion matrix and classification report.
Level 2: Refined Model with Hyperparameter Tuning & Pipelines
Objective: Enhance the fraud detection model's performance, particularly Recall, through structured feature engineering and automated hyperparameter tuning.
Key Methodologies & Steps:
Feature Engineering: Developed new features (e.g.,
balance_diff_orig,balance_diff_dest,flow) to provide richer context for the model.Scikit-learn Pipelines: Structured the preprocessing and model training into robust pipelines for streamlined workflow and reproducibility.
Hyperparameter Tuning: Employed RandomizedSearchCV from scikit-learn to efficiently search for optimal hyperparameters for the XGBoost model within the pipeline. (Note:
RandomizedSearchCVwas used instead of Ray due to implementation constraints).Refined Model Evaluation: Re-evaluated the pipeline's performance on the test set, comparing metrics against the Level 1 baseline.
Level 3: Real-Time API Deployment (AWS Lambda & API Gateway)
Objective: Expose the trained fraud detection model as a secure, scalable, and zero-cost API endpoint accessible over the internet.
Key Methodologies & Steps:
FastAPI Development: Built a high-performance Python API for real-time predictions.
Containerization with Docker: Packaged the FastAPI application into a Docker image for consistent deployment.
Serverless Deployment (AWS SAM): Utilized AWS Serverless Application Model (SAM) CLI to define and deploy the serverless infrastructure (Lambda function and API Gateway endpoint).
Model Loading from S3: Implemented a strategy to load the
best_fraud_pipeline.joblibmodel from Amazon S3 into Lambda to overcome deployment package size limits.Manual ECR Push: Addressed SAM CLI's Docker image build/push issues by manually building and pushing the Docker image to Amazon ECR before SAM deployment, gaining granular control.
API Testing: Thoroughly tested the live API endpoint to ensure functionality and debug deployment issues via CloudWatch logs.
Zero-Cost Adherence: Ensured strict adherence to AWS Free Tier limits using AWS Budgets and Cost Explorer for monitoring.
Level 4: Interactive Demo UI & Deployment
Objective: Provide an intuitive, interactive web application to demonstrate the API's functionality and model explainability, accessible globally.
Key Methodologies & Steps:
Streamlit Application Development: Created a user-friendly Streamlit web application for real-time interaction.
Temporary EC2 Demo: Deployed a full version of the Streamlit app (including local SHAP explainability) to a temporary AWS EC2
t2.microinstance for testing full-stack VM deployment and ensuring immediate termination for cost control.Permanent Streamlit Community Cloud Deployment: Refactored a lighter version of the Streamlit app (without local SHAP, calling the live API) for free, permanent hosting on Streamlit Community Cloud.
SHAP Explainability Integration: Incorporated SHAP (SHapley Additive exPlanations) to provide crucial model interpretability, offering insights into individual predictions.
GitHub Integration: Managed code versioning and deployment triggers via GitHub, connecting with Streamlit Community Cloud for continuous deployment.
Comprehensive README: Updated the project's
README.mdwith detailed project descriptions, architecture, and a prominent link to the live demo.
Key Results & Model Performance
Key Features & Technical Details
Machine Learning Core: Implemented a highly accurate fraud detection model utilizing XGBoost as the core algorithm. The model underwent extensive local development and hyperparameter tuning (e.g., using Ray Tune). Crucially, SHAP (SHapley Additive exPlanations) was integrated for local model explainability, providing vital insights into feature contributions for each prediction, enhancing trust and auditability.
Robust API Development: Built a high-performance, real-time prediction API using FastAPI, a modern Python framework. This API is designed to efficiently receive transaction features, process them through the trained ML pipeline, and return fraud predictions with low latency.
Serverless Cloud Deployment: The API was deployed as a serverless function on AWS Lambda, exposed securely via Amazon API Gateway as an HTTP endpoint. AWS Serverless Application Model (SAM) was extensively used for defining, building, and deploying the infrastructure as code (IaC), ensuring scalability and maintainability. A strict, non-negotiable adherence to
AWS Free Tier limits was maintained to incur absolutely zero ($0.00) cost.
Interactive Demo & User Interface: Developed an interactive web application using Streamlit to provide a user-friendly interface for demonstrating the API's real-time fraud detection capabilities. The demo was initially hosted temporarily on
Amazon EC2 for learning and testing purposes, with a permanent, cost-free solution deployed to Streamlit Community Cloud for ongoing portfolio showcase.
Strict Cost Management: A core mandate for this project was to achieve and maintain zero ($0.00) operational cost. This was accomplished through rigorous selection of AWS Free Tier services (Lambda, API Gateway, S3, IAM, CloudFormation, SAM CLI) and vigilant monitoring. Mandatory
AWS Budgets were configured with zero-spend alerts, and daily usage was monitored via AWS Cost Explorer to prevent any accidental charges.
Technical Stack
Machine Learning: Python, XGBoost, scikit-learn, Ray Tune, SHAP, Pandas, NumPy
API: FastAPI, Uvicorn, Mangum
Cloud & Serverless: AWS Lambda, Amazon API Gateway, AWS SAM CLI, Docker, Amazon ECR, AWS IAM, AWS CloudFormation, AWS Budgets, AWS Cost Explorer, AWS IAM
UI/Demo: Streamlit, Streamlit Community Cloud, Amazon EC2
Version Control: Git, GitHub
Challenges & Solutions
Throughout the project, several significant challenges were encountered and overcome, leading to a deeper understanding of MLOps and cloud deployment practices.
Challenge: Overcoming AWS Lambda's Deployment Package Size Limit
The Problem: Initial attempts to deploy the FastAPI application failed because the total size of the deployment package—which included all code, dependencies, and the
best_fraud_pipeline.joblibmodel file—exceeded AWS Lambda's 250 MB unzipped size limit. The deployment would result in an "Internal Server Error" andCREATE_FAILEDstatus in CloudWatch logs.The Solution: The strategy was pivoted to separate the model artifact from the code. The large
.joblibmodel file was uploaded to Amazon S3. The Lambda function's code was then modified to use theboto3library to download and load the model directly from S3 at runtime, which kept the deployment package size within the acceptable limits.
Challenge: Unexpected Issues with AWS SAM's Automated Image Deployment
The Problem: The AWS Serverless Application Model (SAM) CLI's internal logic for automatically building, pushing, and deploying a Docker image to Amazon ECR failed. The
sam deploy --guidedcommand would report "No images found to deploy," even though the Docker image was built locally. This bug prevented a streamlined, single-command deployment.The Solution: An alternative, more robust, and manual approach was adopted. The Docker image was manually built and tagged locally using
docker buildanddocker tag, then manually pushed to the ECR repository usingdocker push. Thetemplate.yamlfile was updated to explicitly reference the image's URI in ECR, and thesam deploycommand was run without the--guidedflag, effectively bypassing the buggy part of the SAM CLI. This approach gave more control and ensured a successful deployment.
Challenge: Managing Costs and Ensuring Zero-Cost Operation
The Problem: A core mandate for the project was to incur absolutely zero cost by strictly adhering to the AWS Free Tier. Using services like Amazon EC2 for the full Streamlit demo posed a high risk of accidental charges if instances were not terminated promptly.
The Solution: A two-part strategy was implemented. First, AWS Budgets were set up with mandatory alerts for any spend over $0.01 to act as a safety net. Second, for the long-term demo, the Streamlit app was refactored and deployed to Streamlit Community Cloud, which provides a permanent, free hosting solution that doesn't rely on AWS Free Tier limits. The EC2 instance was used only as a temporary learning step and was always terminated immediately after use to avoid costs.
Challenge: Correctly Installing Python Packages on the EC2 Instance
The Problem: When deploying the Streamlit demo to an EC2 instance, the
pip installcommand failed with "ERROR: Could not find a version that satisfies the requirement...". This was caused by a mismatch between the package versions in the local Python 3.11 development environment and the EC2 instance's default Python 3.9 environment.The Solution: The solution was to explicitly install Python 3.11 on the EC2 instance and create a virtual environment with it, ensuring the Python version on the deployment target matched the development environment. This allowed the project's exact package versions to be installed successfully.




Future Enhancements & Improvements
Pipeline Automation: Implement a full CI/CD pipeline using GitHub Actions (GHA) to automatically train the model and deploy the API whenever new code is pushed to the repository. This would automate the entire MLOps lifecycle.
Database Integration: Replace the simple API with a more robust system that interacts with a database (Amazon RDS or DynamoDB) to log all prediction requests and their outcomes. This would enable data versioning and ongoing model monitoring.
Advanced Model Monitoring: Implement a monitoring solution to track model performance drift in a production environment. This would involve comparing the model's predictions over time against actual outcomes to identify when the model needs to be retrained.
Extended Feature Set: Expand the project to handle additional data types, such as location data, device information, or historical user spending patterns, to create a more comprehensive fraud detection model.
Cost & Performance Optimization: Fine-tune the Lambda function's memory and CPU allocation for better performance, and explore using a single endpoint for both model inference and explainability to reduce latency and resource usage.
Refactor for Explainable AI (XAI) on Streamlit Cloud: Implement a solution to run SHAP on the Streamlit Community Cloud without exceeding free tier limitations, perhaps by sending a request to the API with an
explainflag or by using a less resource-intensive explainability method.
More Works
©2024

Project 2: Automated MLOps CI/CD Pipeline
2025 - Completed
MLOps
CI/CD
Docker
Spark
Serverless Deployment
AWS Cloud

Project 3: QA Bot with Multi-turn RAG for e-Commerce
2025 - Completed
RAG
Multilingual
FastAPI
Gemini API
Hugging Face
Pinecone

Mini 1: OCR Text Extractor with GCP Vision API & Streamlit
2025 - Completed
GCP Vision API
Streamlit
OCR
Data Extraction
Cloud

Mini 2: Serverless ETL Pipeline on GCP for CSV Automated Processing to BigQuery
2025 - Completed
Data Engineering
ETL
Serverless
GCP
BigQuery
Cloud Functions

Mini 3: Sentiment Analysis API
2025 - Completed
NLP
Sentiment Analysis
Hugging Face
Transformer
RoBERTa
Streamlit