|
Algorithm 1: Temporal Information Bottleneck (TIB) |
-
1:
Input: Sequence of video frames F = {f1, f2, …, fn} frame rate fps
-
2:
Output: Pedagogically significant keyframes K = {k1, k2, …, kr}, moderate significance frames K’ = {k’1, k’2, …, k’s}
-
3:
// Step 1: Pedagogical Information Scoring
-
4:
for i ← 2 to n do
-
5:
Compute MSEᵢ ← // structural saliency
-
6:
Compute SaliencyMapᵢ ← ComputeSaliencyMap(fᵢ)
-
7:
Compute SaliencyValueᵢ ← Mean (SaliencyMapᵢ) // content saliency
-
8:
Set weight α ← 0.67
-
9:
Compute SignificanceScoreᵢ ← α × MSEᵢ + (1 − α) × SaliencyValuei//pedagogical information score
-
10:
end for
-
11:
//Step 2: Instructional Transition Identification
Apply Clusters ← DensityPeakClustering({SignificanceScore2, …, SignificanceScoren})
-
12:
Initialize candidate keyframes: K ← {| ∈ Clusters.Centroids}
-
13:
// Step 2: Domain-informed pruning
-
14:
Initialize K’ ←∅
-
15:
for each frame k∈ K do
-
16:
Compute duration ← ComputeFrameDuration(k, fps)
-
17:
Compute personArea ← ComputePersonArea(k)
-
18:
Compute ssim ← ComputeSSIM (k, previousKeyframe)
-
19:
Compute saliencyScore ← Mean (ComputeSaliencyMap(k))
-
20:
Compute nccBlank ← ComputeNCC (k, )
-
21:
Compute nccLogo ← ComputeNCC (k, )
-
22:
if duration < then
-
23:
Remove k from K
-
24:
else if nccBlank > Threshold_Blank or nccLogo > Threshold_Logo then
-
25:
Remove k from K
-
26:
else if personArea > AreaThreshold and not HasContext(k) then
-
27:
Remove k from K
-
28:
else if ssim > SSIMThresholdHigh and duration > DurationThreshold then
-
29:
Remove k from K
-
30:
else if ssim > SSIMThresholdModerate and saliencyScore < SaliencyThresholdLow then
-
31:
Add k to K’
-
32:
end if
-
33:
end for
-
34:
return K, K’
|