# Object and Event Detection Pipeline for Rink Hockey Games
## 4 Experiments and Evaluation
### Event Detection  
For the rule production system used for event detection, one rule, illustrated in Algorithm 1, was tested to detect the occurrence of penalties or direct free hits, according to the existing official risk hockey regulations [42].  
```
inputs:current_time, the current time; \(\Delta t\), temporal window duration for event searching returns:\(EVENT\_DIRECT\_FREE\_HIT\_OR\_PENALTY\) if detects the event or \(FALSE\) if not functiondirect_FREE_HIT_OR_penalty_Rule(\(current\_time,\Delta t\)) \(OL\)\(\leftarrow\)\(\textsc{update\_objects\_detected}()\)\(\triangleright\) Gets the automatically annotated detected list of visual objects, updated and timestamped \(t_{1}\)\(\leftarrow\)\(current\_time-\Delta t\) \(t_{2}\)\(\leftarrow\)\(current\_time\) if\(T(isReferee(OL)\)\(\wedge\)\(isGoal(OL)\)\(\wedge\)\(isGoalkeeper(OL)\)\(\wedge\)\(countPlayer(OL)\)\(==TRUE,t_{1},t_{2})\)then return\(EVENT\_DIRECT\_FREE\_HIT\_OR\_PENALTY\) else return\(FALSE\) endif endfunction
```  
**Algorithm 1** Function Implementing Rule for Direct Free Hit or Penalty Detection  
This rule considers several predicates. The predicate \(T(expression,t_{1},t_{2})\) is true if _expression_ is true for the temporal interval between \(t_{1}\) and \(t_{2}\). Remaining predicates are auto-explicated and have, as their argument, the updated list \(LO\) of timestamped and automatically detected visual objects. Predicates starting with the prefix _is_ mean the presence of at least one visual object in that frame for that class. Predicates starting with the prefix _count_ return the total number of visual objects in that frame for that class.  
According to the current regulations [42], the player taking the penalty or the direct free hit has, after the indication of the main referee, a maximum of five seconds to start  
Figure 8: Confusion matrix.  
the execution with the ball stopped. Thus, in this rule, the temporal window duration, \(\Delta t=(t_{2}-t_{1})\), should be appropriately chosen. In our qualitative analysis, we set \(\Delta t=4\) s. In the quantitative preliminary tests, we annotated a total of 23 penalty images: 11 from the training set; 7 from the validation set; and 5 from the test set. Figure 9 illustrates an example of a penalty detected by our rule where six distinct visual object instances are considered:  
* Predicate \(isReferee(LO)\) is satisfied by the visual object of class referee;
* Predicate \(isGoal(LO)\) is satisfied by the visual object of class goal;
* Predicate \(isGoalkeeper(LO)\) is satisfied by the visual object of class goalkeeper;
* Predicate \(countPlayer(LO)==1\) is satisfied by the presence of exactly one instance of class player per frame;
* Predicate \(T(f,t_{1},t_{2})\) is satisfied by the truthfulness of \(f\), where \(f=isReferee(LO)\wedge isGoal(LO)\wedge isGoalkeeper(LO)\wedge countPlayer(LO)==1\) in at least one frame within the time interval \([t_{1},t_{2}]\) and according to the test criteria adopted.  
The penalty and direct free hit sanction executions are probably the most important ones in risk hockey. Thus, their detection is rather important as an event. Figure 5 (row, col) = (3, 4) illustrates an example of a penalty event during the game that was correctly detected by this rule.