A computer system, the computer system comprising: a facial expression model configured to receive an input image that depicts a face and, in response, provide a facial expression embedding that encodes information descriptive of a facial expression made by the face depicted in the input image; one or more processors; and one or more non-transitory computer-readable media that store instructions that, when executed by the one or more processors, cause the computer system to: obtain the input image that depicts the face; input the input image into the facial expression model; and receive the facial expression embedding that encodes information descriptive of the facial expression made by the face from the facial expression model, wherein the facial expression model has been trained on a training dataset that comprises a plurality of images organized into triplets of images, wherein each triplet of images comprises a label that indicates which two of three images included in such triplet of images have been assessed to be a most similar pair of images within such triplet of images, wherein: the facial expression model has been trained with an objective function that encodes both a first constraint and a second constraint for each triplet of images; the first constraint comprises a first requirement that a first distance between a first embedding provided for a first image of the most similar pair of images of the triplet by the facial expression model and a second embedding provided for a second image of the most similar pair of images of the triplet by the facial expression model is less than a second distance between the first embedding and a third embedding provided for a third image of the triplet by the facial expression model; and the second constraint comprises a second requirement that the first distance between the first embedding and the second embedding is less than a third distance between the second embedding provided for the second image by the facial expression model and the third embedding provided for the third image by the facial expression model. a facial expression model configured to receive an input image that depicts a face and, in response, provide a facial expression embedding that encodes information descriptive of a facial expression made by the face depicted in the input image; one or more processors; and one or more non-transitory computer-readable media that store instructions that, when executed by the one or more processors, cause the computer system to: obtain the input image that depicts the face; input the input image into the facial expression model; and receive the facial expression embedding that encodes information descriptive of the facial expression made by the face from the facial expression model, wherein the facial expression model has been trained on a training dataset that comprises a plurality of images organized into triplets of images, wherein each triplet of images comprises a label that indicates which two of three images included in such triplet of images have been assessed to be a most similar pair of images within such triplet of images, wherein: obtain the input image that depicts the face; input the input image into the facial expression model; and receive the facial expression embedding that encodes information descriptive of the facial expression made by the face from the facial expression model, wherein the facial expression model has been trained on a training dataset that comprises a plurality of images organized into triplets of images, wherein each triplet of images comprises a label that indicates which two of three images included in such triplet of images have been assessed to be a most similar pair of images within such triplet of images, wherein: the facial expression model has been trained with an objective function that encodes both a first constraint and a second constraint for each triplet of images; the first constraint comprises a first requirement that a first distance between a first embedding provided for a first image of the most similar pair of images of the triplet by the facial expression model and a second embedding provided for a second image of the most similar pair of images of the triplet by the facial expression model is less than a second distance between the first embedding and a third embedding provided for a third image of the triplet by the facial expression model; and the second constraint comprises a second requirement that the first distance between the first embedding and the second embedding is less than a third distance between the second embedding provided for the second image by the facial expression model and the third embedding provided for the third image by the facial expression model.