Answers.Body: <p>You can interpret the image as follows:</p>
  <ul>
  <li>Each <em>column</em> represent a <strong>class</strong> (or category) of an object, for example what you denote with <span class="math-container">$X_1$</span> and <span class="math-container">$X_2$</span> are classes not domains which can overlap.</li>
  <li>Instead, each <em>row</em> is a <strong>domain</strong>, i.e. the broader, more general, and higher-level (semantically) concept that can include multiple categories even partially. In fact, the domain &quot;quickdraw&quot; contains objects that belong to the same classes of the domain &quot;real&quot;: you still have plane, clock, etc but the conceptual representation is different. I cannot claim that domains are mutually exclusive, maybe they are when there is no ambiguity.</li>
  </ul>
  <p>For example, a human can interpret a sketch as a plane (instead of as a set of lines and curves) thanks to its higher-level cognitive capabilities that allow, at the same time, to see something in its building blocks (e.g. the lines; which is kind of low-level understanding) and as a whole (giving it some semantics and meaning.)</p>
  <p>Take as an example an image classifier, you train it on images from the real domain. The classifier, in order to show out-of-domain (OOD) generalization should correctly classify images from the quickdraw domain: if so it achieved OOD generalization on that domain. In order to do this, the model should (at least): 1) not adapt to the training domain (which translates to almost zero <em>overfitting</em> and plenty of <em>regularization</em>), 2) ignore the noise in the images (<em>robustness</em>), and 3) capture high-level features that describe the image semantically, i.e. it should capture the concept that an image describes but also capture the same on OOD images.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-04-07T15:31:00.173Z
Answers.Text: Thanks for the answer. I am really interested in whether the domains are mutually exclusive in the input space. If so, do you agree that OOD is actually about extrapolating a function?
Answers.UserDisplayName: NicAG
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-04-09T17:29:50.777Z
Answers.Text: Well, extrapolation can be a result of OOD generalization but it can also happen within the same domain: I mean if your training data belong to domain $D$ and are bounded in a range $(a,b)$ (simply because the data can't always represent the whole domain) and the model shows good performance either with points below $a$ and $b$, then it achieved extrapolation but within the same training domain, i.e. $D$. Perhaps, OOD generalization implies *adaptation* to a new domain with zero samples (or in *zero-shot* regime.)
Answers.UserDisplayName: Luca Anzalone
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-04-07T14:56:46.547Z
Answers.LastActivityDate: 2023-04-07T14:56:46.547Z
Answers.UserDisplayName: Luca Anzalone
Body: <p>Given <span class="math-container">$X$</span> the space of all <span class="math-container">$N \times N$</span>-pixel images and <span class="math-container">$I=\{$</span>airplane,clock,axe,...<span class="math-container">$\}$</span> a set of labels.</p>
  <p>An image classification task is generally concerned to learn a map
  <span class="math-container">$$F:X \rightarrow I$$</span>
  Let's look at the examples of pictures below taken from <a href="https://openaccess.thecvf.com/content_ICCV_2019/papers/Peng_Moment_Matching_for_Multi-Source_Domain_Adaptation_ICCV_2019_paper.pdf" rel="nofollow noreferrer">2</a>. The rows classify the domain of the picture. I.e. a real plane or a sketched plane. Out-of-domain generalization deals with the question of whether it is possible to train a NN e.g. on real photos of planes such that it will also be able to classify sketched pictures of a plane.</p>
  <hr />
  <p>I have a hard time understanding these domains. My question is the following: Can I think of each domain as a disjoint set in <span class="math-container">$X$</span>. Let's say <span class="math-container">$X_1$</span> are all sketched planes and <span class="math-container">$X_2$</span> all real planes. Then <span class="math-container">$X_1 \cap X_2 = \emptyset$</span>. If not, what is the right way to think about domains?</p>
  <p><a href="https://i.sstatic.net/fUou3.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/fUou3.jpg" alt="" /></a></p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-04-13T20:15:12.757Z
Comments.Text: Can you please put your **specific question** in the title?
Comments.UserDisplayName: nbro
Tags: <neural-networks><machine-learning><convolutional-neural-networks><image-recognition><generalization>
Title: Out-of-domain generalization
UserDisplayName: NicAG
ThreadText: # Out-of-domain generalization
  
  (Asked by: username_0 on 2023-04-05)
  
  Given $X$ the space of all $N \times N$-pixel images and $I=\{$airplane,clock,axe,...$\}$ a set of labels.
  
  An image classification task is generally concerned to learn a map
  $$F:X \rightarrow I$$
  Let's look at the examples of pictures below taken from [2](https://openaccess.thecvf.com/content_ICCV_2019/papers/Peng_Moment_Matching_for_Multi-Source_Domain_Adaptation_ICCV_2019_paper.pdf). The rows classify the domain of the picture. I.e. a real plane or a sketched plane. Out-of-domain generalization deals with the question of whether it is possible to train a NN e.g. on real photos of planes such that it will also be able to classify sketched pictures of a plane.
  
  ---
  
  I have a hard time understanding these domains. My question is the following: Can I think of each domain as a disjoint set in $X$. Let's say $X\_1$ are all sketched planes and $X\_2$ all real planes. Then $X\_1 \cap X\_2 = \emptyset$. If not, what is the right way to think about domains?
  
  [![](https://i.sstatic.net/fUou3.jpg)](https://i.sstatic.net/fUou3.jpg)
  
  **Tags:** neural-networks, machine-learning, convolutional-neural-networks, image-recognition, generalization
  
  > **Comments:**
  > **username_1**: Can you please put your **specific question** in the title?  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2023-04-07. Score: 2 | Accepted answer
  
  You can interpret the image as follows:
  
  * Each *column* represent a **class** (or category) of an object, for example what you denote with $X\_1$ and $X\_2$ are classes not domains which can overlap.
  * Instead, each *row* is a **domain**, i.e. the broader, more general, and higher-level (semantically) concept that can include multiple categories even partially. In fact, the domain "quickdraw" contains objects that belong to the same classes of the domain "real": you still have plane, clock, etc but the conceptual representation is different. I cannot claim that domains are mutually exclusive, maybe they are when there is no ambiguity.
  
  For example, a human can interpret a sketch as a plane (instead of as a set of lines and curves) thanks to its higher-level cognitive capabilities that allow, at the same time, to see something in its building blocks (e.g. the lines; which is kind of low-level understanding) and as a whole (giving it some semantics and meaning.)
  
  Take as an example an image classifier, you train it on images from the real domain. The classifier, in order to show out-of-domain (OOD) generalization should correctly classify images from the quickdraw domain: if so it achieved OOD generalization on that domain. In order to do this, the model should (at least): 1) not adapt to the training domain (which translates to almost zero *overfitting* and plenty of *regularization*), 2) ignore the noise in the images (*robustness*), and 3) capture high-level features that describe the image semantically, i.e. it should capture the concept that an image describes but also capture the same on OOD images.
  
  > **Comments:**
  > **username_0**: Thanks for the answer. I am really interested in whether the domains are mutually exclusive in the input space. If so, do you agree that OOD is actually about extrapolating a function?  
  > **username_2**: Well, extrapolation can be a result of OOD generalization but it can also happen within the same domain: I mean if your training data belong to domain $D$ and are bounded in a range $(a,b)$ (simply because the data can't always represent the whole domain) and the model shows good performance either with points below $a$ and $b$, then it achieved extrapolation but within the same training domain, i.e. $D$. Perhaps, OOD generalization implies *adaptation* to a new domain with zero samples (or in *zero-shot* regime.)  
  
  ---
  
  