Introduction

Mammals are known for possessing relatively large brain volumes compared to their body mass1, and humans, in particular, stand out among all other endothermic vertebrates in this regard. The close link between cognition and brain size made the latter the focus of intense and continuous scientific effort, seeking to describe trends in encephalization and to investigate the link between brain size and cognitive power2,3,4,5. It is clear, though, that absolute (or relative to the body) brain size is not enough to understand cognition in mammals, since brain shape, the relative proportions of different cortical areas and their mutual connections must have had prominent roles in the evolution of mammalian intelligence6,7,8. For instance, Primates are especially large-brained, but they possess more than just a scaled-up version of the average mammalian brain. Primate brains have smaller and more densely packed neurons9. During their evolution, Primates acquired a granular layer in the prefrontal cortex10,11, including a distinct region, the dorsolateral prefrontal cortex, exclusive to the group12,13 and greatly expanded parietal cortex14. Anthropoid primates further stand out for the unusually high neuron count15, and the increased number of cortical areas16. In terms of behavioral attributes, anthropoids (and apes in particular) are especially good at inferring causal relationships, planning future actions, and in the ability to attribute mental states to oneself and to other individuals, forming a ‘theory of mind’ of the intentions and beliefs of their conspecifics17,18,19.

To understand how the primate brain evolved, we tested which regions of the cortex underwent the most profound evolutionary change throughout the evolution of the group, whether these regions’ evolution differs from that of other mammals, and whether the human brain is exceptional in these regards, marking a discontinuity with fellow monkey and apes. Seeking answers to these research questions is usually hampered by limited and hard-to-acquire data, especially for fossil species, and since a wide phylogenetic scope, although crucial to consider11,20 is difficult to come by. To overcome these limitations and to study the evolution of the primate cortex at a fine scale21, we assembled the largest ever, to our knowledge, collection of three-dimensional mammalian brain endocasts completed with phylogenetic information, consisting of 465 individuals referring to 311 different species, of which 34 are extinct. The species on the tree span across mammals from marsupials to hominins and temporally from the Eocene to the present. We registered the position of 208 landmark and semilandmark points (here to fore ‘landmarks’ for simplicity) on the endocast of each specimen by applying geometric morphometrics (Supplementary Fig. 1, Supplementary Table 1). We developed a method we recently devised, rate.map22, which now allows charting the evolutionary rates of shape change directly on the original endocast 3D meshes or even to magnetic resonance image (fMRI) reproductions of the brain, and to associate the rates to individual landmarks5. Since the rates represent phylogenetic ridge regression slopes23 that have a magnitude and a sign, mapping rates allow for the straightforward interpretation of the direction (whether there is an enlargement or a contraction) and the amount of evolutionary shape change across specific areas of the endocast.

Results and discussion

Primates have peculiar brain shapes

We started by applying a relative warp analysis (RWA, the principal component analysis of the landmark coordinates) on the endocast shapes. The distribution of endocast shapes on the Relative Warp 1 (RW1) to RW2 plot (explaining together 65.85% of the total shape variance) indicates that Primates set apart from all mammals in terms of brain shape, along RW1. This axis, which accounts for 56.94% of the total shape variation, describes changes mainly associated to the dorsomedial frontal cortex (Fig. 1), as opposed to changes in the temporal areas and the frontal pole. By repeating RW analysis isolating the non-uniform component to focus directly on small-scale shape variation24,25, Primates were still found to stand apart from other mammals, by virtue of shape changes that still appear concentrated in the medial frontal, as opposed to occipital and frontopolar areas of the cortex (Supplementary Fig. 2).

Fig. 1: Relative warp analysis (RWA) plot showing the distribution of mammalian endocast diversity.
figure 1

The two meshes to the right (in latero-frontal view) show the relative importance of each landmark (their loadings) on the extreme values of first and on the second Relative Warp (RW) axes, respectively.

The highest rates of endocast shape evolution pertain to Homo sapiens and Homo neanderthalensis (Fig. 2a). Catarrhini (Old World monkeys) brains evolved at a faster pace compared to other mammals (p value = 0.010). Ferungulata and Marsupialia show an opposite pattern, with significantly low rates (p value = 0.001; Fig. 2b).

Fig. 2: The phylogenetic tree with the evolutionary rates.
figure 2

a Evolutionary rate values related to the node correspond to the positive and significant shift. b The phylogenetic tree of mammals. The light blue circle indicates the positive shift in Catarrhine. The light red circles indicate the negative shift pertaining to Ferungulata and Marsupialia. The circle size is proportional to the intensity of rate change. c The phylogenetic tree of the Primates (extracted from the tree in b) shows the location of principal primate clades and representative shapes of their respective endocasts. The color gradient represents the map of the evolutionary changes in shape of the endocast from the mammal tree root, in terms of cortical area expansion (blue) and contraction (red). Multivariate rates of brain evolution of individual species are indicated by the colored dots next to the tree tips in both b and c. Brain endocasts of the different species are not to scale. Silhouettes for Homo, Carlito, Lemur, Bradypus, Macropus, Canis, Panthera, and Capreolus are free for reuse under CC0 1.0 Universal Public Domain Dedication license (https://creativecommons.org/publicdomain/zero/1.0/). Silhouettes for Cebus (credits to Sarah Werning) and Ceratotherium (credits to Jan A. Venter, Herbert H. T. Prins, David A. Balfour and Rob Slotow) are free for reuse under the Attribution 3.0 Unported license (https://creativecommons.org/licenses/by/3.0/). Silhouette for Macaca is free for reuse under the Public Domain Mark 1.0 license (https://creativecommons.org/publicdomain/mark/1.0/).

To verify the notion that catarrhine brains evolved faster than in other mammals, we further fitted four different evolutionary models: single rate Brownian Motion model (BM), Ornstein-Uhlenbeck model (OU), and two different multiple rate BM (BMM), one by setting a different rate for anthropoids, and the other by setting a different rate for Catarrhini only. By applying the extended information criterion (EIC)26 we found the latter performs as the best model (EIC = −20865.44) followed by BMM with anthropoids designed to evolve under a different rate (EIC = −20857.24), and then by OU and BM (EIC = −20785.76 and −20789.3, respectively). Clearly, although designing only catarrhine or the entire anthropoid clade as evolving under a different rate regime makes little difference, these nested clades differ from the rate regime experienced by the rest of the mammal tree.

Anthropoids experienced fast cortical expansion across the brain dorsal midline

We charted evolutionary rates on the endocasts to elucidate patterns of cortical expansion and contraction. Primate brain evolution is characterized by enlarging frontal cortex, which is faintly pronounced in stem strepsirrhinae (Adapis) but becomes more evident in anthropoids (Fig. 2c). Towards the human branch of the primate tree, a second area, the posterior parietal cortex (PPC), becomes interested by fast cortical expansion (Fig. 2c). By using the non-uniform component of shape variation, rate shifts coincide in position, direction and magnitude to the analysis of entire shape. Still, the evolutionary enlargement of the posterior parietal area among anthropoids is similarly evident (Supplementary Fig. 3).

To investigate the patterns of evolutionary cortical expansion at a finer scale, we selected the landmarks in the top quartile distribution of the evolutionary rate values (i.e. the fastest evolving landmarks), that are indicative of cortical expansion in primates. Then, we selected among these landmarks those shared by at least 90% of the primate species. This ‘id90primate’ figure is thus set to recognize the areas of the endocast interested by the largest morphological expansion and shared by most species in the clade. We repeated the procedure for anthropoids (id90anthropoid), for Catarrhini (id90catarrhini), and for the genus Homo (id90Homo). The id90primate is formed by landmarks occurring in the prefrontal area (Fig. 3). This conforms to the strongly held notion that the enlargement of the prefrontal cortex characterized brain evolution in the group5,27,28. In id90anthropoid, the medial PPC adds to the prefrontal, a pattern replicated in catarrhine monkey (id90catarrhini), marking a discontinuity between anthropoids and prosimians. The same discontinuity is evident repeating the analysis using the non-uniform shape component (Supplementary Fig. 4). Finally, in id90Homo, areas of fast cortical expansion further comprise the lateral parietal cortex, including the planum temporale (Fig. 3).

Fig. 3: Areas interested in the greatest evolutionary expansion.
figure 3

The coloured areas represent the areas of the cortex interested in the greatest evolutionary cortical expansion and the position of the landmarks associated with these areas (from left to right): all primates (id90primate), anthropoids (id90anthropoid), catarrhine (id90catarrhini) and in the genus Homo (id90Homo). The top row indicates the location of the areas in the consensus shape triangle mesh. The bottom row represents the same figure located upon representative species for each group. Silhouettes for Lemur, Gorilla, and Homo are free for reuse under CC0 1.0 Universal Public Domain Dedication license (https://creativecommons.org/publicdomain/zero/1.0/). Silhouette for Alouatta is free for reuse under the Public Domain Mark 1.0 license (https://creativecommons.org/publicdomain/mark/1.0/).

These findings withstand independent verification. We tested whether the areas marked by cortical expansion collectively cover, in primates, a proportionally larger area of the endocast compared to other mammals. We found that id90primate covers 26.2% of the endocast, which is significantly larger than in other mammals (mean percentage for mammals other than Primates: 19.3%, p value of the difference: << 0.001). For id90anthropoid and id90catarrhini the corresponding figures are extremely similar to each other, and both significantly larger than in other mammals (id90anthropoid 36%, p << 0.001; id90catarrhini 35.7%, p << 0.001). Finally, for id90Homo, the inclusion of additional, lateral parietal areas into the fast-expanding zones (Fig. 3) resulted in an overall larger proportion (40.7%), which is significantly larger than in non-human mammals (p << 0.001). In addition to this proof, we extracted the landmark coordinates defining id90anthropoid for all primate species and reprojected the coordinates to a common ordination space, that allows replicating PCA on Primates only. In this new PCA space anthropoids are set apart from non-anthropoids along PC1 (Fig. 4). The difference in shape along this axis concentrates in the frontal and PPC, confirming that the patterns we found with rate.map are genuine (Fig. 4). The same applies when restricting the shape analysis to the non-uniform component (Supplementary Fig. 5).

Fig. 4: Principal Components (PC) 1 to 2 plot of the landmark configurations of individual species restricted to landmarks falling within areas of maximal cortical expansion in anthropoids (id90anthropoid).
figure 4

The color maps on the axes represent the difference in cortical areas along PC1 compared to the consensus shape.

To identify where the greatest evolutionary expansion occurs over the brain cortex of Homo sapiens, we devised a procedure to associate the top quartile landmarks interested by cortical expansion in our species to the digital MRI reproduction of a human individual’s brain. These landmarks coincide with the prefrontal and, especially, the dorsomedial prefrontal cortex (dmPFC), with the lateral prefrontal cortex (lPFC), including the inferior frontal gyrus (IFG), with the PPC (in coincidence to the superior parietal lobule), with the angular gyri within the inferior parietal lobules, and eventually with the medial temporal lobe (MTL, Fig. 5). By inspecting the non-uniform component of shape variation, dmPFC and PPC at least still appears the main loci for cortical expansion in Homo sapiens (Supplementary Fig. 6).

Fig. 5: Patterns of evolutionary shape change from expansion (proportional to shades of blue) calculated for Homo sapiens.
figure 5

The approximate location of the main regions involved in the default mode network (DMN) (located after refs. 42,43). The purple dots represent the location of landmarks associated with the highest rates of cortical expansion.

Selection for higher-order cognition?

Early mammals had relatively small neocortex3 containing a single layer of pyramidal neurons. The neocortex later extended to six layers in present-day mammals29. Several derived features of the primate PFC are known to confer them complex cognitive capacities, playing crucial roles in the representation of the self, working memory, decision-making, and social interactions12,30,31,32,33. Therefore, most investigations of brain evolution in Primates focused on the relative size of PFC and tend to indicate this large area of the brain greatly expanded towards the human branch of the tree5,28,30,34. Here, we found evidence supporting this same pattern (Figs. 2 and 3, Supplementary Figs. 3 and 4). Yet, we were also able to highlight the regions of the endocast, and the clades, interested by the highest rate of cortical expansion. This trend starts with dmPFC (Fig. 2c), a brain region involved in managing emotions and understanding others in both humans and other primates31,35,36,37,38. In anthropoids, expanding cortical regions extend to the superior parietal lobule in the PPC. Finally, in Homo sapiens, enlarging cortical areas further extend to the angular gyri and the MTL (Fig. 5). dmPFC and PPC are strongly connected to each other and participate in brain networks involved in social cognition19,32,39,40,41. These overlapping networks include the default mode network (DMN)42,43,44, the mirror neuron system (MNS)45, and the theory of mind network (ToM)19. In humans, DMN, MNS and ToM extend to IFG, MTL and the angular gyri19,39,42. ToM is only present in humans and to a lower level in greater apes, whereas MNS does not include IFG in non-human primates and includes the inferior- but not the superior parietal lobules45. In contrast, the DMN is present and well-developed in both humans and other primates and extends to further, non-social higher-order cognitive tasks such as mind-wandering, long-term memory consolidation and mental time travel32,42,44,46,47. Resting state networks functionally equivalent to the human DMN were identified in a variety of mammals besides primates, including rats, ferrets, and dogs48,49,50,51. Yet, our results suggest that cortical areas expansion in DMN-related regions of the brain played a special role in primate evolution, indicating the behavioral outputs produced by the network were a primary target of selection during the evolution of anthropoids in particular. This interpretation further agrees with earlier findings suggesting that the precuneus52, medial PFC47, PFC in general11,30 and PPC20,53,54 are all larger in anthropoids as compared to prosimians. However, there is momentous variation even within the group. The IFG is important to integrate facial and vocal information in catarrhines but is not nearly as specialized in platyrrhines55,56. Albeit humans and chimpanzees may have similar DMNs49, in non-hominoid Primates (macaques, marmosets, and mouse lemurs) the connection between dmPFC and PPC is less strongly developed57,58 suggesting that although a shared pattern for evolution towards DMN-related areas occurs in anthropoids, it develops further in Homo (Figs. 3 and 5).

We propose that the special features of anthropoid cognition, including their standout ability for mind-wandering, communication, logical inference, and mindread others, affected brain evolution in the group. The reasons for selection in favor of DMN-related brain activities are readily apparent, given the obvious fitness advantages provided by higher-order cognition, including creativity, complex sociality, and Machiavellian intelligence, which all link to DMN31,59,60. This interpretation derives from the projection of the landmarks associated with the highest rate of cortical expansion on the human brain and, thence, the cortical areas they intersect and their functions. As such, there are potential caveats to consider which may undermine its validity. First, we measured cortical expansion in terms of an increased proportion of the cortex surface occupied by a specific portion of the endocast. Cortical areas, though, develop in three dimensions, which means our metric is a proxy for cortical area expansion at best. Secondly, although we strove to place landmarks according to anatomical homology (Supplementary Fig. 1, Supplementary Table 1), and slid semilandmarks on the endocasts keeping the frontal, cerebellar and neocortex (exclusive of the frontal portion) regions separate in order to maintain topological consistency (Methods), we implicitly assumed that the positioning of major cortical territories is the same across mammals. There is good evidence that this is true at the very least for medial PFC across mammals3,11 and for both medial PFC and PPC across primates54,61 meaning the evolutionary trend for cortical expansion in these areas is genuine.

It is worth noticing that we avoided referring to specific areas of the cortex, such as Brodmann areas, and their functions in interpreting the results because neither topological nor functional homology is maintained across species at this small level of investigation62,63. Still, there are valid statistical reasons not to interpret landmark variation one landmark at a time64. This implies that we can infer function only at a coarse scale of investigation. Moreover, our insights only hold if the expanding areas held similar functions over the evolutionary time. Consistently with this assumption, dmPFC is involved in decision-making, self-representation and social behavior in all mammals and plays a crucial role in processing social information and the representation of the self in Primates31,41,65. The PPC is involved in decision making, working memory, and motor planning66 across mammals. For what concerns the DMN, it is feasible to assume that monkeys engage in cognition detached from goal-oriented behavior, mostly like humans do46. Their DMN recruits PFC and PPC as ours, although the overlap between brain areas active during resting states between humans and model monkey species is not perfect46,58. A study on captive macaques found that the medial frontal cortex progressively activates more and more as the test individual is exposed to an increasing number of conspecifics during resting state experiments67. This further points to the preeminent role of dmPFC in particular31,60,65 and medial PFC in general31,35, to primate social lives. Still, on the functional grounds, the paracingulate sulcus within the dmPFC provides the ability to mentalize (that is to endow the individual’s mind with metarepresentations of the world), which is a highest-order cognitive function, in Hominoidea (rather than just in humans as previously thought). To a rudimentary level, this skill can be traced to Old World monkey (Catarrhini)47. The role of the DMN in mentalization and social cognition seems especially linked to dmPFC and PPC19,60,65.

Most studies point to the precuneus and posteromedial cortex (rather than just PPC) as the main areas involved in DMN in primates40,42,46,58. We cannot study the brain inner structures by looking at the endocasts, let alone the understanding of how the connections between different cortical areas evolved. Yet, in keeping with our results, it was demonstrated that humans have greatly expanded PPC68 and the expansion of the precuneus52 within the posteriomedial cortex can only have expanded the posteriomedial cortex outer surface.

Despite the comforting evidence bolstering our insight that dmPFC and PPC expansion in anthropoids were under selection, it is worth considering that primates evolved different new cortical areas and novel connections between them, that may have produced new or improved functions and behavioral outputs regardless of the relative cortical surface extension. For instance, in anthropoid primates, the rostral portion of the PPC is expanded compared to strepsirrhine (galagoes)16. Our results are consistent with this finding, and with the notion that strong connections occurring between dorsolateral PFC and the parietal and temporal cortices are typical of Primates12. Yet, these connections are embodied in the dense corticotectal projections originating from the frontal, parietal and temporal areas12 and reach the dorsal pulvinar and superior collicus, something that our data cannot reveal. Interestingly, Kaas16 highlighted that expanding PPC in the human lineage may have been involved the use of tools and gestures for communication.

One additional caveat regards the MTL. This region is associated with DMN in humans42,43. Yet, the relationship between MTL and DMN is complex42, and MTL shows reduced centrality within DMN compared to both dmPFC and PPC43. In the chimpanzee’s and monkeys’ DMNs, the greatest overlap with human’s occurs across the dmPFC and PPC46,49, rather than MTL. Our results indicate that the recruitment of MTL within the DMN could be confined to Homo sapiens (Fig. 5).

The findings we report here point to the emphasis on DMN-related brain activity during anthropoid evolution. They further indicate that the human DMN does not need, and probably is not the same as in the anthropoid brain. Overall, the monkey and ape DMNs are especially developed along the cortical midline10,46, which is entirely consistent with our findings, but also suggests that there are features of the human DMN not shared with other species. In keeping with this, the PFC in Homo sapiens follows a different allometry than in other Primates, is more lateralized27, and the PPC has a richer array of connections compared to other primates, most notably mapping to tool use and speech centers (in the IFG)40. Still, the human brain has overall stronger patterns of covariation among the brain cortical areas than any other primate alive69 and the dmPFC-to-PPC connection is better developed in our species58. These non-trivial differences suggest that in Homo sapiens the DMN activity is maximized and most probably includes novel functions that are not present in other species. Yet, the evolutionary drive towards DMN-related behavioral outputs is shared among anthropoids, suggesting a difference in grade, rather than a sheer innovation, subtended the evolution of the human mind.

Methods

Reproducing the mammalian endocasts

We collected 93 mammalian endocasts either from websites or previous studies (Supplementary Data 1). Three-hundred and seventy-two additional specimens refer to three-dimensional skulls originally obtained via CT scanning. For these specimens, we applied the function endomaker from the package Arothron70 to retrieve the endocast shape. endomaker is a fast endocast extraction tool which is as precise as manual segmentation in terms of endocast reproduction and endocast volume calculation71,72. Most of the specimens were completed with gender information, so that we could get a fair representation of each sex per species. The specimens refer to 311 different species, 34 of them (unsexed) refer to fossil taxa. For the latter, since the fossilization process comes with natural deformation, we limited the sampling collection to symmetric and undeformed specimens only (Supplementary Data 1).

Landmarks and semilandmarks positioning

The landmarking procedure begun by sampling 18 landmark points on each specimen, focusing on both anatomical and geometrical similarities (Supplementary Table 1). The study sample includes specimens belonging to Marsupialia, Carnivora, Artiodactyla, Perissodactyla, Notoungulata, Xenarthra, and Primates. Although most of the landmarks were placed following geometric criteria (i.e., frontal pole, occipital pole, see Supplementary Table 1, Supplementary Fig. 1), we conducted an in-depth revision of the relevant literature pertaining to the brain anatomy of each group to identify homologies aiding the landmarks placement. The whole procedure was repeated three times testing whether the inter-operator error was significant. We found the average error around each landmark to be 2.77% (1.1–4.3%).

In eutherian mammals, one of the largest frontal areas is the motor cortex, which can be identified by robust criteria in most cases73. Hence, it is possible to partition the brain into three main regions, the frontal portion, the rest of the cortex and the cerebellum (which is morphologically quite distinctive and separated by the telencephalon by the sinus transversus). In Primates, the inferior convolution of the frontal lobe is delimited by the lateral sulcus (LS; i.e. the Sylvian scissure), while the posterior limit is demarcated by the central sulcus (CS). The CS separates the motor cortex (anteriorly to CS) from the somatosensory cortex (posteriorly). However, there are some notable exceptions. As noted in ref. 74 tarsiers and galagoes do not have a CS, and owl monkeys have only a shallow dimple in the cortex where the CS would occur. We, therefore, decided to mark the boundary of the frontal portion as medially appearing above the anterior margin of LS in these species and used the CS otherwise14,75,76,77,78,79,80,81.

The cruciate sulcus is a distinctive carnivoran feature82, known to coincide with the premotor and motor areas83,84 and, hence, to separate the frontal lobe from the rest of the cortex. There are exceptions among carnivores as well. Some viverrid species (i.e., Genetta) lack the cruciate sulcus but may have an incipient ansate sulcus medially to the coronal sulci to guide the placement of the landmark identifying the rearmost limit of the frontal lobe85,86. To recognize the correct positioning of the cruciate sulcus we referred to detailed reports illustrating carnivoran brain anatomy in both living and fossil carnivore species87,88,89,90,91,92.

Among Artiodactyla, one of the best-studied species for neurological research is Ovis aries. Its brain is claimed to be analogous to the human brain in many regards and can be similarly divided into four lobes (frontal, parietal, temporal, and occipital)93,94. The sheep brain is further very well-known because of extensive MRI analyses and detailed atlases95. As stated by John and co-authors94, the frontal lobe lies anterior to the ansate (cruciate) sulcus in Ovis. Similarly, the pig brain matches human brain’s gross anatomy96, and the limit of the motor cortex can be located between the cruciate and the ansate sulci. It is to be noticed that the nomenclature of the cruciate and ansate sulcus is not universally accepted and can differs among institutions97, and even for the same species, as pointed out by Graïc and co-author in describing the giraffe brain98. The pattern of cerebral sulci differs among Artiodactyla (figure 13.3 in ref. 99). Yet, the major sulci can always be recognized100,101,102,103,104.

Among Perissodactyla, the neuroanatomy of horses and donkeys is well-studied105,106, and the main delimitations between brain lobes were readily identified. The position of the motor cortex can be safely recognized by the presence of the cruciate sulcus107. For the identification of cerebral sulci on the rhinoceros brain, we followed ref. 108 which provides a description of its gross anatomy. As stated in ref. 109, living Xenarthra show many cortical architectural traits in common with the stem eutherian mammal, including the motor cortex. We followed the sulcal pattern in Xenarthra described in ref. 110.

Unlike placental mammals, marsupials do not have a well-distinguished motor cortex. Yet, the somatosensory cortex (S1) is recognizable73,111. Kaas112 proposed that a so-called sensory-motor amalgam represents the primitive form of the mammalian neocortex, which is segregated into separate sensory and motor areas in placentals. Karlen and Krubitzer113 illustrated that starting with early studies of the motor cortex in mammals the amalgam62,114 is topographically organized and located at the rostral pole of the neocortex115,116. They also illustrated two different hypotheses for the evolution of sensorimotor cortex in mammal, which show that, unlike what is known for monotremes, in marsupials S1 and the motor cortex have the same orientation, and there is a complete overlap in less derived groups. Karlen and Krubitzer113 eventually proposed that the somatosensory rostral field of marsupial brain may be homologous to area 3a of primates and flying foxes. With this knowledge at hand, and thanks to the Comparative Brain Anatomy atlas by Prof. Kenneth Ashwell and Dr. Yamila Gurovich (https://www.comparativebrainanatomy.org/), we were able to identify sulcal patterns on the marsupial endocasts.

Sliding procedure

The endocast morphology shows high variability among mammals. The sliding procedure for semilandmark placing can be affected by this variability. On the other hand, maintaining the homology between configurations is crucial. To provide the best fit for semilandmarks, we elaborated a new sliding protocol which works as follows. We performed a preliminary alignment of the landmarks configurations to identify the specimen closest to the consensus shape, and its 3D surface was chosen as reference, in this case Eulemur mongoz USNM35260. Then, we cut the 3D surface of the neocortex into three different patches by using Geomagic Studio software (version 2014.3.0; © 2014 Geomagic): 1. frontal portion, 2. non-frontal and 3. cerebellum. The frontal portion was separated from the rest of the neocortex along the coronal plane considering landmarks number 16–18 as boundary. The cerebellum was separated along the transverse sinuses.

Semilandmarks were automatically sampled on each patch separately through the k-means clustering methods (kmeans function, ‘stats’ R package) as follow:

  1. 1.

    the points of the patch surface are clustered and partitioned into k groups following the Voronoi tessellation (which minimizes the sum of squares distance from each 3D mesh triangle vertex to the cluster it belongs);

  2. 2.

    all cluster centers are at the mean of their Voronoi sets (the set of data points which are nearest to the cluster center), and the center of each group returned.

At the end of this process, we produced three different bilateral semilandmark patches (Supplementary Fig. 1): one for the frontal region (60 semilandmarks), one for the non-frontal neocortex (100 semilandmarks), and one for the cerebellum (30 semilandmarks).

Based on these templates, the semilandmarks were then transferred to all other Primates specimens by following the sliding procedure described in ref. 117:

  1. 1.

    create a template with semilandmarks placed outside the 3D surface (see above)

  2. 2.

    create an atlas which can work as a guideline in which points that are allowed to slid are specified (createAtlas function, Morpho R package)

  3. 3.

    transfer the semilandmarks to all other specimens (placePatch function, Morpho R package)

  4. 4.

    slide semilandmarks along surfaces (slider3d function, Morpho R package)

In dealing with Primates, the atlas was the original template generated on Eulemur mongoz surface. In any other case, the template was warped on the closest-to-mean specimen per group via thin-plate spline (tps3d, Morpho R package). With this step, it was possible to maintain the number and the identity of semilandmarks.

The iterations for the sliding function can be set with the argument iterations. We set the argument equal to 0, which means iteration until convergence, except for marsupials for which the empirically derived value of 10 was used.

Once that all the separate sliding sessions were performed, we put all sets together and we performed a final and global sliding to minimize the noise which could have been generated from the group-wise and cortical region-wise procedures, setting the iteration parameter to 10.

Then, we performed a global sliding to minimize the noise which could have been generated from the group-wise and cortical region-wise procedures. Finally, all the configurations were symmetrized. The symmetrization was performed via symmetrize, a function embedded in the Morpho R package based on the reflection and relabeling procedure.

Phylogenetic tree and comparative methods

We built an informal supertree including all the species in our sample. The tree was constructed by means of the tree.merger tool118 available within the RRphylo R package (v. 2.8.0). Our main references for species phylogenetic positions and extinction ages are ref. 119 for primates and ref. 120 for all other living species. Locations and extinction ages for missing species were individually found from different sources (Supplementary Data 1). The final tree includes 311 species (277 extant, 34 extinct). The tree root is set at 141.8 Ma120.

Relative warp analyses

The standard principal component analysis (PCA) is an effective way to reduce variable dimensionality. In geometric morphometrics (GM), the variables are represented by the coordinates of the superimposed landmarks (and semilandmarks), or warp scores, calculated through mathematical decomposition of the deformations computed via Thin-Plate Spline (TPS)121. The TPS is a mathematical algorithm used to predict the difference in shape between a reference and another shape and can address affine and non-affine deformations separately.

We analyzed the shape variation via RWA (a PCA of warp scores) with the function relWarp included in the Morpho R package122. Procrustes superimposition applied to remove the size, orientation, and translation effect is part of the function.

As we are interested in analyzing the entire shape variation (affine and non-affine deformation taken together), we set the alpha parameter equal to 0. The alpha parameter is a means to emphasize the large-scale/small-scale variation when set equal to 1/−1. When the parameter is set to 0, a standard PCA is performed.

Besides using ordinary RWA with alpha set to zero, we implemented a second shape analysis to look for shape variation occurring at the local scale. Following Grunstra and colleagues25, we replicated the analyses separating the non-affine from the affine shape variation, as non-uniform deformation has different effects over different regions of the form. Grunstra and colleagues developed the function prWarp in R to compute principal warps, partial warp scores, and the non-affine component of shape variation for two-dimensional data25,123. We implemented their algorithm create.pw.be to work with three-dimensional data.

The partial warps are obtained through the decomposition of the bending energy matrix, which is a function of the distance between landmarks in the reference shape. Usually, the chosen reference is the consensus shape retrieved from the Procrustes superimposition. In this study, since we were interested in evolutionary changes, we decided to use as reference the shape of mammalian ancestor reconstructed by applying the RRphylo function23, available within RRphylo R package toolkit (v. 2.8.0). RRphylo applies phylogenetic ridge regression to the tree and data (see below) to derive branch-wise rates of phenotypic evolution and estimate ancestral phenotypes at internal nodes, while minimizing within-clades and maximizing between-clades phenotypic differences. Here the phenotypes are the RW scores. RRphylo provides ancestral character estimation at nodes, from which we retrieved the vector of RW scores at the root of the tree124. To compute the root estimate, we first performed a preliminary PCA and supplied the PC scores to RRphylo, to retrieve the PC scores at the tree root. Then, we use restoreShapes, an algorithm embedded in the package Morpho, to restore the shape coordinates at the root from the PC scores estimates. The coordinates estimated at the root were used to obtain the coordinates of the non-uniform shape, and to perform a RWA (from now on RWA, which is a PCA weighted by the bending energy125) by using custom functions from prWarp package126 .

Eventually, we extracted the relative warp scores (RW scores) and averaged the values per species, which were used for further analyses as representing the endocast ‘phenotype’. We applied this procedure both to the full-shape and to the non-uniform component datasets.

Evolutionary shape analysis

We used RRphylo to locate instances of rate shift in endocast shape evolution, by applying the function search.shift23.

To map the intensity and direction of evolutionary change directly on endocast models, we used the rate.map function embedded in the brand-new R package RRmorph5. For a node-species pair, rate.map identifies the RW axes linked to the highest (lowest) evolutionary rate values for the species and reconstructs its endocast morphology weighted on such axes. Then, it selects the RW axes associated with the highest magnitudes in evolutionary rate by using the extreme distance estimator approach127 and uses the RW scores estimated by RRphylo at the focal node to reconstruct the ancestor’s 3D surface mesh. Eventually, the algorithm calculates the area differences between corresponding triangles of the species’ and the ancestor’s reconstructed surfaces. Finally, the values of differences associated to each triangle of the 3D surface are transferred to the vertices via an interpolation procedure (interpolMesh function from RRmorph). Since the species reconstructed surface is based on RWs with extremely positive and negative rate values, the magnitude of the area differences is directly related to the magnitude of the rates, so that the latter are conveniently translated into shape changes.

Testing for different evolutionary models

We tested the fitting of four different evolutionary models: single rate BM, Ornstein-Uhlenbeck model (OU), multiple rate BM (BMM) by setting a different rate for anthropoids, and BMM by setting a different rate for Catarrhini. The models were fitted by the function mvgls embedded in the R package mvMORPH128.

Models’ comparison was performed via EIC26 using the function EIC (mvMORPH R package).

Selection of landmarks occurring in high-rate areas

To find which landmarks (and semilandmarks) occur in areas of the endocast experiencing significant relative expansion in a particular clade, we collated the area difference between the mesh triangles (the reconstructed mesh minus the common reference mesh triangle area) from the largest to the smallest. Then, we calculated the 75th percentile (90th percentile when the non-affine variation is considered) of the area differences and selected all landmarks and semilandmarks that fall in the selected triangles in at least 90% of the species of the focal clade. This procedure serves the aim of selecting those landmarks and semilandmarks coinciding with the areas of maximum expansion for most of the species in the clade.

Testing expansion of landmarks occurring in high-rate areas with aligned coordinates

We tested the enlargement of areas involved in the DMN resulting from multivariate statistics and phylogenetic ridge regression by measuring from raw data (shape variables and 3D endocranial meshes) their relative surface areas.

We used the three-dimensional coordinate of the consensus shape to build a 3D surface with Geomagic Studio software (v. 2014.3.0). We used this template together with the averaged coordinates to reconstruct the surface of each species. Subsequently, we isolated the triangles defined by selected vertices occurring in high-rate areas, and their area was calculated. We compared the relative isolated areas selecting in hierarchical manner all the species belonging to Primates, anthropoids and Catarrhini.

Analyzing selected areas via GM

We decided to delimitate the shape variation analysis among anthropoids to the areas subjected to high rates of cortical expansion. The areas were treated as separated modules, and their morphological information was combined into a single dataset under a GM context with combinland, a method written in R language (Arothron R package), which builds a common ordination space considering the entire shape information encoded in the starting configurations129.

Transferring cortical expansion/contraction patterns on the fMRI digital reproduction of Homo sapiens brain

To visualize the cortical areas affected by high rate of evolution, we used a digital reproduction of fMRI image of the same individual of Homo sapiens showed in Fig. 3 whose endocast was included in the analyses. To this aim, we sampled the same 18 landmarks (Supplementary Table 1) directly on the fMRI brain surface. Then, we transferred the semilandmarks patch of the corresponding H. sapiens endocast specimen on the brain surface by using the thin-plate spline algorithm (tps3d function in Morpho R package). Eventually, we used Morpho’s slider3d on both endocast and fMRI semilandmarks sets to minimize the differences between them. The cortical expansion/contraction patterns on the fMRI were eventually interpolated for the endocasts by using the interpolMesh algorithm in RRmorph5.

Statistics and reproducibility

Statistical analyses were performed by using R Studio Software version 2023.06.0 based on R 4.4.0. The R packages used to run the analyses were RRphylo23, RRmorph5, Morpho, and Rvcg122. Digital models of the skulls were either downloaded from public repositories, repositories available upon request, or provided by colleagues. The full list of specimen provenances is available as Supplementary Data 1. The complete list of the species with their status (living/extinct), extinction age, reference for phylogenetic position, and reference for extinction age are provided in Supplementary Data 2. R script associated with this study is available as a Supplementary Data 3.zip file. The files include annotated R scripts that describe the entire procedure used to reproduce the analysis with both alpha = 0 and by using the non-affine shape. Data to reproduce the analysis and results that take too long time are also provided as .rda files. All the materials to reproduce the analyses (along with information about specimen provenance and references) are available via Zenodo130.

Endocasts were extracted via the R software endomaker71 available within the R package Arothron70. CT and laser scans were processed in Amira131 (version 5.4.5) and landmarked with this same software. Rate analysis was performed with the function RRphylo23. We reproduced and analyzed 465 specimens overall, referring to 311 different species, inclusive of 34 extinct taxa. Figures and plots were prepared using the R package ggplot2132 and the Photoshop suite.