One possibility is differences in normalisation of data - Alexnet has zero-center normalisation in the first layer in MATLAB but it may work slightly differently when used with Java. According to documentation:
- 'zerocenter' — Subtract the average image specified by the AverageImage property. The trainNetwork function automatically computes the average image at training time.
I expect it should work if you preprocess images this way. Let me know if that solves your issue.