<p>The performance of a neural network on one dataset will not generally be the same as its performance on another. Images in one dataset can be more difficult to distinguish than those in another. As a rule of thumb: if your landmark datasets are similar, it's likely that performance will be similar. However, this is not always the case: subtle differences between the datasets can result in significantly different performance.</p>

<p>You can account for the potentially different performance on the two datasets by training another network on the other dataset. This will give you a baseline of what to expect when you try to generalize your network to it.</p>

<p>You can apply your neural network trained for one set of classes to another set of classes. There are two main approaches to this:</p>

<ul>
<li><a href="https://arxiv.org/abs/1808.01974" rel="nofollow noreferrer">Transfer learning</a>. This is where the last layer of your trained network is replaced with a new layer(s) that is trained, by itself, to classify the new images. (Use for many classes. Can use for few classes.)</li>
<li><a href="https://arxiv.org/abs/1711.04450" rel="nofollow noreferrer">All-Transfer learning</a>. Rather than replacing the last layer, add a new layer after it and only train the final layers. (Use for few classes.)</li>
</ul>

<p>Both approaches are much quicker than training a neural network from scratch.</p>
Is it possible to train a CNN on a dataset and test it on another dataset with different classes?
<p>I am new to deep learning, and I am doing a research using CNNs. I need to train a CNN model on a dataset of images (landmark images) and test the same model using a different dataset (landmark images too). One of the motivations is to see the ability of the model to generalize. But the problems is: Since the dataset used for train and test is not the same, the classes are not the same! Possibly, the number of classes too, which means that the predictions made on the test dataset are not trust worthy (Since the weights of the output layer have been calculated based on different classes belonging to train dataset). Is there any way to evaluate a model on a different dataset without affecting test accuracy? </p>