Diesel engines, as power equipment, are widely used in the fields of the automobile industry, ship industry, and power equipment. Due to wear or faulty adjustment, the valve train clearance abnormal fault is a typical failure of diesel engines, which may result in the performance degradation, even valve fracture and cylinder hit fault. However, the failure mechanism features mainly in the time domain and angular domain, on which the current diagnosis methods are based, are easily affected by working conditions or are hard to extract accurate enough from, as the diesel engine keeps running in transient and non-stationary processes. This work aimed at diagnosing this fault mainly based on frequency band features, which would change when the valve clearance fault occurs. For the purpose of extracting a series of frequency band features adaptively, a decomposition technique based on improved variational mode decomposition was investigated in this work. As the connection between the features and the fault was fuzzy, the random forest algorithm was used to analyze the correspondence between features and faults. In addition, the feature dimension was reduced to improve the operation efficiency according to importance score. The experimental results under variable speed condition showed that the method based on variational mode decomposition and random forest was capable to detect the valve clearance fault effectively.