CSC410 Data Warehousing and Data Mining

Data Warehousing and Data MiningUnit 1020 min read

Multimedia Mining & Advanced Topics: Text, Web, Graph, Spatial & Challenges

Unit 10 of Data Warehousing and Data Mining explores multimedia mining (text, audio, video, images), web mining (content, usage, structure), graph mining (social networks, link analysis), spatial data mining, and advanced challenges like scalability, heterogeneity, and real-time processing—with practical applications i

TAKEAWAYS:

  • Multimedia mining extracts patterns from unstructured data (text, images, audio) using feature extraction (e.g., TF-IDF, SIFT) and similarity measures (e.g., cosine similarity, Euclidean distance).
  • Web mining analyzes three layers: content (text/html), usage (clickstreams), and structure (hyperlinks), with applications in recommendation systems (e.g., YouTube’s "Recommended for You").
  • Graph mining reveals hidden relationships in networks (e.g., fraud detection in Ncell’s call graphs) using metrics like degree centrality, betweenness, and community detection.
  • Spatial data mining identifies geographic patterns (e.g., traffic congestion in Kathmandu using GPS data from Pathao) via spatial joins, density-based clustering (DBSCAN), and nearest-neighbor queries.
  • Advanced challenges include heterogeneity (mixing text, images, and audio), scalability (handling terabytes of data), and real-time processing (e.g., live sentiment analysis on Twitter).
  • Exam focus: Define key terms (e.g., link mining, spatial autocorrelation), explain algorithms (e.g., Apriori for association rules, DBSCAN for clustering), and compare techniques (e.g., web usage vs. web structure mining).

Multimedia Data Mining: Extracting Patterns from Unstructured Data

Multimedia data (text, audio, images, video) dominates modern datasets (e.g., 90% of data on the internet is unstructured). Multimedia mining applies data mining techniques to extract meaningful patterns from these formats.

Key Techniques:

  1. Text Mining
    • Feature Extraction: Convert text into numerical features using:
      • Bag-of-Words (BoW): Count word frequencies (e.g., "Nepal" appears 5 times in a news article).
      • TF-IDF (Term Frequency-Inverse Document Frequency): Weighs words by importance across documents.
      • Word Embeddings (Word2Vec, GloVe): Captures semantic meaning (e.g., "king" – "man" + "woman" ≈ "queen").
    • Similarity Measures:
      • Cosine Similarity: Measures angle between document vectors (used in eSewa’s customer complaint clustering).
      • Jaccard Similarity: Compares sets of words (e.g., two resumes with overlapping skills).
Raw Text (e.g., eSewa reviews)Preprocessing (Tokenization, Stopword Removal)Feature Extraction (TF-IDF, Word2Vec)Similarity (Cosine, Jaccard)Clustering/Classification
Text preprocessing and similarity pipeline for eSewa review analysis
  1. Image Mining

    • Feature Extraction:
      • Color Histograms: Distribute pixel intensities (e.g., detecting red traffic lights in Kathmandu traffic images).
      • Edge Detection (Sobel, Canny): Highlights boundaries (used in Daraz’s product image search).
      • SIFT/SURF: Scale-invariant feature transform for object recognition (e.g., Google Lens identifying landmarks).
    • Similarity Search: Finds visually similar images using Euclidean distance or histogram intersection.
  2. Audio Mining

    • Feature Extraction:
      • MFCC (Mel-Frequency Cepstral Coefficients): Captures spectral features (used in Shazam for song identification).
      • Spectrograms: Visualizes frequency over time (e.g., detecting bird calls in bioacoustics).
    • Applications: Music recommendation (Spotify), speaker recognition (Ncell’s voice authentication).
  3. Video Mining

    • Combines frame-level image mining + temporal analysis (e.g., YouTube’s "Watch Next" uses shot boundaries and object tracking).

Challenges of Multimedia Mining:

Challenge Example Solution Approach
Heterogeneity Mixing text (reviews) and images (product photos) in Daraz. Use multimodal embeddings (e.g., CLIP).
High Dimensionality SIFT descriptors have 128 dimensions per keypoint. Apply PCA or t-SNE for reduction.
Scalability Processing millions of images in Google Photos. Use approximate nearest neighbors (e.g., FAISS).
Semantic Gap Low-level features (pixels) vs. high-level concepts (e.g., "sunset"). Train deep learning models (e.g., CNNs).

## In the Real World

  1. eSewa’s Fraud Detection

    • Text Mining: Analyzes user complaints in Nepali/English to detect fraud patterns (e.g., repeated "payment failed" keywords).
    • Graph Mining: Builds a transaction graph where nodes = users/merchants, edges = transactions. Uses community detection to flag clusters with high chargeback rates.
    • Worked Example: Suppose eSewa’s graph has 3 communities:
      • Community A: High transaction volume, low fraud (e.g., Daraz merchants).
      • Community B: Low volume, high fraud (e.g., fake "Ncell recharge" sellers).
      • Community C: Mixed (e.g., Pathao drivers with occasional fraud). Action: eSewa flags Community B for manual review.
  2. YouTube’s Recommendation System

    • Multimedia Mining:
      • Video Content: Extracts MFCCs from audio and SIFT from frames to cluster similar videos.
      • Text Mining: Analyzes titles, descriptions, and comments using TF-IDF to find trending topics.
      • Graph Mining: Builds a watch graph where edges = "user A watched video B after video C." Uses PageRank to rank videos.
    • Worked Example: If you watch "Nepali cooking tutorials," YouTube’s system:
      1. Extracts visual features (e.g., knives, spices) from your watch history.
      2. Matches these to similar videos in its database.
      3. Ranks them using collaborative filtering (videos watched by similar users).
  3. Ncell’s Network Optimization

    • Spatial Data Mining:
      • Uses GPS data from user locations to detect hotspots (e.g., crowded areas in Lalitpur during festivals).
      • Applies DBSCAN to cluster users with similar call patterns (e.g., high data usage in the evening).
    • Worked Example: Suppose Ncell’s data shows:
      • Cluster 1: Users in Thapathali (high 4G usage, 6–9 PM).
      • Cluster 2: Users in Kirtipur (high voice calls, 8–10 AM). Action: Ncell allocates more 4G towers in Thapathali and optimizes voice call routing in Kirtipur.
  4. Daraz’s Product Search

    • Image Mining:
      • Uses SIFT + deep learning to let users upload a photo of a product (e.g., a shoe) and find matches.
      • Worked Example: If you upload a photo of a Nike Air Max, Daraz’s system:
        1. Extracts SIFT keypoints from the image.
        2. Compares them to a database of 10,000 product images using cosine similarity.
        3. Returns the top 5 visually similar products (even if their titles don’t match).
  5. Pathao’s Traffic Prediction

    • Spatial-Temporal Mining:
      • Combines GPS trajectories (where drivers go) with time data (peak hours) to predict congestion.
      • Uses spatial autocorrelation (e.g., "areas near Thamel have correlated high demand").
    • Worked Example: Pathao’s algorithm detects:
      • High demand: Thamel (7–9 PM), Lakshmi Path (5–7 PM).
      • Low demand: Budhanilkantha (midnight). Action: Pathao increases driver supply in Thamel during peak hours and adjusts surge pricing.

Web Mining: Extracting Patterns from the Web

The web is a multidimensional data source with three layers:

  1. Web Content Mining: Extracts information from text/html (e.g., news articles, product descriptions).
  2. Web Usage Mining: Analyzes user behavior (e.g., clickstreams, browsing patterns).
  3. Web Structure Mining: Studies hyperlinks (e.g., PageRank, trustworthiness).

1. Web Content Mining

  • Techniques:
    • Information Extraction: Uses regex, NLP, or DOM parsing to extract structured data (e.g., extracting prices from Daraz product pages).
    • Topic Modeling (LDA): Discovers latent topics in a corpus (e.g., analyzing NEPSE news for "stock market sentiment").
  • Example: Google’s Knowledge Graph uses content mining to link entities (e.g., "Sagarmatha" → "Mount Everest" → "8,848m").

2. Web Usage Mining

  • Data Sources:
    • Server Logs: Records URLs, timestamps, and user IDs.
    • Clickstreams: Sequence of clicks (e.g., user path: Home → Electronics → Mobiles → Ncell → Buy).
  • Techniques:
    • Association Rule Mining: Finds co-occurring items (e.g., "Users who buy iPhones also buy AirPods").
    • Sequential Pattern Mining: Detects temporal patterns (e.g., "Users browse Daraz → compare prices on Amazon → return to Daraz").
  • Worked Example: Suppose eSewa’s clickstream data shows:
    User ID Path
    U1 Home → Electricity Bill → Pay → Confirmation
    U2 Home → Recharge → Ncell → Top-up → Fail → Customer Service
    U3 Home → Recharge → Ncell → Top-up → Success
    Association Rule: {Recharge, Ncell} → {Top-up} with support = 66% and confidence = 80%.
    Action: eSewa simplifies the Ncell recharge flow to reduce drop-offs.

3. Web Structure Mining

  • Key Concepts:
    • Hyperlink-Induced Topic Search (HITS): Identifies authorities (trusted sources) and hubs (pages linking to many authorities).
    • PageRank: Google’s algorithm for ranking pages based on link popularity.
  • Worked Example: Suppose we analyze Nepali news websites:
    • Authority Pages: Kantipur Online, Republica (linked by many blogs).
    • Hub Pages: Nepal News Portal (links to many authorities). Action: A search engine would rank Kantipur Online higher for "Nepal earthquake news."

Comparison Table: Web Mining Types

Type Data Source Example Use Case Key Algorithm
Content Mining Text/HTML Extracting product specs from Daraz. NLP, TF-IDF, LDA
Usage Mining Clickstreams/Logs Detecting user drop-offs in eSewa. Apriori, Market Basket
Structure Mining Hyperlinks Ranking NEPSE websites for "stock tips." PageRank, HITS

Graph Mining and Social Network Analysis

Graphs model relationships (e.g., users, transactions, roads). Graph mining extracts patterns like communities, influential nodes, and anomalies.

510384Nepal PoliceKathmandu MetroPathaoKathmandu UniversityNcell
Hypothetical co-occurrence network of Nepal's transport and tech sectors (edge weights = collaboration strength)

Key Concepts:

  1. Graph Representation:

    • Nodes (Vertices): Entities (e.g., users, products).
    • Edges (Links): Relationships (e.g., "friends," "transactions").
    • Attributes: Node/edge properties (e.g., user age, transaction amount).
  2. Centrality Measures (Identify influential nodes):

    • Degree Centrality: Number of connections (e.g., a user with 100 friends).
    • Betweenness Centrality: How often a node lies on shortest paths (e.g., a bridge in a social network).
    • Closeness Centrality: Proximity to all other nodes (e.g., a user who can reach everyone in 2 steps).
User A (Degree: 3)User BUser CUser D (Betweenness: High)User E
Social network illustrating degree and betweenness centrality (User D as bridge)
  1. Community Detection:

    • Groups nodes with dense internal connections (e.g., friend groups on Facebook).
    • Algorithms: Louvain, Girvan-Newman (edge betweenness).
    • Example: Ncell’s call graph might reveal cliques of fraudsters (e.g., a group repeatedly calling premium-rate numbers).
  2. Link Prediction:

    • Predicts missing edges (e.g., "User X and Y should be friends").
    • Methods: Common neighbors, Jaccard similarity.
  3. Theories in Social Networks:

    • Balance Theory: "Friends of friends are friends" (triadic closure). Example: If A and B are friends, and A and C are friends, B and C are likely friends.
    • Status Theory: High-status nodes (e.g., influencers) attract more links. Example: A celebrity on Instagram has more followers than a random user.

Challenges in Graph Mining:

  • Scalability: Real-world graphs (e.g., Facebook) have billions of nodes.
    • Solution: Use graph partitioning (e.g., Metis) or sampling.
  • Dynamic Graphs: Links change over time (e.g., Twitter follows).
    • Solution: Temporal graph mining (e.g., tracking how communities evolve).
  • Noise: Fake accounts, spam links.
    • Solution: Anomaly detection (e.g., nodes with sudden high degree).

Spatial Data Mining: Uncovering Geographic Patterns

Spatial data includes locations, shapes, and geographic relationships (e.g., GPS coordinates, satellite images). Key techniques:

1. Spatial Data Types:

  • Vector Data: Points (e.g., traffic cameras), lines (e.g., roads), polygons (e.g., districts).
  • Raster Data: Grids (e.g., satellite images, elevation maps).

2. Key Operations:

Operation Example Algorithm
Spatial Join Find all ATMs within 500m of a Pathao pickup point. R-tree, Quad-tree
Nearest Neighbor Find the closest Ncell tower to a user’s location. KD-tree, Ball-tree
Density Estimation Detect hotspots for NTC’s 5G rollout. DBSCAN, Kernel Density Est.
Spatial Autocorrelation Areas with high crime rates cluster together. Moran’s I

3. DBSCAN: Density-Based Clustering

  • Parameters:

    • ε (eps): Maximum distance between two points to be considered neighbors.
    • MinPts: Minimum number of points to form a dense region.
  • Worked Example: Suppose we analyze traffic congestion in Kathmandu using GPS data from Pathao drivers:

    • ε = 1 km, MinPts = 5.
    • Points (x,y) represent driver locations at 6 PM.
    • Cluster 1: Dense area around Thamel (high congestion).
    • Noise: Drivers in remote areas (e.g., Nagarkot) with <5 neighbors.
    • Action: Pathao adjusts surge pricing in Thamel and routes drivers away from Nagarkot.
    graph TD
      A["Pathao Driver 1\n(Thamel)"] --> B["Cluster 1\n(High Density)"]
      B --> C["Pathao Driver 2\n(Thamel)"]
      B --> D["Pathao Driver 3\n(Thamel)"]
      E["Pathao Driver 4\n(Nagarkot)"] --> F["Noise\n(Low Density)"]

4. Applications in Nepal:

  • Traffic Management: NTC uses spatial mining to optimize signal timings based on GPS data.
  • Disaster Response: Red Cross analyzes flood-prone areas using elevation data.
  • Retail Optimization: Daraz identifies high-demand zones for warehouse placement.

Advanced Topics and Challenges

1. Challenges in Multimedia Mining

Challenge Description Example
Heterogeneity Mixing text, images, and audio (e.g., a WhatsApp message with a photo + voice note). eSewa’s chatbot must handle all three.
Scalability Processing petabytes of data (e.g., YouTube’s 500+ hours of video uploaded per minute). Use distributed systems (e.g., Apache Spark).
Real-Time Processing Analyzing live streams (e.g., Ncell’s call data in real time). Use streaming frameworks (e.g., Flink).
Privacy Mining user data without violating laws (e.g., GDPR in Europe). Anonymize data (e.g., k-anonymity).

2. Future Directions

  • Multimodal Learning: Combining text, images, and audio (e.g., CLIP model by OpenAI).
  • Explainable AI (XAI): Making multimedia models interpretable (e.g., why an image was classified as "cat").
  • Edge Mining: Processing data on devices (e.g., smartphones) for privacy (e.g., Federated Learning).

## Exam Tip

  1. Definitions Are Critical:

    • Always define terms precisely. For example:
      • Graph Mining: "The process of discovering meaningful patterns in graph-structured data, including nodes, edges, and their attributes."
      • Spatial Autocorrelation: "The degree to which a variable’s value at one location is related to its value at nearby locations."
  2. Compare Techniques:

    • Exams often ask to distinguish between:
      • Web usage mining vs. web structure mining.
      • DBSCAN vs. k-means (DBSCAN handles arbitrary shapes; k-means assumes spherical clusters).
      • PageRank vs. HITS (PageRank ranks nodes globally; HITS identifies authorities/hubs).
  3. Worked Examples:

    • For Apriori or DBSCAN, show step-by-step calculations with small datasets (e.g., 5–10 transactions).
    • For graph mining, draw a small graph (5–7 nodes) and label centrality measures.
  4. Real-World Applications:

    • Link concepts to Nepali companies (e.g., eSewa for text/graph mining, Pathao for spatial mining).
    • Use local examples (e.g., "How would Ncell use DBSCAN?").
  5. Common Pitfalls:

    • Ignoring parameters: Always state ε and MinPts for DBSCAN or support/confidence for Apriori.
    • Overlooking challenges: Mention scalability, heterogeneity, or privacy when discussing multimedia mining.
    • Confusing terms: Don’t mix up web content mining (text) with web structure mining (links).
  6. Diagrams Save Marks:

    • Draw small graphs for centrality measures.
    • Sketch DBSCAN clusters with noise points.
    • Use flowcharts for KDD stages or web mining layers.

Practice Questions (Based on Past Exams)

  1. Define graph mining and discuss the conflict between balance theory and status theory.

    • Answer: Graph mining extracts patterns from graph data. Balance theory (triadic closure) assumes harmony in relationships, while status theory explains link formation based on node importance (e.g., a celebrity’s high status attracts more links). Conflict: In a network, balance theory might predict a friend-of-friend link, but status theory may ignore it if one node has low status.
  2. What are the roles of ε and MinPts in DBSCAN?

    • Answer:
      • ε (eps): Defines the neighborhood radius. Points within ε are considered neighbors.
      • MinPts: Minimum points required to form a dense region. If a point has <MinPts neighbors, it’s labeled noise.
    • Example: For Kathmandu traffic data, ε = 1 km, MinPts = 5 → clusters are dense areas with ≥5 drivers within 1 km.
  3. List two challenges of multimedia mining and describe them with examples.

    • Answer:
      1. Heterogeneity: Mixing text (e.g., "Ncell recharge failed") and images (e.g., a screenshot of the error) requires multimodal models like CLIP.
      2. Scalability: YouTube processes 500+ hours of video per minute; solutions include approximate nearest neighbors (e.g., FAISS).
  4. Distinguish between web usage mining and web structure mining.

    • Answer:
      Feature Web Usage Mining Web Structure Mining
      Data Source Clickstreams, server logs Hyperlinks
      Example eSewa tracking user drop-offs Google’s PageRank
      Key Algorithm Apriori (association rules) HITS, PageRank
      Output User behavior patterns Authority/hub pages

Based on the TU BSc CSIT syllabus for Data Warehousing and Data Mining (CSC410), unit 10.

Discussion

Loading…