Lecture 5

Label Propagation for Node Classification
LEC05
Author

iDeal

Published

July 20, 2022

5.1 - Message passing and Node Classification

Message Passing and Node Classification

Today’s Lecture: outline

Main question today: Given a network with labels on some nodes, how do we assign labels to all other nodes in the network? Example: In a network, some nodes are fraudsters, and some other nodes are fully trusted. How do you find the other fraudsters and trustworthy nodes? We already discussed node embeddings as a method to solve this in Lecture 3

오늘 주요 질문: 일부 노드에 레이블이 있는 네트워크에서 네트워크의 다른 모든 노드에 레이블을 할당하려면 어떻게 해야 합니까? 예: 네트워크에서 일부 노드는 사기꾼이고 다른 일부 노드는 완전히 신뢰됩니다. 다른 사기꾼과 신뢰할 수 있는 노드를 어떻게 생각하십니까? 우리는 이것을 해결하기 위한 방법으로 노드 임베딩을 이미 강의 3에서 논의하였습니다

Example: Node Classification

Given labels of some nodes Let’s predict labels of unlabeled nodes This is called semi-supervised node classification

일부 노드의 지정된 레이블 레이블이 없는 노드의 레이블을 예측해 봅시다. 이를 준지도 노드 분류라고 합니다.

Today’s Lecture: outline

  • Main question today: Given a network with labels on some nodes, how do we assign labels to all other nodes in the network?
  • Today we will discuss an alternative framework: Message passing
  • Intuition: Correlations (dependencies) exist in networks.
    • In other words: Similar nodes are connected.
    • Key concept is collective classification: Idea of assigning labels to all nodes in a network together.
  • We will look at three techniques today:
    • Relational classification
    • Iterative classification
    • Correct & Smooth
  • 오늘 주요 질문: 일부 노드에 레이블이 있는 네트워크에서 네트워크의 다른 모든 노드에 레이블을 할당하려면 어떻게 해야 합니까?
  • 오늘은 대체 프레임워크에 대해 논의하겠습니다: 메시지 전달
  • 직관: 상관 관계(의존성) 네트워크에 존재하다
    • 즉, 유사한 노드가 연결되어 있습니다.
    • 핵심 개념은 집단 분류: 네트워크의 모든 노드에 label을 함께 할당하는 아이디어입니다.
  • 오늘은 세 가지 기법을 살펴보겠습니다.
    • 관계구분
    • 반복구분
    • 정확하고 매끄러운

Correlations Exist in Networks

  • Behaviors of nodes are correlated across the links of the network

  • Correlation: Nearby nodes have the same color (belonging to the same class)

  • 노드의 동작은 네트워크 링크 전체에서 상관됨

  • 상관: 근처 노드의 색상은 동일합니다(동일한 클래스에 속함).

  • Two explanations for why behaviors of nodes in networks are correlated:

  • 네트워크에서 노드의 동작이 상관되는 이유에 대한 두 가지 설명은 다음과 같다.

Social Homophily

  • Homophily: The tendency of individuals to associate and bond with similar others

  • “Birds of a feather flock together”

  • It has been observed in a vast array of network studies, based on a variety of attributes (e.g., age, gender, organizational role, etc.)

  • Example: Researchers who focus on the same research area are more likely to establish a connection (meeting at conferences, interacting in academic talks, etc.)

  • 동성애: 개인이 유사한 타인과 연관되고 유대감을 갖는 경향

  • “깃털 같은 새들”

  • 다양한 속성(예: 연령, 성별, 조직 역할 등)을 기반으로 한 광범위한 네트워크 연구에서 관찰되었다.

  • 예시: 동일한 연구 분야에 집중하는 연구자는 (학회에서의 회의, 학술 강연에서의 상호작용 등) 연결을 확립할 가능성이 높다.

Homophily: Example

Example of homophily

  • Online social network
    • Nodes = people
    • Edges = friendship
    • Node color = interests (sports, arts, etc.)
  • People with the same interest are more closely connected due to homophily

동음이의 예

  • 온라인 소셜 네트워크
    • 노드 = 사람
    • 가장자리 = 우정
    • 노드 색상 = 관심 사항(스포츠, 예술 등)
  • 동종애로 인해 같은 관심사를 가진 사람들이 더 밀접하게 연결되어 있다.

Social Influence: Example

  • Influence: Social connections can influence the individual characteristics of a person.
    • Example: I recommend my musical preferences to my friends, until one of them grows to like my same favorite genres!
  • 영향: 사회적 관계는 개인의 특성에 영향을 미칠 수 있다.
    • 예시: 친구 중 한 명이 제가 좋아하는 장르를 좋아하게 될 때까지 친구들에게 제 음악적 취향을 추천합니다!

How do we leverage node correlations in networks?

Classification with Network Data

  • How do we leverage this correlation observed in networks to help predict node labels?

  • 네트워크에서 관찰된 이 상관 관계를 활용하여 노드 레이블을 예측하는 방법은 무엇입니까?

How do we predict the labels for the nodes in grey?

노드의 레이블을 회색으로 어떻게 예측합니까?

Motivation

  • Similar nodes are typically close together or directly connected in the network:
    • Guilt-by-association: If I am connected to a node with label 𝑋, then I am likely to have label 𝑋 as well.
    • Example: Malicious/benign web page: Malicious web pages link to one another to increase visibility, look credible, and rank higher in search engines
  • Classification label of a node 𝑣 in network may depend on:
    • Features of 𝑣
    • Labels of the nodes in 𝑣’s neighborhood
    • Features of the nodes in 𝑣’s neighborhood
  • 유사한 노드는 일반적으로 네트워크에서 서로 가까이 있거나 직접 연결됩니다.
    • 연관별 죄책감: 레이블 𝑋이 있는 노드에 연결되어 있다면 레이블 𝑋도 있을 수 있습니다.
    • 예: 악성/악성 웹 페이지: 악성 웹 페이지는 가시성을 높이고 신뢰도를 높이며 검색 엔진에서 더 높은 순위를 차지하기 위해 서로 연결됩니다.
  • 네트워크에 있는 노드 \(v\)의 분류 라벨은 다음 조건에 따라 달라질 수 있습니다.
    • \(v\)의 기능
    • \(v\)의 이웃에 있는 노드의 레이블
    • \(v\)의 이웃에 있는 노드의 기능

Semi-supervised Learning

Formal setting:

Given:

  • Graph
  • Few labeled nodes

Find: Class (red/green) of remaining nodes

Main assumption: There is homophily in the network

공식 설정:

제공됨:

  • 그래프
  • 레이블이 지정된 노드 몇 개

찾기: 나머지 노드의 클래스(빨간색/녹색)

주요 가정: 네트워크에 동질성이 있습니다.

Example task:

  • Let 𝑨 be a 𝑛×𝑛 adjacency matrix over 𝑛 nodes
  • Let Y = \([0,1]^n\) be a vector of labels:
    • \(Y_v\) = 1 belongs to Class1
    • \(Y_v\) = 0 belongs to Class0
    • There are unlabeled node needs to be classified
  • Goal: Predict which unlabeled nodes are likely Class 1, and which are likely Class 0

작업 예:

  • A를 n개 노드의 nxn 인접 행렬로 설정
  • Y = \([0,1]^n\) 을 레이블 벡터라고 하자:
    • \(Y_v\) = 1이 클래스 1에 속함
    • \(Y_v\) = 0이 클래스 0에 속함
    • 라벨이 지정되지 않은 노드가 분류되어야 합니다
  • 목표: 레이블이 없는 노드가 클래스 1일 가능성이 높고 클래스 0일 가능성이 높은 노드를 예측합니다.

Problem Setting

How to predict the labels \(Y_v\) for the unlabeled nodes \(v\) (in grey color)? Each node \(v\) has a feature vector \(f_v\) Labels for some nodes are given (1 for green, 0 for red) Task: Find \(P(Y_v)\) given all features and the network 라벨이 없는 노드 \(v\)(회색)에 대한 레이블 \(Y_v\)를 예측하는 방법 각 노드 \(v\)에는 특징 벡터 \(f_v\)가 있습니다. 일부 노드의 라벨이 제공됩니다(녹색은 1, 빨간색은 0). 작업: 모든 기능 및 네트워크가 주어진 \(P(Y_v)\) 찾기

\[ P(Y_v)=? \]

Example applications:

  • Many applications under this setting:
    • Document classification
    • Part of speech tagging
    • Link prediction
    • Optical character recognition
    • Image/3D data segmentation
    • Entity resolution in sensor networks
    • Spam and fraud detection
  • 이 설정 아래의 많은 응용 프로그램:
    • 문서구분
    • 음성 태그의 일부
    • 링크 예측
    • 광학식 문자 인식
    • 영상/3D 데이터 분할
    • 센서 네트워크의 엔티티 해상도
    • 스팸 및 부정 행위 탐지

Collective Classification Overview (1)

collective classification을 전반적으로 살펴보면 다음과 같다.

이때 1차 마르코프 연쇄를 사용한다. 즉, 노드 \(\mathrm{v}\) 의 레이블 \(Y_{v}\) 를 예측하기 위해서는 이웃노드 \(N_{v}\) 만 필요하다는 것이다. 2차 마르코프 연쇄를 사용할 경우 \(N_{v}\) 의 이웃노드 역시 사용할 것이다. 1차 마르포크 연쇄를 사용할 경우 식은 다음과 같아질 것이다.

\[ P\left(Y_{v}\right)=P\left(Y_{v} \mid N_{v}\right) \]

collective classification은 하나의 모델을 이용하거나 기존의 분류모델처럼 한번의 과정으로 구성되지 않고 총 세가지 과정으로 구성된다.

Collective Classification Overview (2)

Local Classifier

최초로 레이블을 할당하기 위해 사용되는 분류기이다. 즉, 그래프에서 레이블이 없는 노드들에 대해 우선 노드를 생성해야 하기 때문에, 기존의 분류문제와 동일하게 구성된다. 이때 예측 과정은 각 노드의 변수만 사용하여 이미 레이블이 있는 노드로 학습하고, 레이블이 없는 노드로 예측하게 된다. 그래프의 구조적 정보가 사용되지 않는다는 점에 유의하자.

Relational Classifier

노드 간 상관관계를 파악하기 위해 이웃 노드의 레이블과 변수를 사용하는 분류기이다. 이를 통해 이웃 노드의 레이블과 변수와 현재 노드의 변수를 이용해 현재 노드의 레이블을 예측할 수 있다. 이때, 이웃노드의 정보가 사용되기 때문에, 그래프의 구조적 정보가 사용된다.

Collective Inference

Collective Classification은 한번의 예측으로 종료되지 않는 것이 핵심이다. 특정 조건을 만족할 때까지 각 노드에 대해 분류하고 레이블을 업데이트한다. 이때의 조건이란 더이상 레이블이 변하지 않거나, 정해진 횟수를 의미한다. 이때 동일한 변수를 가진 노드라 하더라도 그래프의 구조에 따라 최종 예측이 달라질 수 있다는 점을 유념하자.

Overview of What is Coming

  • We focus on semi-supervised binary node classification
  • We will introduce three approaches:
    • Relational classification
    • Iterative classification
    • Correct & Smooth
  • 우리는 준지도 이진 노드 분류에 초점을 맞춘다.
  • 다음 세 가지 접근 방식을 소개합니다.
    • 관계구분
    • 반복구분
    • 정확하고 매끄러운

CS224W: Machine Learning with Graphs 2021 Lecture 5.1 - Message passing and Node Classification

5.2 - Relational and Iterative Classification

Relational Classification

Probabilistic Relational Classifier

  • Idea: Propagate node labels across the network

    • Class probability \(Y_v\) of node \(v\) is a weighted average of class probabilities of its neighbors.
  • For labeled nodes \(v\), initialize label \(Y_v\) with ground-truth label \(Y^*_v\).

  • For unlabeled nodes, initialize \(Y_v\) = 0.5.

  • Update all nodes in a random order until convergence or until maximum number of iterations is reached.

  • Update for each node \(v\) and label \(c\) (e.g. 0 or 1 )

    \[ P\left(Y_{v}=c\right)=\frac{1}{\sum_{(v, u) \in E} A_{v, u}} \sum_{(v, u) \in E} A_{v, u} P\left(Y_{u}=c\right) \]

    • If edges have strength/weight information, \(A_{v, u}\) can be the edge weight between \(v\) and \(u\)
    • \(P\left(Y_{v}=c\right)\) is the probability of node \(v\) having label \(c\)
  • Challenges:

    • Convergence is not guaranteed
    • Model cannot use node feature information
  • 아이디어: 노드 레이블을 네트워크에 전파

    • 노드 \(v\)의 클래스 확률 \(Y_v\)는 이웃의 클래스 확률에 대한 가중 평균이다.
  • 레이블링된 노드 \(v\)의 경우 지상 실측 레이블 \(Y^*_v\)로 레이블 \(Y_v\)를 초기화한다.

  • 레이블이 없는 노드의 경우 \(Y_v\) = 0.5를 초기화합니다.

  • 수렴할 때까지 또는 최대 반복 횟수에 도달할 때까지 모든 노드를 임의의 순서로 업데이트합니다.

  • 각 노드 \(v\) 및 레이블 \(c\)에 대한 업데이트(예: 0 또는 1)

    \[ P\left(Y_{v}=c\right)=\frac{1}{\sum_{(v, u) \in E} A_{v, u}} \sum_{(v, u) \in E} A_{v, u} P\left(Y_{u}=c\right) \]

    • 가장자리의 강도/무게 정보가 있는 경우 \(A_{v,u}\)\(v\)\(u\) 사이의 에지 가중치일 수 있습니다.
    • \(P\left(Y_{v}=c\right)\)는 노드 \(v\)\(c\) 레이블을 가질 확률이다.
  • 과제:

    • 수렴이 보장되지 않음
    • 모델은 노드 피쳐 정보를 사용할 수 없습니다.

Example: Initialization

Initialization:

  • All labeled nodes with their labels
  • All unlabeled nodes 0.5 (belonging to class 1 with probability 0.5)

초기화:

  • 라벨이 표시된 모든 노드
  • 표시되지 않은 모든 노드 0.5 (확률 0.5의 클래스 1에 속함)

Example: \(1^{st}\) Iteration, Update Node 3

  • Update for the \(1^{st}\) Iteration:
    • For node 3, \(N_3=[1,2,4]\)
  • \(1^{st}\) 반복에 대한 업데이트:
    • 노드 3의 경우 \(N_3=[1,2,4]\)

Example: \(1^{st}\) Iteration, Update Node 4

  • Update for the \(1^{st}\) Iteration:
    • For node 4, \(N_4=[1,3,5,6]\)
  • \(1^{st}\) 반복에 대한 업데이트:
    • 노드 4의 경우 \(N_4=[1,3,5,6]\)

Example: \(1^{st}\) Iteration, Update Node 5

  • Update for the \(1^{st}\) Iteration:
    • For node 5, \(N_5=[4,6,7,8]\)
  • \(1^{st}\) 반복에 대한 업데이트:
    • 노드 5의 경우 \(N_5=[4,6,7,8]\)

Example: After \(1^{st}\) Iteration

After Iteration 1 (a round of updates for all unlabeled nodes) 반복 후 1 (라벨이 지정되지 않은 모든 노드에 대한 업데이트 라운딩)

Example: After \(2^{nd}\) Iteration

After Iteration 2 (반복 후 2)

Example: After \(3^{rd}\) Iteration

After Iteration 3 (반복 후 3)

Example: After \(4^{th}\) Iteration

After Iteration 4 (반복 후 4)

Example: Convergence

  • All scores stabilize after 4 iterations.

    We therefore predict:

    • Nodes 4,5,8,9 belong to class 1 (\(𝑃_{Y_v}\) > 0.5)
    • Nodes 3 belong to class 0 (\(𝑃_{Y_v}\) < 0.5)
  • 4회 반복 후 모든 점수가 안정됩니다.

    따라서 다음과 같이 예측한다.

    • 노드 4,5,8,9가 클래스 1(\(𝑃_{Y_v}\) > 0.5)에 속함
    • 노드 3은 클래스 0(\(𝑃_{Y_v}\) < 0.5)에 속합니다.

Iterative Classification

Iterative Classification

  • Relational classifier does not use node attributes.

  • How can one leverage them?

  • Main idea of iterative classification:

    Classify node \(v\) based on its attributes \(f_v\) as well as labels \(z_v\) of neighbor set \(N_v\).

  • Input: Graph

    • \(f_{v}\) : feature vector for node \(v\)
    • Some nodes \(v\) are labeled with \(Y_{v}\)
  • Task: Predict label of unlabeled nodes

  • Approach: Train two classifiers: \(\phi_{1}\left(f_{v}\right)=\) Predict node label based on node feature vector \(f_{v}\). This is called base classifier.

  • \(\phi_{2}\left(f_{v}, z_{v}\right)=\) Predict label based on node feature vector \(f_{v}\) and summary \(z_{v}\) of labels of \(v'{\text {s }}\) neighbors.

    This is called relational classifier.

  • 관계 분류자가 노드 특성을 사용하지 않습니다.

  • 어떻게 그들을 활용할 수 있을까?

  • 반복 분류의 주요 개념:

    노드 \(v\)는 속성 \(f_v\)와 인접 세트 \(N_v\)의 레이블 \(z_v\)를 기준으로 분류한다.

  • 입력: 그래프

    • \(f_{v}\) : 노드 \(v\)의 피쳐 벡터
    • 일부 노드 \(v\)\(Y_{v}\)로 레이블 지정됨
  • 작업: 레이블이 없는 노드의 레이블 예측

  • 접근법: 두 가지 분류기 훈련: \(\phi_{1}\left(f_{v}\right)=\) 노드 특징 벡터 \(f_{v}\)를 기반으로 노드 레이블을 예측한다. 이를 기본 분류기라고 합니다.

  • \(\phi_{2}\left(f_{v}, z_{v}\right)=\) 노드 특징 벡터 \(f_{v}\)\(v'{\text {s}}\) 이웃 레이블의 요약 \(z_{v}\)를 기반으로 레이블을 예측한다.

    이를 관계 분류기라고 합니다.

Computing the Summary \(z_v\)

How do we compute the summary \(z_v\) of labels of \(v's\) neighbors \(N_v\)?

  • \(z_v\) = vector that captures labels around node \(v\)
    • Histogram of the number (or fraction) of each label in \(N_v\)
    • Most common label in \(N_v\)
    • Number of different labels in \(**N_v**\)

\(v\)의 인접 \(N_v\) 레이블의 요약 \(z_v\)는 어떻게 계산합니까?

  • \(z_v\) = 노드 \(v\) 주변의 레이블을 캡처하는 벡터
    • \(N_v\) 단위의 각 레이블의 숫자(또는 부분) 히스토그램
    • \(N_v\)의 가장 일반적인 레이블
    • \(N_v\)의 서로 다른 레이블 수

Architecture of Iterative Classifiers

  • Phase 1: Classify based on node attributes alone
    • On the labeled training set, train two classifiers:
      • Base classifier: \(\phi_{1}\left(f_{v}\right)\) to predict \(Y_{v}\) based on \(f_{v}\)
      • Relational classifier: \(\phi_{2}\left(f_{v}, z_{v}\right)\) to predict \(Y_{v}\) based on \(f_{v}\) and summary \(z_{v}\) of labels of \(v^{\prime}\)s neighbors
  • Phase 2: Iterate till convergence
    • On test set, set labels \(Y_{v}\) based on the classifier \(\phi_{1}\), compute \(z_{v}\) and predict the labels with \(\phi_{2}\)
    • Repeat for each node \(v\) :
      • Update \(z_{v}\) based on \(Y_{u}\) for all \(u \in N_{v}\)
      • Update \(Y_{v}\) based on the new \(z_{v}\left(\phi_{2}\right)\)
    • Iterate until class labels stabilize or max number of iterations is reached
    • Note: Convergence is not guaranteed
  • 1단계: 노드 속성만을 기준으로 분류
    • 라벨이 부착된 교육 세트에서 두 가지 분류기를 교육합니다.
      • 기본 분류자: \(f_{v}\)를 기반으로 \(Y_{v}\)를 예측하기 위한 \(\phi_{1}\left(f_{v}\right)\)
      • 관계 분류자: \(f_{v}\)\(v^{\prime}\)s 인접 레이블의 요약 \(z_{v}\)를 기반으로 \(Y_{v}\)를 예측하기 위한 \(\phi_{2}\left(f_{v}, z_{v}\right)\)
  • 2단계: 수렴될 때까지 반복
    • 테스트 세트에서 \(\phi_{1}\) 분류기를 기반으로 레이블 \(Y_{v}\)을 설정하고 \(z_{v}\)를 계산하고 \(\phi_{2}\)로 레이블을 예측한다.
    • 각 노드 \(v\)에 대해 반복:
      • 모든 \(u \in N_{v}\)에 대해 \(Y_{u}\)를 기준으로 \(z_{v}\) 업데이트
      • \(z_{v}\left(\phi_{2}\right)\)를 기준으로 \(Y_{v}\) 업데이트
    • 클래스 레이블이 안정되거나 최대 반복 횟수에 도달할 때까지 반복
    • 참고: 수렴이 보장되지 않음

Example: Web Page Classification

  • Input: Graph of web pages

  • Node: Web page

  • Edge: Hyper-link between web pages

    • Directed edge: a page points to another page
  • Node features: Webpage description

    • For simplicity, we only consider two binary features
  • Task: Predict the topic of the webpage

  • Baseline: Train a classifier (e.g., linear classifier) to classify pages based on node attributes.

  • 입력: 웹페이지 그래프

  • 노드: 웹 페이지

  • 가장자리: 웹 페이지 간의 하이퍼링크 (Directed Edge)

    • 방향 가장자리: 한 페이지가 다른 페이지를 가리키다
  • 노드 기능: 웹 페이지 설명 (TF-IDF 등의 토큰 정보, 여기선 2차원 벡터로 표현)

    • 단순성을 위해 두 개의 이진 기능만 고려한다.
  • 작업: 웹 페이지의 주제 예측

  • 기준: 노드 속성을 기준으로 페이지를 분류하도록 분류기(예: 선형 분류기)를 훈련합니다.

  • Each node maintains vectors \(z_v\) of neighborhood labels:
    • \(I\) = Incoming neighbor label information vector.
    • \(O\) = Outgoing neighbor label information vector.
      • \(I_0\) = 1 if at least one of the incoming pages is labelled 0.

        Similar definitions for \(I_0\), \(O_0\), and \(O_1\)

  • 각 노드는 이웃 레이블의 벡터 \(z_v\)를 유지한다.
    • \(I\) = 들어오는 인접 레이블 정보 벡터.
    • \(O\) = 나가는 인접 레이블 정보 벡터.
      • \(I_0\) = 1 (수신 페이지 중 하나 이상이 0으로 표시된 경우)

        \(I_0\), \(O_0\)\(O_1\)에 대한 유사한 정의

Iterative Classifier - Step 1

  • On training labels, train two classifiers:
    • Node attribute vector only: \(\phi_1(f_v)\)
    • Node attribute and link vectors \(z_v\): \(\phi_2(f_v,z_v)\)
  1. Train classifiers
  2. Apply classifier to unlab. set
  3. Iterate
  4. Update relational features \(z_v\)
  5. Update label \(Y_v\)
  • 교육 라벨에서 두 가지 분류기를 교육합니다.
    • 노드 속성 벡터만: \(\phi_1(f_v)\)
    • 노드 속성 및 링크 벡터 \(z_v\): \(\phi_2(f_v,z_v)\)
  1. 분류기 학습
  2. 레이블 해제 세트에 분류자 적용
  3. 반복
  4. 관계 기능 업데이트 \(z_v\)
  5. 레이블 업데이트 \(Y_v\)

Iterative Classifier - Step 2

  • On the unlabeled set:
    • Use trained node feature ****vector classifier \(**\phi_1**\) to set \(**Y_v**\)
  1. Train classifiers
  2. Apply classifier to unlab. set
  3. Iterate
  4. Update relational features \(z_v\)
  5. Update label \(Y_v\)
  • 라벨이 없는 세트에서:
    • 훈련된 노드 특징 벡터 분류기 \(\phi_1\)를 사용하여 \(Y_v\) 설정
  1. 분류기 학습
  2. 레이블 해제 세트에 분류자 적용
  3. 반복
  4. 관계 기능 업데이트 \(z_v\)
  5. 레이블 업데이트 \(Y_v\)

Iterative Classifier - Step 3.1

  • Update \(z_v\) for all nodes:
  1. Train classifiers
  2. Apply classifier to unlab. set
  3. Iterate
  4. Update relational features \(z_v\)
  5. Update label \(Y_v\)
  • 모든 노드에 대해 \(z_v\) 업데이트:
  1. 분류기 학습
  2. 레이블 해제 세트에 분류자 적용
  3. 반복
  4. 관계 기능 업데이트 \(z_v\)
  5. 레이블 업데이트 \(Y_v\)

Iterative Classifier - Step 3.2

  • ****Re-classify all nodes with \(\phi_2\):**
  1. Train classifiers
  2. Apply classifier to unlab. set
  3. Iterate
  4. Update relational features \(z_v\)
  5. Update label \(Y_v\)
  • \(\phi_2\)로 모든 노드를 다시 분류합니다.
  1. 분류기 학습
  2. 레이블 해제 세트에 분류자 적용
  3. 반복
  4. 관계 기능 업데이트 \(z_v\)
  5. 레이블 업데이트 \(Y_v\)

Iterative Classifier - Iterate

  • Continue until convergence
    • Update \(z_v\) based on \(Y_v\)
    • Update \(Y_v\) = \(\phi_2(f_v,z_v)\)
  1. Train classifiers
  2. Apply classifier to unlab. set
  3. Iterate
  4. Update relational features \(z_v\)
  5. Update label \(Y_v\)
  • 정합될 때까지 계속합니다
    • \(Y_v\)를 기준으로 \(z_v\) 업데이트
    • 업데이트 \(Y_v\)= \(\phi_2(f_v,z_v)\)
  1. 분류기 학습
  2. 레이블 해제 세트에 분류자 적용
  3. 반복
  4. 관계 기능 업데이트 \(z_v\)
  5. 레이블 업데이트 \(Y_v\)

Iterative Classifier - Final Prediction

  • Stop iteration
    • After convergence or when maximum iterations are reached
  • 반복 중지
    • 수렴 후 또는 최대 반복 횟수에 도달한 경우

Summary

  • We talked about 2 approaches to collective classification
  • Relational classification
    • Iteratively update probabilities of node belonging to a label class based on its neighbors
  • Iterative classification
    • Improve over collective classification to handle attribute/feature information
    • Classify node 𝑣 based on its features as well as labels of neighbors
  • 집단 분류에 대한 2가지 접근법에 대해 이야기했습니다
  • 관계구분
    • 인접 관계에 따라 레이블 클래스에 속하는 노드의 확률을 반복적으로 업데이트합니다.
  • 반복구분
    • 특성/특징 정보를 처리하기 위해 집합 분류보다 개선
    • 특징과 이웃의 label을 기준으로 노드 based 분류

CS224W: Machine Learning with Graphs 2021 Lecture 5.2 - Relational and Iterative Classification

5.3 - Collective Classification : Belief Propagation

Collective Classification : Belief Propagation

Collective Classification Models

  • Relational classifiers

  • Iterative classification

  • Loopy belief propagation

  • 관계 분류자

  • 반복구분

  • 루피 신앙 전파

Loopy Belief Propagation

  • Belief Propagation is a dynamic programming approach to answering probability queries in a graph (e.g. probability of node \(v\) belonging to class 1 )

  • Iterative process in which neighbor nodes “talk” to each other, passing messages

  • When consensus is reached, calculate final belief

  • 믿음 전파는 그래프에서 확률 쿼리에 응답하는 동적 프로그래밍 접근법이다(예: 클래스 1에 속하는 노드 \(v\)의 확률).

  • 인접 노드가 메시지를 전달하면서 서로 “대화”하는 반복 프로세스

  • 합의가 이루어지면 최종 믿음을 계산합니다.

Message Passing: Basics

  • Task: Count the number of nodes in a graph*

  • Condition: Each node can only interact (pass message) with its neighbors

  • Example: path graph

  • 과제: 그래프의 노드 수 계산*

  • 조건: 각 노드는 인접 노드와만 상호 작용(메시지 전달)할 수 있습니다.

  • 예: 경로 그래프

Potential issues when the graph contains cycles.

We’ll get back to it later!

그래프에 주기가 포함되어 있을 때 발생할 수 있는 문제. 나중에 다시 얘기하자!

Message Passing: Algorithm

  • Task: Count the number of nodes in a graph
  • Algorithm:
    • Define an ordering of nodes (that results in a path)
    • Edge directions are according to order of nodes
      • Edge direction defines the order of message passing
    • For node \(i\) from 1 to 6
      • Compute the message from node \(i\) to \(i+1\) (number of nodes counted so far)
      • Pass the message from node \(i\) to \(i+1\)
  • 과제: 그래프의 노드 수 계산
  • 알고리즘:
    • 노드 순서 정의(경로 생성)
    • 에지 방향은 노드 순서에 따릅니다.
      • 에지 방향은 메시지 전달 순서를 정의합니다.
    • 노드 \(i\)의 경우 1 ~ 6까지
      • 노드 \(i\)에서 \(i+1\)로 메시지 계산 (지금까지 카운트된 노드 수)
      • 노드 \(i\)에서 \(i+1\)로 메시지 전달

Message Passing: Basics

Task: Count the number of nodes in a graph Condition: Each node can only interact (pass message) with its neighbors Solution: Each node listens to the message from its neighbor, updates it, and passes it forward \(m\) : the message

작업: 그래프의 노드 수 계산 조건: 각 노드는 인접 노드와만 상호 작용(메시지 전달)할 수 있습니다. 솔루션: 각 노드는 인접 노드로부터 메시지를 수신하고 업데이트한 후 전달 \(m\) : 메시지

Generalizing to a Tree

  • We can perform message passing not only on a path graph, but also on a tree-structured graph

  • Define order of message passing from leaves to root

  • 경로 그래프뿐만 아니라 트리 구조 그래프에서도 메시지 전달을 수행할 수 있습니다.

  • 리프에서 루트로 전달되는 메시지 순서 정의

Message passing in a tree

Update beliefs in tree structure

트리 구조의 신뢰 업데이트

Loopy BP Algorithm

What message will \(i\) send to \(j\) ? - It depends on what \(i\) hears from its neighbors - Each neighbor passes a message to \(i\) its beliefs of the state of \(i\)

\(i\)\(j\)에 보낼 메시지는 무엇입니까? - \(i\)가 이웃으로부터 무엇을 듣느냐에 따라 달라진다. - 각 이웃은 \(i\) 상태에 대한 믿음을 \(i\)에 전달한다.

Notation

  • Label-label potential matrix \(\psi\) : Dependency between a node and its neighbor. \(\boldsymbol{\psi}\left(Y_{i}, Y_{j}\right)\) is proportional to the probability of a node \(j\) being in class \(Y_{j}\) given that it has neighbor \(i\) in class \(Y_{i}\).

  • Prior belief \(\phi: \phi\left(Y_{i}\right)\) is proportional to the probability of node \(i\) being in class \(Y_{i}\).

  • \(m_{i \rightarrow j}\left(Y_{j}\right)\) is \(i^{\prime}\) s message / estimate of \(j\) being in class \(Y_{j}\).

  • \(\mathcal{L}\) is the set of all classes/labels

  • 레이블 레이블 잠재적 매트릭스 \(\psi\) : 노드와 인접 노드 간의 종속성. \(\boldsymbol{\psi}\left(Y_{i}, Y_{j}\right)\)는 노드 \(j\)가 클래스 \(Y_{j}\)에 있을 확률에 비례한다.

  • \(\phi: \phi\left(Y_{i}\right)\)는 노드 \(i\)가 클래스 \(Y_{i}\)에 포함될 확률에 비례한다.

  • \(m_{i \rightarrow j}\left(Y_{j}\right)\)는 클래스 \(Y_{j}\)에 속하는 \(j\)\(i^{\prime}\) 메시지/추정이다.

  • \(\mathcal{L}\) 는 모든 클래스/라벨의 집합입니다.

Loopy BP Algorithm

  1. Initialize all messages to 1

  2. Repeat for each node:

  3. 모든 메시지를 1로 초기화

  4. 각 노드에 대해 반복합니다.

After convergence: \(b_{i}\left(Y_{i}\right)=\) node \(i\) ’s belief of being in class \(Y_{i}\)

수렴 후: \(b_{i}\left(Y_{i}\right)=\) 노드 \(i\)의 클래스 \(Y_{i}\)에 대한 믿음

Example: Loopy Belief Propagation

  • Now we consider a graph with cycles
  • There is no longer an ordering of nodes
  • We apply the same algorithm as in previous slides:
    • Start from arbitrary nodes
    • Follow the edges to update the neighboring nodes

What if our graph has cycles? Messages from different subgraphs are no longer independent! But we can still run BP, but it will pass messages in loops.

  • 이제 주기가 있는 그래프를 살펴봅시다.
  • 더 이상 노드 순서가 없습니다.
  • 이전 슬라이드와 동일한 알고리즘을 적용합니다.
    • 임의 노드에서 시작
    • 가장자리를 따라 인접 노드를 업데이트합니다.

만약 우리 그래프에 주기가 있다면? 다른 하위 그래프의 메시지는 더 이상 독립적이지 않습니다! 하지만 BP는 여전히 실행할 수 있지만 메시지를 루프 형태로 전달합니다.

What Can Go Wrong?

  • Beliefs may not converge
  • Message \(m_{u \rightarrow i}\left(Y_{i}\right)\) is based on initial belief of \(i\), not a separate evidence for \(i\)
  • The initial belief of \(i\) (which could be incorrect) is reinforced by the cycle

\[ i \rightarrow j \rightarrow k \rightarrow u \rightarrow i \]

  • However, in practice, Loopy BP is still a good heuristic for complex graphs which contain many branches.

  • 신념이 수렴되지 않을 수 있다.

  • 메시지 \(m_{u \rightarrow i}\left(Y_{i}\right)\)\(i\)에 대한 별도의 증거가 아니라 \(i\)의 초기 믿음에 기초한다.

  • (잘못될 수 있음) \(i\)의 초기 신념은 주기에 의해 강화된다.

\[ i \rightarrow j \rightarrow k \rightarrow u \rightarrow i \]

  • 그러나 실제로 Loopy BP는 많은 분기를 포함하는 복잡한 그래프에 여전히 좋은 휴리스틱이다.

  • Messages loop around and around: \(2,4,8,16,32, \ldots\) More and more convinced that these variables are \(T\) !
  • BP incorrectly treats this message as separate evidence that the variable is \(\mathrm{T}\)!.
  • Multiplies these two messages as if they were independent.
    • But they don’t actually come from independent parts of the graph.
    • One influenced the other (via a cycle).
  • 메시지는 돌고 돈다: \(2,4,8,16,32,\ldots\) 이러한 변수가 \(T\)임을 점점 더 확신하게 된다!
  • BP는 이 메시지를 변수가 \(\mathrm{T}\)라는 별도의 증거로 잘못 취급한다.
  • 이 두 메시지를 독립한 것처럼 곱합니다.
    • 하지만 그것들은 사실 그래프의 독립적인 부분에서 나온 것이 아닙니다.
    • 한 사람이 다른 사람에게 영향을 주었다.

This is an extreme example. Often in practice, the cyclic influences are weak. (As cycles are long or include at least one weak correlation.)

이것은 극단적인 예입니다. 실제로, 주기적인 영향은 약하다. (주기가 길거나 하나 이상의 약한 상관 관계를 포함하기 때문에)

Advantages of Belief Propagation

  • Advantages:
    • Easy to program & parallelize
    • General: can apply to any graph model with any form of potentials
      • Potential can be higher order: e.g. \(\boldsymbol{\psi}\left(Y_{i}, Y_{j}, Y_{k}, Y_{v} \ldots\right)\)
  • Challenges:
    • Convergence is not guaranteed (when to stop), especially if many closed loops
  • Potential functions (parameters)
    • Require training to estimate
  • 장점:
    • 프로그래밍 및 병렬화가 용이함
    • 일반: 모든 형태의 잠재력이 있는 그래프 모델에 적용할 수 있습니다.
      • 잠재력은 고차일 수 있다. 예를 들어 \(\boldsymbol{\psi}\left(Y_{i}, Y_{j}, Y_{k}, Y_{v} \ldots\right)\)
  • 과제:
    • 특히 닫힌 루프가 많은 경우 수렴이 보장되지 않습니다(정지 시기).
  • 잠재적 함수(모수)
    • 평가하려면 교육 필요

Summary

  • We learned how to leverage correlation in graphs to make prediction on nodes
  • Key techniques:
    • Relational classification
    • Iterative classification
    • Loopy belief propagation
  • 우리는 그래프의 상관 관계를 활용하여 노드에 대한 예측을 하는 방법을 배웠다.
  • 주요 기술:
    • 관계구분
    • 반복구분
    • 루피 신앙 전파

CS224W: Machine Learning with Graphs 2021 Lecture 5.3 - Collective Classification