High fidelity (HF) mathematical models describing the generation of active force in the cardiac muscle tissue typically feature a large number of state variables to capture the intrinsically complex underlying subcellular mechanisms. With the aim of drastically reducing the computational burden associated with the numerical solution of these models, we propose a machine learning method that builds a reduced order model (ROM); this is obtained as the best-approximation of the HF model within a class of candidate differential equations based on Artificial Neural Networks (ANNs). Within a semiphysical (gray-box) approach, an ANN learns the dynamics of the HF model from input-output pairs generated by the HF model itself (i.e. non-intrusively), being additionally informed with some a priori knowledge about the HF model. The ANN-based ROM, with just two internal variables, can accurately reproduce the results of the HF model, that instead features more than 2000 variables, under several physiological and pathological working regimes of the cell. We then propose a multiscale 3D cardiac electromechanical model, wherein active force generation is described by means of the previously trained ANN. We achieve a very favorable balance between accuracy of the result (order of 10(-3) for the main cardiac biomarkers) and computational efficiency (with a speedup of about one order of magnitude), still relying on a biophysically detailed description of the microscopic force generation phenomenon. (C) 2020 The Author(s). Published by Elsevier B.V.