[go: up one dir, main page]

0% found this document useful (0 votes)
4 views16 pages

AI Application Lecture-3

The document discusses the applications of Artificial Intelligence (AI) in finance and transportation, highlighting its transformative effects such as enhanced security, fraud detection, and autonomous vehicles. Key technologies include machine learning algorithms for real-time analysis and predictive analytics for traffic management. The lecture emphasizes the operational tools already in use within these sectors and their potential benefits for safety, efficiency, and accessibility.

Uploaded by

dibakardutta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views16 pages

AI Application Lecture-3

The document discusses the applications of Artificial Intelligence (AI) in finance and transportation, highlighting its transformative effects such as enhanced security, fraud detection, and autonomous vehicles. Key technologies include machine learning algorithms for real-time analysis and predictive analytics for traffic management. The lecture emphasizes the operational tools already in use within these sectors and their potential benefits for safety, efficiency, and accessibility.

Uploaded by

dibakardutta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

AI Subfields and

Technologies

Dr. Dibakar Dutta


Department of Physics
Rammohan College
102/1, Raja Rammohan Sarani
Kolkata-700009

Special Lecture series on “AI for Everyone” delivered for UG


students of Geography, Rammohan College, Kolkata-700009.
Applications of Artificial Intelligence –
Part 2
 In this lecture, we explore how AI is
transforming:
• The Finance sector: enhancing security,
improving decision-making
• The Transportation sector: improving safety
and efficiency
AI in Finance – Overview
AI in finance supports:
• Real-time analysis of market trends
• Detection of fraudulent behavior
• Automated trading decisions
• Risk profiling and assessment
Real-time analysis
# Step 1: Import required libraries
import yfinance as yf
import pandas as pd
import matplotlib.pyplot as plt
# Step 2: Define the ticker symbol (e.g., Apple = 'AAPL', Reliance =
'RELIANCE.NS', NIFTY 50 = '^NSEI')
ticker_symbol = 'AAPL' # Change this to 'RELIANCE.NS' or '^NSEI' for Indian
market
# Step 3: Download real-time data (last 30 days, hourly interval)
data = yf.download(ticker_symbol, period="1mo", interval="1h")
# Step 4: Show first few rows
data.head()
# Step 5: Calculate moving averages
data['MA20'] = data['Close'].rolling(window=20).mean()
data['MA50'] = data['Close'].rolling(window=50).mean()
# Step 6: Plot
plt.figure(figsize=(14, 7))
plt.plot(data['Close'], label='Close Price', linewidth=2)
plt.plot(data['MA20'], label='20-period MA')
plt.plot(data['MA50'], label='50-period MA')
plt.title(f"{ticker_symbol} Market Trend with Moving Averages")
plt.xlabel("Date")
plt.ylabel("Price (USD)")
plt.legend()
plt.grid(True)
plt.show()
Real-time analysis (contd...)
Fraud Detection
• AI powered fraud detection systems analyze patterns,
user behaviour and network connec tions to identify
suspicious activities in real-time.
Key Technologies:
• Machine Learning Algorithms: Random Forest, XGBoost,
Neural Networks
• Anamolie Detection: Isolation Forest, One-Class
SVM(Support Vector Machine)
• Real-time Processing: Stream processing for instant alerts.
• Feature Engineering: Transaction velocity, location analysis,
spending patterns.
Example:
• Mastercard uses AI to analyze billions of transactions in real-
time for fraud detection
Fraud Detection Example(contd..)
# Fraud Detection Demo # Evaluate performance
import pandas as pd from sklearn.metrics import classification_report, confusion_matrix
import numpy as np
from sklearn.ensemble import IsolationForest print("Fraud Detection Results:")
from sklearn.preprocessing import StandardScaler print(classification_report(df['is_fraud'], df['predicted_fraud']))
import matplotlib.pyplot as plt
import seaborn as sns # Visualization
plt.figure(figsize=(12, 8))
# Generate synthetic transaction data
np.random.seed(42) plt.subplot(2, 2, 1)
n_samples = 1000 plt.scatter(df[df['is_fraud']==0]['amount'], df[df['is_fraud']==0]['hour'],
# Normal transactions alpha=0.6, label='Normal', c='blue')
normal_data = { plt.scatter(df[df['is_fraud']==1]['amount'], df[df['is_fraud']==1]['hour'],
'amount': np.random.lognormal(3, 1, n_samples), alpha=0.8, label='Fraud', c='red')
'hour': np.random.choice(range(6, 23), n_samples, p=np.full(17, 1/17)), plt.xlabel('Transaction Amount')
'merchant_category': np.random.choice(['grocery', 'gas', 'restaurant', 'retail'], plt.ylabel('Hour of Day')
n_samples), plt.title('Transaction Patterns')
'days_since_last': np.random.exponential(2, n_samples) plt.legend()
}
# Fraudulent transactions (anomalies) plt.subplot(2, 2, 2)
sns.boxplot(data=df, x='is_fraud', y='amount_log')
fraud_data = {
plt.title('Amount Distribution (Log Scale)')
'amount': np.concatenate([np.random.lognormal(3, 1, 50),
np.random.uniform(5000, 10000, 50)]), plt.tight_layout()
'hour': np.random.choice(range(0, 24), 100), plt.show()
'merchant_category': np.random.choice(['grocery', 'gas', 'restaurant', 'retail'],
100), print(f"Total transactions: {len(df)}")
'days_since_last': np.random.uniform(0, 0.1, 100) print(f"Fraud cases detected: {df['predicted_fraud'].sum()}")
# Combine data print(f"Actual fraud cases: {df['is_fraud'].sum()}")
df_normal = pd.DataFrame(normal_data)
df_fraud = pd.DataFrame(fraud_data)
df_fraud['is_fraud'] = 1
df_normal['is_fraud'] = 0
df = pd.concat([df_normal, df_fraud]).reset_index(drop=True)
# Feature engineering
df['amount_log'] = np.log1p(df['amount'])
df['is_night'] = (df['hour'] < 6) | (df['hour'] > 22)
# Prepare features for anomaly detection
features = ['amount_log', 'hour', 'days_since_last']
X = df[features]
# Scale features
scaler = StandardScaler()
X_scaled = scaler.fit_transform(X)
# Train Isolation Forest
iso_forest = IsolationForest(contamination=0.1, random_state=42)
anomaly_labels = iso_forest.fit_predict(X_scaled)
# Convert to binary (1 for normal, -1 for anomaly)
df['predicted_fraud'] = (anomaly_labels == -1).astype(int)
Algorithmic Trading
• AI executes trades based on real-time data and
predictive models
• Minimizes human emotion in trading
• Increases speed and precision of trading
Key Applications:
• High-Frequency Trading: Microsecond-level trade
execution
• Sentiment Analysis: News and social media
sentiment impact
• Technical Analysis: Pattern recognition in price
charts
• Risk Management: Dynamic portfolio optimization
Example:
• Hedge funds and investment banks use AI bots to
trade in milliseconds
Credit Scoring and Risk Assessment
• AI transforms credit scoring by analyzing
diverse data sources beyond traditional
credit history
• This enables more accurate risk
assessment and financial inclusion
Key Features:
• Alternative Data: Social media, transaction history, utility
payments
• Real-time Assessment: Instant credit decisions
• Bias Reduction: Fairer lending through algorithmic transparency
• Dynamic Scoring: Credit scores that update with new
information
Example:
• ZestFinance uses machine learning for credit scoring
Credit Scoring Demo (Graphs only)
AI in Transportation
AI is revolutionizing how we move people
and goods through:
• Intelligent automation,
• Predictive analytics,
• Smart decision-making systems that
enhance safety, efficiency, and
sustainability across all modes of
transport.
Autonomous Vehicles
🧠Machine Learning 👁️Computer Vision

Deep neural networks process real-time Advanced image recognition


sensor data from cameras, LiDAR, and identifies traffic signs, lane
radar to understand road conditions, markings, pedestrians, and other
detect obstacles, and make driving vehicles, enabling precise
decisions with superhuman reaction navigation and adherence to traffic
times. rules in complex environments.

🗺️Path Planning ⚡Real-time Processing

AI algorithms calculate optimal routes in Edge computing enables split-


real-time, considering traffic patterns, second decision making, processing
road conditions, and safety factors to millions of data points per second to
ensure smooth and efficient respond instantly to changing road
transportation. conditions and unexpected
situations.
🚦 Smart Traffic Management
📊 📊 🗺️ 📱
Predictive Adaptive Route Connected
Analytics Signals Optimization Systems

Forecasts traffic Traffic lights Dynamic routing Integration with


patterns using adjust timing suggestions to mobile apps and
historical data based on minimize navigation systems
and real-time current traffic congestion and for coordinated
inputs flow and density travel time traffic flow

• AI systems analyze traffic flow and adjust


signals in real time
• Uses data from GPS, CCTV, sensors
• Reduced Congestion: Up to 25% improvement in traffic flow
through intelligent signal coordination.
• Lower Emissions: Decreased idle time and optimized routes
reduce fuel consumption and pollution
• Emergency Response: Priority routing for ambulances and
emergency vehicles
Future Impact & Benefits
Safety Improvements: Efficiency & Sustainability:
• 94% reduction in • 40% reduction in fuel
traffic accidents consumption through
caused by human error optimized routing
• Enhanced collision • Decreased urban pollution
avoidance systems and carbon emissions
• Improved visibility in • Better utilization of existing
adverse weather infrastructure
conditions • Reduced need for parking
• Consistent adherence spaces in urban areas
to traffic laws and
speed limits
Accessibility Revolution
AI-powered transportation will provide unprecedented mobility for elderly
and disabled individuals, creating inclusive transportation systems that
adapt to diverse needs and physical capabilities.
Summary
• - AI in finance enhances security and
investment decisions
• - AI in transportation powers
autonomous systems and smart
traffic control
• - Real-world tools are already
operational in both sectors
Thank You
• Questions or discussions welcome!

You might also like