Abstract:
RESUMO: Com o  aumento da produção comercial dos criatórios de animais puros da raça de 
galinhas Canela-Preta surge a necessidade de automatizar a identificação dos 
animais. Algoritmos de visão computacional têm se mostrado eficientes  na 
automação de identificação de animais para zootecnia de precisão.  Neste sentido, 
este trabalho tem como proposta desenvolver um algoritmo com base em  visão
computacional para detectar e identificar, por meio de imagens, galinhas da raça 
Canela-Preta. Para essa finalidade, foram capturadas 501 imagens de 167 fêmeas 
adultas. No entanto, 33 imagens de 11 indivíduos foram descartadas  devido à baixa
qualidade, de modo que  apenas 468 imagens com resolução 1280 x 1920 pixels
serviram como base de dados. Isto resultou em 156 indivíduos tomados como 
referência em três planos distintos (lateral direito, lateral esquerdo e frontal).  Foram 
utilizados dois métodos para a identificação das galinhas. O primeiro consistiu na 
aplicação de uma rede neural convolucional (CNN), utilizando as 468 imagens da 
base separadas em treino, validação e teste, para gerar o modelo e, posteriormente, 
identificar o indivíduo. O segundo  método utilizou 156 imagens frontais das galinhas
para a detecção dos indivíduos pela rede YOLO (you  only look once) e, em seguida, 
o template matching, que buscou as imagens detectadas para encontrar a melhor 
similaridade entre uma imagem de entrada (template) e outra de pesquisa 
(indivíduo). Como resultado, na etapa de detecção, obteve -se taxa de acerto de 
86,54% e 14,46% de erro, correspondendo a 135 e 21 imagens, respectivamente . 
Para a etapa de identificação  com uso da CNN, foi obtida acurácia de 40%. A
técnica de template matching conseguiu identificar os indivíduos com acurácia de 
86,54%, similaridade média de 99,58% e taxa de erro médio de 0,42%. Conclui-se 
que este trabalho atingiu sua proposta de desenvolver um algoritmo para identificar 
individualmente galinhas caipiras da raça Canela-Preta. Esse algoritmo poderá ser 
utilizado para a identificação de galinhas por meio de imagens, monitoramento, controle  genealógico, bem-estar e tomadas de decisões quanto ao manejo das 
galinhas.
ABSTRACT: The need for automated animal identification emerges with the increased commercial
production of  purebred Canela-Preta chickens. In this sense, computer vision
algorithms have proven to be efficient in the automation of animal identification for 
precision livestock farming. In the current study, we proposed the development of an
algorithm  based  on  computer  vision  to  detect  and  identify  Canela-Preta chickens
through  images. For this  purpose, 501 images  of 167  adult  female chickens  were
captured. Nevertheless, 33  low quality  images  of 11 individuals  were  discarded, so 
that the database  was composed of  only 468 images  with 1280 × 1920  pixels. This
resulted in 156 individuals used as reference in three different planes (right side view, 
left  side view, and frontal plane). Two methods  were  used for chicken identification. 
The first method was the application of a convolutional neural network (CNN), using
the 468 images of the database, which were distributed into training, validation, and
testing to generate the model and subsequently identify the individual. The second
method used 156 frontal images of the chickens for detection of the individuals
applying the YOLO (you only look once) network, and then template matching, which
searched the detected images to find the best similarity between an input image 
(template) and a search image (animal). A rate of 86.54% accuracy and an error rate 
of 14.46% were obtained in the detection step, which corresponded to 135 and 21 
images, respectively. An accuracy of 40% was reached in the identification step
using the CNN. The template matching allowed the identification of individuals with 
accuracy of 86.54%, average similarity of 99.58%, and average error rate of 0.42%. 
We concluded that this work has achieved its proposal of developing an algorithm for 
individual identification of Canela-Preta free-range chickens. Thus, this algorithm
could be used for the image identification of chickens, monitoring, genealogical 
control, welfare, and decision-making regarding the management of chickens.