Not really an answer, but I would like to mention that there are not only these two acceptions. For example, have a look at the kernel page on wikipedia.
The term is quite appreciated in mathematics, and can mean so many things.
Some of them are closely related: For example, heat kernel and kernel-gram matrices of machine learning. But, some others seem not.
For example, is there any link between the kernel of a linear map in linear algebra, i.e. between $ker f = \{v \in V|f(v) = 0\}$ and gram matrices in machine learning?
It would be interesting if someone mathematically knowledgeable could classify all the acceptions of the wikipedia page (which acceptions are similar and which are not).