(smooth $L_1$ loss), respectively. The two terms are normalized by $N_{cls}$ and $N_{res}$. $\beta$ is the balancing parameter.

### Neighbor Loss {#sec:neighborloss}

Since the sequential orders of the amino acids is provided in this task, the geometric constraints (distance, the overlapping region and sequential order) between amino acids should be integrated to regularize the detection results, as shown in [@gao2018question]. In most cases, the distance between an amino acid and one of its two neighbors, should be smaller than the distance between its two neighbors. To take advantage of this information, we introduced a novel neighbor loss. For each proposal, we checked both criteria: 1) it is a positive anchor, and 2) its distance to either neighbor of the associated ground truth, is smaller than the distance between the two neighbors. The qualified anchor will be assigned a higher weight as they are “better” samples in the view of the sequence. The additional weight $(1-p_i)^\lambda$ follows the spirit of focal loss [@lin2017focal], which down-weights the sample well classified by the model. We define the neighbor loss as: $$\begin{aligned}
\begin{split}
      L_{neighbor}(p_i) = - ((1-p_i)^\lambda m_i + 1) log(p_i),
\end{split}    \end{aligned}$$ where $m_i\in \{0,1\}$, and $m_i=1$ when object $i$ is one of 