Beyond Deepfake Technology Fear: On its Positive Uses for Livestock Farming

8 Deepfake technologies are known for the creation of forged celebrity pornography, face and voice 9 swaps, and other fake media content. Despite the negative connotations the technology bears, the 10 underlying machine learning algorithms have a huge potential that could be applied to not just digital 11 media, but also to medicine, biology, affective science, and agriculture, just to name a few. Due to the 12 ability to generate big datasets based on real data distributions, deepfake could also be used to 13 positively impact non-human animals such as livestock. Generated data using Generative Adversarial 14 Networks, one of the algorithms that deepfake is based on, could be used to train models to accurately 15 identify and monitor animal health and emotions. Through data augmentation, using digital twins, and 16 maybe even displaying digital conspecifics where social interactions are enhanced, deepfake 17 technologies have the potential to increase animal health, emotionality, sociality, animal-human and 18 animal-computer interactions and thereby animal welfare, productivity, and sustainability of the 19 farming industry. 20


1
Introduction 21 Videos of politicians appearing to make statements they have never said in real-life, edited (revenge)  22 pornography of celebrities, and movies with actors that have already passed awaydeepfake 23 technologies keep appearing in many different types of media, often while the audience is unaware of 24 it. The term deep fake stems from combining the words 'deep learning' and 'fake', as the technology 25 relies on machine learning technologies to create forged content. Deepfake is a type of technology 26 based on artificial intelligence (AI) that allows fake pictures, videos or other forms of media to be 27 created through swapping faces or voices, for example. Popularly, deepfakes carry a tainted 28 representation due to their adverse misuses that can result in manipulation, misinterpretation, or 29 malicious effects. However, the technologies behind it, in particular the Generative Adversarial 30 Networks (GANs), have a handful of advantages when it comes to biomedical and behavioral 31 applications, and can even reach uses beyond humans. The creative algorithms behind this booming 32 technology allow big datasets to be generated and can level up AI technologies to e.g. identify 33 emotions, behaviors and intentions, and subsequently to predict them timely. This therefore opens up 34 the possibility to be applied to a broad scientific audience, including but not limited to animal science. 35 With an ever-growing population size, the demand for livestock continues to increase, raising 36 numerous concerns about its environmental impact, animal welfare and productivity. In this article, we 37 explain the basics of deepfake technologies, its (mis)uses and how it bears the potential to be applied 38 to agricultural practices such as livestock farming. 39 What is deepfake and how does it work? 41 Deepfake, just like other deep-learning algorithms, rely on neural networks which simply said, is a 42 software construction that attempts to mimic the functioning of the human brain . Deepfakes require a  43  source and target, and an encoder and decoder. A universal encoder is used to analyze and compare the  44  key features of the source data, which can be an image, video, text or audio file. The data are broken  45 down to a lower dimensional latent space and the encoder gets trained to find patterns. The decoder is 46 a trained algorithm that uses the specifications of the target to then compare and contrast the two 47 images. As a result, the algorithm superimposes the traits of the source onto the image of the target 48 resulting in the forged data. 49 The main architecture that allows a high precision and functioning of deepfake technology is the 50 generative adversarial network (GAN) which is part of the decoder (1). The GAN trains a generator 51 and a discriminator, where the generator in the context of deepfake is the decoder. What makes GANs 52 so unique and accurate is the operating and working together of the generator and discriminator. The 53 generator creates a new image from the latent representation of the source data. The discriminator on 54 the other hand tries to distinguish between the newly generated and the original real data as accurately 55 as possible and determines whether the image is generated or not. As both networks perform adversarial 56 learning to optimize their goals based on their loss function, the generator and discriminator continue 57 to work together to constantly improve its accuracy. The applicability is highly powerful due to the 58 continuous performance improvements and vector arithmetic in latent space. Moreover, GANs can 59 create new datasets with a similar distribution and statistics as the main dataset used to train the 60 algorithm. The discriminator learns about the distribution of the data, resulting in a model that can 61 output new, realistic samples. 62 Deepfake technologies have been used to create software's and applications that generate fake images, 63 texts or videos. Examples of these are apps that reproduce text with someone else's handwriting ("My 64 text in your handwriting"), perform face swaps between humans but also from human to animals 65 ("FakeApp") and synthesize human voices ("Lyrebird"), amongst others. Open-source software's 66 allow these technologies to be readily available to the public. Even though to date, it is still relatively 67 intuitive to distinguish between real and fake, this distinction will start to fade as the technology 68 advances. This development will increase the chance of misuse, manipulation, misinterpretation and 69 spreading of fake news. Deepfake applications have therefore had a negative image due to the fear 70 what may happen when falling in the wrong hands, to for example spread false information, pretending 71 to be someone else or commit fraud. 72 However, the applications of deepfake technologies are not limited to (social) media purposes. The 73 GAN model provides a sophisticated neural network with the big advantage that it can generate data 74 based on a smaller, initial, real dataset. These frameworks have widespread uses, within fields such as 75 biomedicine, behavior, affective science, but also beyond human applications. 76

Using deepfakes & GANs to create value 77
Whereas the negative applications of deepfakes and GANs can be scary, there are many positive ways 78 to apply these models to create value for numerous fields of science that in turn, benefit humans and 79 society. First of all, GANs are proving their high value in medical settings, such as to 1) recognize 80 pathogens (2), 2) support a better and more effective screening and diagnosing of disease and 81 abnormalities due to complementing MRI and CT imagery (3,4) and 3) predict the progress of disease 82 (5). Moreover, research within medicine can be facilitated through creating synthetic patient data that 83 not only benefits the scarcity of medical data sets through replicating real-like data (4), but it can also 84 be efficiently used for sharing, research, and in deciding treatment protocols and targeted interventions 85 without needing to worry about patient privacy (6). In addition to this, mental health of clinical patients 86 can be addressed through creative solutions using deepfake. For example, the voice of patients that 87 have lost their own voice, such as ALS patients, can be regenerated with GANs by using recordings of 88 their original voice. Their own voice can then be used to communicate, instead of a generic computer 89 voice synthesizer, to give the patients back a part of their identity (7). Outside the context of medical 90 applications, GAN can also be used as classifiers to detect and classify the subject's emotional 91 response. It can be beneficial for a plethora of applications, including patient health monitoring, crowd 92 behavior tracking, predicting demographics (8) and similar behavioral applications (9). 93 But the potential applications of GANs are not limited to humans. Biologists, ecologists and ethologists 94 are starting to understand the limitless applications of GANs especially in settings where obtaining 95 high quantity and quality of data are difficult or impossible. Using these networks, scientists from 96 different disciplines are starting to explore methods to e.g. simulate the evolutionary arms race between 97 the camouflage of a prey and predator (10), to automatically identify weeds in order to improve 98 productivity within agriculture (11) and to augment deep-sea biological images (12). These studies 99 highlight the possibilities of GANs and lead to the possibility of using these technologies within 100 livestock farming, too. 101

Uses beyond humanshow GANs can contribute to increase welfare in livestock 102
As the global population is exponentially growing, it has been predicted that within a few decades, the 103 demand for animal products will have doubled (13). This therefore puts a great pressure on the farming 104 industry, that will need to keep up with the rising demand. The challenge to develop efficient processes 105 of livestock farming is accompanied by a rising concern for animal health and welfare (14), in addition 106 to environmental and societal concerns (15). Can GANs contribute to increase welfare in livestock, 107 and as a consequence increase productivity, too? 108 Machine learning applications in animal science and the veterinary sector are predominantly focused 109 on tracking activity and movement of the animals aimed at enhancing welfare or disease related 110 measurements. In order to be able to use machine learning algorithms to, for example, automatically 111 monitor animal health and welfare by screening and recognizing pain, stress and discomfort, large 112 validated and annotated datasets are required. Physiological and behavioral measurements are able to 113 reveal information about an animal's inner state. Animal emotions have been linked to particular 114 vocalizations (16,17), eye temperature (18,19), hormone levels (20,21) and facial expressions 115 (20,22,23). These emotional states, such as fear, stress but also positive emotions like joy and 116 happiness, remain however difficult to understand as they are complex and multi-modal. 117 AI and machine learning algorithms can provide an automated way of monitoring animal health and 118 emotions. This helps us understand animal behavior and stress that therefore can increase welfare by 119 controlling and preventing disease and can increase productivity through helping famers decide on 120 effective and productive strategies. However, validated and annotated datasets that are large enough 121 for supervised machine learning algorithms are, however, limited and largely unavailable. Examples 122 of specific medical conditions of farm animals and the related videos or animals are hard to come by 123 and often require specialized sensing platforms and tools to collect. Due to this challenge, the 124 advancements of applications of deep learning and AI are still in the nascent stages in the farm animal 125 sector. 126 There are a few methods to overcome the lack of high quality, labelled data. Semi-supervised learning 127 helps in situations in which a large dataset is available but only a small portion of the dataset is labelled. 128 In this case, the challenge of insufficient datasets can be overcome by data augmentation methods. GANs have the potential to be used for enhancing the performance of the classification of algorithms 136 in a semi-supervised setting, and it can address some of the barriers mentioned above. Training a GAN 137 model has been successfully shown in augmenting a smaller dataset (2), such as for liver cancer 138 diagnostic applications (24). By adjusting the dimensions of the hidden layers and the output from the 139 generator as well as input to the discriminator network, the framework was developed to produce 140 satisfactory images of liver from the model. An accuracy of 85% was achieved by the GAN-created 141 models in the liver lesion classification based on this method. In a similar way, data augmentation can 142 be used to enhance the ability to classify animal disease and negative emotions such as stress and 143 discomfort, that might lead to disease. A trained GAN model will allow the continuous monitoring of 144 farm animals in order to prevent, monitor and predict disease just as in humans, but also to recognize 145 and avoid negative emotions such as stress and fear, and promote positive ones. By creating bigger 146 datasets with GANs with a similar distribution as the original datasets, machine learning algorithms 147 could be trained to accurately and efficiently classify disease and animal emotional states, similarly as 148 to how human emotions can be recognized by GAN models (9). 149 In addition to creating big fake datasets for classification, GANs could also be used to develop digital 150 twins (25). A digital twin is a virtual representation of a real-world entity, such as a human or other 151 animal. Based on input from the real world, the digital twin simulates the physical and biological state, 152 as well as the behavior of the real-world entity. A digital twin of a farm animal will allow continuous 153 monitoring of the mental, physical, and emotional state of the animals. In addition, modeling, 154 simulating and augmenting the data allows the digital twin to be used to plan, monitor, control and 155 optimize cost-, labor-and energy-efficient animal husbandry processes based on real-life data (26,27). 156 Using GANs to develop a digital twin will allow different situations to be explored and will help 157 predicting its effects on the animals. It can, for example, be used to simulate and predict the effect of 158 different housing structures or conditions, heat cycles for breeding or social settings on the positive 159 and/or negative emotions of the animals, as well as on their productivity. Simulating different situations 160 through digital twins will enable farmers to control and optimize processes within their operation, 161 benefitting farming productivity, sustainability and animal health and welfare. 162 Deepfakes have been suggested to help humans dealing with grief, by creating a virtual representation 163 of the missing beloved. A similar approach could be taken to enhance animal welfare. Many farm 164 animals are highly social, meaning that social comfort can play a large role in the mental wellbeing of 165 the animals, but also that the maintenance of social organization is important for the entire population behaviors have been shown to play an important role in the positive welfare of (farm) animals (31). 180 The trained model can then be used to optimize the digital representation in the form of e.g., a video 181 that imitates such engagement, for example to assure young calves, chicks or piglets by a fabricated 182 "mother" figure which aids a healthy development. 183 An advantage of using deep fake technologies is that other non-human animals, too, can be individually 184 identified through their voice (32,33,34). Deep fake technologies that can base the generated data on a 185 small fragment of the vocalization of an individual's mother, for example, will therefore be able to 186 create a realistic mother figure rather than a general vocal sample. Outside of the mother-offspring 187 context, vocal contagion of (positive) emotions can also be positively reinforced using the same 188 technologies. The affective state of individuals can be influenced by its environment, and the literature 189 shows that non-human animals can be affected by not only conspecific vocal expression of emotion, 190 but also by human vocal expressions (35). This opens up the potential for deepfake technologies to 191 positively influence farm animals through emotional contagion, promoting positive emotions. 192 Moreover, with the rapid advancement of digital farming in which farmers have to be less present with 193 the animals, also displays of positive interactions by "fake" farmers can be used to improve animal 194 welfare. Such positive interactions could be used to reward good behavior, comfort the animals by 195 reducing stress which in turn, have the potential to avoid unwanted behavior. These virtual farmer 196 activities can therefore promote habituation, associative learning, social cognition and bonding, which 197 could also enhance the human-animal relationship which is important for positive welfare outcomes as 198 well as productivity (36). 199 A video, of course, is merely a digital visual and maybe auditory representation of this conspecific, 200 meaning that the physical and olfactory components of the virtual conspecific are lacking, which might 201 limit its effectiveness. A better understanding of the cognitive framework and awareness of farm 202 animals (37), and inter-specific differences between cognitive abilities are important to understand the 203 potential effectiveness of 2D digital representations. In order for deepfake technologies and their applications to be fully explored, it is important that the 215 negative stigma on the technology are addressed first. See Table 1 for a summary of current and 216 potential applications of deepfake technologies, both positive and negative ones. Many people are 217 hesitant and scared due to the immense implications fake media can have when used to manipulate, 218 misinterpret or abuse. A legal framework and insurance that deepfake recognition software will always 219 outcompete deepfake media creation, to make sure fake can always be recognized from real. Next, 220 creative solutions for a range of different fields of science should be promoted to change the negative 221 outlook on deepfake applications and highlight the positive uses of the yet relatively unexplored 222 possibilities it opens up. Regardless of the particular application, it is important to not only have a 223 recognized and well-established legal framework, but also an ethical one. The inherent nature of 224 deepfake technologies is to create fake content, which is then used to deceive either humans, animals 225 or machine learning algorithms. The ethical consequences have to be addressed by professionals from 226 different disciplines to allow a broad understanding of the consequences of using deepfake. 227 Regarding the accuracy, efficiency and added value that deepfake technologies can bring to livestock 231 farming, it is important to highlight the extremely high quality of the real data that is used to train the 232 models with. The model learning should be well-supervised and validated to ensure no wrong 233 classification or labelling is created within the algorithm. Empirical evidence or studies within 234 livestock farming is currently absent as GANs and their applications are still in their infant stages, and 235 have to date only been explored in a few scientific contexts. The uses of GANs for livestock farming 236 should be explored through funding case studies that e.g., adopt digital twin technology to collect 237 evidence and facts about its uses. 238

Summary 239
In conclusion, similar to all AI implementations, deepfakes also have positive and negative impacts. 240 The potential positive effects of deepfakes are still new areas that are under exploration, and as such, 241 it may require some time for these technical architectures to mature and being vastly implemented in 242 the public domain. Their contribution to biomedical and behavioral applications, on top of agricultural 243 practices, demonstrates that few of these applications might soon surface and help balance the adverse 244 impacts of deepfakes. However, at higher stakes, various standardizations and security measures will 245 be required, along with implementations of such technologies to ensure that no manipulations can take 246 place. Pilot studies and explorative experiments are necessary to allow a better understanding of what 247 deepfake technologies can mean for scientific purposes beyond us humans. 248

Conflict of Interest 249
The author declare that the research was conducted in the absence of any commercial or financial 250 relationships that could be construed as a potential conflict of interest. 251

Funding 252
This research did not receive any external funding. 253