This paper presents an {it ab initio} derivation of the expression given by irreversible thermodynamics for the rate of entropy production for different classes of diffusive processes. The first class are Lorentz gases, where non-interacting particles move on a spatially periodic lattice, and collide elastically with fixed scatterers. The second class are periodic systems where $N$ particles interact with each other, and one of them is a tracer particle which diffuses among the cells of the lattice. We assume that, in either case, the dynamics of the system is deterministic and hyperbolic, with positive Lyapunov exponents. This work extends methods originally developed for a chaotic two-dimensional model of diffusion, the multi-baker map, to higher dimensional, continuous time dynamical systems appropriate for systems with one or more moving particles. Here we express the rate of entropy production in terms of hydrodynamic measures that are determined by the fractal properties of microscopic hydrodynamic modes that describe the slowest decay of the system to an equilibrium state.