Internal leakage is the most common failure of hydraulic cylinder; when it increases, it decreases volumetric efficiency, pressure and speed of the hydraulic cylinder, and can seriously affect the normal operation of the hydraulic cylinder, so it is important to measure it, especially to measure it online. Firstly, the principle of internal leakage online measurement is proposed, including the online measurement system, the fixed mode of the strain gauge and the mathematical model of the flow-strain signal conversion. Secondly, an experimental system is established to collect internal leakages and strain values, and the data is processed. Finally, the convolutional neural network (CNN), BP neural network (BPNN), Radial Basis Function Network (RBF), and Support Vector Regression (SVR) are used to predict the hydraulic cylinder leakage; the comparison of experimental results show that the CNN has high accuracy and high efficiency. This study provides a new idea for online measurement of small flow on other hydraulic components.