This paper utilizes the optimized composite neural network (OCNN)-Hammerstein model to directly identify the dynamic inverse hysteresis effect, employing it as a feedforward controller to compensate for the rate-dependent and amplitude-dependent dynamic hysteresis of the piezoelectric actuator. The OCNN-Hammerstein model consists of an optimized composite neural network and an auto-regressive exogenous model in series. The OCNN comprises convolutional neural network layer and radial basis function neural network layer, with its hyperparameters optimized using a modified grey wolf optimizer algorithm. Compared to the existing dynamic Prandtl-Ishlinskii-Hammerstein and dynamic Bouc-Wen-Hammerstein models in the literature, the feedforward controller based on the proposed model in this paper demonstrates superior performance, with an RSME below 0.45 μm and a 74.5% reduction in relative hysteresis at the condition of 300 Hz and maximum amplitude. The feedforward controller exhibits universality across all amplitude ranges and within the 50–300 Hz frequency range, while also providing predictive compensation for dynamic hysteresis at 300–400 Hz. The feedforward controller based on the OCNN-Hammerstein model in this paper provides a crucial methodology for open-loop control of piezoelectric actuators.