The heat flux pattern at Earth's core mantle boundary (CMB) imposes a heterogeneous boundary condition on core dynamics that may profoundly affect the geodynamo. Owing to the expected temperature dependence of seismic velocities, this pattern is classically approximated as proportional to the lowermost layer of seismic tomography models for the global mantle. Two biases however undermine such a simple linear relationship: 1) other contributions than thermal (compositional and mineralogical) influence seismic velocities and 2) the radial average inherent to tomographic models might distort the local thermal state at the CMB. We analyze here simulations of thermochemical mantle convection where, owing to their spatial characteristics, specific mantle components are readily identified: hot thermochemical piles (TCPs), ``normal'' mantle (NM) and, when post-peroskite (pPv) is included, a cold region where this phase is present. Synthetic seismic velocities (i.e. based on the mantle simulations) are then computed based on thermal, compositional and mineralogical sensitivities. A formalism to infer the CMB heat flux from these seismic shear velocity anomalies is derived. In this formalism, within each mantle population (i.e. TCPs, NM or pPv) the CMB heat flux vs. seismic anomalies follows a unique fitting function. The transition from one mantle population to another is marked by a jump in the seismic anomaly, i.e. a range of seismic anomalies in between two mantle populations corresponds to a similar CMB heat flux. Applying our formalism to the seismic anomalies from the mantle convection simulations provides far superior fits than the commonly used linear fits. The results highlight reduced negative heat flux anomalies beneath large low shear velocity provinces (LLSVPs), while positive heat flux anomalies are enhanced, both with respect to the classical linear interpretation.