# A Photo Identification Framework to Prevent Copyright Infringement with Manipulations
## 3 Copyright Photo Identification Framework
### Image Rol Detection
```
Input: Subframe \(\mathbf{T}=\{x,y,w,h\}\), current partition level \(L\), partition probability \(p_{\text{div}}\), and partition center parameter \(\alpha\) Output: Frame partitioning information \(\mathbf{T}^{\text{out}}\in\mathbb{R}^{K\times 4}\), where \(K\) is the number of total subframes FunctionSubFrame(\(\mathbf{T},L,p_{\text{div}},\alpha\)): \(P_{\text{div}}\)(\"True\") \(=p_{\text{div}}\), \(P_{\text{div}}\)(\"False\") \(=1-p_{\text{div}}\); \(x\leftarrow\) SampleFromDistribution(\(P_{\text{div}}\)); if\(x\) = \"True\" or \(L>0\)then \(P_{\text{axis}}\)(\"V\") \(= \begin{cases}w/h&\text{if }w\leq h,\\ h/w&\text{otherwise}\end{cases} \), \(P_{\text{axis}}\)(\"H\") \(=1-P_{\text{axis}}\)(\"V\");  Axis \(\leftarrow\) SampleFromDistribution(\(P_{\text{axis}}\)) ;// Axis of partition if\(x\) = \"True\" or \(L>0\)then \(P_{\text{axis}}\)(\"V\") \(= \begin{cases}w/h&\text{if }w\leq h,\\ h/w&\text{otherwise}\end{cases} \), \(P_{\text{axis}}\)(\"H\") \(=1-P_{\text{axis}}\)(\"V\");  Axis \(\leftarrow\) SampleFromDistribution(\(P_{\text{axis}}\)) ;// Axis of partition if\(\text{Axis}\) = \"V\" then \(\mu=(h/2)\); else\(\mu=(w/2)\); \(\sigma=\mu/(4\sqrt{2\log\left(\alpha\right)})\) ;// FWHM \(c\leftarrow\) SampleFromDistribution(\(\mathcal{N}(\mu,\sigma^{2})\)); if\(\text{Axis}\) = \"V\" then \(t_{\text{model}1}=\{x,y,w,c\}\) ;// Top \(t_{\text{node}2}=\{x,y+c,w,h-c\}\) ;// Bottom  end if else \(t_{\text{node}1}=\{x,y,c,h\}\) ;// Left \(t_{\text{node}2}=\{x+c,y-c,w-c,h\}\) ;// Right  end if \(\mathbf{T}^{\text{out}}\leftarrow\) Insert(PartitionSubFrame(\(t_{\text{node}1}\),\(L-1\), \(p_{\text{div}}^{2}\), \(\alpha\))); \(\mathbf{T}^{\text{out}}\leftarrow\) Insert(PartitionSubFrame(\(t_{\text{node}2}\), \(L-1\), \(p_{\text{div}}^{2}\), \(\alpha\)));  end if  end if else \(\mathbf{T}^{\text{out}}\leftarrow\) Insert(\(\mathbf{T}\));// Leaf node  end if return\(\mathbf{T}^{\text{out}}\)
```  
**Algorithm 1**Generating the template by the partitioning frame. For each partitioning step, the occurrence of partition, partitioning axis, and its center are randomly determined with appropriate probability distributions. Specifically, we sample the partition center from a Gaussian distribution centered on the mid-location of the partition axis to make the size of the subframe variable. Furthermore, to prevent the partition center set too far from the mid-location, the variance of the Gaussian distribution is computed based on full width tenth maximum (FWTM) with \(\alpha=10\). Details of the recursive frame partitioning algorithm are shown in Algorithm 1. In Figure 6, an example of recursive frame partitioning is described. For an image collage produced from the proposed method, the bounding box information and its label named as 'image' for each image in the image collage are marked as the ground-truth label. In our framework, by using the trained detectors, the image RoIs of the query image are determined based on detected images in an image collage and its objects. Note that the number of RoIs is the number of images used for image collage. Since the main purpose of copyrighted photos is to use a salient object, the image RoI is chosen to be a bounding box of the conspicuous object. If there is an object in a single image, a bounding box of the object which has a larger IoU (Intersection over Union) than the predefined IoU threshold is determined to the image RoI while the whole image is used as image RoI otherwise. By using image RoI instead of general objects or whole image regions, our framework is robust to the geometric manipulations.