Introduction

Microscale characterization of mechanical properties has become an important branch of materials science owing to the advancements in nanotechnology, microelectronics and MEMS devices. Within this context, in situ micromechanical testing inside the scanning electron microscope (SEM) is a valuable tool for accessing mechanical properties and investigating failure mechanisms and deformation characteristics at small scales.1,2,3,4,5,6,7,8,9,10 While nanoindentation-based techniques can be used to measure localized mechanical properties at small scales, the complex multi-axial stress field beneath the indentation tip during deformation11 as well as a non-perfect tip shape impedes the straightforward conversion of measured hardness to a continuous stress-strain relationship, as obtained via uniaxial testing.

Fabrication of microsamples using, e.g., a focused ion beam (FIB) offers a wide range of miniaturized testing geometries for materials characterization, each with its unique characteristics and limitations. Micropillar compression12 and microtensile experiments1 enable measuring material properties during uniaxial loading, while giving profound insights into deformation mechanisms and size effects at small scales. Experiments of this type require a precise alignment between testing equipment (flat punch or gripper), as any misalignment of a few degrees can invalidate measurement data. Additionally, no infinitely stiff substrate is present at the base of the sample, which can cause a sink in of the pillar into the base of the tested material during micro-compression.

While tension experiments allow for a better measure of ductility due to final rupture, the FIB milling of dog bone-shaped microtensile specimens is significantly more time-consuming to prepare and test than other geometries, limiting the number of samples that can reasonably be processed and tested. Micro-cantilever samples13,14 are considerably easier to fabricate and test because of simpler geometric constraints and no need to grip the sample. Bending such specimens using a wedge indenter tip only requires a good alignment in the thickness direction of the cantilever to avoid torsional loads. The difference of bending geometries is the intrinsic strain gradient, whereby both tensile and compressive regions, divided by a neutral axis, are present within one specimen. On one hand, this can be seen as an advantage as both loading states are present within one specimen, which enables a single direct measurement of stress-strain asymmetry of materials, as is generally observed in wood,15 strongly textured nanotwinned systems16 or anisotropic twin-dominated deformation in hexagonal systems.17 On the other hand, the strain gradient introduces potential for size effects with decreasing sample height18,19,20,21 and is generally challenging to separate directly using analytical beam theory.22,23

All these investigations would benefit from additional information from in situ images to counteract their inherent drawbacks and enable accurate determination of mechanical response in the micron scale, especially considering the recent drive towards higher throughput mechanical experimentation.24,25

Therefore, the present work utilizes the state-of-the-art Segment Anything Model (SAM),26 which features excellent generalization capabilities for image segmentation and helps to quantify continuously gathered images. The investigations focus on mechanical characterization of well-reproducible IP-DIP resin specimens produced with two-photon lithography (TPL)27 and comparison among different loading geometries.

Experimental

For demonstration purposes micro-specimens were manufactured for the common in situ testing cases of tension, bending and compression. Therefore, TPL is an ideal method to obtain confidentially constant specimen dimensions, neglecting the effort of determining dimensions individually. Since this work aims for a demonstration of the method utilizing image data rather than determining mechanical properties themselves, a suitable demonstration material is of advantage. Photo-resist specimens lack detrimental effects obtained by FIB milling and show isotropic properties due to their amorphous structure. Furthermore, the manufacturing process is automated to a large extent, reducing specimen manufacturing effort compared to common FIB preparation.

Sample Fabrication

The shapes of all specimens were modeled via FreeCAD (Debian GNU/Linux 10, version: 0.18) and had comparable critical dimensions in terms of minimum sample size. The gauge section of the square-shaped pillar and tension specimen had a modeled cross section of 7.5 × 7.5 µm2 and 25 µm height, sitting on a pyramidal base to increase the footprint surface and therefore the overall adhesion. This compliant base also serves to highlight the unavoidable pillar sink in during microcompression. The bending specimens had dimensions of 5 × 5 × 25 µm3 (height × width × length), attached to a prismatic base block with larger volume to act as stiff base and facilitate sufficient clearance below the cantilever to enable unimpeded downward bending during testing. The lower edge of the specimens was inclined by a nominal taper angle of α = 4.4° (2° in the model, Fig. 1c) to counteract processing artifacts, as described in more detail previously.28

Fig. 1
figure 1

In situ SEM images of direct laser written micro specimens: (a) square pillar shape, (b) dog-bone tensile shape and (c) printing-optimized cantilever shape. The essential geometric dimensions and coordinate systems are depicted for each shape individually.

The actual manufacturing was performed by direct laser writing using a TPL printer (Photonic Professional GT2, NanoScribe GmbH & Co.KG, Eggstein-Leopoldshafen, Germany). The configuration for highest resolution was selected, consisting of a 63× objective (Plan-Apochromat 63× N.A. 1.4 Oil DIC, Carl Zeiss AG, Oberkochen, Germany) in conjunction with IP-DIP (Nanoscribe GmbH & Co.KG, Eggstein-Leopoldshafen, Germany) as photoresist to achieve sub-micrometer precision.

As printing substrate, a pre-structured 25 × 25 × 0.7-mm3 fused silica platelet was used. The grid-shaped grooves with a spacing of around 5 × 5 mm2, introduced via a diamond wire saw (type: 6234, Well Diamantdrahtsägen GmbH, Mannheim, Germany), enable the splitting of the substrate after the writing process to meet the geometrical requirements for in situ SEM testing. Furthermore, the substrate was subjected to a surface salinization treatment to achieve superior surface adhesion strength and avoid detachment of specimen structures prior to testing. Further details on the pre-preparation can be found in another open access publication.28

All models were sliced at 100 nm and hatched at 200 nm, including a shift in scanning direction of 90° for consecutively printed layers. The writing was performed with a voxel scan speed of 10 mm/s and a laser power of 25 mW, corresponding to 50% of the maximum value available. A printing script was used to conveniently chain individual tasks such as stage repositioning, surface finding and starting individual print jobs. Thereby, the specimens were printed in a row parallel to a groove at about 30 µm. After successful specimen writing, the standard development procedure was applied, which is essentially washing of uncured resin. Therefore, the entire substrate was submersed in propylene-glycol-methyl-ether-acetate for 20 min and isopropanol for 5 min followed by dry blowing via a blowing ball.

Then, a uniform gold coating with a thickness of several nm was applied with a dedicated sputter-coating device (Sputter Coater 108auto, Cressington Scientific Instruments Ltd., Watford, UK) using two processing cycles of 50 s to reduce charging artifacts and enhance detailed SEM imaging during mechanical testing. Afterwards, a hard-metal scribing pen was used to scratch along the wire-saw grooves to introduce pre-cracks where the substrate will be separated in the next step. The substrate was clamped near a groove on one side and far away from the specimens on the other and split apart by gently applying a bending force by hand. Thereby, the specimens are finally exposed on an edge with two perpendicular obstacle free directions for simultaneous testing and imaging.

Mechanical Testing

Micromechanical experiments of all three sample geometries were conducted inside a SEM (DSM982, Carl Zeiss AG, Oberkochen, Germany) using an UNAT-SEM microindentation system (ASMEC Gmbh, Dresden, Germany) in open-loop displacement-controlled mode. Cuboidal micro-compression pillars with a square cross section situated on a base were tested using a conductive diamond flat punch indenter tip (Synton-MDP AG, Nidau, Switzerland). Dog-bone-shaped micro-tensile samples were tested with a polycrystalline tungsten gripper.1 Both uniaxial testing experiments were conducted using a displacement rate of 50 nm/s. Microcantilever bending was performed using a diamond wedge indenter (Synton-MDP AG, Nidau, Switzerland) with a displacement rate of 20 nm/s. During testing, in situ frames were acquired with a frame rate of 0.99 frames per second, using a scanning speed suitable for continuous image acquisition. The gathered in situ frames were used in conjunction with recorded load-displacement data to obtain engineering stress-strain data. Acquisition of in situ frames is started simultaneously with the recording of indenter load displacement data. Due to the manual initiation, an estimated offset of up to 0.5 s can be present. However, in view of the framerate, a reasonable synchronization is still guaranteed. Subsequent linear fitting of time-resolved deformation is used to correct any offset between indenter displacement and in situ frames. For compression and tension loading, continuous determination of the sample deformation from the in situ frames was used to correct measurement errors arising during uniaxial loading, such as the added compliance of the measurement chain. For cantilever bending, the continuous deflected contour was used to calculate stress and strain in the tensile and compressive fiber, respectively.

Image Segmentation and Processing

To achieve efficient deformation tracking of micro-specimens from in situ frames, each frame is individually treated in consecutive image and data processing steps within a Python script, which will be elucidated in this section. The routines described in this section are developed using Python 3.10.8 and standard packages, while the implementation of the image segmentation model is performed using the PyTorch 2.1.2 package.29 The first step involves cropping all frames to only include the region of interest for evaluation, discarding scaling bars and other superfluous information. The resulting image is then used as input for a trained neural network model, whose task is to identify the specimen using image segmentation. For this purpose, SAM is employed, which is a foundation model trained on the largest image segmentation dataset so far, consisting of 11 million images and 1.1 billion masks.2 The developers indicate good zero-shot generalization, meaning the model recognizes new concepts it was not initially trained on. It should thus be well applicable to segment grayscale in situ electron microscopy images and ultimately recognize various specimens without any additional image processing or training necessary. For segmenting an object, the model requires an image as well as a segmentation prompt for specifying the object. From the available types of prompts, the use of point prompts proved to be best suited. The point prompt consists of two types of points in the form of (x, y) coordinates that are placed on the image. Foreground points are located on the object to be segmented, in this case the specimen itself, and provide information about where it is located in the image. Background points are added onto other regions, not belonging to the object, in this case the indentation tip and vacuum. Once these points are specified on the first frame of a given experiment, the positions of these points are applied to all subsequent in situ frames of the experiment (Fig. 2a–c). Additionally, the input of temporary foreground and background points is implemented, which are only considered on a limited range of in situ frames. Generally, placed foreground and background points for image segmentation are remaining on identical positions for all frames throughout the whole experiment. Temporary points are required in cases where points are placed on a region that is not consistently belonging to foreground or background throughout the whole in situ experiment and therefore need to be readjusted periodically. Such readjustments were performed roughly every 50 to 80 frames. Since the sample geometry and indenter position change during deformation, temporary points may be placed, e.g., on the head of a micro-tensile sample or the tip of a micro-cantilever. An image encoder accepts the in situ frames as an input, while foreground and background points are passed on to a prompt encoder. The model then returns a binary segmentation mask, ideally matching the shape of the specimen as exemplary shown for the in situ frames (Fig. 2d–f). For all segmentation tasks, the “large” vision transformer (ViT), “ViT-L” model size was used, featuring a manageable network size and a good performance to accuracy ratio. Segmentation was performed on a GeForce RTX 3050 laptop GPU with 4 GB of VRAM. The inference time of a single image segmentation task was in the range of several seconds, allowing relatively fast evaluation of complete in situ movie frame datasets.

Fig. 2
figure 2

In situ micrographs of (a,d,g) compression, (b,e,h) tension and (c,f,i) cantilever specimens, with the white scale bars depicting 5 µm for each shape, respectively. The upper images (a,b,c) show the manually added in-contour positions for the algorithm as green pluses, while the out-of-contour positions are marked with red crosses. The second row (d,e,f) depicts the segmented mask as a gray region and the contour with an overlaid curvature color scheme, whereby the red hotspots depict positions of high curvature. The lower row (g,h,i) provides the segmented contours with respective linear fits and crossings to determine the current gauge length of compression and tension specimens (g,h) as well as the compression fiber (blue) and tension fiber (red) of the bending specimen (i) (Color figure online).

The binary segmentation mask is then passed to the “findContous” function30 of the OpenCV library.31 This function calculates boundary points along a region of identical intensity on the binary mask, hence returning the contour of the segmented region. It is necessary to split this singular contour into sections that are meaningful for tracking the edges of the respective sample. The splitting is performed at edge points, where the sample outline features a distinctive kink and thus the contour shows a curvature hotspot (i.e., a small curvature radius), as designated in Fig. 2f. Calculating the curvature of the contour is performed by determining the image gradients in horizontal and vertical orientation by applying a Scharr gradient operator32 along the respective axis. The obtained gradient values in horizontal and vertical direction of a given point represent the gradient vector at that position. The gradient vector at the position of point i on the contour is then compared to the vector at point (i + n), located further ahead on the contour. The value n specifies the distance between points at which the gradient vector is compared and needs to be tuned depending on the geometry of the sample. The angle α between these gradient vectors is calculated and taken as a measure of the curvature. Although the Scharr operator proves more accurate compared to other examined gradient operators, the curvature values are too noisy to be directly utilized for further calculations of strain. To detect kinks in the contour, a threshold angle αT is specified. Regions that show a higher curvature than the threshold angle αT are discarded from the original contour, while sufficiently straight segments of the sample outline remain in the dataset. The threshold angle αT is another value that needs to be adjusted, depending on the specific specimen geometry. The points of all remaining continuous segments are selectively grouped together using density-based spatial clustering (DBSCAN).33 For correct clustering of points, to form individual continuous segments, an appropriately chosen epsilon parameter is required, which determines the distance at which two points are considered as being in different segments. The continuous segments of interest for deformation tracking are then chosen by establishing arithmetic criteria for the coordinates of the included points. As an example, the tensile fiber during bending is selected by searching the topmost of all sections in the in situ frame with the largest number of points (Fig. 2i).

The selected contour segments are then used to individually track the positions of different edges of the specimen for each frame during the in situ experiment video. This enables a continuous determination of the change in geometry, which is suitable for corrections of experimental data, as well as for calculation of quantities not straightforwardly accessible from in situ frames. This is performed in a different manner for each type of specimen geometry, all three of which will be elucidated separately.

Micro-compression Evaluation

As input for the image segmentation model, several foreground points are placed on the pillar in a uniform manner, with emphasis on the border region between the pillar and its base, as occasionally the pillar and base would be recognized as two separate objects. The background points are placed on the flat punch tip, as well as the vacuum (Fig. 2a). Temporary foreground points are placed near the top of the pillar, which need to be moved further down during compression to not end up on the flat punch tip. After generating a segmentation mask for the pillar, the mean x value (Fig. 1a) of all points in the contour section of the pillar top edge is taken as the position of its top edge (Fig. 2g, orange contour section). The exact position of the pillar base is most accurately determined by considering intersections of lines fitted to specific sections of the sample contours. A linear fit is performed on the two contour sections belonging to the edges of the (truncated) pyramidal micropillar base. Likewise, lines are fitted on the vertical edges of the micropillar. The two intersections of the vertical lines of the micropillar edges with the corresponding fitted lines of the micropillar base represent the two points at which the position of the base is assumed (Fig. 2g). For tracking the base position, the mean x-coordinate of the two identified base points is used.

Compressive engineering stress is calculated by dividing the measured load evolution by the original cross-sectional area of the unstrained pillar (Table I), while compressive engineering strain is calculated by dividing the compression displacement of the pillar by the height of the unstrained pillar.34 Compression displacement is usually obtained as recorded displacement data of the indenter system. However, some errors can remain unconsidered using this approach, such as the potential sinking in of the pillar into the base or the fact that recorded displacement data are influenced by the compliance of the total measurement chain, including the pillar base and the substrate on which the samples have been printed.35 Using the continuous deformation tracking, a correction of the compliance of the complete measurement chain can be performed by measuring the height reduction by continuously tracking the pillar height from acquired in situ frames. The current height can be determined by subtracting the position of the pillar base from the position of the pillar top edge (Fig. 2g). The resulting height in pixels is subsequently converted into metric units by multiplication with the correct µm/px ratio. This ratio needs to be obtained from measuring the scaling bar, since such information is not embedded in the image metadata because of hardware limitations. Since the height was calculated by subtraction of the sample base, a potential sink in of the pillar36 can already be corrected. The continuously determined pillar height during compression loading is then used to correct the displacement data recorded by the indentation system. This is done via linear correlation of the raw indentation displacement with accurate time-resolved pillar height from the deformation tracking algorithm to correct for additional load-train compliance and initial displacement offset at the point of contact.

Table I Relevant geometric parameters measured from SEM micrographs

Micro-Tensile Evaluation

Calculating tensile engineering stress is performed by dividing the measured load evolution by the cross-sectional area of the original specimens’ gauge section (Table I), while tensile engineering strain is obtained by dividing the measured displacement of the gripper by the initial gauge length.34 The measurement of strain during micro-tensile testing is particularly prone to errors originating from the additional compliance of the gripper,37 base and head of the dog-bone sample, as well as the substrate on which the sample is printed. Utilizing the continuous evaluation of sample deformation by tracking edge positions visible in the in situ frames, we attempted to correct the measured tensile elongation for these errors, from which an accurate tensile strain could be derived. The aim is to determine the evolution of the gauge section length to correct the measured displacement of the indentation system. Analogous to the micro-compression experiments, the evolution of the sample length is obtained by subtracting the position of the base section from the position of the head. This length evolution is used for a linear correction of displacement data of the indentation system after contact is achieved (Fig. 4a). The method for position determination of the micro-tensile sample base is analogous to the method used in micro-compression: two lines are fitted on the contour points of the base edges and the intersection with lines fitted on the contour points of the gauge length edges is calculated. The calculation of the head position is performed in a similar manner, fitting two lines on selected points of the head edges and calculating the intersection with the lines fitted on the gauge length edges (Fig. 2h).

Micro-Bending Evaluation

Evaluation of micro-bending experiments using this method involves identification and separation of the points belonging to the tensile and compressive outermost fibers of the cantilever. These points are then used separately to fit two parametrized curves and determine the curvature of the tensile and compressive fibers along the cantilever, respectively. The detailed mathematical framework is the same as has been used for curvature determination of dislocation lines and can be found in (Ref. 5). For image segmentation, foreground points are placed on the base of the cantilever, while background points are located on the wedge indenter and the vacuum (Fig. 2c). Particular care needs to be taken when placing temporary foreground points on the cantilever, as such points can lose alignment with the intended region within a few frames and remain located on vacuum as the cantilever is bending away. Image segmentation is straightforward with well-placed points and the cantilever is consistently recognized, as depicted in Fig. 2f. However, the extraction of correct contours for the tensile and compressive fiber is not a straightforward task, as during bending the curvature of the tensile and compressive fibers increase. Since the curvature of the sample contour is also used for the detection of kinks and splitting the contour into sections, a too low value for the threshold angle αT can prevent further evaluation. In this case, the curvature of the tensile or compressive fiber reaches a certain value, at which the angle between the gradient vectors of two points on the contour reaches αT. This leads to unintended splitting of the continuous tensile or compressive fiber into multiple sections, requiring readjustment of the αT parameter.

The stress-strain evaluation is based on simplified beam bending theory, whereby the strain is considered as a linear gradient, even if the outermost fibers already show plastic deformation23,38 as depicted schematically in Fig. 3. The cantilever geometry does not exhibit a region of constant bending moment M, as would be the case, for example, for the four-point bending geometry, but rather a linear dependence with bending lever. Thus, all the following mathematical considerations are only valid for specific incremental x-positions (see Fig. 1c) along the cantilever. For the sake of readability, the deduction of geometric parameters as functions of position, e.g., W(x), was omitted in the following. To estimate the engineering strain from the measured curvature, it is necessary to consider the geometric relationship between the bending radius of the respective fibers κc−1, κt−1 and the radius of the neutral axis ρ, as:

$$ \rho = \frac{1}{{\kappa_{{\text{t}}} }} - \left( {W - z_{0} } \right); \rho = \frac{1}{{\kappa_{{\text{c}}} }} + z_{0} $$
(1)

and calculate the respective strains εcεt, as:23,38

$$ \varepsilon_{{\text{t}}} = \frac{{W - z_{0} }}{\rho } = \frac{{\left( {W - z_{0} } \right)\kappa_{{\text{t}}} }}{{1 - \kappa_{{\text{t}}} \left( {W - z_{0} } \right)}} ; \varepsilon_{{\text{c}}} = \frac{{z_{0} }}{\rho } = \frac{{\kappa_{{\text{c}}} z_{0} }}{{1 + \kappa_{{\text{c}}} z_{0} }} $$
(2)
Fig. 3
figure 3

Schematic of plastic beam bending, depicting tensile and compressive regimes, as well as a neutral axis. The strain ε is considered to follow a linear gradient, while the stress in the plastified regions exhibits classical non-linear hardening behavior. Relevant geometric parameters are: position of the neutral axis z0, radius of curvature of the neutral fiber ρ, compression fiber curvature κc and tension fiber curvature κt.

The precise position of the neutral axis z0 might change during plastic deformation but will stay in close proximity to the geometric center of the beam for a respective incremental position. To obtain a first-order estimate for the strains, the neutral axis was considered constant at z0 = W/2. With these engineering strains the nominal respective strain-load P compliances Cc, Ct can be calculated numerically as:

The stresses can further be calculated as:

$$ C_{{\text{C}}} = \frac{{{\text{d}}\varepsilon_{{\text{c}}} }}{{{\text{d}}P}} ; C_{{\text{t}}} = \frac{{{\text{d}}\varepsilon_{{\text{t}}} }}{{{\text{d}}P}} $$
(3)
$$ \sigma_{{\text{t}}} = \frac{2L}{{BW^{2} C_{{\text{t}}} }}\left( {P\left( {C_{{\text{t}}} + C_{{\text{c}}} } \right) + \frac{{\varepsilon_{{\text{t}}} + \varepsilon_{{\text{c}}} }}{2}} \right) $$
(4)
$$ \sigma_{{\text{c}}} = \frac{2L}{{BW^{2} C_{{\text{c}}} }}\left( {P\left( {C_{{\text{t}}} + C_{{\text{c}}} } \right) + \frac{{\varepsilon_{{\text{t}}} + \varepsilon_{{\text{c}}} }}{2}} \right) $$
(5)

with the cantilever width B, the cantilever height W and the length to wedge tip L for the respective position of evaluation. These formulations are based on the calculus of first variation arguments, and the interested reader is referred to the original works of Mayville and Finnie22 and Kato et al.23 for their precise determination.

Results

The high reproducibility of geometries fabricated by two-photon lithography is well known39,40,41,42 and allows for high-throughput testing of quasi-equal shapes to determine statistical variations. However, it is still essential to measure the final geometries after processing and before testing, as these might vary from the initial model because of shrinkage or other influences during the curing process. The geometrically relevant parameters measured from electron microscopy images before testing are summarized in Table I, whereby any error estimates are based on at least ten individual manual measurements. All of them show a small overall scatter, except for the cantilever bending length L. This is measured for each experiment individually because of manual positioning of the wedge tip with respect to the specimen.

Uniaxial Microcompression/-Tension

For both uniaxial test configurations, the contour tracking data were not directly used, but rather employed to correct the gathered displacement from the indentation system. This reduces stochasticity within the stress-strain curves that could be introduced because of outliers within the image data and the reduced data point fidelity of image versus displacement data. A representative example of a tensile specimen displacement is shown in Fig. 4a, where the raw data are depicted by a black line and the contour tracking data are indicated by red points. The image data still show a linear behavior over time, as expected. However, an evident difference in slope arises from the fact that the load-train is not infinitely stiff, and the raw displacement is influenced by various sources of compliance within the base and the head, whereas the image data only measure direct extension on the sample. An additional benefit arises regarding the correction of initial displacements of the gripper or flat punch tip. These occur as the experiment starts out of contact, and they are often subtracted manually. Now these are automatically removed using this procedure, as the inherent axis offset with the contour tracking data considers this feature as shown in Fig. 4a. The resultant change in engineering stress-strain data is depicted in Fig. 4b, where an increase in general elastic slope as well as a removal of the pronounced nonlinear behavior in the beginning of the curve (up to a strain of 0.01) is observed, which is commonly attributed to the initial contact settling between gripper/punch and specimen.

Fig. 4
figure 4

(a) Displacement correction scheme of a tensile specimen based on contour tracked data and (b) resulting change in engineering stress-strain curve (Color figure online).

For each uniaxial testing configuration six individual specimens were tested and evaluated, and the corrected engineering stress-strain data are shown in Fig. 5. There, the curves of all compression specimens are shown in sub-figure Fig. 5a, with open black squares denoting the 0.2% yield onset (σ0.2%) calculated using an elastic slope shift for each specimen individually. The same is depicted for all tensile specimens in Fig. 5c, with the addition that fatal failure can be observed in tension and the strain-at-failure (black crosses) can be gathered as a measure of ductility. Evidently the individual specimens show strong agreement among themselves for each loading direction, respectively. The yield onset is consistently lower for tension at 71 ± 2 MPa, then at compression with 89 ± 5 MPa. The rupture for all tensile specimens occurred at the head section of the specimen, which is likely a result of slight stress concentration at the 45° angles in conjunction with bending loads occurring through imperfect sample-gripper contact. However, the strain-to-failure exhibits only small scatter at 0.258 ± 0.024, which suggest good reproducibility of the whole specimen fabrication and methodology. The elastic modulus was calculated for each specimen using raw displacement and contour tracking corrected displacement data and is summarized in Table II. There it becomes evident that the modulus is underestimated by up to 30% when neglecting the load train compliance. Furthermore, a modulus asymmetry between tension (Etension = 2.20 ± 0.15 GPa) and compression (Ecompression = 2.60 ± 0.17 GPa) is apparent.

Fig. 5
figure 5

Comparison of all calculated engineering stress-strain curves: (a) microcompression experiments, (b) compression data from bending experiments, (c) microtensile experiments and (d) tensile data from bending experiments. White squares depict the 0.2% yield offset stress and black crosses mark final failure.

Table II Summary of all measured parameters

The image data allow for determination of strain on the specimen not only along the loading direction (εXX) but also perpendicularly (εYY), which allows for calculation of Poisson’s ratio ν = − εYY/εXX. Using individual images for such a calculation yields rather significant scatter, but plotting εYY (considering contraction as positive) over εXX shows a strong agreement for compression and tension specimen, as detailed in Fig. 6, respectively. As Poisson’s ratio is only properly defined in the elastic regime, the data were fitted linearly between 0.02 and 0.04 for compression and between 0.01 and 0.03 for tension for each specimen and the average Poisson’s numbers calculate to νcompression = 0.28 ± 0.06 for compression and νtension = 0.31 ± 0.15 for tension, respectively. In the plastic regime (roughly for strains > 0.05), Poisson’s ratio should theoretically be 0.5 when assuming volumetric continuity. While the data show slightly larger values, the scatter is also quite significant, and the continuous trend from a shallower slope to a higher slope of roughly 0.5 suggests good agreement with standard continuum considerations of plastic deformation.

Fig. 6
figure 6

Engineering lateral strains (εYY) over loading direction strains (εXX) for (a) compression and (b) tension specimens, respectively, to depict the evolution of Poisson’s ratio.

To estimate strain errors, three main sources are present: (1) scatter of averaged contour segments, (2) image shift over frame acquisition time and (3) error from linear fitting of image displacement for correction of indenter displacement. A sample estimation for type (1) errors will be performed for compression experiments by considering solely the deviation of the pillar top position. This position is calculated by averaging over all points of the corresponding contour section (Fig. 2g, orange section). The resulting variance of this position over all performed experiments is 0.613 px2. Assuming uncertainty propagation of uncorrelated input quantities,43 the strain error has a constant value of 0.00255, irrespective of applied strain. This means that the strain error decreases proportionally at higher compressions, 5.10% at 0.05 compressive strain, 2.55% at 0.1 compressive strain and 1.06% at maximum compressive strain of 0.24. The type (2) error source arises from the continuous deformation during image acquisition. It is dependent on the orientation of the specimen regarding the scanning direction. If SEM scanning is performed from top to bottom of the image, the error is considerably smaller when uniaxial testing is performed in horizontal direction, opposed to vertically, since the currently scanned line will travel across the deformed region faster in the first case. With the image dimensions and scanning parameters used in the experiments, the strain error when loading in a vertical orientation is 0.094%, while loading in horizontal orientation it is 0.0173%. With this error source in mind, all uniaxial testing was performed in horizontal orientation. The type (3) error source concerns the linear fitting of the determined compression from in situ frames for correction of the indenter displacement data. It can be estimated by the mean squared error (MSE) of the linear fit. The linear fit is performed for specimen compression over time, while excluding all initial frames where no contact between gripper or flat punch and the specimen is present. The MSE value of the linear regressions of all compression experiments is 0.184 ± 0.0615 px2; for tension experiments it is significantly higher, with 2.569 ± 0.9612 px2. This suggests that calculation of sample extension using the intersection of fitted lines produces a significantly higher error, since in the case of tension both base and head position are calculated with line intersection, resulting in a higher MSE, compared to compression. However, a full error quantification for this case would necessitate statistical sampling, e.g., Markov chain Monte Carlo, which would considerably exceed the focus of this manuscript. From this initial estimation the type (1) error source seems to be the dominating factor.

Microcantilever Bending

Four cantilever-shaped specimens were tested at various bending lengths spanning from 13.4 µm to 20.6 µm, and the curvature and resulting stress strain behavior were calculated following Eqs. 15 at a constant position of 2 µm from the base of the cantilever. This reduces any influence from the stress concentration at the compression side close to the base while still being reasonably close to the region of first plastic deformation. The calculated engineering stress-strain data are shown in Fig. 5b, d for the compression and tension sides of the cantilevers, respectively. Compared to the uniaxial data (Fig. 5a), the compression bending data show quite a significant scatter, with a rather unphysical strong increase in stress far in the plastic regime. For the bending tensile data (Fig. 5d) the behavior in the plastic regime seems to exhibit a distinct softening with a subsequent constant flow plateau, which is not evident in the uniaxial data (Fig. 5c). The initial slope is also considerably steeper than in the uniaxial compression and tension data, with nominal moduli reaching as high as ~ 20 GPa. This can be attributed to the fact that small curvatures are extremely hard to resolve with only (sub-)pixel changes from frame to frame. However, while the initial part is resolution-limited and the higher plastic regime is limited by the accurate knowledge of geometric constraints, the regime around the yield onset still shows promising similarities with the uniaxial counterparts. Using the classical 0.2% offset construction with the slopes of the individual specimens shows strong agreement with the uniaxial data as summarized in Table II. Even the yield stress deviation between tension and compression is accurately revealed using the cantilever data. These possibilities, challenges and implications will be regarded in more detail in the following discussion.

Discussion

Image-Assisted Micromechanical Testing

The correction of uniaxial testing data via continuous tracking of in situ specimen edges using the state-of-the-art image segmentation model SAM is a straightforward task. Although the network was never trained on these specific types of images, owing to the good generalization capability of the model, the segmentation of such grayscale images containing specimens with rather simple geometric shapes did work quasi ‘out-of-the-box,’ given suitable choice of point prompts. To obtain valid and consistent segmentation results, multiple foreground points need to be specified. Considerable variation and a high ratio of unusable masks were found when specifying only a single point, especially when employing the smallest available variant, with vision transformer “ViT-B.” Conversely, employing the larger vision transformer models “ViT-L” and “ViT-H” with a higher number of foreground and background points leads to consistent masks with high quality. Slow processing speeds should not be an obstacle when employing the largest model type for evaluation of large datasets when reasonable computing power is available. While the entry-level RTX 3050 Mobile GPU used in this work managed image segmentation in roughly 20 s using the largest “ViT-H” model, a more capable RTX 3080 desktop GPU with an increased number of CUDA computing cores allowed image segmentation runs with inference times consistently around one second.

When using SAM in the as-released state, special care needs to be taken with suboptimal SEM scanning parameters leading to high noise or low contrast, as the quality of segmented masks can degrade, hindering further processing. Imaging poorly conducting specimens can lead to polarization effects, leading to elevated noise levels, poor contrast as well as brightness variations on the specimen surface. Variations of contrast and brightness did not cause any noticeable degradation in mask quality, emphasizing the segmentation capabilities of SAM compared to traditional thresholding methods. However, at particularly high noise levels, where specimen outlines can hardly be detected by the SEM operator, unusable segmentation masks are returned. While such noise levels show the limitations of SAM, they were only observed during acquisition while the conductive diamond indenter was out of contact with the specimen.

Furthermore, non-specimen features, such as dust particles on the specimen surface, are correctly excluded from the segmentation mask by the model as they represent a separate object. This, however, also complicates further evaluation, since a mask featuring cutouts at the position of dust is obtained. Most of the times simply placing a foreground point on the dust particle solves this issue, while in some cases the region of the mask containing the dust particles requires manual editing. Additionally, should such a dust particle be positioned at the edge of a specimen, the model will consider the particle as a separate object, discarding it from the mask, especially when placing a background point on top of it. However, in particular if the particle is not sufficiently large, it can cause the mask outline to exhibit a kink, which leads to splitting of continuous segments at this position. The remedy for this is increasing the epsilon parameter during density-based clustering, which joins the formerly separated segments together.

All these aspects strongly suggest that a purely automated evaluation is rather challenging, when using SAM out of the box, as to date still a human-assisted placement of temporary background points, tuning of contour sectioning parameters and general sanity check are necessary to obtain trustworthy high-quality data.

Digital image correlation is a popular method used for determination and tracking of strain and displacement field. Compared to the proposed method of contour tracking, a higher local resolution, with fewer assumptions about boundary conditions, can be achieved, which is particularly interesting for non-uniform deformation fields. However, for employing classical DIC on SEM images, low noise levels are required, which leads to long acquisition times, not suited for continuous loading experiments. Fast image acquisition is possible when, instead of grayscale matching, tracking of fiducial markers is performed, which however leads to additional efforts in specimen fabrication, not always feasible for high-throughput characterization of specimens.

Uniaxial Stress-Strain Data from Bending Specimens

Substituting uniaxial microscale testing by using bending geometries would provide a few benefits: easier FIB-based sample fabrication routines compared to dog-bone-shaped tensile specimens, more convenient instrumental positioning of a wedge compared to a gripper and examination of two uniaxial loading modes within a single experiment. However, the data analysis is not as straightforward as for uniaxial specimens, and the accuracy of the stress-strain response is limited. This is rooted in the elastic regime in the rather small curvature changes and in the plastic regime by unknown relative movement of the neutral axis. To progress and assess the differences between theoretical assumptions and experimentally observed contour data, a purely elastic finite element simulation (Calculix 2.17,44 CPS4 elements) was conducted using the exact bending length as a comparative specimen and the measured elastic modulus (E = 2.6 GPa) and Poisson’s ratio (ν = 0.31) obtained from uniaxial tension data. The simulations were conducted with a fixed cantilever base in analogy to the analytical considerations (Fig. 7b) as well as an extended 30 × 30 µm2 base to reduce stress concentrations in analogy to the experimental specimens (Fig. 7c). The contour data of the simulations are shown as individual symbols for the compression and tension contours and two respective loads (50 µN, 250 µN) on top of the experimentally observed contour data in Fig. 7a. There it is evident that the simulations with a fixed base (green triangles and crosses) show closer agreement with the contour tracking data than the extended base simulations. This suggests that the three-dimensional base of the specimens is considerably more rigid than a narrow (same width as cantilever) base and that the simplified ‘rigid base’ assumptions are reasonable and will not lead to major deviations. The simulations suggest a linear increase of curvature with only marginal deviations between simulations with or without base and tension or compression fibers, as expected by linear elastic theory (Fig. 7d). Investigating the curvature overload data necessary for the stress evaluation in bending (Eq. 3), it is evident that the experimental data (black and red small dots) do not depict a change in curvature up to approximately 150 µN. This is a result of the limited curvature resolution in the low load regime as individual pixel shifts only contribute marginally to overall curvature changes. Thus, the elastic modulus in the bending stress-strain curves is not in accordance with the actual material modulus, but rather a measurement artifact. However, after 150 µN the experimental slope of the curvature-load data are in agreement with linear elastic assumptions, leading to a non-linear behavior in accordance with the uniaxial data, and are the reason for the correct yield onset provided from the bending evaluation. Furthermore, the simulated strain gradients in cantilever direction (εxx) at the evaluation distance of 2 µm are shown in Fig. 7e for five different loads ranging from 50 µN to 250 µN with fixed base (red doted lines) and extended base (black continuous lines). These underline that the neutral axis does not change in the elastic regime and stays reasonably close to the center of the beam (0.499 for fixed base, 0.484 for extended base), suggesting that the assumed constant z0 of 0.5 can be considered a good approximation. Taken together, this leads to the conclusion that bending analysis based on classical curvature measurements can be used to measure yield onset but should not be utilized for other mechanical characteristics within the present experimental constraints. To address these issues in more detail in case an extent plastic analysis is required, it would be necessary to incorporate the experimentally measured contours into a finite element framework to obtain strain gradients and errors thereof, similar to the feature tracking in digital image correlation.37

Fig. 7
figure 7

(a) Comparison of finite element (individual symbols) with experimental contour (orange, blue continuous) data, whereby two loads (50 µN, 250 µN) are shown for tensile and compressive fibers, respectively. (b,c) Strain (εxx) plot of cantilever simulations at 250 µN with fixed support and extended base, respectively. (d) Comparison of curvature data between simulations and experiment and (e) simulated strain (εxx) gradient for various loads with fixed and extended base supports, respectively (Color figure online).

Correlation of Mechanical Data

The yield onset of the present commercially available IP-DIP resin was already exhaustively investigated regarding strain rate and temperature by Rohbeck et al.45 Their results for 25°C and within the tested strain rates of 7 × 10−4 s−1 to 7 × 10−3 s−1 lie in the range of 55–80 MPa, in good agreement with the present results (see Table II). Especially, the asymmetry between tension and compression yield onset is well reflected in both the present results as well as the mentioned literature data. This reproducible result is likely an outcome of the hydrostatic pressure dependence of yielding in amorphous polymers.46 Other literature based on printed nanofibers applied directly on MEMS chips for experimentation using the same resin reports tensile yield strengths of 62 MPa,47 which is again in excellent agreement and suggests a high reproducibility of the material among various research groups. Furthermore, also the ‘concave-up’ increased hardening response in the plastic regime is well reproduced and is a direct consequence of the high cross-link density obtained via two-photon polymerization.48

Young’s modulus is strongly dependent on the laser power during the fabrication process,49 as this directly influences the cross link density. Uniaxial Young’s modulus values have been reported ranging from < 1 GPa to 3.6 GPa by various research groups.45,47,49,50 The deviation in modulus between tension and compression has also been observed in Ref. 45, but as the focus in that work was on the strain rate sensitivity of the mechanical response, the slight deviation was not investigated in detail. However, with the present addition of Poisson’s ratio, one can now study not only Young’s modulus as a measure for the uniaxial elastic response but also the bulk modulus as a measure for the volumetric response, enumerated as bulk modulus B = E/(3-6ν) for tension and compression, respectively. This calculates as Bc = 1.97 GPa for compression and Bt = 1.93 GPa for tension, which is only a 2% difference, while the deviation in Young’s moduli would be 15%. This suggests that, while the differences in uniaxial response might be governed by the influence of the hydrostatic stress, similar to the yield onset, the volumetric response is an actual material inherent quantity.

Further Opportunities for Image-Based Quantification

While detailed quantification of uniaxial mechanical parameters can be enhanced using additional information from recorded images, there are also cases where image data are the only source available for quantification, and precise (preferably computer assisted) image analysis is mandatory. For example, elastic-plastic fracture or fatigue experiments cannot be analyzed without the knowledge of actual crack extension during the test. Therefore, continuous image gathering can be a valuable tool for such investigations.51,52 Also some fracture-related parameters, such as the crack tip opening displacement/angle, or fracture process features such as crack bridging, are inherently geometric characteristics and can be well evaluated using image segmentation and contour tracking.53 Other challenging geometries, such as open hole tensile tests,54 would also benefit from segmentation of the hole. In that case, utilizing the changing ellipticity of the hole in conjunction with finite element method modeling would allow for determination of the local stress state and more in-depth characterization of failure in such specimens.

Alternatively, not only the continuous deformation of more complex geometries, but also a change in deformation, without external mechanical load and therefore without related measurement devices, could be conceived. For example, increasing the temperature on a multilayer system with various different coefficients of thermal expansion can be utilized to measure intrinsic stress gradients,55 while subsequent removal of stressed layers can be utilized to determine depth profiles of residual stresses.56,57,58 Using a combined approach of annular FIB milling and digital image correlation, lateral and depth-resolved information on residual stress profiles can be obtained in multilayered thin films with nanoscale resolution.59 All these studies necessitate image information and would benefit greatly from automated segmentation and tracking routines. In the present case, one such deformation change without external load would be the viscoelastic relaxation of specimens after rupture, as summarized in Fig. 8a. There the relative strain decrease from the first image after rupture is shown over time, and an exponential decay function was fitted to each specimen individually. The results show that, while the decrease scatters noticeably, all specimens exhibit a relaxation over multiple seconds, with most of the viscoelastic response occurring over a period of ~ 20 s, causing an average relaxation for all specimens of 0.031 ± 0.006. This relaxation of roughly 3% is evidenced in Fig. 8b. The red dashed contour corresponds to the first frame after rupture, which is superimposed to the last gathered image reflecting the nearly completely relaxed state. Such methodological opportunities could have broad implications for studying anelastic responses of various micro-/nanoscaled systems, such as amorphous silicon nanowires with different bond densities60 or varying dopant levels in semiconductors.61 Other innovative applications beyond deformation tracking, such as detection of slip steps on the surface of specimens as contour kinks, are conceivable, which would also allow automated determination of slip plane orientation and critical resolved shear stresses. Investigations regarding crack propagation resistance are also of significant interest; however, rapid crack growth or fracture events cannot be easily captured by the SEM using a finite scan speed. One possibility would be combining the presented methodology with inherently stable testing geometries, such as chevron notch geometries62 or double cantilever wedging.52 Resulting stable crack growth would allow tracking crack propagation based on sectioned contours.

Fig. 8
figure 8

(a) Relative strain decrease Δε over time after rupture of six tensile specimens, fitted with the given exponential decay function, and (b) a fully relaxed tensile specimen with the red dashed overlay of the first contour frame after rupture (Color figure online).

Conclusion

The present work shows the feasibility of utilizing the freely available SAM image segmentation model for micromechanical research purposes without the need for additional training of the network. Three different geometries, namely compression pillars, dog-bone tensile specimen and bending cantilevers, produced with two-photon lithography were successfully segmented. Additional contour tracking algorithms and analytical arguments enabled the determination of corrected stress-strain response, indicating a yield onset asymmetry between uniaxial tension (71 ± 2 MPa) and compression (89 ± 5 MPa), which is in excellent agreement with literature data. Furthermore, the Young’s modulus as well as Poisson’s ratio can be evaluated using the segmented image data and suggests a slight difference between tension and compression behavior, while the bulk modulus remains constant independent of loading direction. Finally, utilizing the inherent compression-tension gradient within the bending specimens is not completely straightforward based on analytical arguments only. The Young’s modulus was considerably overestimated, which is a result of the limited curvature resolution at small loads, while the plastic regime showed unphysical behavior due to a not accounted shift in neutral axis. However, the yield onset values provide comparable results to the corresponding uniaxial tests, which suggests that this approach can be used for tension and compression strength estimates. In summary, the additional information gathered from images using this semi-automated approach can be beneficial for a wide range of experimental setups and investigation parameters.

Outlook

Considering further developments on this method, segmentation performance of SAM is expected to improve after performing fine-tuning, especially when using SEM images featuring high-noise image artifacts due to polarization as well as dust particles on the specimen for training. Aside from improved mask quality, less detailed point prompts might be required for valid masks with fine-tuned SAM. To pursue efforts of automation, a promising approach involves using a lightweight neural network for object detection of in situ specimens, which would allow determination of the experimental geometry, as well as the outlines of the specimen in the frame. This information could be used to predict a suitable box prompt for subsequent segmentation of the given frame by SAM without user input, potentially allowing fully automated segmentation of in situ SEM frames.

Subsequent sectioning of the mask contour to continuous segments is a task requiring further development as well. Contour sectioning can be improved beyond Scharr filter and density-based clustering, which requires considerable tweaking of parameters for every experiment. Application of alternative algorithms such as B-spline interpolation could prove as a more robust method for kink detection while not requiring extensive user input. The training of a U-Net neural network to understand and identify kinks in the mask contour also constitutes a viable approach.