Robust estimation of attenuation coefficients remains a challenging problem, especially for heterogeneous anisotropic media. Here, we apply waveform inversion (WI) to perform attenuation analysis in heterogeneous VTI (transversely isotropic with a vertical symmetry axis) media. A time-domain finite-difference algorithm based on the standard linear solid model simulates nearly constant quality-factor values in a specified frequency band. We employ the adjoint-state method to derive the gradients of the objective function based on the Born approximation. Four parameters describing the attenuation coefficients of P- and SV-waves are updated simultaneously with a quasi-Newton optimization algorithm. To remove the time shifts between the modeled and observed data caused by velocity errors, we apply a local similarity technique. The inversion still requires a sufficiently accurate velocity model to minimize the trade-off between the contributions of velocity and attenuation to amplitudes. The inversion algorithm is tested on homogeneous background models with a Gaussian anomaly in one of the attenuation parameters and on a realistic heterogeneous VTI medium.