The aim of this study is to detect aggressive behaviors of pigs. An artificial intelligence model, specialized in detecting aggressive behaviors of pigs, was developed to automatically detect aggression and help the farmers to respond in a timely manner. We approached it as image anomaly detection setting, and a few anomaly data were used in training. To detect aggressive behaviors of pigs, we proposed a method of Reconstruction Loss Inversion (R.L.I) based on an autoencoder. Additionally, with the adversarial attack, we proposed a method that can handle the unseen anomaly problem. Reconstruction loss inversion (R.L.I) is literally taking the inverse of loss function only for the case of anomaly. The reconstruction error of anomaly in inference can be increased enough to discriminate between normal and anomaly with ease. In addition, by the adversarial attack, a small linear perturbation was added to the normal feature vector in the direction of increasing reconstruction error, and the perturbed normal feature vector was considered as anomaly by applying R.L.I. Therefore, the model could learn various representations of anomaly, detecting unseen anomalies. Our method remarkably outperformed the competing methods for both known anomaly and unseen anomaly detection.
본 연구의 목적은 돼지의 공격적인 행동을 탐지하는 것이다. 돼지의 이상행동 탐지에 특화된 인공지능 모델을 개발하여 공격적 행동을 자동적으로 탐지하고, 이에 대한 농장주의 시의적절한 대처에 도움을 주고자 한다. 이미지 분야의 이상치 탐지 문제로 접근하였으며, 적은 양의 이상치 데이터를 모델링에 사용하였다. 돼지의 공격적 행동을 탐지하기 위해 재구성 손실 역전 및 적대적 공격 방법을 활용하는 방법을 제안했다. 재구성 손실 역전을 통해 이상치의 재구성 오류를 높이는 방향으로 학습시킴으로써, 추론 시 이상치의 재구성 오류가 커질 수 있도록 유도했다. 또한, 적대적 공격 방법을 통해, 재구성 오류가 증가하는 방향으로 정상 특징 벡터에 작은 변동을 준 벡터를 이상치로 간주함으로써, 모델이 이상치와 비슷한 표현을 다양하게 학습하도록 했다. 이를 통해 모델이 학습 데이터에서 보지 못한 이상치를 보다 잘 탐지할 수 있게 되길 기대했다. 우리가 제안한 모델이 알려진 이상치 팀지와 보지 못한 이상치 탐지 모두에서 경쟁 방법론들보다 유의미한 차이로 좋은 성능을 보였다.