Answers.Body: <p>This idea is more or less what driven the development of <a href="https://ai.googleblog.com/2015/06/inceptionism-going-deeper-into-neural.html" rel="nofollow noreferrer">Google Deep Dream</a>.</p>
  <p>They framed the problem in a much different way though, i.e. as a reversed task compared to classification. So given a trained network, we choose a final activation, and we modify a given input image till the chosen activation is maximized trough gradient ascent (n.b. not gradient descent).</p>
  <p><a href="https://i.sstatic.net/Ca2qY.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/Ca2qY.png" alt="enter image description here" /></a></p>
  <p>You don't specify your definition of &quot;archetypical&quot; so maybe that's not exactly what you're looking for, but conceptually this is more sounded than combining feature maps. Reason being that a feature map is just an image modified with some filters, so the average of a feature maps is basically the same as the average of images themselves. Deep dream instead modify an image in such a way that this image will react to specific, already learned filters. So it's a generative approach. You can see it in the example below, where a sky image is modify to produce a &quot;face&quot; activation. All those faces are not training images nor part of the original sky image.</p>
  <p><a href="https://i.sstatic.net/q1fcH.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/q1fcH.png" alt="enter image description here" /></a></p>
  <p>Note that if you're looking for a model that given thousands of images produce always the same output one, then the problem is simply ill posed. Even unsupervised energy based models like restricted boltzmann machines simply learn a mixture of features, not a single &quot;archetypical&quot; image (see pic below).</p>
  <p><a href="https://i.sstatic.net/MKxZa.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/MKxZa.png" alt="enter image description here" /></a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-03-29T15:23:52.530Z
Answers.Text: yeah I had thought about deep dream, but I guess I was thinking more of "statistically reproducing" the content of a set of images without being generative. "archetypical" might be too a humanizing - basically, I meant that I want a model to redraw the features or components that it learned to common features in the images I supplied before. basically you are right with it somewhat being of a "reversed classification" task, but I guess I will need to think more about the criteria that I want to apply here
Answers.UserDisplayName: mluerig
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-03-29T13:42:06.513Z
Answers.LastActivityDate: 2022-03-29T13:42:06.513Z
Answers.UserDisplayName: Edoardo Guerriero
Body: <p>I have a few thousand images and I would like to generate a representation of the foreground patterns within - a composition of all of its features, so to speak. In simple terms: take 10000 images of a dog and then draw the archetypical dog.</p>
  <p><strong>Does this task have a name, and is there a method out there specifically for such purposes?</strong></p>
  <p>The images have different sizes and neither scale nor rotation invariant, so simple averaging algorithms wouldn't work. I would guess that deep learning techniques could be capable - e.g., extracting the features from the first layers of a neural network - as hinted at <a href="https://stats.stackexchange.com/a/262060/123056">here</a>: ...&quot;The original network can't be used to classify new identities, on which it wasn't trained. But, the kth layer may provide a good representation of faces in general....&quot;.</p>
  <p>I just don't necessarily need a model for prediction afterwards, just the aggregate representation will do.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-04-23T22:14:15.173Z
Comments.Text: It sounds similar to [eigenface](https://en.wikipedia.org/wiki/Eigenface). Here, PCA was used to extract principal components where each of them looks like an "average" of faces.
Comments.UserDisplayName: entropy07
Tags: <deep-learning><feature-extraction><representation-learning>
Title: A technique of aggregating many input images to a single representation of the relevant features within
UserDisplayName: mluerig
ThreadText: # A technique of aggregating many input images to a single representation of the relevant features within
  
  (Asked by: username_0 on 2022-03-29)
  
  I have a few thousand images and I would like to generate a representation of the foreground patterns within - a composition of all of its features, so to speak. In simple terms: take 10000 images of a dog and then draw the archetypical dog.
  
  **Does this task have a name, and is there a method out there specifically for such purposes?**
  
  The images have different sizes and neither scale nor rotation invariant, so simple averaging algorithms wouldn't work. I would guess that deep learning techniques could be capable - e.g., extracting the features from the first layers of a neural network - as hinted at [here](https://stats.stackexchange.com/a/262060/123056): ..."The original network can't be used to classify new identities, on which it wasn't trained. But, the kth layer may provide a good representation of faces in general....".
  
  I just don't necessarily need a model for prediction afterwards, just the aggregate representation will do.
  
  **Tags:** deep-learning, feature-extraction, representation-learning
  > **Comments:**
  > **username_1**: It sounds similar to [eigenface](https://en.wikipedia.org/wiki/Eigenface). Here, PCA was used to extract principal components where each of them looks like an "average" of faces.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2022-03-29. Score: 0
  
  This idea is more or less what driven the development of [Google Deep Dream](https://ai.googleblog.com/2015/06/inceptionism-going-deeper-into-neural.html).
  
  They framed the problem in a much different way though, i.e. as a reversed task compared to classification. So given a trained network, we choose a final activation, and we modify a given input image till the chosen activation is maximized trough gradient ascent (n.b. not gradient descent).
  
  [![enter image description here](https://i.sstatic.net/Ca2qY.png)](https://i.sstatic.net/Ca2qY.png)
  
  You don't specify your definition of "archetypical" so maybe that's not exactly what you're looking for, but conceptually this is more sounded than combining feature maps. Reason being that a feature map is just an image modified with some filters, so the average of a feature maps is basically the same as the average of images themselves. Deep dream instead modify an image in such a way that this image will react to specific, already learned filters. So it's a generative approach. You can see it in the example below, where a sky image is modify to produce a "face" activation. All those faces are not training images nor part of the original sky image.
  
  [![enter image description here](https://i.sstatic.net/q1fcH.png)](https://i.sstatic.net/q1fcH.png)
  
  Note that if you're looking for a model that given thousands of images produce always the same output one, then the problem is simply ill posed. Even unsupervised energy based models like restricted boltzmann machines simply learn a mixture of features, not a single "archetypical" image (see pic below).
  
  [![enter image description here](https://i.sstatic.net/MKxZa.png)](https://i.sstatic.net/MKxZa.png)
  
  > **Comments:**
  > **username_0**: yeah I had thought about deep dream, but I guess I was thinking more of "statistically reproducing" the content of a set of images without being generative. "archetypical" might be too a humanizing - basically, I meant that I want a model to redraw the features or components that it learned to common features in the images I supplied before. basically you are right with it somewhat being of a "reversed classification" task, but I guess I will need to think more about the criteria that I want to apply here  
  
  ---
  
  