1 Introduction

Spinal correction surgery through pedicle screws is a common procedure in treating patients with spine deformities or fractures. However, complications can occur due to the loosening of the screw after surgery [1]. In order to prevent this complication, different trajectories for insertion of the screw can be studied [2]. For proper evaluation of different trajectories, it is important to understand how the system works from a mechanical point of view. Finite element methods have been widely used in this regard [3, 4], and they might be capable of correctly simulating the stress conditions in this kind of procedure. With this technique, it is possible to assess multiple trajectories for the screw insertion. However, the use of this technique for a wide variety of insertion angles is time-consuming and eventually costly from a computational point of view. This creates the opportunity to explore different methods of evaluation of the maximum stress in the pedicular screw positioning. Artificial neural network (ANN) is one method that has been used to determine the mechanical structure of bones [5]. It has also been shown that this model can be trained to reproduce results from finite element analysis of pedicle screws [6].

Studies have compared different insertion angles of pedicle screw instrumentation of the spine [2, 7,8,9]. The most common insertion angle, i.e., traditional trajectory, is following the transpedicular path. In the lower lumbar spine, a common value for the transpedicular angle is at a 22° to the sagittal plane and parallel to the superior end plate of the vertebra. This trajectory follows a transpedicular path [8]. Although it is possible to increase the anchorage of the system by changing this trajectory [3, 8], this reduces the angle to the sagittal plane [7]. Other trajectories have also been tested, particularly the cortical trajectory [8]. In this case, for the lumbar vertebrae, the screw is inserted at a 22° angle to the transverse plane, pointing toward the cranial direction, and at a 6° angle to the sagittal plane, pointing outward. The objective was to maximize thread contact with cortical bone, resulting in greater bone-screw fixation.

A typical method of evaluating pedicle screw fixation is the pullout strength test [4, 10, 11]. This test consists of fixing the vertebra and applying an axial force to the screw. The failure point is the load for which the screw is separated from its anchorage, often by tearing. This point can also be detected by a sharp drop in the force during in vitro tests [3]. The load at failure is influenced by several factors, including but not limited to the studied vertebra, bone density, insertion angle, insertion technique and screw geometry. The force at failure is usually in the 200 N to 800 N range [3, 4, 9,10,11,12].

As an alternative to in vitro tests, the stress values of pedicle screw instrumentation can be determined by finite element analysis (FEA). Due to the complexity of the vertebral bone structure, some simplifications are usually made. Mechanical properties of the bone are considered homogeneous and isotropic, with the only distinction being between trabecular and cortical bone [6, 13]. The cortical bone is considered as an outside layer with uniform thickness. For boundary conditions, the screw is considered fixed to the vertebra, with no relative motion between them. The vertebra is considered fully fixed in its lower surface [14, 15]. A typical mesh has element size varying from 0.4 to 1 mm [9]. Previous works have analyzed the validity of these parameters [16].

The artificial neural network (ANN) is a technique used to estimate relationships between variables [13]. An ANN is composed of multiple layers, each subdivided into neurons. Between the neurons of each layer, a weight is applied by multiplication with the neuron value. Each neuron has also threshold for activation. An activation function is used to introduce nonlinearity to the model [17]. This model has been used to emboss the mechanical stress in the bone and biomechanical systems such as pedicle screw fixation [5, 6, 13, 18].

Currently, studies have shown benefits of applying optimization in biomechanical situations [19, 20]. For this, it is important that adequate mathematical models are applied, as it may require a high computational cost. Mathematical optimization is a group of models used to find a desired point in an input function, usually the maximum or minimum point. In this group, a notable model is the genetic algorithm [19]. Inspired by natural evolution, it uses randomization of the input values to search for the extreme point of a given function, called the fitness function. Each solution found is called a chromosome, and its parameters the genes. At each iteration of the algorithm, called generation, the chromosomes are randomly combined according to their fitness in order to produce a new generation for analysis. This process is named reproduction. Typical combinations are mutation, in which one of the genes is randomly altered, and crossover, where genes of two different chromosomes are changed [21, 22].

This paper presents a study based on finite element analysis to assess the resulting stress in the vertebra given different pedicle screw positionings. The stress is measured simulating a pullout strength test on an isolated L4 vertebra. Specific angles were defined to train an ANN to predict the screw stresses in the different trajectories. Afterward, an optimization algorithm, i.e., genetic algorithm, was used to minimize the maximum von Mises stress in the vertebra. The next section presents the materials and methods used in this work, followed by the results and discussions.

2 Materials and methods

This work chose the L4 vertebra as a pilot test to verify the applicability of the suggested method (Fig. 1). This vertebra was selected due to the image quality obtained from CT (Computer Tomography) scan, and it was converted to the STL file format from a public medical library (DICOM). Figure 1 shows the CAD solid model, which afterward was exported to the Abaqus® FEA tool.

Fig. 1
figure 1

L4 vertebra CAD model

The screw (Fig. 2) was modeled using SolidWorks® 2018, based on a generic geometry representation of a pedicle screw with triple start. The dimensional specifications of the screw are: major diameter 7 mm, minor diameter 3 mm, pitch 3 mm, 60° thread angle and 37 mm length. The screw head is represented as a cube to simplify the model.

Fig. 2
figure 2

Modeled pedicle screw

The baseline trajectory was chosen as parallel to the transverse plane (Fig. 3 right), and at a 15° angle to the sagittal plane (Fig. 3 left), which corresponds to the traditional trajectory. Fifty different positions were created based on the combination of two angles (α and β) considering increments of 5°. The first angle (α) varies from 5° to 40°, and the second (β) from − 15° to 20° (Fig. 4). This range was based on the vertebra geometry, with the limits set according to the values in which the screw penetrates the vertebra wall. Within these limits, the screw thread stays inside the bone structure.

Fig. 3
figure 3

Initial screw trajectory and positive angle directions

Fig. 4
figure 4

Limiting angles of the screw trajectory

The finite element analysis was made using Abaqus® FEA tool. The vertebra was meshed (Fig. 5) using tetrahedral elements of quadratic order (C3D10) in the analysis region (close to the screw), and of linear order (C3D4) in the noninteresting regions. The cortical bone layer was modeled using a skin of linear triangular shell elements (S3) with 1 mm thickness. The screw was meshed with tetrahedral quadratic elements (C3D10). The average length of the elements was 1 mm, and the total number of elements was around 300 000 (varying for each specific trajectory).

Fig. 5
figure 5

Model mesh in traditional trajectory

The vertebra was considered fixed in the lower surface (Fig. 6, right). The screw mesh was merged with the vertebra, simulating a fully fixed join between both. A force of 400 N was applied in the axial direction of the screw (Fig. 6, left), simulating a pullout strength test. This force was defined for being close to the force of failure in a typical pullout strength test [10]. The von Mises stresses were evaluated in the cortical portion of the bone surrounding the screw [12, 23].

Fig. 6
figure 6

Force applied (left) and vertebra fixation (right)

The bone material properties were modeled according to [14], and the screw properties were considered to be TiAl4V, according to [4], as shown in Table 1.

Table 1 Material properties of the vertebra and screw

A neural network was trained using the results of the simulations. The 50 individual positions were randomly split into two sets: a training set, with 44 positions, and a test set, with six positions. The neural network was modeled using TensorFlow [24]. A grid search varying all parameters was used to choose the ideal architecture. The input layer contains two neurons, one for each angle that defines the screw position, as shown in Fig. 3. A single hidden layer with ten neurons was used.

The output layer has one neuron corresponding to the maximum von Mises stress in the trabecular bone region. The activation function chosen for the hidden layer was the rectified linear function. A penalty term in the loss function of the ANN of 0.1 and dropout of 0.5 were used to prevent overfitting. The RMSProp optimizer was used, with a learning rate of 5.10–4. To train the model, an early stop callback was employed, using 10% of the data as validation and patience of 1000 epochs. The batch size was 16. The mean squared error (MSE) was chosen as loss function.

In order to find the best screw position, a genetic algorithm was used and modeled using the software Distributed Evolutionary Algorithms in Python (DEAP) [25]. The mathematical model can be written as:

$$\text{Minimize }{\text{MVS}}\left(\alpha,\beta\right)$$

Subject to:

$$-10^{\circ} \le \alpha \le 25^{\circ}$$
$$-15^{\circ} \le \beta \le 20^{\circ}$$

MVS represents the maximum von Mises stress value in the vertebra. The α and β angles vary in a continuous distribution. In this model, the α angle varies in relation to the initial (15°) angle. A − 10° angle in this model corresponds to a 5° absolute angle (Fig. 4a), and a 25° angle to a 40° angle (Fig. 4b). This change in reference was done due to modeling convenience. The genetic algorithm was parametrized as a minimization problem, with population size 300, 40 generations, crossover probability of 50% and mutation probability of 20%. The trained neural network was used to predict the stress in each chromosome. To keep the results within the modeled angle range, a penalty of 100 was applied to chromosomes outside the range.

The final trajectory obtained was reevaluated using FEA analysis. This step was added to verify the validity of the result, since the nature of the ANN generates an error in the stress value.

3 Results and discussions

The ANN achieved a mean squared error (MSE) value of 0.71 in the validation set, which was used as early stop condition, and of 0.91 in the testing set, which were the points excluded for training. The mean absolute error (MAE) was of 0.81 in validation and 0.92 in testing. Using the entire dataset, the MSE was 0.27, and the MAE 0.42. This error is 12% of the yield stress of trabecular bone, being compatible with the usual range met for in vitro tests [10].

Figure 7 shows the maximum von Mises stress as predicted by the neural network and according to the FEA results. Each point in the graph represents one trajectory. As expected from the MAE result, the predicted stress values are close to the simulated values. The maximum absolute error was 1.17 MPa (relative error 18%, from 6.48 MPA in CAE to 5.31 MPA in ANN). The maximum relative error is 25% (absolute error 0.86 MPa, from 3.43 MPa in CAE to 4.29 MPa in ANN). The von Mises stresses values obtained from the ANN tend to be closer to the average value of stress obtained with the FEA model, showing less spread between minima and maxima. As expected for the applied 400 N pullout force, the stresses were around or above the yield stress of 3.4 MPa, which indicates that the chosen criterion is consistent with experimental results [3, 4, 9,10,11,12].

Fig. 7
figure 7

Maximum von Mises [MPa] stress in trabecular bone region

For the case studied, the optimized trajectory with minimum stress was found at the position with 37° from the sagittal plane (α) and 1.4° from the transverse plane (β), as shown in Fig. 8. In this position, the predicted stress is 4.29 MPa. The FEA simulation of the optimized trajectory (as determined by the genetic algorithm) results in a stress value of 3.25 MPa. The error from the ANN was 32.0% in this case.

Fig. 8
figure 8

Trajectory with minimal stress

In the initial FEA analysis, before the optimization, the lowest stress found was 3.43 MPa, at α 35° and β 0°. This position is close to the optimal one found by the genetic algorithm, with a difference of 2° in α and 1.4° in β. The optimal position presented a stress value 5.25% lower than the value obtained by FEA calculations, showing that the optimization was possible.

Based on this experiment, it may be noted the combination of an ANN and a genetic algorithm can help in the definition of an optimized screw position. However, the results showed that ANN cannot be used to fully characterize the stress state at a particular position, since the error can push the stress past the yield point. Thus, it is needed to be used in combination with another method of stress determination, such as FEA. Even considering the error found in the ANN method, the obtained stress results were consistent with the FEA analysis for each trajectory. This indicates that even though the results from the proposed method can optimize the screw trajectory, they cannot be used for a precise stress assessment.

The stress distribution around the failure point for the trajectory with minimal maximum stress in the initial FEA analysis (before optimization) is shown in Fig. 9 (α 35°, β 0°). Figure 10 shows the equivalent point for the optimized trajectory (α 37°, β 1.4°). In both cases, failure occurs near the screw thread, as expected, as these points act as stress increasers due to geometry and difference of material in the contact point of screw and bone. Also, these points are located around the pedicle area, the thinnest region that the screw is inserted. However, the distribution of von Mises stresses was more uniform in the position defined by the optimized model than the position of initial model.

Fig. 9
figure 9

Stress distribution in the best trajectory before optimization

Fig. 10
figure 10

Stress distribution in optimized trajectory

Finally, the numerical results achieved by this research will be different for other vertebrae and spine regions due to differences in geometry and anatomy. Also, vertebrae geometry varies from person to person. This issue is amplified when dealing with different spine pathologies, since the nature of each deformity would bring different constraints to a model. Obtaining the vertebra model for a specific patient and performing a study of the specific problems regarding orthopedics and traumatology may help the population with the ANN model, providing a way of bridging this gap. The surgery itself is another point that should be considered. The method can cause variations in the structural integrity of the vertebra and spine, and this deviation should be considered before the final trajectory is chosen. These issues offer different opportunities for further works supporting the development of the proposed method for a more general application throughout the spine.

4 Conclusions

The use of an ANN combined with a genetic algorithm was effective in finding a screw position with lowered stress. However, the error in the ANN result is generally high, showing that it cannot be used alone to determine the stress in a given trajectory.

The optimized trajectory is one with increased contact with cortical bone when compared to the traditional trajectory, which passes through the pedicle center. The same happens with a cortical trajectory, increased proximity to cortical bone reduces the maximum stress and helps distribute the stress over the contact area.

Further works might use additional von Mises stress values in ANN training aiming to evaluate the sensitivity of the proposed model.