Hydrofoil optimization plays a crucial role in improving the hydrodynamic performance of tidal turbines. However, the high-dimensional representations in hydrofoil design space require significant Computational Fluid Dynamics (CFD) simulations, increasing computational load and time expenditure. This paper proposes a hydrofoil optimization framework based on deep learning to achieve an effective mapping between design parameters, pressure fields, and hydrodynamic characteristics. The designed hydrofoil represented using the Signed Distance Function (SDF) is input to Convolutional Neural Networks (CNN) for fast prediction of hydrodynamic coefficients and pressure field. Due to the effective integration of the prediction model and genetic optimization algorithm, this framework can generate a large number of smooth hydrofoils and rapidly predict their hydrodynamic performance to achieve efficient optimization of hydrofoils. The optimized hydrofoil shapes obtained based on the above framework exhibit a higher lift-to-drag ratio than common hydrofoils. Furthermore, the optimized hydrofoils are applied to design tidal energy turbine blades. The simulation results demonstrate that the hydrodynamic performance of tidal turbines can be effectively improved through hydrofoil design optimization. The proposed framework enhances the design efficiency of the tidal turbine rotor and provides turbine hydrofoils with higher power coefficients.