Domain adaptation

From HandWiki
Short description: Field associated with machine learning and transfer learning


Distinction between usual machine learning setting and transfer learning, and positioning of domain adaptation

Domain adaptation[1][2][3] is a field associated with machine learning and transfer learning. This scenario arises when we aim at learning a model from a source data distribution and applying that model on a different (but related) target data distribution. For instance, one of the tasks of the common spam filtering problem consists in adapting a model from one user (the source distribution) to a new user who receives significantly different emails (the target distribution). Domain adaptation has also been shown to be beneficial for learning unrelated sources.[4] Note that, when more than one source distribution is available the problem is referred to as multi-source domain adaptation.[5]

Overview

Domain adaptation is the ability to apply an algorithm trained in one or more "source domains" to a different (but related) "target domain". Domain adaptation is a subcategory of transfer learning. In domain adaptation, the source and target domains all have the same feature space (but different distributions); in contrast, transfer learning includes cases where the target domain's feature space is different from the source feature space or spaces.[6]

Domain shift

A domain shift,[7] or distributional shift,[8] is a change in the data distribution between an algorithm's training dataset, and a dataset it encounters when deployed. These domain shifts are common in practical applications of artificial intelligence. Conventional machine-learning algorithms often adapt poorly to domain shifts. The modern machine-learning community has many different strategies to attempt to gain better domain adaptation.[7]

Examples

  • An algorithm trained on newswires might have to adapt to a new dataset of biomedical documents.[9]
  • A spam filter, trained on a certain group of email users during training, must adapt to a new target user when deployed.[10]
  • Applying AI diagnostic algorithms, trained on labeled data associated with previous diseases, to new unlabeled data associated with the COVID-19 pandemic.[11]
  • A sudden societal change, such as a pandemic outbreak, can constitute domain shift and cause machine learning algorithms trained on now-obsolete consumer data to fail and require intervention.[12][13]

Other applications include wifi localization detection and many aspects of computer vision.[6]

Formalization

Let [math]\displaystyle{ X }[/math] be the input space (or description space) and let [math]\displaystyle{ Y }[/math] be the output space (or label space). The objective of a machine learning algorithm is to learn a mathematical model (a hypothesis) [math]\displaystyle{ h:X\to Y }[/math] able to attach a label from [math]\displaystyle{ Y }[/math] to an example from [math]\displaystyle{ X }[/math]. This model is learned from a learning sample [math]\displaystyle{ S=\{(x_i,y_i) \in (X \times Y)\}_{i=1}^m }[/math].

Usually in supervised learning (without domain adaptation), we suppose that the examples [math]\displaystyle{ (x_i,y_i)\in S }[/math] are drawn i.i.d. from a distribution [math]\displaystyle{ D_S }[/math] of support [math]\displaystyle{ X\times Y }[/math] (unknown and fixed). The objective is then to learn [math]\displaystyle{ h }[/math] (from [math]\displaystyle{ S }[/math]) such that it commits the least error possible for labelling new examples coming from the distribution [math]\displaystyle{ D_S }[/math].

The main difference between supervised learning and domain adaptation is that in the latter situation we study two different (but related) distributions [math]\displaystyle{ D_S }[/math] and [math]\displaystyle{ D_T }[/math] on [math]\displaystyle{ X\times Y }[/math][citation needed]. The domain adaptation task then consists of the transfer of knowledge from the source domain [math]\displaystyle{ D_S }[/math] to the target one [math]\displaystyle{ D_T }[/math]. The goal is then to learn [math]\displaystyle{ h }[/math] (from labeled or unlabelled samples coming from the two domains) such that it commits as little error as possible on the target domain [math]\displaystyle{ D_T }[/math][citation needed].

The major issue is the following: if a model is learned from a source domain, what is its capacity to correctly label data coming from the target domain?

The different types of domain adaptation

There are several contexts of domain adaptation. They differ in the information considered for the target task.

  1. The unsupervised domain adaptation: the learning sample contains a set of labeled source examples, a set of unlabeled source examples and a set of unlabeled target examples.
  2. The semi-supervised domain adaptation: in this situation, we also consider a "small" set of labeled target examples.
  3. The supervised domain adaptation: all the examples considered are supposed to be labeled.

Four algorithmic principles

Reweighting algorithms

The objective is to reweight the source labeled sample such that it "looks like" the target sample (in terms of the error measure considered).[14][15]

Iterative algorithms

A method for adapting consists in iteratively "auto-labeling" the target examples.[16] The principle is simple:

  1. a model [math]\displaystyle{ h }[/math] is learned from the labeled examples;
  2. [math]\displaystyle{ h }[/math] automatically labels some target examples;
  3. a new model is learned from the new labeled examples.

Note that there exist other iterative approaches, but they usually need target labeled examples.[17][18]

Search of a common representation space

The goal is to find or construct a common representation space for the two domains. The objective is to obtain a space in which the domains are close to each other while keeping good performances on the source labeling task. This can be achieved through the use of Adversarial machine learning techniques where feature representations from samples in different domains are encouraged to be indistinguishable.[19][20]

Hierarchical Bayesian Model

The goal is to construct a Bayesian hierarchical model [math]\displaystyle{ p(n) }[/math], which is essentially a factorization model for counts [math]\displaystyle{ n }[/math], to derive domain-dependent latent representations allowing both domain-specific and globally shared latent factors.[4]

Softwares

Several compilations of domain adaptation and transfer learning algorithms have been implemented over the past decades:

  • ADAPT[21] (Python)
  • TLlib [22] (Python)
  • Domain-Adaptation-Toolbox [23] (Matlab)

References

  1. Redko, Ievgen; Morvant, Emilie; Habrard, Amaury; Sebban, Marc; Bennani, Younès (2019). Advances in Domain Adaptation Theory. ISTE Press - Elsevier. pp. 187. ISBN 9781785482366. https://www.elsevier.com/books/advances-in-domain-adaptation-theory/redko/978-1-78548-236-6. 
  2. Bridle, John S.; Cox, Stephen J (1990). "RecNorm: Simultaneous normalisation and classification applied to speech recognition". Conference on Neural Information Processing Systems (NIPS). pp. 234–240. http://papers.nips.cc/paper/328-recnorm-simultaneous-normalisation-and-classification-applied-to-speech-recognition.pdf. 
  3. Ben-David, Shai; Blitzer, John; Crammer, Koby; Kulesza, Alex; Pereira, Fernando; Wortman Vaughan, Jennifer (2010). "A theory of learning from different domains". Machine Learning 79 (1–2): 151–175. doi:10.1007/s10994-009-5152-4. https://link.springer.com/content/pdf/10.1007/s10994-009-5152-4.pdf. 
  4. 4.0 4.1 Hajiramezanali, Ehsan; Siamak Zamani Dadaneh; Karbalayghareh, Alireza; Zhou, Mingyuan; Qian, Xiaoning (2018). "Bayesian multi-domain learning for cancer subtype discovery from next-generation sequencing count data". arXiv:1810.09433 [stat.ML].
  5. Crammer, Koby; Kearns, Michael; Wortman, Jeniifer (2008). "Learning from Multiple Sources". Journal of Machine Learning Research 9: 1757–1774. http://www.jmlr.org/papers/volume9/crammer08a/crammer08a.pdf. 
  6. 6.0 6.1 Sun, Shiliang; Shi, Honglei; Wu, Yuanbin (July 2015). "A survey of multi-source domain adaptation". Information Fusion 24: 84–92. doi:10.1016/j.inffus.2014.12.003. 
  7. 7.0 7.1 Sun, Baochen, Jiashi Feng, and Kate Saenko. "Return of frustratingly easy domain adaptation." In Thirtieth AAAI Conference on Artificial Intelligence. 2016.
  8. Amodei, Dario, Chris Olah, Jacob Steinhardt, Paul Christiano, John Schulman, and Dan Mané. "Concrete problems in AI safety." arXiv preprint arXiv:1606.06565 (2016).
  9. Daumé III, Hal. "Frustratingly easy domain adaptation." arXiv preprint arXiv:0907.1815 (2009).
  10. Ben-David, Shai, John Blitzer, Koby Crammer, and Fernando Pereira. "Analysis of representations for domain adaptation." In Advances in neural information processing systems, pp. 137-144. 2007.
  11. Hu, Yipeng; Jacob, Joseph; Parker, Geoffrey J. M.; Hawkes, David J.; Hurst, John R.; Stoyanov, Danail (June 2020). "The challenges of deploying artificial intelligence models in a rapidly evolving pandemic" (in en). Nature Machine Intelligence 2 (6): 298–300. doi:10.1038/s42256-020-0185-2. ISSN 2522-5839. 
  12. Matthews, Dylan (26 March 2019). "AI disaster won't look like the Terminator. It'll be creepier." (in en). Vox. https://www.vox.com/future-perfect/2019/3/26/18281297/ai-artificial-intelligence-safety-disaster-scenarios. 
  13. "Our weird behavior during the pandemic is messing with AI models" (in en). MIT Technology Review. 11 May 2020. https://www.technologyreview.com/2020/05/11/1001563/covid-pandemic-broken-ai-machine-learning-amazon-retail-fraud-humans-in-the-loop/. 
  14. Huang, Jiayuan; Smola, Alexander J.; Gretton, Arthur; Borgwardt, Karster M.; Schölkopf, Bernhard (2006). "Correcting Sample Selection Bias by Unlabeled Data". Conference on Neural Information Processing Systems (NIPS). pp. 601–608. http://papers.nips.cc/paper/3075-correcting-sample-selection-bias-by-unlabeled-data.pdf. 
  15. Shimodaira, Hidetoshi (2000). "Improving predictive inference under covariate shift by weighting the log-likelihood function". Journal of Statistical Planning and Inference 90 (2): 227–244. doi:10.1016/S0378-3758(00)00115-4. https://www.researchgate.net/publication/230710850. 
  16. Gallego, A.J.; Calvo-Zaragoza, J.; Fisher, R.B. (2020). "Incremental Unsupervised Domain-Adversarial Training of Neural Networks". IEEE Transactions on Neural Networks and Learning Systems PP (11): 4864–4878. doi:10.1109/TNNLS.2020.3025954. PMID 33027004. https://www.pure.ed.ac.uk/ws/files/172035660/Incremental_Unsupervised_GALLEGO_DOA18092020_AFV.pdf. 
  17. Arief-Ang, I.B.; Salim, F.D.; Hamilton, M. (2017-11-08). "DA-HOC: semi-supervised domain adaptation for room occupancy prediction using CO2 sensor data". 4th ACM International Conference on Systems for Energy-Efficient Built Environments (BuildSys). Delft, Netherlands. pp. 1–10. doi:10.1145/3137133.3137146. ISBN 978-1-4503-5544-5. https://dl.acm.org/citation.cfm?id=3137146. 
  18. Arief-Ang, I.B.; Hamilton, M.; Salim, F.D. (2018-12-01). "A Scalable Room Occupancy Prediction with Transferable Time Series Decomposition of CO2 Sensor Data". ACM Transactions on Sensor Networks 14 (3–4): 21:1–21:28. doi:10.1145/3217214. 
  19. Ganin, Yaroslav; Ustinova, Evgeniya; Ajakan, Hana; Germain, Pascal; Larochelle, Hugo; Laviolette, François; Marchand, Mario; Lempitsky, Victor (2016). "Domain-Adversarial Training of Neural Networks". Journal of Machine Learning Research 17: 1–35. http://jmlr.org/papers/volume17/15-239/15-239.pdf. 
  20. Hajiramezanali, Ehsan; Siamak Zamani Dadaneh; Karbalayghareh, Alireza; Zhou, Mingyuan; Qian, Xiaoning (2017). "Addressing Appearance Change in Outdoor Robotics with Adversarial Domain Adaptation". arXiv:1703.01461 [cs.RO].
  21. de Mathelin, Antoine and Deheeger, François and Richard, Guillaume and Mougeot, Mathilde and Vayatis, Nicolas (2020) "ADAPT: Awesome Domain Adaptation Python Toolbox"
  22. Mingsheng Long Junguang Jiang, Bo Fu. (2020) "Transfer-learning-library"
  23. Ke Yan. (2016) "Domain adaptation toolbox"