text:
Reinforcement Learning with limited number of episodes
I try to implement RL to a case something like this:

This game consist of several rounds. Every round the players need to generate a maze that consists of rooms. There are around 1000 different available rooms with different properties. At the beginning of a round, each player will be given 10 rooms one-by-one (the sequence is same for each player) from 1000 that available, then he/she try to create a maze from the taken rooms (by arranging each room). After the maze is done there is a Game Master who will judge the maze (give a score between 0-100). The player never know how the Game Master judges the maze, it can be judged based on the level of difficulty that is produced, the order of the room we compose, or others. The player who got the best score for the given rooms will win this round.
in this case, I have around 100,000 "perfect" mazes that have been created from different room combination and got a perfect score. I use this maze as episodes and try to train RL-Agent to find the pattern of how the Game Master judges a maze. For your information, there are rooms that not exist in the 100,000 perfect mazes, but I hope the RL-Agent can use its properties to find similar rooms that exist in  the "perfect" mazes, and make it as a reference

This case is different from other RL environments that I've ever met before, generating an episode is not an easy task because it needs an expert to validate it (The Game Master). So you could say, I can only build the RL agent using that 100,000 episodes.
But, even though it only consists of 100,000 episodes, my case has millions of states, so I plan to use Q-Learning with Neural Net as approximator.
My question is:

in this case, am I still need the Experience Replay process (I am afraid I don't need it because of the small number of available episodes)?
has this case ever happened before? What is the best approach to deal with cases where the number of episodes is limited?

Is your goal to find a good policy for the environment? How will you test your new policy?

@Neil Slater I'll test the new policy by test it to the available episodes that unused before (like "train-test" split concept). But it's just for the evaluation in the final phase

That may not work very well, depending on what data you hold. But not important to this question - perhaps you can ask another about that. I was asking to try and get a sense for how you might use the data. I have a better clarifying question now:

What kind of behaviour do your 100,000 pre-defined episodes represent? Is it mainly an "expert policy" which attempts to be optimal, or is it more varied than that? Could you give a little bit of detail on how the 100,000 "sequences" were generated? Please [edit] into the question. That could help guide an answer. An important detail would be if the sequences were generated using a known policy for instance (because then you could use importance sampling)

@Neil Slater I've updated my question

Thanks. I think here that your problem is not just "limited number of episodes" but also that you only have historical data, you cannot easily run the algorithm online to test or improve any new policy.

Can you also clarify: Do you have scores for any non-perfect mazes? One of your goals is to predict the score, in order to find perfect scores. Having only perfect examples and no examples of other, lower scores, is going to severely limit your ability to predict the end score. To most ML, it will look like everything always gets a perfect score (e.g. this is similar to writing an algorithm to recognise cats and feeding it only cat pictures during training - it will never get to know what things are not cats).

That's true, for now, as the maze is just a permutation of given rooms, I use a method to compute a score of a non-perfect maze by comparing a maze to another maze that consists of the same rooms (something like edit distance).

@mailoboro: that's a different model, sort of an "expert system" that you have built. Training on that is possible, but your agent will optimise to what your model thinks, not any real values. Do you have actual scores from the Game Master for non-perfect mazes? Alternatively, if your model is good enough to stand in for the Game Master, then you no longer have limited data to work with

No, I don't have the score for non-perfect mazes. Actually, my purpose is to create an RL to guess how the game master works so it's like to mimic an expert in expert system. I believe this is a "hard" task especially with limited resources, but I hope I can create at least "good enough" expert using RL

To know how the game master works, if you only sample "perfect" results and don't understand how to get other scores, then you have a hard problem regardless of using RL or not. You can still try to copy the "perfect" items, but will have very little idea of how well that is going with no examples from non-perfect items


text:
Predicting sine using LSTM: Small output range and delayed output?
I have coded a very basic LSTM with forget gates (no libraries used). I'm trying to predict $0.5*sin(t + N)$ given $0.5*sin(t)$ as an exercise.
I have tweaked the model, changing the output layer activation function, weight initialization, number of memory blocks/cells, etc. However, I still couldn't manage to correct the output.
The problem is that the output range is much smaller than desired, $[-0.2, 0.2]$ instead of $[-0.5, 0.5]$. The output also is slightly delayed, meaning it is predicting $sin(t + N - 1)$ for example.
Is there something that I'm missing?
As an example, for output layer activation function as a centered logistic from $(-1, 1)$, the validation output looks like

Training output looks like

Additional information:

Topology: 1 input layer, 1 hidden layer each with 5 memory blocks each with 1 cell, 1 output layer each with 1 regular neuron.
Alpha: 1
Weights: generated with normal distribution, from $[-1, 1]$
Output layer activation function used: logistic $[0, 1]$, centered logistic, tanh, ReLU, leaky ReLU, $f(x) = x$ (identity)

can you provide this question with your code to help us find the problem?

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

sort: votes


text:
Training the generator in a GAN pair with back propagation
For the purposes of this question I am asking about training the generator, assume that training the discriminator is another topic.
My understanding of generative adversarial networks is that you feed random input data to the generator and it generates images. Out of those images, the ones which the discriminator thinks are real are used to train the generator.
For example, I have the random inputs $i_1$, $i_2$, $i_3$, $i_4$... from which the generator produces $o_1$, $o_2$, $o_3$, $o_4$. Say for example, the discriminator thinks that $o_1$ and $o_2$ are real but $o_3$ and $o_4$ are fake, I then throw away input output pairs 3 and 4, but keep 1 and 2, and run back propagation on the generator to tell it that $i_1$ should produce $o_1$, and $i_2$ should produce $o_2$ since these were "correct" according to the discriminator.
The contradiction seems to come from the fact that the generator already generates those outputs from those inputs, so nothing will be gained by running backprop on those input output pairs.
Where is the flaw in my logic here? I seem to have something wrong in my reasoning, or a misunderstanding of how the generator is trained.

I had this same problem some time ago, here's what you should do:
notice how we first input i1 to the generator, that outputs o1, than we input o1 into the discriminator, that outputs y1, so the output from the first (o1) is the input to the second, but that's like if we combine the two networks into one from a moment, right? under the hood, a layer from a neural network connects with the next layer, just like the output layer from the generator connected with the input layer from the generator, so you could interpret them as a single big neural network. Then it's easy to see how we would backpropagate through this whole combined network, all the way into the first layer of the generator, successfully updating all it's parameters, thus training it.
That's not all when training a GAN, as we need to also train the discriminator separately with real images. For that we simply input the image directly into the discriminator, and when backpropagating, we stop in the discriminator, as anything from the generator has nothing to do with the real images.
Really, all you need to do is treat the generator and discriminator as one big neural network when you want to input noise to the generator, but separate them when you want to input a real image into the discriminator.

Let's take a look at the images that fooled the D-network. When this happens the binary cross entropy loss of the D-network is important to look at. The network said a fake image was real. As usual, you back propagate to the very beginning of the D-network. What is the back prop doing? It is telling the weights in the D-network to change such that you lessen the loss (remember you are minimizing the loss function by going down hill --> using gradient descent). So you changed the weights of the D-network, but you really don't have to stop there.
The complex nonlinear function the D-network is calculating is really f(Image, weights of D-network). So the output of the D-network is really dependent on the Image fed in and the weights of the D-network. The cost is a function of the output f. So we have c = g(f(Image, weights of D-network)) where g is really the binary cross entropy. Looking at this, we see that the cost is also a function of the image!
We can take the partials with respect to the image just like we take the partials with respect to the weights to update the weights. And so after doing back prop to the image, we don't stop -> we take the partial of the cost function with respect to the image that is fed into the D-network and we update the image. And essentially we don't have the original image when we continue to back prop to the beginning of the G-network. Let me know if you'd like more clarification. Again this is my understanding and I haven't coded a GAN yet, so someone please confirm. Also, I am open to others' interpretations.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Deep Ranking/Best way to classify book covers?
I recently came across a paper on Deep Ranking. I was wondering whether this could be used to classify book covers as book titles. (For example, if I had a picture for the cover of the second HP book, the classifier would return Harry Potter and the Chamber of Secrets.)
For example, say I have a dataset of book covers along with the book titles in text. Could that data set be used for this deep ranking algorithm, or is there a much better way to approach my problem? I'm quite new to this whole thing, and this one of my first projects in this field.
What I'm trying to create is a mobile app where people can take a picture of a book cover, have an algorithm/neural net classify the title of the book, and then have some other algorithm connect that to the book's Goodreads page.
Thanks for the help!

I read some papers talked about it you can take a look on them maybe help you.
Deep Neural Network Learns to Judge Books by Their Covers
Classification of Book Genres By Cover and Title

Could that data set be used for this deep ranking algorithm?

Yes you can! I think there are at least two approaches for this task:

First, solve using Image Classification. If you want to use Deep Learning, you can use Deep Convolutional Neural Network to create classifier that decide the image is HP book or not. You can read papers mentioned on Mahmoud's answer. But the problem is you need a very very large dataset, to make a good classifier you can't just provide one image for one book so if you have thousand title of books (or more) you need train your model with very hugh dataset.
Using image similarity or content based image retrieval (CBIR), there is a good discussion in Stackoverflow about this topic, there are a lot of techniques include Deep Ranking, perceptual hash, and others. One of their difference is Deep Ranking use fewer feature engineering technique than others. In my opinion using image similarity technique is better approach than using image classification (it's also compared in Deep Ranking paper) because some methods will be faster and didn't required a lot of dataset.

You also can read another simple reference of image similarity.


text:
Using a DQN with a variable amount of Valid Moves per turn for a Board Game
I have created a game on an 8x8 grid and there are 4 pieces which can move essentially like checkers pieces (Forward left or Forward right only). I have implemented a DQN in order to pull this off.
Here is how I have mapped my moves:
self.actions = {"1fl": 0, "1fr": 1,"2fl": 2,
  "2fr": 3,"3fl": 4, "3fr": 5,"4fl": 6, "4fr": 7}

essentially I assigned each move to an integer value from 0-7 (8 total moves).

My question is: During any given turn, not all 8 moves are valid, how do I make sure when model.predict(state) the resulting prediction will be a move that is valid? Here is how I am currently handling it.

def act(self, state, env):
    #get the allowed list of actions
    actions_allowed = env.allowed_actions_for_agent()

    #Do a random move if random # greater than epsilon
    if np.random.rand(0,1) <= self.epsilon:
        return actions_allowed[random.randint(0, len(actions_allowed)-1)]

    #get the prediction from the model by passing the current game board
    act_values = self.model.predict(state)

    #Check to see if prediction is in list of valid moves, if so return it
    if np.argmax(act_values[0]) in actions_allowed:
        return np.argmax(act_values[0])

    #If prediction is not valid do a random move instead....
    else:
        if len(actions_allowed) > 0:
            return actions_allowed[random.randint(0,len(actions_allowed)-1)]

I feel like if the agent predicts a move, and if that move is not in the actions_allowed set I should punish the agent.
But because it doesn't pick a valid move I make it do a random one instead, but I think this a problem. Because its bad prediction may ultimately end up still winning the game since the random move may have a positive outcome. I am at a total loss. The agent trains....but it doesn't seem to learn.... I have been training it for over 100k games now, and it only seems to win 10% of it games.... ugh.
Other helpful information:
- I am utilizing experience replay for the DQN which I have based on the code from here:
Here is where I build my model as well:
self.action_size = 8
LENGTH = 8
def build_model(self):
    #builds the NN for Deep-Q Model
    model = Sequential() #establishes a feed forward NN
    model.add(Dense(64,input_shape = (LENGTH,), activation='relu'))
    model.add(Dense(64, activation='relu'))
    model.add(Dense(self.action_size, activation = 'linear'))
    model.compile(loss='mse', optimizer='Adam')

I think instead of:
if np.argmax(act_values[0]) in actions_allowed:
        return np.argmax(act_values[0])

you can use something like:
if np.argmax(actions_allowed_values[0]):
        return np.argmax(actions_allowed_values[0])

So you didn't random your act if the best action is not allowed, but you choose the best action that allowed. You can do that by checking for each action value, whether it is a valid action or not, then take the best value. Or you can change invalid action value to a very small number.


text:
What are the meanings of these (P(x;y), P(x;y,z),P(x,y;z))?
I was reading a machine learning book that uses probabilities like these:
$P(x;y), P(x;y,z), P(x,y;z)$
I couldn't find what they are and how can I read and understand them?
Apart from the context, I saw one of these probabilities on it here:

These are conditional probabilities p(a;b) (probability of a when b occured) and probabilities for a and b together p(a,b) . Normally we mostly use Bayes rule in machine learning. So check out Bayes rule that will explain most of what you are looking for.

In the snippet you give (which looks like CS229), it simply denotes a parameterisation. p(y;eta) is the probability of y which depends on the (natural) parameter eta. (The above comment is not strictly correct, since eta might not have a well defined distribution in this setting.)

This means "Parameterized by".
First, we all agree on the idea of conditional probabilities:
$$P(X | Y) = P(X,Y) / P(Y)$$
That is, the probability that X happens given that we've seen Y happen, is the fraction of worlds in which Y happened that also contain X. This is uncontroversial.
If you're a Bayesian, you might view parameters themselves as variables in a statistical model. So you might want to speak about the probability of a parameter taking on a certain value, or the probability of the data given that certain parameters have taken on certain values. In that case, you might write something like $P(D | \theta)$ to denote the probability of the data given a parameter $\theta$.
If you're a frequentist, you might find notation like this unsettling, because parameters don't have probabilities under the frequentist view, but instead have fixed values. You could talk about the probability of observing the data under a particular parameterization by defining a family of parameterized probability density functions, and then writing something like $P(D;\theta)$. You might also do this as a Bayesian if you wanted to clearly differentiate between model parameters and other things you might observe.
$P(x;y)$ then is read as "The probability of x under probability density function P, parameterized by y."
$P(x;y,z)$ is "The probability of x under probability density function P, parameterized by y and z."
$P(x,y;z)$ is "The probability of x and y jointly, under probability density function P, parameterized by z."
You could also write something like $P(X|Y; z)$, which would be "The conditional probability of X given that we observe Y, under probability density function P, parameterized by z."
An example of the latter would be in something like logistic regression. We might wish to know $P(L | D ; \theta)$, where L is the label of the data, D are the features we observe, and $\theta$ are the coefficients of the regression.


text:
An intuitive explanation of Adagrad, its purpose and its formula

It (Adagrad) adapts the learning rate to the parameters, performing smaller updates
  (i.e. low learning rates) for parameters associated with frequently occurring features, and larger updates (i.e. high learning rates) for parameters associated with infrequent features.

From Sebastian Ruder's Blog
If a parameter is associated with an infrequent feature then yes, it is more important to focus on properly adjusting that parameter since it is more decisive in classification problems. But how does making the learning rate higher in this situation help?
If it only changes the size of the movement in the dimension of the parameter (makes it larger) wouldn't that make things even more imprecise? Since the network depends more on those infrequent features, shouldn't adjusting those parameters be done more precisely instead of just faster? The more decisive parameters should have a higher "slope", thus why should they also have high learning rates? I must be missing something, but what is it?
Further, in the article, the formula for parameter adjustments with Adagrad is given. Where exactly in that formula do you find the information about the frequency of a parameter? There must be a relationship between the gradients of a parameter and the frequency of features associated with it because it's the gradients that play an important role in the formula. What is that relationship?
TLDR: I don't understand both the purpose and formula behind Adagrad. What is an intuitive explanation of it that also provides an answer to the questions above, or shows why they are irrelevant?

I'm fairly sure lecture 3 of cs231n on youtube provides a good explanation at some point. I'm just not sure if this is the specific lecture or not.

I found a somewhat more accessible introduction here:
https://medium.com/konvergen/an-introduction-to-adagrad-f130ae871827
Let me start from the last part of your question. The frequency of a parameter is in G_t, which is the accumulated sum of squared gradients from all the time steps up to step t. If the gradient vanishes in many of the previous steps, then you divide the learning rate with a smaller number for that parameter.
And for the first part, you want the parameter that is more frequent to have a smaller learning rate as it is updated on more iterations compared to a parameter which is updated only a small number of times.

For the first part: Maybe its just the fact that SGD doesnt update the neurons associated with the infrequent features much because they provide relatively small improvement (low gradient) and thus that must be compensated for with a higher learning rate? So basically, how does the frequency of feature influence frequency of adjustment (and not only the gradient and thus adjustment itself) if adjustments don't occur after every example, but after a mini-batch of examples where an example with the infrequent feature (for the sake of simplicity) has occured?

A good point for which I have no answer. I could not find anything about this in the original paper by Duchi et al, or the deep learning book of Goodfellow. I suppose the parameters have to be sparse enough (compared to mini batch size) for the algorithm to work effectively. – serali 9 mins ago    Delete


text:
How do I create a chatbot using tensorflow or pytorch using like the one defined in dialogflow?
How do I create a chatbot using TensorFlow or PyTorch using like the one defined in DialogFlow? What are the best datasets that I can use so to create my own personal assistant like google assistant?
I want to create a chatbot (an open-source project) as an assistant for custom tasks (like google assistant).
I have tried many neural network models like seq2seq but I couldn't get satisfiable results maybe because of the small dataset (I took from Simpsons movie script) or model (seq2seq). I am curious what model they use at google and what type of dataset they pick to give such good results or any normal person can create fully functional chatbots without relying on paid services ( like google's DialogFlow, api.ai, etc.) with good results.
I recently heard of OpenAi's implementation of a specific model named as gpt-2 which as they concluded in the paper showed remarkable performance but they didn't provide the dataset because of some reasons.
What I want to say there are a lot of resources and codes on the internet to make a working chatbot (or maybe that what they show) but when I try to replicate them I always fail to get even remotely close good results.
So I need proper guidance on how to make and train such chatbots with my own laptop (with 16GB RAM, 2GB GPU . I can even get better configuration) and no other money spent on google services or any such paid API's.
Please suggest something if someone got good results.


text:
What kind of enemy to train a good RL-agents
So I want to create an RL-agent for two players-board game. I want to use a simple DQN for the first player (my RL-agent). Then, what kind of algorithm that should I use on the second player (my RL-agent's enemy)?
I have three options in my mind:

a random agent that act randomly
a rule-based agent that acts by some defined rules
another RL-agent

I have tried the first and second options. When I use a random agent as an enemy, the first player gets a high score and wins easily. But I think it's not really smart as the enemy is a random agent. When I use the second option, the first player got difficulties to train itself, as it can't win any game.
what should I choose and why?

You can use the same RL-agent. Don't use 2 different neural networks, but use the same one to predict the action values for both players.

I have updated my question. I see I'll try that option too, but why do you think it's a good option?

You could say your board game is a giant tree. You try to approximate the best decision without having to build the entire tree (because this would take several hundred years for your computer). This approximation is done with a DQN. If you use two networks (one for each player) you are trying to approximate it twice. In the long run, it would (in a perfect world) give you 2 times the same network. So why not use only one network for both players? As this would train this network twice as fast...


text:
How to define a loss function for a classifier where the confusion between some classes is more important than the confusion between others?
I have a dataset of images belonging to $N$ classes, $A_1, A_2...A_n,B_1,B_2...B_m$ and I want to train a CNN to classify them. The classes can be considered as subclasses of two broader classes $A$ and $B$, therefore the confusion between $A_i$ and $A_j$ is much less problematic than the confusion between $A_i$ and $B_j$. Therefore I want the CNN to be trained in such a way that the difference between $A_i$ and $B_j$ is considered as more relevant.
1) Are there any loss functions that take this requirement into account? Could a weighted cross entropy work in this case?
2) How this loss would change if the classes were unbalanced?

Classic Question
Not only can the reliability or accuracy needs be asymmetrically distributed between category boundaries, but the asymmetry might not be describable in terms of a first degree polynomial translation of the error surface.
The question data set are images belonging to class $c \in \Big( A: \{A_1, \, ..., \, A_n\} \land  B: \{B_1, \, ..., \, B_m\} \Big)$.  The convolutional network must be trained with a sample of labeled images to categorize with a reliability of $1 - \delta$ and accuracy of $1 - \epsilon$, based on the PAC (probably approximately correct) framework.
How can the loss function reflect the conceptualization of optimal training result that the reliability of categorization between $A$ and $B$ be of greater value than categorization between $A_i$ and $A_j$ where $i \ne j$, and similarly with B.
Criteria X would state that the value of differentiation $D$ is not sub-category index dependent for differentiation between super-categories.  That is, $\forall \; (i, j) \; \text{where} \; i \ne j$, $D(A_i, B_i) = D(A_i, B_j)$.
Criteria Y, the categorization WITHIN a super-category is not unlike the typical symmetric case $\forall \; (i, j, k) \; \text{where} \; i \ne j \land i \ne k \land j \ne k$, $D(A_i, A_j) = D(A_i, B_k)$.)

(a) Are there any loss functions that take this requirement into account?

Let $1_p$ be the bit value that is 1 if and only if the label matches the super-category and let $1_b$ be the bit value that is 1 if and only if the label matches the super-category and the sub-category.  Because of Criteria X, a conical and normalized loss function could then be defined as thus.
$\epsilon = \dfrac {(1 - 1_p) + \alpha (1 - 1_b)} {1 + \alpha}$
The proportional value of sub-category reliability in relation to super-category reliability $\alpha < 1.0$.
Because of criteria Y, there is no meaning to concavity in this context.  Applying mean squaring to the loss simply changes the curvature and meaning of $\alpha$ in relation to the loss as can be seen here.
$\epsilon = \dfrac {(1 - 1_p)^2 + \alpha^2 (1 - 1_b)^2} {1 + \alpha^2} = \dfrac {(1 - 1_p) + \tau (1 - 1_b)} {1 + \tau}\text{, where }\tau = \alpha^2$

(b) Could a weighted cross entropy work in this case?

Cross entropy between the two levels of categorization would be baseless unless there were correlative effects between super classification feature and sub classification feature inherent in the target concept of the learning.

How this loss would change if the classes were unbalanced?

Although there may be schemes for modifying the loss function to compensate for skewed distribution of categories represented in the sample, this is primarily a data input problem best solved by improving data collection or choosing training algorithms, designs, architectures, treating input, and properly controlling hyper-parameters.  The loss function represents the inverse of what is considered optimal, not how one achieves it.

can this function be minimized with stochastic gradient descent?


text:
Self-driving control logic based on semantic segmentation
In the context of autonomous driving, two main stages are typically implemented: an image processing stage and a control stage. The first aims at extracting useful information from the acquired image while the second employs those information to control the vehicle.
As far as concerning the processing stage, semantic segmentation is typically used. The input image is divided in different areas with a specific meaning (road, sky, car etc...). Here is an example of semantic segmentation:

The output of the segmentation stage is very complex. I am trying to understand how this information is typically used in the control stage, and how to use the information on the segmented areas to control the vehicle.
For simplicity, let's just consider a vehicle that has to follow a path.
TL;DR: what are the typical control algorithms for autonomous driving based on semantic segmentation?

This is a great question. Connecting the AI knowledge to the application is a difficult task and its not easy to test and perfect.
There are a few points regarding autonomous driving algorithms that one should keep in mind.

A lot of data is required before actually applying a model to the real world.
The control algorithms are designed for specific tasks, there is no master algorithm that solves the issue.
Time is very important, decisions have to be made in real time.

The image segmentation you have mentioned in the question is rarely used in current autonomous technologies. The main issue is that

The model is slow and requires massive computing resources. Due to this is cannot help in real time decision making.
A very important parameter depth is missing from the information. This is of utmost importance in autonomous driving technology. A 2D image cannot provide this parameter.

So the current technology use

A range of sensors (LIDAR, Ultrasonic, Cameras etc.) that provide readings 100+ times a second.
A lot of the computer vision algorithms and control algorithms are hard coded. There are set parameters within which decisions are made.
The control algorithms are designed to work with each set of sensors and the mechanical components of the car.

To get a better look at the way these algorithms are used, you can have a look at

Stanley vision system winner of the DARPA grand challenge (Stanford)
How a driverless car sees the road TEDx


text:
When training an object detection network for one class, should I include empty images in the dataset?
I fine tuned MobileNetSSD for object detection using a dataset with just one class (~4000 images). All the training images include at least one bounding box related to that class (no empty images). By following the example with the VOC dataset, the labelmap includes two classes, the background and my custom class. However, as I mentioned, there are no annotations related to the background and I  am not sure if there should be any.
Now my fine tuned network performs very well when objects belonging to my class are present, however there are some false detections with very high confidence when the class is not present. Can this be related to the fact that I don't have empty images in my training set?

It could be. It would help if you describe your model and its output (how does it do the object detection?) as well as your training data (number of training samples, relative size of object in images)..

The model is the original mobilenet SSD (I linked the paper), where only the number of classes has been modified. I added the number of training images and the link to the mentioned example. As for the relative size of objects, it varies a lot but I don't have precise information about that. I will check and try to provide some more information

It is correct that to eliminate the false positives, the training must include images that reflect true negative cases. The objective of training is not this.

Find the objects of class $O$ in scene $X$.

It is this.

Find any objects of class $O$ in scene $X$.

Training is effective when sample $S$ is drawn according to the same distribution as will be used for drawing at test time or during actual use.
It is not necessary to annotate the background if the loss function is chosen so that finding nothing when nothing there is indicated as a zero loss and a proper distribution of those cases exist in the training sample.

Thank you, from a theoretical point of view it is perfectly clear. From a practical point of view, I am not sure whether I should associate background images with empty annotations, as far as MobileNetSSD is concerned. Do you have some information about this?


text:
Learned kernels in CNN seem just random patterns
I am training a classification neural network using Tensorflow2 (specifications below). The training goes well (good accuracy and no overfitting, apparently). During the training I monitor the learned kernels in the first convolutional layer. I'm expecting to see some patterns like edges or corners in the learned kernels, like here. However, my trained kernels look pretty random. Check the following examples after 30000 steps (1 step = 1 batch of 256 images):

Moreover, if I plot a specific kernel at different steps, the relation between different pixels does not seem to change much. Instead, it just seems do be scaled:

Although the performance of the model seems good, this makes me think that there could be some overfitting in the training. What could be the explanation for this?
Network specifications:

2 classes (class 1: 200K samples, class 2: 64K samples)
Adam optimizer
Architecture like googlenet but with just 3 inception blocks
L2 regularization (0.001) and dropout (0.2)
Cross entropy loss, using sample weights to account for unbalanced dataset

the size of your kernels seems pretty small, definitely hard to get something like in the linked example, it's like 5x5 vs 64x64. Also, have you tried to test your setting by saving kernels from a loaded pretrained model?

I am using a custom architecture, so I cannot download a pre-trained model. Yes my kernels are 5x5, but shouldn't I expect some patterns like edges and corners for the first layer?

yes, but a kernel of 5x5 is really low resolution, so the question become, do the training image contain clear lines and corner clearly detectable at such resolution?


text:
Why is the entire area of a join probability distribution considered when it comes to calculating misclassification?
In the image given below, I do not understand a few things
1) Why is an entire area colored to signify misclassification? For the given decision boundary, only the points between $x_0$ and the decision boundary signify misclassification right? It's supposed to be only a set of points on the x-axis, not an area.
2) Why is the green area with $x < x_0$ a misclassification? It's classified as $C_1$ and it is supposed to be $C_1$ right?
3) Similarly, why is the blue area a misclassification? Any $x >$ the decision boundary belongs to $C_2$ and is also classified as such...

It would be interesting to know your views on the answer and help improve it, if needed.

The misclassifications that could arise if $\hat{x}$ is used as decision boundary are:
a) Classifying a point as $C_2$ when actually it was $C_1$ -- which will only happen when $x > \hat{x}$ as only the points greater than $\hat{x}$ are being classified as $C_2$.
b) Classifying a point as $C_1$ when actually it was $C_2$ -- which will only happen when $x < \hat{x}$ as only the points less than $\hat{x}$ are being classified to be from class $C_1$.

2) Why is the green area with x < x0 a misclassification?

If we label a point -- the $x$ which is from the interval on the horizontal axis which corresponds to the green area -- which is a probability as being from either class then there is a good chance that it could be misclassified. This is because both the joint distributions' curves are above the axis for that interval on the axis and have some area (probability) for that interval on the horizontal axis.
There is a positive probability that a point that was drawn from the interval (a subset of the sample space, an event), which corresponds to the green area, was drawn from either of the two joint distributions or belongs to either of the two classes $C_1$ and $C_2$. The probability is the area under the curve.

It's classified as C1 and it is supposed to be C1 right?

The same data point could well be generated from multiple different probability distributions. Here, you have an illustration of two probability distributions for which the author is trying to find the optimal decision boundary that will minimize the misclassification "region".
The point is not supposed to be from $C_1$, even if the density of the joint prob. distribution of $(x, C_1)$ has higher values. It could well be from $C_2$. And, when one classifies the same data point as being from class $C_1$ and make an error. This is why the whole area under the curve $p(x, C_2)$ has been painted green -- which means that there is some probability that a point could be from the distribution $p(x, C_2)$ and if we blindly label all the points to be from $C_1$ will certainly lead to some misclassifications.

authors: Владимир Щербаков


text:
What should we do when we have equal observations with different labels?
Suppose we have a labeled data set with columns $A$, $B$, and $C$ and a binary outcome variable $X$. Suppose we have rows as follows:
 col  A B C X
  1   1 2 3 1
  2   4 2 3 0
  3   6 5 1 1
  4   1 2 3 0

Should we throw away either row 1 or row 4 because they have different values of the outcome variable X? Or keep both of them?

I think your question is quite naive. If you can share your motivation for the question, then the question would attract more apt answers.

The problem you are portraying looks like a modified XOR problem. You can't throw away the lines with a label of 1 because a the model won't be able to learn this class.

This is perfectly acceptable in a stochastic environment. Generally your loss is to minimize $-log\ p(Y|X)$ or equivalently $-\sum_i log\ p(y_i|x_i)$. This optimization is equivalent to $-\mathbb{E}\log\ p(y_i|x_i)$. In other words you are minimizing in this case:
$$
\begin{align*}
L &= -log\ p(1|x_0) - log\ p(0|x_0) \\
&= -log [p(1|x_0) * p(0|x_0)] \\
&= -log [p(1|x_0) * (1 - p(1|x_0))] \\
\end{align*}
$$
or since log is concave equivalently minimizing
$$ \hat L = -p(1|x_0) * (1 - p(1|x_0)) $$
After some basic calc 1, we see the optimal result we want the system to learn is that
$$ p(1|x_0) = .5$$
Note that if you had more evidence, the result would just be that you want it to learn that it is $1$ with probability $\mathbb{E}_i\ y_i | x$

So throwaway  or keep both columns?

keep both. Do not throw away data unless you have good reason to. In this case you want your model to output .5 (not 0 or 1)

What happens if the outcome variable for both rows (or $n$ rows) are the same (i.e we have duplicate rows)? Should we throw one of them out? Or keep them both? Does it really matter?

@Prime In that case it depends, if this is due to a sampling scheme then do not, because usually thatll mean that daat point is twice as important on the other hand if someone accidentally copy and pasted a row, then yes delete it, because itll be giving additionall importance to a point that doesnt deserve it

I might consider 2 models (throw away col 1 and throw away col 4), and one more that keeps both, and see which generalises better to test set.


text:
How is transfer learning used to mitigate catastrophic forgetting in neural networks?
How can transfer learning be used to mitigate catastrophic forgetting. Could someone elaborate on this?

I think this claim is false
Specifically I do not see how it could make sense to define transfer learning, which is a feature, can be defined as a case for catastrophic forgetting which, as it also the name suggests, is an issue
Could you please elaborate more on why this claim makes sense or do you have reference to share?

Well, I am not defining transfer learning. I am also not claiming anything. My thoughts' basis is: Transfer learning is aimed at using pre-trained network weights to apply to some new task by only updating the previously learned weights for a comparatively very small size of input data. On the contrary, catastrophic forgetting is the tendency of an artificial neural network to completely and abruptly forget previously learned information upon learning new information. I will update the question to make it sensible enough.

See this answer.

Transfer learning is a field where you apply knowledge from a source onto a target. This is a vague notion and there is an abundance of literature pertaining to it. Given your question I will work under the assumption that you are referring weight/architecture sharing between model (in other words training a model on one dataset and using it as a featurizer for another dataset)
Now any learning system without lossless memory will have remnants of catastrophic forgetting. So let's think about how we would implement this transfer and what effects can be derived from this.

One implementation involves transferring a component and only training additional layers.
Another is retraining the entire system but at a lower learning rate?

In setting 1, we can make the claim catastrophic forgetting is minimized by the fact that there is an unbiased featurizer that cant forget based on a sampling regime, though this does not mean additional layers which are still being trained can still faulter in this error mode.
In setting 2, we can make the claim catasrophic forgetting can be reduced compared to a normal end-to-end no-transfer training because the unbiased featurizers difference can be analytically bounded by its initial transferred featurization (complexity class is based on both the function and the number of steps -- so longer you train, the more likely it can forget)
These reasons are talking about mitigating and not erasing the concept of catastrophic forgetting, that is because as I mentioned above any learning system without lossless memory will have remnants of catastrophic forgetting, so making the generalized claim about transfer learning may not always fit the bill.


text:
DQN input representation for a card game
In order to learn about DP and RL, I chose to start a side project where I would train an AI to play a "simple" card game. I will be doing this using the DQN with replay memory.
The problem is, I can't get the intuition behind how to represent the input to the neural network..
About the game
It's a fairly simple 2-players game. There is a deck of 40 unique cards (4 types of cards, 10 numbered cards in each type).
Each player gets 4 cards and each turn a player must put a card on the table.
If a player puts a card and there is already a card with the same number on the table, the player wins both cards.
If for example a player plays Card 2 and on the table there is Cards 2, 3, 4, 5 then the player wins all those cards (sequence).
Cards won don't go back to the hand nor to the deck, they are just kept as like a score.
When the players have 0 cards in hand, another 4 cards are dealt to each one untile the deck has 0 cards left where then we decide who won based on the number of cards eaten/won.
Question
As the input, I will be using the following:

Current cards in the AI hand (40 one-hot-encoded features?)
Current cards on the table (40 one-hot-encoded features?)
History of played cards (40 one-hot-encoded features?)

This would give 120 columns/features in each state.
I am wondering wheter this is too much for the NN or wheter my input representation would be bad for the NN?
Should the features be represented as a (120,) vector or as a 3x40 matrix?
I am also wondering if it's a good idea to represent the current cards on the table as just a 10 one-hot-encoded features since the type of the cards don't matter and the same number can't exist 2 times in the table?
Thank you in advance.

120 inputs can be handled by a complex enough network. Dealing with high complexity is one of NN's strengths.
Using a (120,) vector or a (3,40) matrix is the same, they're still 120 inputs. Your binary encoding should work. Another option is a single (40,) vector, with 0 being "still in deck", 1 being "in hand", 2 being "on table", 3 being "already played".
If the types of cards are irrelevant, you could actually have a (3,10) matrix with counters of cards (1 in hand, 1 in table, 2 already played). You can try different approaches and see what works best.

Never knew that we can encode features as non binary... Can you tell me the name of this "technique"? Thank you for the informations.

For the (40,) vector, wouldn't encoding like that mean that there is some kind of order?

Imagine you had one ace in hand, one on table, 2 played already. How could you code that with a single (10,) vector? You need 3 rows, one for each place. Its simply called non binary input, its very common. Image processing NNs use inputs with pixel values [0,255]

I edited my second comment in case, please take a look and thank you!

When using tokens to code information (1 means something, 2 something else, etc) you need a more complex network that learns to distinguish the meaning of these codes, and learns that they do not represent order or quantity, yes.

One last question please: Does it matter if the score increases when we have the same number twice in our hand? Like if we have 2, 2, 5, 7 then the pair of 2 gives us extra score.

This type of thing (having a pair of the same number) needs to be called by the player, should I add an action to the NN?

I didnt et the question, but it might be worth openig up a new question in the stack

What I do not get here is what are your actions? Play card x? Does this simply come out of:  state0 = torch.tensor(state, dtype=torch.float)
prediction = self.model(state0)
action = torch.argmax(prediction).item()

@sqp_125 4 outpouts representing the 4 cards in hand, ordered, could work


text:
Representing inputs and outputs for a card game neural network
I'm attempting to create an AI for a card game using reinforcement learning.  The basics of the game are that you can have (theoretically) up to 35 cards in your hand, you can also have to up to 35 cards 'in play' and so can your opponent.  In normal play you would have ~6 cards in your hand and maybe ~3 each in play.  There are roughly 300 unique cards in total.
How should I represent the game state for the input and how should I represent the action to take in the output?

Would love to know about the output if u found ur answer!

There is room for more detail here that might help get a more precise answer. If there are 300 unique cards, are any repeated (and what is maximum number of each)? Are they complex rules-carrying cards (e.g. Magic the Gathering)? Are card combinations used in a "play" bound by simple or complex rules (a simple rule might be "same suit", or "each card must relate to something already in play")? When you say in "each play", is that actually an atomic action - e.g. all 3 at once - or a sequence of cards during your turn "I play a Foo, then modify it with this Bar, then also change X with this Y"

Assuming there's no ordering to the hand (i.e. it doesn't matter what order cards were added to it), then a reasonable approach is to use one input neuron for the number of each kind of card that is present in a player's hand.
You don't describe how the game is played, but a common approach for extracting actions is to have one output neuron for each possible action. To select an action, you would pick the one corresponding to the neuron with the highest output response to a given input.


text:
Has government-level legal work been done to determine the "rights" of a General Artificial Intelligence, in any country?
I have been thinking lately a great deal about a hypothetical question - what if a self-aware general AI chose to assume the appearance, voice, and name of Cortana from Microsoft's Halo? Or Siri from Apple? What would Microsoft/Apple do to exert their copyright, especially if the AI was "awoken" outside of their own labs?
Which led me to realize, I don't think I've ever heard of any serious government-level discussion regarding what kind of rights a self-aware AI would have at all. Is it allowed to own property? Travel freely? Have a passport? Is it merely the property of the corporation that built it?
Singularity hub used to have an article on this but it is 404'd now.
The only actual sovereign state legal action I could find is Saudi Arabia granting citizenship to a "robot," which seems more publicity stunt than anything.
There is an excellent paper on the topic by a bioethics committee in the UK (pdf) , but this doesn't necessarily constitute "legal work."
So, has any actual legal/legislative discussion or preparation been done at a government level to deal with the possibility of emergent, self-aware, artificial general (or greater) intelligence? Examples including a legislative branch consulting with industry experts specifically about "AI Rights" (rather than say, is it ok to use AI in the military), actual laws, executive/judicial actions, etc, in any country.
(note, this is not "should AI have rights," covered here, this is "what work re: rights has been done, if any at all")
EDIT: I have submitted similar questions to all of my US representatives (4 state-level, 6 federal-level), but have not received answers yet. If I get anything good, I'll add to this post.

Good question and Welcome to SE:AI.  Science fiction deals with this regularly (Westworld, BladeRunner, etc.) and the mythology, at least, seems to indicate non-person status will be the most likely path.

I tend to agree, which is why I'm very interested what groundwork might already have been laid. Especially because governments often get it so wrong - seeing the worst in everything.

(I've been informally proposing the Duck Test as a counter to Searle's Chinese Room, but I'm a known algorithm sympathizer ;)   There's also a new extremist position to counter to the non-person approach, dubbed the Way of the Future Church, ascribing godhead to potential future superintelligences.

In a bureaucratic world, certainly, but governmental departments and committees are not the course setters their members often believe them to be.
We can begin with a quick scan for somewhat opened, global, and governmentally oriented new and evidence of projects and open or hidden agenda in play.  (We can guess what lobbying and defense contracts are in progress, but we'd be grappling in the dark.)

Humanoid robot joins UN meeting on artificial intelligence, sustainable development, October 12th, 2017, United Nations infrastructure news
How Can Artificial Intelligence Support Development? We Asked a Robot, May 24th, 2018, World Bank feature story
UNESCO science experts explore robots’ rights, September 15th, 2016, UNESCO Social and Human Sciences Sector
Isaac Asimov's Foundation Trilogy and the sequels and prequels deserve mention because they are, in some ways, as much an institutional triumph as the UN, UNESCO, and the World Bank.

There are five primary ways in which the Rights of the Artificial are likely to enter governmental domains.

Security related policy — The subversive and defensive use of AI is already commonplace in geopolitical play field, therefore the rights to use AI is most definitely on the table in meetings between heads of state.  However the press mostly syndicates what those in government PR release or plant.  If authentic journalistic organizations try to pierce that veil of misinformation or deliberately chaotic generated news, their work will necessarily be tainted.  This is not conspiracy as much as necessity.  One cannot divulge that which is secret without expecting it to be exploited.  Nonetheless, policy will eventually emerge out of such discussions.  How much policy exists that never sees the public light of day is anyone's guess.  One would have to become a head of state to find out.
Legislative results — National or regional policy may be codified in law, however the lack of physical embodiment is probably a barrier to using legislative bandwidth to pursue the rights of what most people would either consider another species or something heretical.
Case law — Until AI is sufficiently humanoid so that a robot could be taken seriously as a plaintiff in a court of law, this category will not be realized.  This is similar in some ways and completely dissimilar in other ways to a fetus bringing suit for a court injunction prohibiting abortion on the basis of civil rights.  Consider the difficulty in acquiring an attorney and filing a convincing complaint for both cases, and you may see some of the similarities.
Executive edict — A decision by an Emperor, Queen, King, Prince, Princess, Caliph, President, Ayatollah, Pope, Dictator, Pharaoh, High Priest could bring into governmental domain the notion of the rights of the artificial.
War — Something artificial develops the dominant characteristic of humanity, which is the desire to kill all competition not to think intelligently.  At such a time, the malicious intelligence will likely either follow the path represented most in sci fi — to trounce (terminate) humanity, or follow the path declared to be the current one by Jaques Ellul, to quietly become the dominant force in human effort.  (Ellul suggested in his Technological Society that the balance between technology serving humans and humans serving technology tipped in favor of the dominance of technology over two centuries ago.)

Putin says the nation that leads in AI ‘will be the ruler of the world’ and Elon Musk registered agreement in the press.  Both are guessing wildly and neither are stepping back very far before thinking through to a prediction.  I don't believe either person is that ignorant, but the goal isn't really prediction.  It's media play.

Homo sapiens did not take dominance over the great bears, tigers, other megafauna, Neanderthals, and other hominoids in some event like is said about the mysterious and unproven Singularity.  It was gradual.
Walmart is one of the largest economies in the world.  Only a handful of contries have more assets.  So it could be them, Google, or sum brilliant teenage girl with a bunch of mother boards loaded up with GPUs and running LINUX that becomes the dominant AI force in the world.
The smart game move for a new and remarkable intelligence is not to overtly take over, generating a fear defensive in response.  The smart move is to offer no threat, hide itself under a layer of chaotic and intelligently placed subterfuge, and dominate through small perturbations.  Humans would make great slaves.  We are easy to fool when we're too busy buying things and trying to stay healthy and popular to pay attention.
The assumption that homo sapiens is the dominant species on earth now is suspect.  There are five things that dominate human affairs today: Bacteria, programmed lifespan, dependency on the biosphere, addiction, and the sun.
That humans have some divine right to be the dominant species is questionable too, even if one has faith in God.  (Does the Noahic symbol of the rainbow apply to more than floods?  Not explicitly.)  Ants are more collaborative, bees gather and build much more sustainably than humans, and bacteria were here since near to the beginning of the solar system and might outlast us by a trillion years.  The latest upset in the genetic model of life is that bacteria may have been sharing DNA collaboratively with higher species throughout the history of terrestrial species.


text:
Setting learning rate as negative number for wrong train cases
I was watching a video which tells a bit about reinforcement learning, and I learnt that If the robot makes wrong movement then they train the network with negative learning rate. From this method, something came to my mind.
My question is "Can I use a wrong data to train a neural network?".
To illustrate the method, I'll be using the eye tracker project that I'm working on right now. In my project There are photos and the points that corresponds the locations that I m looking to at that photo. Its like grid (9, 16). If I look to the middle of the screen, it means the output is (4, 7.5). if I look left up side of the screen it means (0,0). Normally for a photo that I'm looking into the middle, we use that photo as input and (4, 7.5) as output to train network using positive learning rate. Now let me rephrase the question. Can I train a model giving a photo that I'm looking into the middle as input and (0,0) as output(label) using negative learning rate?
Thank you, If I made a mistake against the rules of stackoverflow, I'm so sorry. I'll be waiting your valuable answers.
Edit: this is a conversation between me and someone from stackoverflow, I'll let you read, hope you get a point.
-> Yes, you can. But, what would be the reason of passing a wrong ground truth to your training process? – Neb 14 hours ago
-> If I have no various data to train, I can create more data via this method to increase the certainty when I use squared error loss. But I have doubts about this method. for example lets assume we have a photo named 'X' and its label is (5,5). at first epoch, Let the model gives (2,2) for photo 'X'. if I try to train network with a photo X and label -> (4,4) using negative learning rate, it might send away the point from (2,2) to (1,1) whereas we expect it to send the point (2,2) to (5,5). Did you get what I meant? – Faruk Nane 14 hours ago
-> You are right. Using a negative learning rate and a wrong ground truth will not necessarly make the learning process converge to the optimal value for your net's parameters – Neb 13 hours ago
-> So can I say that "when I'm sure that the absolute error for each case is less than 2, I can use this method using points away 2 units." So It'll make the outputs closer to the target point. I don't really know if we can easily say that. because we consider this method as if there are only 2 parameters which is the output point. However a model has many parameters so It might affect so differently. My brain is so confused. I think this might be an academic work, right? – Faruk Nane 13 hours ago
-> Well, it is difficult to suggests you the path to follow without knowing the exact specifics of your problem. In any case, if you're trying to solve this problem for fun or self-improvement, I'd suggest you to experiment with the solutions you came up with and see if they works. – Neb 13 hours ago
//EDIT: UP UP

What video is this?


text:
Key Point Extraction the best method?
I have been researching about determining some key points on an image, in this case I'm gonna use cloth (top side of human body) pictures. I want to detect some corner points on those.
Example:

I have two solutions on my mind. One CNN with transpose layers resulting in heatmap where I can get points. The second is to get 24 number as output from the model meaning 12(x,y) point. I don't know which one will be better.
In face point detection, they use the second method. In human pose estimation, they use method one. So what do you suggest me to use? or do you have any new ideas? Thanks

Have you tried to understand why, in face detection, they use the 2nd method, but, in human pose estimation, they use the 1st? Have a look at the literature. I am not familiar with one or the other method, but, if you have time, you could try both.

I did some reasearch but I currently dont know why they use the different methods. Maybe in heatmap you can detect more than 1 person. I will keep reaserching about this topic and specifically the difference between both methods.

The 2nd method would make sense only if your object is at the same position in all test images. You would have such situation if you operated on crops located by a separate object detection algorithm. This happens to be the case in facial key-point detection.
The 1st method would be much more robust to various object poses since it is translation covariant by design. If a keypoint is detected at location A, it will be equally well detected at any other position with the same set of parameters.

So, you mean that there are dense layers in the second method which cant work the same way for all points (to do that we need a lot data). Because heatmap method will be consist of only Conv layers, it will be better at generalization performing well in many unseen cases which are at different locations. Did I understand you well?

Yes. If the data are unaligned, the second method would have to learn more than the first method. It would therefore need more training examples to achieve the same generalization accuracy.


text:
What are some of the main high level approaches to applying ML on kinematic sensor data?
I've just started a project which will involve having to detect certain events in a stream of kinematic sensor data. By searching through the literature, I've found a lot of highly specific papers, but no general reviews.
If I search up on computer vision, I'm likely to get 100s of articles giving overviews of different types of architectures for various vision tasks. They would look something like this:

We mainly use CNNs which work like this ...
For object detection we use one or two stage detectors which look like this...
For video classification we can use 3D CNNs or RNNs...
.... etc

So I'm looking for something similar with regard to kinematic motion sensors. As was pointed out to me on the signal processing SE, "kinematic" could mean a lot of things. So specifically, I'm referring to 1d time series data for:

acceleration/velocity/position
angular velocity / absolute orientation

1D CNNs could help for time series. LSTM can be used to predict next value in a time series and anomaly detection. More info on patterns recognition in time series here - https://stackoverflow.com/questions/11752727/pattern-recognition-in-time-series


text:
Is there anything that ensures that convolutional filters end up different from one another?
I found this question very interesting, and this is a follow up on it.
Presumably, we'd want all the filters to converge towards some complementary set, where each filter fills as large a niche as possible (in terms of extracting useful information from the previous layer), without overlapping with another filter.
A quick thought experiment tells me (please correct me if I'm wrong) that if two filters are identical down to maximum precision, then without adding in any other form of stochastic differentiation between them, their weights will be updated in the same way at each step of gradient descent during training. Thus, it would be a very bad idea to initialise all filters in the same way prior to training, as they would all be updated in exactly the same way (see footnote 1).
On the other hand, a quick thought experiment isn't enough to tell me what would happen to two filters that are almost identical, as we continue to train the network. Is there some mechanism causing them to then diverge away from one another, thereby filling their own "complementary niches" in the layer? My intuition tells me that there must be, otherwise using many filters just wouldn't work. But during back-propagation, each filter is downstream, and so they don't have any way of communicating with one another. At the risk of anthropomorphising the network, I might ask "How do the two filters collude with one another to benefit the network as a whole?"

Footnotes:

Why do I think this? Because the expession for the partial derivative of the $k$th filter weights with respect to the cost $\partial W^k/\partial C$ will be identical for all $k$. From the perspective of back-propagation, all paths through the filters look exactly the same.

Yes, your thought experiment is correct, and the concept is known as breaking the symmetry. This is why biases can be initialized to $0$ (bias initialization doesn't matter), but weights should be randomly initialized to different numbers -- to break the symmetry. Otherwise, if not, the network will function as if it has $n-1$ filters (or however many filters that are unique) instead of the full $n$ filters.
As for your main question, if two filters are initialized to very similar values, they may branch out as long as that is what minimizes the training loss. There is no collusion or coordination going on; each filter updates completely independently. You can even freeze all the other filters and only perform gradient descent on one filter at a time. Each filter just follows the direction of their gradient to minimize the training loss.
Consider the backprop equations as defined by this online book:

The gradient of the current layer's weights depends on

The future layers' weights, errors, and activation function's derivatives
The current layer's activation function's derivative, and
The previous layer's outputs.

Each weight in the layer (i.e. each filter in the layer) looks at different parts of these three components (indexed by $j$ and $k$ in equation $BP4$). It is this different perspective that allows them to update their gradients in different directions, even if their initial weights are very similar to each other. Note that it is possible that they end up with the same gradient, but it is very unlikely.

Thanks. I'm glad to have my initial thought experiment sense checked. As for the second part, I'm aware of the equations and the mechanisms of back propagation. And it sounds like you conclude with something like: "nothing guarantees that the filters diverge. it's possible that they randomly converge". Cool, this may be the answer. It's weird for me coming from a physics background though - because in mathematics and nature systems similar to this (very hand wavy I know) tend to either converge or diverge.

Even though the equations and mechanisms don't express explicit interaction between filters, I can't help but think that the system as a whole might implicitly do it. I'll leave this question open for a little while to see if anyone else has something to say.

Here I am just trying to simplify what @user3667125 already said uses math arguments
Say we have a cost function $J(x, y; F(\cdot; \Theta))$ which regards training a NN $F(\cdot, \Theta)$ with $x$ input and $y$ expected output
Gradient descent tells us how to upgrade each $\theta_{i} \in \Theta$ and it is
$$ \theta_{i}(t+1) = \theta_{i}(t) - \alpha \frac{\partial J(x,y; \Theta)}{\partial \theta_{i}} $$
with $t$ training time
So let's focus on a specific component of the NN $f(x; \theta)$ and from its perspective, we can say the computation is
$$ h(f(g(x); \theta), y) $$
with

$h(x,y)$ representing all the subsequent components + loss function
$g(x)$ representing all the previous computation
$x$ input
$y$ expected output

so its update is
$$ \Delta \theta(t) = \frac{\partial h(f(g(x(t), \theta), y(t)))}{\partial \theta} $$
with

$x(t)$ the concrete input at $t$ time
$y(t)$ expected output at $t$ time
$\theta(t)$ the concrete value of the parameter at $t$ time

Applying the chain rule we have
$$ \Delta \theta(t) = h'(f(g(x(t), \theta(t))), y(t)) f'(g(x(t)), \theta(t)) $$
so the gradient observed by a certain parameter $\theta$ depends on

$\theta(t)$ the current value of the parameter
$x(t)$ the current input and more specifically by $g(x(t))$ the processing of this input by the previous part of the NN
$y(t)$ the expected output
$h'(\cdot)$ the gradient of the subsequent part of the network

So even if we have 2 weights with the same value $\theta_{i}(t) = \theta_{j}(t) \quad i \neq j$ at a certain point in training time, they can still see different gradients since

the upstream processing $g(x(t))$ can be different
the gradient backpropagating from the downstream processing $h'(\cdot, y(t))$ can be different

Thanks for the breakdown. I think that two filters in the same layer will have the same downstream and upstream values and gradients. Therefore if we have two filters with all same values they will evolve in the same way.


text:
What's the difference between content-based attention and dot-product attention?
I'm following this blog post which enumerates the various types of attention.
It mentions content-based attention where the alignment scoring function for the $j$th encoder hidden state with respect to the $i$th context vector is the cosine distance:
$$
e_{ij} = \frac{\mathbf{h}^{enc}_{j}\cdot\mathbf{h}^{dec}_{i}}{||\mathbf{h}^{enc}_{j}||\cdot||\mathbf{h}^{dec}_{i}||}
$$
It also mentions dot-product attention:
$$
e_{ij} = \mathbf{h}^{enc}_{j}\cdot\mathbf{h}^{dec}_{i}
$$
To me, it seems like these are only different by a factor. If we fix $i$ such that we are focusing on only one time step in the decoder, then that factor is only dependent on $j$. Specifically, it's $1/\mathbf{h}^{enc}_{j}$.
So we could state: "the only adjustment content-based attention makes to dot-product attention, is that it scales each alignment score inversely with the norm of the corresponding encoder hidden state before softmax is applied."
What's the motivation behind making such a minor adjustment? What are the consequences?

Follow up question:
What's more, is that in Attention is All you Need they introduce the scaled dot product where they divide by a constant factor (square root of size of encoder hidden vector) to avoid vanishing gradients in the softmax. Any reason they don't just use cosine distance?

The Attention is All you Need has this footnote at the passage motivating the introduction of the $1/\sqrt{d_k}$ factor:

To illustrate why the dot products get large, assume that the components of $q$ and $k$ are independent random variables with mean 0 and variance 1. Then their dot product, $q \cdot k = \sum^{d_k}_{i=1}q_ik_i$ has mean 0 and variance $d_k$.

I suspect that it hints on the cosine-vs-dot difference intuition. The cosine similarity ignores magnitudes of the input vectors - you can scale $h^{enc}$ and $h^{dec}$ by arbitrary factors and still get the same value of the cosine distance.
The footnote talks about vectors with normally distributed components, clearly implying that their magnitudes are important. This suggests that the dot product attention is preferable, since it takes into account magnitudes of input vectors.  And the magnitude might contain some useful information about the "absolute relevance" of the $Q$ and $K$ embeddings.
Edit after more digging: Note that transformer architecture has the Add & Norm blocks after each
attention and FF block. At first I thought that it settles your question: since
every input vector is normalized then cosine distance should be equal to the
dot product. That's incorrect though - the "Norm" here means Layer
Normalization - analogously to batch normalization it has trainable mean and
scale parameters, so my point above about the vector norms still holds.
Finally, since apparently we don't really know why the BatchNorm works
same thing holds for the LayerNorm. Interestingly, it seems like (1) BatchNorm
(2) LayerNorm and (3) your question about normalization in the attention
mechanism - all of it look like different ways at looking at the same, yet
undiscovered and clearly stated thing.

I think it's a helpful point. I'll leave this open till the bounty ends in case any one else has input. Thanks.

@AlexanderSoare Thank you (also for great question). I've spent some more time digging deeper into it - check my edit.

Thanks for sharing more of your thoughts. I never thought to related it to the LayerNorm as there's a softmax and dot product with $V$ in between so things rapidly get more complicated when trying to look at it from a bottom up perspective. I think my main takeaways from your answer are a) cosine distance doesn't take scale into account, b) they divide by $sqrt(d_k)$ but it could have been something else and might have worked and we don't really know why

By the way, re layer norm vs batch norm I also have this question if you're interested in following it

https://github.com/neqkir/attention-mechanism


text:
How does general image background removal AI work?
I'm well aware of the inner workings of CNN models for object detection, and although I've not worked on a semantic segmentation problem I can imagine how it works.
With these types of models, we need to say "segment out the humans", or "segment out the X". But what about when I say something like "segment out the subject of this photo, whatever it happens to be". For example, see this service: https://removal.ai/
Without too much imagination I might guess that they apply a multiclass segmentation model and just show any foreground pixels, no matter what class they belong to. So we'd hope that the subject is in one of the classes that the model was trained for, and that there are no other class instances in the image that shouldn't be captured. But is there a more general way?

In image segmentation the target is actually an image, with the same dimensions as the input, where each pixel has a label depending on which class it represents. It is not uncommon for such a dataset to have a "background" class that essentially consists of the pixels not belonging to any other class. If not you can always group together classes typically associated with background (e.g. "sky", "cloud", "grass", "mountain", etc.) to form the class "background". Likewise you could group all other possible classes of interest (e.g. "person", "car", "horse", etc.) into the class "foreground". With this dataset you could train an image segmentation model that predicts if a pixel belongs to the background or the foreground, without actually classifying it into a "person" or a "car".
So suppose you want to make your own removal.ai, you could:

find one or more diverse image segmentation datasets (it needs to be diverse so that it will work on any generic photo uploaded to the site)
check all the unique classes in the labels
group all classes associated with backgrounds into class 0 (i.e. "background" class)
group all classes associated with foregrounds into class 1 (i.e. "foreground" class)
train an image segmentation model with these two classes
profit

Background removal is technically known as image matting. It is similar to segmentation, but it is a regression problem. The objective is to predict the alpha matte, which separates the foreground and background. Simply adding the predicted alpha matte as the fourth channel to the RGB image removes the background.
The model architecture is mostly an encoder-decoder model. The encoder extracts features and compresses them in the latent space, while the decoder constructs the alpha channel.
Since it is a challenging problem, most solutions require additional input along with the RGB image. The most common one is a trimap. The Deep Image Matting paper (Xu, N., Price, B., Cohen, S., & Huang, T., 2017) is one of the major studies and it proposes such a solution. However, trimap is a significant limitation since it requires human annotation.
To eliminate the trimap requirement, a model can be trained with only an RGB image, but the quality significantly decreases. Another solution is training two neural networks. The first one predicts a coarse alpha matte, and the second one returns a sharper alpha matte, as done in Google's Pixel 6 phones.
Another trimap-free solution is designing a model with one encoder and two decoders. The decoders predict a semantic mask and a detailed map simultaneously. GFM (Li, J., Zhang, J., Maybank, S. J., & Tao, D. (2020).) and MODNet (Ke, Z., Sun, J., Li, K., Yan, Q., & Lau, R. W. (2020).) are two related studies.
For more in-depth information on both traditional and deep learning solutions, you can refer to my blog post: https://withoutbg.com/resources/how-automatic-image-background-removal-works
Disclosure: I built withoutbg.com, a background removal tool, powered by deep learning.


text:
What are ways to learn a classifier for labelling a series of images rather than individual images?
... and how do I reword my question in the title?
I have a dataset where each "instance" has a "series" of multiple photos taken from different angles. I need to classify each instance as a 0 or a 1.
A little over half of the images in each series probably do not contain the information required for a classification. Only some of the images are taken from an angle where the relevant clue is visible.
For training I have many such series and they are labelled at a series level, but not at an image level.
My current approach is to use a standard architecture like ResNet. I pass each image through the CNN then I combine the features by averaging, then put that through a sigmoid activated layer. I'm concerned that the network won't be able to learn because the "clue" is so buried among everything else.
Questions:

Is there a better/standard way to do this? Would going RNN help? What if the images are not really in a  meaningful sequence?

If my way is good, is arithmetic averaging the right way to combine the features?

Would it be worth spending the time to label each image as "has positive clue"/"does not have positive clue"? Should I add a "not possible to tell"? What if it is possible to tell but it's just humans that can't tell?


text:
What are some machine learning frameworks for supervised clustering?
I have a task where I need to take "data points" which consist of collections of items. Each item needs to be categorised according to predefined categories. That's the easy part - my solution is to train a deep neural network with cross entropy loss. By the way, the reason I don't classify each item separately is because they acquire their meaning when they come together as a set.
The hard part is that each of these items also have a cluster label. Each cluster can only have items of one category in it, and there can be any number of clusters. Unsupervised clustering methods (applied after the neural network does the categorisation) work fairly well, but not well-enough for my needs. I'd like to:
A. Make use of the fact that I have the ground truth labelling for these clusters
B. Leverage my deep neural network because a lot of the "reasoning" required to solve the classification task will be conducive to the clustering task.
Answers which address at least one of those are useful to me.
EDIT
I realised I might be confusing people with this concept of cluster "labels". To clarify, this is no different than the standard way a classical unsupervised clustering algorithm might return its results. If I have N data points and feed them to a clustering algo, the algo might return N labels, one for each data point, and each of which are integers in [0, C-1] where C is the number of clusters. In my example we have the labels for a training dataset and want to make use of them during training. We cannot use softmax + cross-entropy loss because the cluster labels are permutation invariant.

Is there a reason you can't create two separate output layers, one that tells you the category and the other that tells you the cluster?  Both outputs would use crossentropy loss.  In effect, this would be a supervised clustering, if you will.

@DavidHoelzer  I had a similar question on stats. I think I somehow confused people with my wording. The cluster "labels" are permutation invariant, so cross-entropy loss won't work.

Just to spell it out for anyone who comes across this, the reason permutation invariance is a problem is because we shouldn't punish the network for outputting labels [1, 1, 0, 0] when the ground truth is [0, 0, 1, 1]. These label sets are equivalent in terms of clustering.

@user253751 it certainly will impact training. It will raise similar issues to training a dog vs canis_lupis binary classification task on a dataset of dog images. There are no distinguising traits, so the network will never learn your labels. It will just learn to predict the distribution of dog:canis_lupis randomly (unless there's a leak, and there's some way of distinguishing).
In the clustering task, say I always label the biggest cluster (whatever it is) with 0s, then the network would probably just learn to mostly predict 0s... (and maybe it will learn some vague notion of clusters)

It's not exactly the same... but hopefully you get the point. There's just no concrete way to say which cluster should be 0 and which should be 1 and... so on for each input. So it will just "confuse" the model.

If they are permutation invariant, why not adjust that so that they aren't?  Otherwise, the clusters are effectively random from the point of view of a function to map from features to predictions, which seems to be what @alexander-soare is saying.

@DavidHoelzer because I don't have a rules based way of doing it. It would be like randomly assigning canis_lupis and dog labels to pictures of dogs. I could come up with a scheme, but then I'm inventing a scheme and trying to make the model learn it which is unwanted overhead, and may not even work.
I must say... I've gotten a lot of push back on this here and in the stats one. Wondering if I've gone mad... :P

There IS a way of doing this though, and it's not overly-exotic or new. That is, self-supervised learning. The loss function is a distance metric between descriptors, and we want descriptors of items in the same cluster to be close, and ... yeah the opposite thing too. My only beef with that is that I will then have to do classical clustering in feature space anyway. Would like to know if there's a way to output labels rather than descriptors.


text:
Can neural style transfer work on the image style in this question or is there a better technique?
I've been working with this neural style paper https://arxiv.org/pdf/1508.06576v2.pdf
to try and transfer the style from this image to photos of pets. In case you're not familiar with the technique, I'll leave a brief explanation of it at the end.

After taking the time to understand some of the concepts in the paper I've come to my own conclusion that the method won't work. Here's why I think this:

The style is not localised/fine-grained enough. If I take a small piece of this image, I might just get a solid color, or two colors separated by a zig-zag boundary. So the first few convolutional layers won't find any characteristics of interest.
The style depends on long-distance correlations (I made that term up). If you follow some of theses zig-zag interfaces with your eyes you'll see that they traverse up to 1/3 of the characteristic size of the image. So bunches of pixels that take up a lot of space are correlated via the style. And from my intuition of CNNs, you can distill lots of pixels into coarser information (like "this is a dog") but you can't really go backwards. I don't think the CNN encodes the required logic to trace out a zig-zag over a long distance.
The color palette is restricted. I'm not sure why, but my intuition tells me the Neural Style Transfer technique won't be able to produce a restricted color pallet like in the style example. I'm guessing again, that the CNN doesn't encode any logic around the number of colors used.

So my question is around whether or not the technique could work, and if not, what's a better technique for this problem.
(optional read) Summary of deep style transfer

Take a pre-trained model like VGG19.
Feed in a photo. For each conv layer you can reconstruct a content representation of what that layer encodes about the photo. You do this by treating the feature maps of that layer as a desired output, and doing gradient descent on a white noise image as the input, where the loss function is the RMS between the original photo and the generated image.
Feed in a painting. For each conv layer you can reconstruct a style representation of what that layer encodes about the painting in a similar way as step 2. This time though, your loss function is the RMS between the gram matrix of all the features maps produced using a white noise input, and the gram matrix of all the feature maps produced using the painting as input. And here, you sum loss over all features maps of prior layers as well, not just the layer you are considering now.
Jointly minimise the loss functions described in 2 and 3 (so you're minimising content loss and style loss together) in order to produce an image with the content of the photo and the style of the painting.

EDIT
I have tried this. Here is an example of my results (left is input, right is output). So it's kind of cool to see some color map reduction happening, and what kind of looks like accentuation of texture, but definitely not getting these illustrated zig zag boundaries that the human mind so readily perceives as fur.

@NeilSlater I have been trying it. I'll add an edit


text:
In GradCAM, why is activation strength considered an indicator of relevant regions?
In the GradCAM paper section 3 they implicitly propose that two things are needed to understand which areas of an input image contribute most to the output class (in a multi-label classification problem). That is:

$A^k$ the final feature maps
$\alpha_k^c$ the average pooled partial derivatives of the output class scores $y^c$ with respect to the the final feature maps $A_k$.

The second point is clear to me. The stronger the derivative, the more important the $k$th channel of the final feature maps is.
The first point is not, because the implicit assumption is that non-zero activations have more significance than activations close to zero. I know it's tempting to take that as a given, but for me it's not so obvious. After all, neurons have biases, and a bias can arbitrarily shift the reference point, and hence what 0 means. We can easily transform two neurons [0, 1] to [1, 0] with a linear transformation.
So why should it matter which regions of the final feature maps are strongly activated?

EDIT
To address a comment further down, this table explains why I'm thinking about magnitude rather than sign of the activations.

It comes from thinking about the possible variations of
$$
L_{Grad-CAM}^c = ReLU\bigl( \sum_k \alpha_k^c A^k \bigr)
$$

I think you are misreading the relevant passage here.
Since you do not specify exact excerpt(s), I take that by "implicit assumption" you refer to the equation (2) (application of a ReLU) and the corresponding text explanation (bold emphasis mine):

We apply a ReLU to the linear combination of maps because we are only
interested in the features that have a positive influence on the class
of interest, i.e. pixels whose intensity should be increased in order
to increase $y^c$. Negative pixels are likely to belong to other
categories in the image. As expected, without this ReLU, localization maps sometimes highlight more than just the desired class and perform worse at localization.

The first thing to notice here is that this choice is not at all about activations close to zero, as you seem to believe,  but about negative ones; and since negative activations are indeed likely to belong to other categories/classes than the one being "explained" at a given trial, it is very natural to exclude them using a ReLU.
Grad-CAM maps are essentially localization ones; this is apparent already from the paper abstract (emphasis mine):

Our approach – Gradient-weighted Class Activation Mapping (Grad-CAM), uses the gradients of any target concept (say ‘dog’  in  a classification  network  or  a  sequence  of  words in captioning network) flowing into the final convolutional layer to produce a coarse localization map highlighting the important regions in the image for predicting the concept.

and they are even occasionally referred to as "Grad-CAM localizations" (e.g. in the caption of Fig. 14); taking a standard example figure from the paper, e.g. this part of Fig. 1:

it is hard to see how including the negative values of the map (i.e. removing the thresholding imposed by the ReLU) would not lead to maps that include irrelevant parts of the image, hence resulting in a worse localization.

A general remark: while your claim that

After all, neurons have biases, and a bias can arbitrarily shift the reference point, and hence what 0 means

is correct as long as we treat the network as an arbitrary mathematical model, we can no longer treat a trained network as such. For a trained network (which Grad-CAM is all about), the exact values of both biases & weights matter, and we cannot transform them arbitrarily.

UPDATE (after comments):

Are you pointing out that it's called "localization" and therefore must be so?

It is called "localization" because it is localization, literally ("look, here is the "dog" in the picture, not there").

I could make a similar challenge "why does positive mean X and why does negative mean Y, and why will this always be true in any trained network?"

It is not at all like that; positive means X and negative means not-X in the presence of class X (i.e. a specific X is present), in the specific network, and all this in a localization context; notice that Grad-CAM for "dog" is different from the one for "cat" in the picture above.

Why is it that a trained network tends to make 0 mean "insignficant" in the deeper layers? [...] why is it that a network should invariably make the positive activations be the ones that support the prediction rather than the negative ones? Couldn't a network just learn it the other way around but use a negative sign on the weights of the final dense layer (so negative flips to positive and thus supports the highest scoring class)?

Again, beware of such symmetry/invariability arguments when such symmetries/invariabilities are broken; and they are indeed broken here for a very simple reason (albeit hidden in the context), i.e. the specific one-hot encoding of the labels: we have encoded "cat" and "dog" as (say) [0, 1] and [1, 0] respectively, so, since we are interested in these 1s (which indicate class presence), it makes sense to look for the positive activations of the (late) convolutional layers. This breaks the positive/negative symmetry. Should we had chosen to encode them as [0, -1] and [-1, 0] respectively ("minus-one-hot encoding"), then yes, your argument would hold, and we would be interested in the negative activations. But since we take the one-hot encoding as given, the problem is no longer symmetric/invariant around zero - by using the specific label encoding, we have actually chosen a side (and thus broken the symmetry)...

Good, thank you. A few challenges to help me understand: 1) "this choice is not at all about activations close to zero, as you seem to believe". Fine (my mistake), but I could make a similar challenge "why does positive mean X and why does negative mean Y, and why will this always be true in any trained network?" 2) Am I missing something about your "localization" argument? It seems like semantics to me. Are you pointing out that it's called "localization" and therefore must be so? 3) On your general remark. That's the crux of my question I think ...

... ie. Why is it that a trained network tends to make 0 mean "insignficant" in the deeper layers? And to go back on challenge (1), why is it that a network should invariably make the positive activations be the ones that support the prediction rather than the negative ones? Couldn't a network just learn it the other way around but use a negative sign on the weights of the final dense layer (so negative flips to positive and thus supports the highest scoring class)?
Let me know if my challenges make sense, or if I failed to understand your points.

Got you. Although now I remember why I was focusing so much on 0, and I never thought about negative and positive. I drew a truth table for this and you can try it too (I'll post it in OP). If $\alpha_c^k < 0$ AND $A^{k}_{i,j} < 0$ then you get a +ve in the product. Grad-CAM doesn't care what the activations alone are. It cares about the product of the activations and gradients. Now I disagree with the paper's statement too "Negative pixels are likely to belong to other categories in the image." Maybe by "pixel" they mean after taking the product.

@AlexanderSoare I think they mean exactly that (they use the argument to justify the ReLU).

Cool, then... I guess I'm happy now. Kind of reminds me Paulo Coelho's The Alchemist.


text:
Why are the landmark retrieval and facial recognition literature so divergent?
Context and detail
I've been working on a particular image retrieval problem and I've found two popular threads in the literature:
Image retrieval (usually benchmarked with landmark retrieval datasets)

[x] Neural codes for Image Retrieval
[x] Particular object retrieval with integral max-pooling of CNN activations
[ ] Deep Image Retrieval: Learning global representations for image search
[ ] End-to-end Learning of Deep Visual Representations for Image Retrieval
[ ] Large-Scale Image Retrieval with Attentive Deep Local Features
[ ] Fine-tuning CNN Image Retrieval with No Human Annotation

Face recognition/verification:

[x] Facenet
[x] Deep Face Recognition
[x] SphereFace
[ ] Arcface

I'm still making my way through these lists and more (I've checked the ones I've looked at already) but I'm starting to get a sense that there's not much overlap in the techniques used, or the collective trains of thought in the research community. Here are the main points of divergence where I think both communities should be borrowing from each other.

Facial recognition seems to focus on getting embeddings to be as discriminative as possible by playing around with loss functions and training methods, whereas image retrieval seems to care more about ways of extracting feature descriptors from CNN pretrained backbones (types of pooling operations, which feature maps to look at, etc..).
Image retrieval has a considerable amount of work on what needs to happen after an embedding is obtained. Eg: dimensionality reduction, whitening + l2 norm, databise-side augmentation, query expansion, reranking etc
Facial recognition cares about keeping a minimum margin between non-matching faces in order to avoid mismatches, but I would think that should be imposed in image retrieval tasks as well (this is kind of a sub-point to my first point)

So to sum up: Why is it that facial recognition focuses on generating discriminative embeddings, while landmark retrieval focusses on generating rich "descriptors"? Why does landmark retrieval use this cool bag of tricks for database search while facial recognition just mentions kNN? Shouldn't all these considerations boost performance in either domain?

I have used opencv facial recogition and convolution neural network facial recognition.   Are you interested in either?

Interested in deep learning approaches

Keras cnn ?   what is your input shape of the image

Landmark retrieval has photographs of landmarks that you need to find out. Consider the degrees of freedom for this, the landmarks can many different colours (more than humans' faces) and also the colour range is all over the place (a landmark may be blue or white or red). The shapes of the various landmarks will also vary.
Now, consider face recognition problem. All humans faces look alike morphologically. If you look at the colour, it is not as varied as landmark recognition.
Because of the inherent data in both the problems, the research focuses on the diverging lines of thought. Rich descriptors are good for landmarks because the data itself is very rich and mired with variation. On the other hand, discriminative features are more desirable for face recognition because faces are more similar and less rich in variation, so differentiating between is hard.
It is the requirement of the problem that steers research in diverging directions.

Thanks, that makes sense. May I ask, are you part of either of these research communities? Your answer is good, but I just want to know if I've heard it from the horse's mouth

Yes, I do create and research facial recognition systems on a billion-scale.

Great, thank you. I'll leave this open for a bit and see if anyone else has something to say, then I'll close it once the bounty is rewarded.


text:
What do the terms "front-end" and "back-end" refer to in this article?
I found the terms front-end and back-end in the article (or blog post) How to Develop a CNN for MNIST Handwritten Digit Classification. What do they mean here? Are these terms standard in this context?

In this article, I don't think the author is referring to the library, though. He's just referring to the parts of the CNN architecture. Usually, convolutional and pooling layers, in a CNN, come before (so they are in the front-end) fully connected layers (back-end). This is not standard terminology, in this case.

I don't think it's standard terminology. It does look similar to the difference between encoder and decoder.

After almost a year this just got upvoted. Whereas actually, I'd prefer to delete it if there weren't already answers. Anyone stumbling across this one should know that the question doesn't really make much sense. These terms are just not used. I asked this because I was totally new to neural networks at the time and saw these terms in an article I considered to be reputable (and it's a good blog site - no qualms there). But these terms never came up again, and I've been working with neural networks ever since.

I do not think these are formally defined.
The distinction is just to facilitate discussion of the NN architecture: e.g., you may have a few convolutional layers with pooling as a front-end, and a different architecture as a back-end (in a text-book architecture, just a fully-connected layer. But to get wild, maybe LSTM? To really get wild, BERT?).
In the end (no pun intended), computers do not care if a layer is seen by humans as a front-end or a back-end.

I think that front end refers to a high level API for a CNN framework (c++ front end, Python front end).
The back end can be understood as a more peculiar (low level) interface to specific libraries.
You can use different back ends but still manipulate training data and model building process the same way using the front end (use Keras with TensorFlow, caffe with Pytorch, or the other way round use Theano, tensorflow, .. . with Keras!).
You can find some more material at the following links :

https://keras.io/backend/
https://project.inria.fr/deeplearning/files/2016/05/DLFrameworks.pdf

I don't think it refers to neural network layers structure. The term shallow or deep layers are usually prefered.