Objective: To early detect nuclear cataract in vivo and automatically classify its severity degree, based on the ultrasound technique, using machine learning. Methods: A 20-MHz ophthalmic ultrasound probe with a focal length of 8.9 mm and an active diameter of 3 mm was used. Twenty-seven features in time and frequency domain were extracted for cataract detection and classification with support vector machine (SVM), Bayes, multilayer perceptron, and random forest classifiers. Fifty rats were used: 14 as control and 36 as study group. An animal model for nuclear cataract was developed. Twelve rats with incipient, 13 with moderate, and 11 with severe cataract were obtained. The hardness of the nucleus and the cortex regions was objectively measured in 12 rats using the NanoTest. Results: Velocity, attenuation, and frequency downshift significantly increased with cataract formation ($P<0.001$ ). The SVM classifier showed the higher performance for the automatic classification of cataract severity, with a precision, sensitivity, and specificity of 99.7% (relative absolute error of 0.4%). A statistically significant difference was found for the hardness of the different cataract degrees ( $P = 0.016$). The nucleus showed a higher hardness increase with cataract formation ($P = 0.049$ ). A moderate-to-good correlation between the features and the nucleus hardness was found in 23 out of the 27 features. Conclusion: The developed methodology made possible detecting the nuclear cataract in-vivo in early stages, classifying automatically its severity degree and estimating its hardness. Significance: Based on this work, a medical prototype will be developed for early cataract detection, classification, and hardness estimation.