event-detection-temporal-intelligence-expert

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Event Detection & Temporal Intelligence Expert

事件检测与时序智能专家

Expert in detecting meaningful events from photo collections using spatio-temporal clustering, significance scoring, and intelligent photo selection for collages.
专注于通过时空聚类、重要性评分和智能照片选择,从照片集合中检测有意义的事件,用于制作拼贴画。

When to Use This Skill

何时使用此技能

Use for:
  • Detecting events from photo timestamps + GPS coordinates
  • Clustering photos by time, location, and visual content (ST-DBSCAN, DeepDBSCAN)
  • Scoring event significance (birthday > commute)
  • Predicting photo shareability for social media
  • Recognizing life events (graduations, weddings, births, moves)
  • Temporal diversity optimization (avoid all photos from one day)
  • Event-aware collage photo selection
NOT for:
  • Individual photo aesthetic quality →
    photo-composition-critic
  • Color palette analysis →
    color-theory-palette-harmony-expert
  • Face clustering/recognition →
    photo-content-recognition-curation-expert
  • CLIP embedding generation →
    clip-aware-embeddings
  • Single-photo timestamp extraction (basic EXIF parsing)
适用场景:
  • 从照片时间戳+GPS坐标检测事件
  • 按时间、位置和视觉内容聚类照片(ST-DBSCAN、DeepDBSCAN)
  • 事件重要性评分(生日>日常通勤)
  • 预测照片在社交媒体上的可分享性
  • 识别生活事件(毕业、婚礼、出生、搬家)
  • 时序多样性优化(避免所有照片来自同一天)
  • 事件感知型拼贴画照片选择
不适用场景:
  • 单张照片美学质量评估 →
    photo-composition-critic
  • 调色板分析 →
    color-theory-palette-harmony-expert
  • 人脸聚类/识别 →
    photo-content-recognition-curation-expert
  • CLIP嵌入生成 →
    clip-aware-embeddings
  • 单张照片时间戳提取(基础EXIF解析)

Quick Decision Tree

快速决策树

Need to group photos into meaningful events?
├─ Have GPS + timestamps? ──────────────────── ST-DBSCAN
│   ├─ Also need visual similarity? ────────── DeepDBSCAN (add CLIP)
│   └─ Need hierarchical events? ───────────── Multi-level cascading
├─ No GPS, only timestamps? ────────────────── Temporal binning
│   └─ With visual content? ─────────────────── CLIP + temporal
└─ Photos have faces + want groups? ─────────── Face clustering first
    └─ Then event detection per person
需要将照片分组为有意义的事件?
├─ 有GPS+时间戳? ──────────────────── ST-DBSCAN
│   ├─ 还需要视觉相似度? ────────── DeepDBSCAN(搭配CLIP)
│   └─ 需要分层事件? ───────────── 多级级联
├─ 无GPS,只有时间戳? ────────────────── 时序分箱
│   └─ 有视觉内容? ─────────────────── CLIP+时序分析
└─ 照片有人脸且需要分组? ─────────── 先做人脸聚类
    └─ 再按人物检测事件

Core Concepts

核心概念

1. ST-DBSCAN: Spatio-Temporal Clustering

1. ST-DBSCAN:时空聚类

The Problem: Standard clustering fails for photos—same location on different days shouldn't be grouped.
Key Insight: 100 meters apart in same hour = same event. 100 meters apart 3 days later = different events.
ST-DBSCAN Parameters:
ε_spatial:   50m (indoor) → 500m (outdoor festival) → 5km (city tour)
ε_temporal:  1hr (short event) → 8hr (day trip) → 24hr (multi-day)
min_pts:     3 (small gathering) → 10 (large event)
Algorithm: Both spatial AND temporal constraints must be satisfied:
Neighbor(p) = {q | distance(p,q) ≤ ε_spatial AND |time(p)-time(q)| ≤ ε_temporal}
Deep dive:
references/st-dbscan-implementation.md
问题:标准聚类算法不适用于照片——不同日期在同一地点的照片不应被归为一组。
核心思路:同一小时内相距100米 = 同一事件。3天后相距100米 = 不同事件。
ST-DBSCAN参数:
ε_spatial:   50米(室内)→ 500米(户外节日)→ 5公里(城市游览)
ε_temporal:  1小时(短事件)→ 8小时(单日旅行)→ 24小时(多日活动)
min_pts:     3(小型聚会)→ 10(大型活动)
算法:必须同时满足空间和时间约束:
Neighbor(p) = {q | distance(p,q) ≤ ε_spatial AND |time(p)-time(q)| ≤ ε_temporal}
深度解析
references/st-dbscan-implementation.md

2. DeepDBSCAN: Adding Visual Content

2. DeepDBSCAN:加入视觉内容

Problem: Photos at same time/place can be different subjects (ceremony vs empty chairs).
Solution: Add CLIP embeddings as third dimension:
Neighbor(p) = {q | spatial_ok AND temporal_ok AND cosine_sim(clip_p, clip_q) > threshold}
eps_visual: 0.3 (similar subjects) → 0.5 (diverse event content)
问题:同一时间/地点的照片可能主题不同(仪式 vs 空椅子)。
解决方案:将CLIP嵌入作为第三个维度:
Neighbor(p) = {q | spatial_ok AND temporal_ok AND cosine_sim(clip_p, clip_q) > threshold}
eps_visual: 0.3(相似主题)→ 0.5(多样化事件内容)

3. Hierarchical Event Detection

3. 分层事件检测

Use case: "Paris Vacation" contains "Day 1: Louvre", "Day 2: Eiffel Tower"
Approach: Cascade ST-DBSCAN with expanding thresholds:
  1. High-level (vacations): eps_spatial=50km, eps_temporal=72hr
  2. Mid-level (daily): eps_spatial=5km, eps_temporal=12hr
  3. Low-level (moments): eps_spatial=500m, eps_temporal=1hr

使用场景:“巴黎度假”包含“第1天:卢浮宫”、“第2天:埃菲尔铁塔”
方法:使用扩展阈值的级联ST-DBSCAN:
  1. 高层(假期):eps_spatial=50公里,eps_temporal=72小时
  2. 中层(单日活动):eps_spatial=5公里,eps_temporal=12小时
  3. 低层(瞬间):eps_spatial=500米,eps_temporal=1小时

Event Significance Scoring

事件重要性评分

Goal: Birthday party > Daily commute photos
Multi-Factor Model (weights sum to 1.0):
FactorWeightDescription
location_rarity0.20Exotic location > home
people_presence0.15Photos with people score higher
photo_density0.15More photos/hour = more memorable
content_rarity0.15Landmarks, celebrations detected via CLIP
visual_diversity0.10Varied shots = special event
duration0.10Longer events score higher
engagement0.10Shared/edited/favorited photos
temporal_rarity0.05Annual patterns (birthdays, holidays)
Deep dive:
references/event-scoring-shareability.md

目标:生日派对>日常通勤照片
多因素模型(权重总和为1.0):
因素权重描述
location_rarity0.20异域地点>家
people_presence0.15有人物的照片评分更高
photo_density0.15每小时照片数量越多 = 记忆越深刻
content_rarity0.15通过CLIP检测地标、庆祝活动
visual_diversity0.10多样的镜头 = 特殊事件
duration0.10事件持续时间越长评分越高
engagement0.10已分享/编辑/收藏的照片
temporal_rarity0.05年度模式(生日、节日)
深度解析
references/event-scoring-shareability.md

Shareability Prediction

可分享性预测

Goal: Predict which photos will be shared on social media.
High-Signal Features (2025 research):
  1. Smiling faces (+0.3 base score)
  2. Group photos (3+ people, +0.2)
  3. Famous landmarks (+0.25)
  4. Food scenes (+0.15)
  5. Moderate visual complexity (0.4-0.6 optimal)
  6. Recency (decays over 30 days)
Shareability Threshold: >0.6 = "Highly Shareable"
Deep dive:
references/event-scoring-shareability.md

目标:预测哪些照片会在社交媒体上被分享。
高信号特征(2025年研究):
  1. 笑脸(基础评分+0.3)
  2. 群体照片(3人及以上,+0.2)
  3. 著名地标(+0.25)
  4. 美食场景(+0.15)
  5. 中等视觉复杂度(0.4-0.6为最优)
  6. 时效性(30天后评分衰减)
可分享性阈值:>0.6 = "高可分享性"
深度解析
references/event-scoring-shareability.md

Life Event Detection

生活事件检测

Automatically detect major life events using multi-modal signals:
Event TypePrimary SignalsThreshold
GraduationCap/gown, diploma, auditorium0.6
WeddingFormal attire, bouquet, cake, rings0.7
BirthNew infant face cluster, hospital setting0.8
Residential Move50km+ location shift, >30 days0.8
Travel MilestoneFirst visit to new country1.0
Deep dive:
references/place-recognition-life-events.md

使用多模态信号自动检测重大生活事件:
事件类型主要信号阈值
毕业学士服/硕士服、文凭、礼堂0.6
婚礼正式礼服、花束、蛋糕、戒指0.7
出生新生儿人脸聚类、医院场景0.8
搬家50公里以上的地点迁移、持续>30天0.8
旅行里程碑首次访问新国家1.0
深度解析
references/place-recognition-life-events.md

Temporal Diversity for Selection

选择时的时序多样性

Problem: Without constraints, collage might be all vacation photos.
问题:无约束时,拼贴画可能全是度假照片。

Method Comparison

方法对比

MethodBest ForUse When
Temporal BinningEven time coverageNeed chronological spread
Temporal MMRQuality + diversity balanceBalanced selection
Event-BasedEvent representationEach event matters
方法最佳适用场景使用时机
时序分箱均匀时间覆盖需要按时间顺序分布
时序MMR质量与多样性平衡均衡选择
基于事件事件代表性每个事件都很重要

Temporal MMR Formula

时序MMR公式

MMR(photo) = λ × quality + (1-λ) × min_temporal_distance_to_selected
  • λ=0.5: Balanced
  • λ=0.7: Prefer quality
  • λ=0.3: Prefer diversity
Deep dive:
references/temporal-diversity-pipeline.md

MMR(photo) = λ × quality + (1-λ) × min_temporal_distance_to_selected
  • λ=0.5:均衡
  • λ=0.7:优先质量
  • λ=0.3:优先多样性
深度解析
references/temporal-diversity-pipeline.md

Common Anti-Patterns

常见反模式

Anti-Pattern: Time-Only Clustering

反模式:仅基于时间的聚类

What it looks like: Using K-means or basic DBSCAN on timestamps only
python
clusters = KMeans(n_clusters=10).fit(timestamps)  # WRONG
Why it's wrong: Multi-day trips at same location get split; same-day different-location events get merged.
What to do instead: Use ST-DBSCAN with both spatial AND temporal constraints.
表现:仅对时间戳使用K-means或基础DBSCAN
python
clusters = KMeans(n_clusters=10).fit(timestamps)  # 错误
问题:同一地点的多日旅行会被拆分;同一天不同地点的事件会被合并。
正确做法:使用同时包含空间和时间约束的ST-DBSCAN。

Anti-Pattern: Fixed Epsilon Values

反模式:固定Epsilon值

What it looks like: Using same eps_spatial=100m for all events
Why it's wrong: Indoor events need 50m, city tours need 5km.
What to do instead: Adaptive thresholds based on event type detection, or hierarchical clustering with multiple scales.
表现:对所有事件使用相同的eps_spatial=100米
问题:室内事件需要50米,城市游览需要5公里。
正确做法:基于事件类型检测使用自适应阈值,或使用多尺度的分层聚类。

Anti-Pattern: Ignoring Visual Content

反模式:忽略视觉内容

What it looks like: ST-DBSCAN alone for event detection
Why it's wrong: Wedding ceremony and empty chairs setup—same time/place, completely different importance.
What to do instead: DeepDBSCAN with CLIP embeddings for content-aware clustering.
表现:仅使用ST-DBSCAN进行事件检测
问题:婚礼仪式和空椅子布置——同一时间/地点,但重要性完全不同。
正确做法:使用带有CLIP嵌入的DeepDBSCAN进行内容感知聚类。

Anti-Pattern: Euclidean Distance for GPS

反模式:对GPS使用欧几里得距离

What it looks like:
python
distance = sqrt((lat2-lat1)**2 + (lon2-lon1)**2)  # WRONG
Why it's wrong: Degrees ≠ meters. 1° latitude = 111km, but 1° longitude varies by latitude.
What to do instead: Haversine formula for great-circle distance:
python
from geopy.distance import geodesic
distance_meters = geodesic((lat1, lon1), (lat2, lon2)).meters
表现:
python
distance = sqrt((lat2-lat1)**2 + (lon2-lon1)**2)  # 错误
问题:度数≠米。1°纬度=111公里,但1°经度随纬度变化。
正确做法:使用Haversine公式计算大圆距离:
python
from geopy.distance import geodesic
distance_meters = geodesic((lat1, lon1), (lat2, lon2)).meters

Anti-Pattern: No Noise Handling

反模式:无噪声处理

What it looks like: Forcing every photo into a cluster
Why it's wrong: Solo commute photos pollute event clusters.
What to do instead: DBSCAN naturally identifies noise (label=-1). Keep noise separate—don't force into nearest cluster.
表现:强制每张照片都归入某个聚类
问题:单独的通勤照片会污染事件聚类。
正确做法:DBSCAN会自然识别噪声(标签=-1)。将噪声单独保留——不要强制归入最近的聚类。

Anti-Pattern: Shareability Without Event Context

反模式:脱离事件上下文的可分享性预测

What it looks like: Predicting shareability from photo features alone
Why it's wrong: A mediocre photo from your wedding is more shareable than a great photo from Tuesday's lunch.
What to do instead: Include event significance as feature:
python
features['event_significance'] = photo.event.significance_score

表现:仅从照片特征预测可分享性
问题:婚礼上的普通照片比周二午餐的精美照片更值得分享。
正确做法:将事件重要性作为特征加入:
python
features['event_significance'] = photo.event.significance_score

Quick Start: Event Detection Pipeline

快速开始:事件检测流水线

python
from event_detection import EventDetectionPipeline

pipeline = EventDetectionPipeline()
python
from event_detection import EventDetectionPipeline

pipeline = EventDetectionPipeline()

Process photo corpus

处理照片集合

results = pipeline.process_photo_corpus(photos)
results = pipeline.process_photo_corpus(photos)

Access events

访问事件

for event in results['events']: print(f"{event.label}: {len(event.photos)} photos, significance={event.significance_score:.2f}")
for event in results['events']: print(f"{event.label}: {len(event.photos)} 张照片,重要性={event.significance_score:.2f}")

Access life events

访问生活事件

for life_event in results['life_events']: print(f"{life_event.type} detected on {life_event.timestamp}")
for life_event in results['life_events']: print(f"检测到{life_event.type},时间为{life_event.timestamp}")

Select for collage with diversity

选择用于拼贴画的照片(兼顾多样性)

collage_photos = pipeline.select_for_collage(results, target_count=100)

---
collage_photos = pipeline.select_for_collage(results, target_count=100)

---

Performance Targets

性能目标

OperationTarget
ST-DBSCAN (10K photos)< 2 seconds
Event significance scoring< 100ms/event
Shareability prediction< 50ms/photo
Place recognition (cached)< 10ms/photo
Full pipeline (10K photos)< 5 seconds

操作目标
ST-DBSCAN(1万张照片)<2秒
事件重要性评分<100ms/事件
可分享性预测<50ms/照片
地点识别(缓存)<10ms/照片
完整流水线(1万张照片)<5秒

Python Dependencies

Python依赖

numpy scipy scikit-learn hdbscan geopy transformers xgboost pandas opencv-python

numpy scipy scikit-learn hdbscan geopy transformers xgboost pandas opencv-python

Integration Points

集成点

  • collage-layout-expert: Pass event clusters for diversity-aware placement
  • photo-content-recognition-curation-expert: Get face clusters before event detection
  • color-theory-palette-harmony-expert: Use for visual diversity within events
  • clip-aware-embeddings: Generate embeddings for DeepDBSCAN

  • collage-layout-expert:传递事件聚类以实现感知多样性的布局
  • photo-content-recognition-curation-expert:在事件检测前获取人脸聚类
  • color-theory-palette-harmony-expert:用于事件内的视觉多样性分析
  • clip-aware-embeddings:为DeepDBSCAN生成嵌入

References

参考文献

  1. ST-DBSCAN: Birant & Kut (2007), "ST-DBSCAN: An algorithm for clustering spatial-temporal data"
  2. DeepDBSCAN: ISPRS 2021, "Deep Density-Based Clustering for Geo-Tagged Photos"
  3. Shareability: arXiv 2025, "Predicting Social Media Engagement from Emotional and Temporal Features"
  4. GeoNames/OpenStreetMap: Reverse geocoding for place recognition

Version: 2.0.0 Last Updated: November 2025
  1. ST-DBSCAN:Birant & Kut (2007), "ST-DBSCAN: An algorithm for clustering spatial-temporal data"
  2. DeepDBSCAN:ISPRS 2021, "Deep Density-Based Clustering for Geo-Tagged Photos"
  3. 可分享性:arXiv 2025, "Predicting Social Media Engagement from Emotional and Temporal Features"
  4. GeoNames/OpenStreetMap:用于地点识别的反向地理编码

版本:2.0.0 最后更新:2025年11月