1 Introduction

In the past two decades, nanoscale materials of single or multidimensions and a size below 100 nm have attracted increasing interest due to their new and unique features over their bulk counterparts [1]. The new features of these materials have made revolutionary improvements in many fields, making nanoscience one of the most promising and innovative fields of research in materials sciences.

Various inorganic materials have been modified, and their size was reduced to nanoscale as nanoparticles to achieve superior properties with greater functional versatility. Among the inorganic nanoparticles, Iron oxide nanoparticles (IONPs) in particular magnetite (Fe3O4), maghemite (γ-Fe2O3), and hematite (α-Fe2O3) are of great technological and industrial interest due to their unique properties appropriate for many fields, including the electronics industry for the fabrications of the new generation technological devices [2], the agriculture sector as a fertilizers [3], environmental remediation removal of pollution or contaminants from water [4], and the various applications in medicine field [5, 6].

Among the different applications in medical field, metal nanoparticles have been extensively explored to combat one of the leading causes of death in worldwide known as the infections of pathogenic bacteria [7,8,9,10,11,12,13]. Bacteria are continuously developing resistance towards different antibiotics, which have arisen the necessary of discovering a new antibacterial agent class [14]. The recent studies concerning inorganic nanomaterials have proven their efficiency as antibacterial agents against many bacterial infections they can be used to enhance the effectivity of existing antibiotics or used directly as antibacterial agent since they exhibit antibacterial features of their own [15, 16].

There are three proposed antibacterial mechanisms of IONPs against bacterial cells. The first mechanism suggests that IONPs enable the formation of reactive oxygen species (ROS) such as hydroxyl ions and hydrogen peroxide, which causes oxidative stress and damages the cell membrane and DNA, leading to bacterial death [17]. The second mechanism by the dissolution of IONPs into iron ions, which is known to inhibit several bacterial cells activities by interfering with enzyme, amino acid, and protein metabolisms causing bacterial death [18]; and the third mechanism propose that IONPs interact directly with cell membrane through electrostatic forces, which damages the membrane plasma, and causes intracellular content leaks [19].

Diverse chemical and physical processes have been extensively employed for the fabrication of metal nanoparticles. However, these production methods are generally costly, toxic, and potentially dangerous to the environment and living organisms. Which have arisen many concerns about the production of nanomaterials; these concerns are faded by implementing a sustainable green biological method in nanomaterials production, which uses biodegradable and biocompatible natural sources such as bacteria fungi, and plant extracts. This synthesis method allowed the production of low-cost, non-toxic, and eco-friendly nanomaterials [20].

The unique features of iron oxide nanoparticles including their antibacterial activity are significantly influenced by their shape and size [2, 21,22,23,24,25,26]. Generally, significant enhancements on nanoparticles properties are reached by reducing their size. Therefore, extensive studies and efforts were made to better understand the relationship between the size and properties, aiming to reach a size-controlled synthesis of nanoparticles with optimized properties and best performance [27].

Former studies in the literature have found that it is possible to control nanoparticles' size and properties by adjusting the synthesis conditions including reaction temperature, pH, duration, and reactant concentration that significantly influences the growth of nanoparticles' crystallite size [28,29,30,31,32,33].

The majority of the former investigations aiming to optimize the nanoparticles antibacterial activity have restricted their examinations to study the influence of only discrete or separate synthesis parameters with a primitive technique widely known as one factor at time (OFAT) optimization. This technique is surrounded by various disadvantages that restricted employing it to solve real industrial problems, it needs a non-reasonable number of tests that can be extremely costly and consumes a lot of resources efforts and especially time. On top of that, its unable to describe the interactive effect of multiple synthesis factors [34].

The prementioned complications can be effectively and efficiently diminished using modern and effective statistical techniques that permit the investigation and the modelling of multiple independent variables. Response surface methodology (RSM), is considered as one of the most powerful and efficient techniques used for this purpose. This technique consisted of generating a polynomial equation that can simulate the experimental data and predict processes output by linking the effect of the studied variables and their response with a mathematical model.

The generated mathematical model is exploited to assist determining the optimal conditions of any process maintaining a reasonable number of experiments, consequently less efforts, recourses and time [35,36,37].

Moringa oleifera or Drumstick tree is one of the world’s most beneficial and easily accessible trees. It is the only genus among fourteen species of the Moringaceae family. Moringa has an extensive geographic distribution throughout Central and South America, Africa, and South Asia due to its capability to quickly grow and resistance to poor soil [38]. Besides using it as food, M. oleifera is also famous for its important healing abilities which make it earn the name of “the miracle tree” or “the tree of life” [39]. It is rich in flavonoids, phenolic acids, phenolic amines, vitamins, protein, and minerals [40].

This paper aims to optimize the antibacterial activity of IONPs against both Gram-positive and Gram-negative bacteria. IONPs were greenly biosynthesized using M. oleifera leaves extract, then, dissimilar to the limited traditional one factor at time (OFAT) optimization studies, we have investigated the collective effect of various experimental factors on the antibacterial activity of IONPs. The reaction and annealing temperatures besides precursor concentration were set as independent variables and were varied in a broad range of five levels for each variable, while the antibacterial activity was set as a response to obtain the optimal conditions that maximize IONPs antibacterial activity. To the best of our knowledge, there is no study have been conducted examining the interactive effect of this combination of factors on antibacterial activity of IONPs. In order to study the properties of the biosynthesized nanoparticles, different characterization techniques such as UV–Vis, FTIR, XRD, SEM, and EDX. Meanwhile, their antibacterial activity was tested using the disk diffusion method.

2 Materials and Methods

2.1 Chemicals

Analytical grade Ferric chloride (FeCl3 98%) purchased from Sigma Aldrich, and Milli-Q water were used in all the performed trials.

2.2 Sample Collection and Preparation of M. oleifera Plant Extract

2.2.1 Sample Collection

Moringa oleifera leaves were gathered from a local farm in Bagouza, Taghzout, 20 km from the provincial capital, El Oued. The leaves were collected on the 12th of October 2019. Additional information about the collection of M. oleifera is shown in Table 1 and Fig. 1.

Table 1 Information about the collection of M. oleifera
Fig. 1
figure 1

Geographic map showing the collection area

2.2.2 The Preparation of Plant Extract

First the green leaves were washed deeply with Deionized water and then left to dry away from sunlight for two weeks at room temperature. The leaves mixed continuously enabling the air to pass through the leaves. After that, electronic grinder was used to crush the air-dried leaves and then using the obtained fine powder to prepare the plant extract utilizing the maceration method [41, 42]; 10 g of plant powder was added to 100 mL of deionized water and mixed steadily over night at room temperature. Finally, the liquid phase was separated with Whatman No.42 filter paper several times and then stored in a refrigerator at 4 °C for further use.

2.3 The Biosynthesis of Iron Oxide NPs

IONPs biosynthesis was performed with minor modifications to a standard method used by prior studies for the plant mediated synthesis of metal oxide NPs [43, 44]. First, 10 mL of M. oleifera leaves extract was poured into 100 mL of different concentrations of iron chloride solutions (0.02–0.07 M). This combination left to react under various temperatures (from 55 to 95) for one hour and magnetic stirring rate of 350 rpm. A sample from each resulted solution was conserved for UV–Visible analysis. Next, the resulting mixture was centrifuged for 15 min with a rate of 3000 rpm, and the precipitated solid was washed with deionized water several times and dried in air-oven at 50 °C overnight. Finally, the dried solid of the different samples was annealed for 3 h at different temperatures (430–768 °C) in order to purify the synthesized nanoparticles by removing the impurities and to ensure their full crystallization [45,46,47]. Schematic illustration of the IONPs biosynthesis method is shown in Fig. 2.

Fig. 2
figure 2

Schematic illustration of the IONPs biosynthesis method

2.4 Characterization of Iron Oxide Nanoparticles

The UV–visible spectrum of IONPs was recorded using a double-beam UV–Visible spectrophotometer (Shimadzu 1800) recording the range of 200–900 nm. Before the analysis, IONPs solution concentration was reduced by pouring 1 mL of the obtained iron oxide NPs solution in 10 mL of Milli-Q water. Quartz cuvette was used in this analysis, and distilled water was used as the reference solvent. FTIR spectra were recorded on total reflection (ATR) spectrometer (Thermo scientific-Nicolet iS5) operating in the range of 400–4000 cm−1. The XRD patterns were recorded using X ray diffractometer (Rigaku, Mini Flex 600) operating in 2θ range from 20° to 80° with Kα radiation of copper (λ = 1.5406 Å). The X rays were produced with 30 kilovolts and current intensity of 20 mA. The iron oxide NPs at the optimal conditions were imaged using (FEI, QUANTA-250 FEG) microscope operating under a voltage of 20 Kilovolts and high vacuum and Scherrer formula (Eq. 1), was used to estimate the crystallite size by choosing the peak with the highest intensity assigned to the plane (104).

$$D = \frac{k \lambda }{{\beta \cos \theta }}$$
(1)

\(D\) signifies the crystallite size, \(k\) denotes the shape factor, \(\beta\) is FWHM (the full width at half maximum), \(\lambda\) is the wavelength (1.5418 Å, Cu) and \(\theta\) is the so-called diffraction angle [48].

2.5 Antibacterial Activity

The antibacterial activity of the biosynthesized IONPs was investigated using the disk diffusion method. Before the experiment, pure cultures of two human pathogens, E. coli and S. aureus, were isolated from patient’s samples collected from (Abd El-hakim) Laboratory, Boudouaou, Algeria and (El-Medjed) Laboratory, El-Oued, Algeria. The bacteria were then sub cultured on nutrient agar (NA) and incubated at a temperature of 37 °C overnight.

Different runs of IONPs of different sizes were properly sonicated and dispersed in deionized water in concentrations of 50 mg/mL. The dispersed IONPs were loaded to 7 mm disks made of No.1 Whatman filter paper.

Mueller–Hinton agar (MHA) was heated to 55 °C, then 20 mL from the solution was poured in a petri dish and left to solidify for 15 min; the preprepared bacteria then was dispersed in saline solution (NaCl 0.9%) using a vortex mixer (2550 rpm) in microorganism concentration of 0.5 McFarland. After that, the bacterial uniformly dispersed at the MHA surface using cotton swap.

The different runs of IONPs of various sizes were properly sonicated and dispersed in deionized water in concentrations of 50 mg/mL. Then, the dispersed IONPs were loaded to 7 mm disks made of No.1 Whatman filter paper. Gentamycin (120 mg/mL) was used as a positive control, while deionized water was the negative control.

Finally, the prepared IONPs disks along with positive and negative controls were placed at the MHA surface at 37 °C for 24 h. At the end of incubation, inhibition zones formed around the disc were measured with a transparent ruler in millimeters.

2.6 Experimental Design

Box-Wilson Central Composite Design, frequently known as central composite design (CCD) was used in this study due to proficiency in generating response surfaces that can be employed to predict the optimal desired response with fewer number of runs. CCD is a two-level factorial design, improved with center and star points that enables fitting the quadratic polynomial models [49]. In this design the independent variables (inputs) are wide-ranging over 05 levels: the high level (1), lower level (− 1), center points (0), added to 02 outer (star) points symbolized (\(\mathrm{\alpha }\) and \(-\mathrm{\alpha }\)). that signify the extreme levels for each factor. For a rotatable design having \(m\) factors,\(\mathrm{\alpha }= {2}^{m/4}\). In the design used for this study \(m\) = 3 so \(\mathrm{\alpha }= {2}^{3/4} =\) 1.682.

The choice of suitable ranges for the studied factors was inspired from the previous studies. It was reported that the ANL Temp of 500 °C synthesizes a clean IONPs [43, 44, 50]. Therefor 500 °C was selected as the low level (− 1) for this factor. Moreover, According to former studies, the recommended reaction temperature (RC Temp) for the biosynthesis of the metallic oxide nanoparticles using plant extracts is in the range of 25–100 °C [51]. Consequently, 95 °C was chosen as the high level (1) for RC Temp parameter. The PR Con ranged from 0.03 to 0.07 in order to be suitable for the volume of the plant extract used in this biosynthesis process [28, 52]. Table 2 shows the coded and real values of the levels of each independent variable.

Table 2 The different levels and codes of the studied factors

The total reduced number of the runs required for this study according to CCD can be calculated using Eq. (2).

$$N = 2^{n} + 2n + n_{c} { }$$
(2)

where \(N\) is the entire number of experimental runs, \(n\) is the number of independent variables (Three in our case). \({2}^{n}\), \(2n\) and \({n}_{c}\) are assigned to factorial, axial and center runs respectively. For aquert error calculations the number of center points recommended for three variables is six [53]. Therefore, for this study taking \({n}_{c}=6\) and \(n=3\) the total number of runs needed is 20 according to Eq. (2). The performed runs are listed with their actual values in Table 3.

Table 3 Experimental design plan for the three factors with the observed responses

In central composite design that contains 03 factors, the quadratic model can be expressed as follows (3):

$$Y{ } = { }\beta_{0} + { }\mathop \sum \limits_{j = 1}^{m} \beta_{{\dot{j}}} x_{j} + { }\mathop \sum \limits_{j = 1}^{m} \beta_{jj} x^{2}_{j} + { }\sum \mathop \sum \limits_{i < j = 2}^{m} \beta_{{\dot{i}j}} x_{i} x_{j} + \varepsilon$$
(3)

where \({x}_{i}\) and \({x}_{j}\) are factors (\(i\) and \(j\) varies from 1 to \(m\)). \(\varepsilon\) represents the error. The coefficients \({\beta }_{\dot{i}}\), \({\beta }_{\dot{i}i}\), and \({\beta }_{\dot{i}j}\) represent the linear, binominal and combined effects, respectively. \({\beta }_{0}\) is a constant coefficient, \(m\) signify the sum of studied factors [54, 55].

2.7 Data Analyses

Design expert (version 13) statistical software was employed for the construction of the experimental design and analyzing the obtained data by generating the different statistical reports and plots, investigating the different effects of the chosen variables, and determining the optimal conditions within the studied range.

3 Results and Discussions

The formation IONPs was clearly distinguished by the immediate color change from light brown to dark black.

Figure 3 when the ferric chloride (FeCl3) solution was mixed with M. oleifera leaves extract which was clearly noted by naked eye observation. This result match those observed in earlier studies using diverse plants [2, 3]. The color change occurred due to the presence of the active molecules in the used extract, which reduced the iron metal ions.

Fig. 3
figure 3

UV–vis absorbance spectra of IONPs and the plant extract

M. oleifera is a rich source of biomolecules such as (polyphenols, flavonoids, terpenoids, alkaloids, tannins, etc.) that can reduce and stabilize metal ions to their nano form. When ferric chloride salt (FeCl3) dissolves in water, it forms an ionic solution of iron and chlorine ions that moves freely moves in the solution. Once the ionic solution is mixed with M. oleifera liquid extract, the freely moving iron ions are attracted towards the plant’s biomolecules due to electron deficiency. This leads to transferring electrons from oxygen to iron ions according to the donor–acceptor mechanism causing the reduction of iron ions to zero-valent NPs. This latter is then stabilized by the other biomolecules of the plant extract. On the other side, the plant biomolecules are converted to keto compounds. The reduced iron nanoparticles are transformed into iron oxide nanoparticles during air-drying and annealing [1]. The bioreduction process can be induced as follows:

$$FeCl^{3} + H_{2} O \to [Fe(H_{2} O)^{n} ]^{3 + } + H_{2} O$$
(4)
$$R + [Fe(H_{2} O)^{n} ]^{3 + } + H_{2} O \to [Fe(H_{2} O)^{n} ]^{2 + } + H^{ + } + R{-}OH$$
(5)
$$[Fe(H_{2} O)^{n} ]^{2 + } + 2R^{ - } + H^{ + } + OH^{ - } \to Fe^{2 + } O^{2 - } + Fe^{2 + } Fe^{3 + } + O^{2 - } + R{-}H + R{-}OH^{ - }$$
(6)

The UV visible graphs corresponding to IONPS and Moringa leaves extract are shown in Fig. 3.Two peaks located around 250 and 320 nm appeared in the plant extract spectrum. Meanwhile, IONPs spectrum exhibited a single peak at 275 nm. This peak is attributed to the characteristic IONPs SPR Surface Plasmon Resonance absorption band of [50, 56, 57].

The gap energy \({E}_{g}\) of the synthesized IONPs was determined from the UV–Visible spectrum. Figures 4 and 5 shows the variation of \((\alpha hv)\) as a function of \((hv)\) the gap energy (\({E}_{g}\)) of nanoparticles is estimated using Tauc’s formula (Eq. 7) [58]:

$$\left( {\alpha hv} \right) = K(hv - E_{g} )^{n}$$
(7)

\(K\) is a constant and \(hv\) represents the energy of the incident photon. \(\alpha\) the absorption coefficient. \({E}_{g}\) the optical band gap in electron volts (eV). \(n\) is an variable exponent that depends on the nature of the electronic transition (when the transition is direct\(n=2\), and when transition is indirect \(n=1/2 )\)[59, 60].

Fig. 4
figure 4

Direct bandgap (Eg) estimation using Tauc's plot

Fig. 5
figure 5

Indirect bandgap (Eg) estimation using Tauc's plot

Prior studies evaluating hematite (α-Fe2O3) band gap observed inconsistent results on whether it has direct or indirect bandgap; some has reported that hematite is a direct bandgap material [50, 61], while others described it as an indirect bandgap material [62, 63]. Differently, other demonstrated that α-Fe2O3 possess the both types of band gaps direct and indirect [64, 65]. Consequently, we have considered studying both direct and indirect band gap transmissions. The estimation of bandgap using Tauc’s plot exhibited a value of 3.53 eV for direct transmissions and 2.83 eV for indirect transmissions. These results are in line with those of previous studies [50, 59]

3.1 Fourier Transform Infrared (FTIR) Spectroscopy

FTIR analysis was mainly employed to identify the biomolecules that participated in iron oxide nanoparticles reduction and stabilization by comparing the spectrum of the crude plant extract with the spectrum of the biosynthesized nanoparticles.

The resultant FTIR spectrum (Fig. 6a) has revealed on multiple absorption peaks that related to the different functional groups of the biomolecules presented in the M. oleifera extract.

Fig. 6
figure 6

FTIR Spectra of: a plant extract, b IONPs before annealing, and c IONPs after annealing

The O–H stretching vibrations was observed at the broad peak centered at 3368 cm−1[66], the two close peaks appeared at 2913 cm−1 and 2842 cm−1 are assigned to the methyl group C–H asymmetric and symmetric stretching vibrations respectively [67], the C=O and C=C stretching vibrations are distinguished by the peaks located 1650 cm−1 and 1453 cm−1 respectively [68]. The presence of amines group was noted by the C–N stretching vibration band appears as narrow peak around 1540 cm−1 [68]. In addition, the peaks centered at 1230 cm−1 and 1055 cm−1 are assigned to C–O stretching C–OH bending vibrations respectively [69]. The peaks appeared in M. oleifera extract spectrum confirms that it contains different polyphenolic compounds [67], that can effectively reduce and stabilize metals for nanoparticles biosynthesis [70].

Comparing the FTIR spectra of plant extract (Fig. 6a) and IONPs (Fig. 6b) show that there is a shift in the wavenumber of the absorption bands, which may indicate the interaction of biomolecules with iron ions [71]. Furthermore, the comparison exposed a distinguished decrease in intensity of the band centered at 3368 cm−1, which indicates the vital role of the biomolecules attributed to this functional group in the reduction and stabilization of IONPs [57]. The wavenumber range from 500 to 600 cm−1 has been zoomed to display the inorganic peaks, the peaks shown at 506 cm−1 and 515 cm−1 are attributed to the Fe–O stretching vibrations [72, 73]. The same peaks were also seen in the spectrum of IONPs annealed (Fig. 6c), and all the executed runs.

3.2 X-Ray Diffraction (XRD)

Figure 7 shows all the XRD patterns of the different runs executed according to the experimental design order Table 3. Common peaks were observed in all the XRD patterns of the different runs placed at 2-theta (2θ) positions of 24.15°, 33.13°, 35.64°, 40.65°, 49.48°, 54.09°, 57.43°, 62.53°, and 64.14° assigned respectively to the crystal system of (012), (104), (110), (113), (024), (116), (122), (214) and (300) [74]. According to JCPDS card no. [33-066-4] these peaks are allocated to iron oxide of the type Hematite α-Fe2O3 of having its characteristic rhombohedral geometry and space group: R-3c (a = b = 5.04 Å, and c = 13.75 Å) [75].

Fig. 7
figure 7

X ray diffraction of Run 01 besides JCDPS refference card pattern [on the left] and the patterns of all the performed experiments [on the right]

As can be seen from Fig. 7 the peaks of XRD patterns vary in terms of intensity and width due to the different biosynthesis conditions. According to Scherrer’s formula (Eq. 2), these variations in peaks intensity and width indorse that these patterns correspond to samples of different crystallite sizes since the CR size is estimated from FWHM and peaks positions. The IONPs of the executed runs were of diverse sizes at the nanoscale range of 29.26–64.55 nm.

3.3 Antibacterial Activity

Figure 8 shows the antibacterial activity for the different runs of IONPs against both gram-positive and gram-negative bacteria. The results indicate that the biosynthesized nanoparticles and antibiotic (ATB) inhibited the growth of both gram-positive and gram-negative microorganisms. The antibiotic (ATB) discs exhibited an inhibition zone of 36.3 ± 1.98 mm and 32.7 ± 2.31 mm against E. coli and S. aureus respectively. Meanwhile no inhibition zone formed around the control discs (C) Table 4. On the other hand, the discs attributed to the designed runs of IONPs exhibited different sizes inhibition zones. The performed runs besides their inhibition zones are listed in Table 3.

Fig. 8
figure 8

The antibacterial activity for the different runs of IONPs against E. coli and S. aureus

Table 4 Inhibition zones of ATB and control discs

3.4 Fitting of model

Tables 5 and 6 represent the ANOVA tables for IONPs antibacterial activity against both E. coli and S. aureus respectively. The analysis of variance tables indicates that both models are significant with P values less than 0.0001 and Fisher’s F-values of 83.63 and 100.61 for E. coli and S. aureus inhibition zones respectively [76]. The studied terms effect on the antibacterial activity of IONPs can be obtained from the relation between the Fisher’s F-value, p-value and term effect. The relation between F-value and p-value is inversely proportional, the higher the F-value the lower the p-value and the more significancy effect of term on the response, and verse versa [77]. In this case, for both E. coli and S. aureus responses, all the studied terms influence is significant except the interactive effects of BC and AC for both responses. The F-value also can be exploited to sort the effect significancy of the model terms, which was as follows: A > C > B2 > A2 > C2 > B > AB > AC > BC. Demonstrating that the Pre-Con term (A) have the most significant effect on both model responses followed by ANL Temp [78].

Table 5 ANOVA Table of IONPs antibacterial activity against E. coli
Table 6 ANOVA Table of IONPs antibacterial activity against S. aureus

Table 7 shows the different R square values for both responses. As can be seen the predicted R2 value for both responses are very close to their adjusted R2, and their coefficient of determination R2. All the prementioned values are very close are unity 1 which approves the adequacy of the generated models [79]

Table 7 The different R square values for E. coli and S. aureus responses

The analysis has revealed on a quadratic polynomial models’ equation that link the responses with the studied factors are expressed by in terms of coded factors.

Exploiting RSM two mathematical quadratic models that links the responses with their independent variables were generated. The equations for both responses are expressed with coded factors in (Eqs. 89).

E. coli inhibition zone

$${\text{Y}}_{{{\text{E}}{.}\,{\text{coli}}}} = 12.56 - 2.19{\text{A}} - 0.7356{\text{B}} - 2.25{\text{C}} - 0.9{\text{AB}} + 0.25{\text{AC}} + 0.275{\text{BC}} + 0.9725{\text{A}}^{2} + 1.1{\text{B}}^{2} + 0.6366{\text{C}}^{2}$$
(8)

S. aureus inhibition zone

$$Y_{S.Aureus} = { }12.56 - 2.19A - 0.7356B - 2.25C - 0.9AB + 0.25AC + 0.275BC + 0.9725A^{2} + 1.1B^{2} + 0.6366C^{2}$$
(9)

These equations (Eqs. 89) can be used to estimate the antibacterial activity of IONPs against E. coli and S. aureus for any value of the synthesis process variables. Which to obtain an enhanced antibacterial activity for our both responses. The equation describes the precisely the effect of each factor in two aspects, the term sign (positive or negative) represent the nature of its effect on the response, Meanwhile the term coefficient represents its effect intensity on the response [80]. According to (Eqs. 8 and 9) AB, AC, BC, A2, B2, C2, has a positive effect on the response (E. coli and S. aureus inhibition zones), while the linear terms such A, B, and C have positive effects.

The predicted versus the actual values plots for E. coli response (Fig. 9a) and S. Aureus response (Fig. 9b). Shows that both responses predicted values are in close agreement with the experimental values, indicating the models proficiency in the prediction [81].

Fig. 9
figure 9

The predicted values versus the observed values of a E. coli and b S. aureus inhibition zones

3.5 Internal vs. Normal

This normal probability plot shown in Fig. 10 is very helpful it shows whether the data are normally distributed or not. If the data forms a linear pattern means that the data is normally distributed and verse versa. In this case, the data is distributed approximately in a straight line, which indicates that data is normally distributed [82, 83].

Fig. 10
figure 10

The normal %probability residuals and studentized residuals for a E. coli and b S. aureus inhibition zones

3.6 Residual’s Analysis

The plot of residuals versus the run number is shown in Fig. 11, this plot is also reffered to as outlier t. The red lines on top and bellow the plot are identical to 95% confidence for the control range. The residual points should be inside the controle range (between the two red lines) in this case, all the points are inside the acceptable range. Furthermore, the plot shows a randomly scattred points without an obvious trend or shape being formed by the data points indicating the normal disterbution of residuals excluding any serial correlation.

Fig. 11
figure 11

The externally studentized residuals and run number for a E. coli and b S. aureus inhibition zones

3.7 Response Surface Plots

The interactive effect of the biosynthesis variables and their influence on gram-positive and gram-negative bacteria (Staphylococcus aureus and Escherichia coli respectively), is represented with three-dimensional (3D) contour plots of the response surface for every interaction of two factors were plotted while keeping the remaining process variable at its central (0) level.

The 3D surface plots in (Fig. 12) represent the combined effect of the Pre-Con and the RC Temp on the (a) E. coli and (b) Aureus inhibition zones. It is noted that a higher antibacterial activity of IONPs at lower levels of Pre-Con. Meanwhile, increasing both of Pre-Con and RC Temp have decreased the antibacterial activity of IONPs significantly.

Fig. 12
figure 12

3D surface plots of interaction between the Pre-Con and RC Temp on the a E. coli and b S. aureus inhibition zones

Figure 13 shows the response surface with respect to Pre-Con and ANL Temp. The contour plot indicates that IONPs antibacterial activity increases significantly by decreasing both Pre-Con and ANL Temp.

Fig. 13
figure 13

3D surface plots of interaction between volume ANL Temp and Pre-Con on a E. coli and b S. aureus inhibition zones

Figure 14 Shows that increasing ANL Temp have decreased IONPs antibacterial activity. Meanwhile, increasing the RC Temp from 55 to 75 °C have decreased the inhibition zones for both gram-positive gram-negative bacteria. However, further increase in RC Temp (more than 75 °C) have increased the antibacterial activity slightly.

Fig. 14
figure 14

3D surface plots of interaction between ANL Temp and RC Temp on a E. coli and b S. aureus inhibition zones

To investigate the effect of IONPs crystallite size on their antibacterial activity against gram-positive and gram-negative bacteria, the crystallite size of each run was plotted against their inhibition zone Fig. 15, higher antibacterial activity was obtained at lower crystallite sizes. In other words, decreasing the crystallite size increases the antibacterial activity. This result is in accord with recent studies indicating that the smaller the nanoparticles size the higher antibacterial activity; the smaller sizes NP penetrates in to the cell easier compared the bigger counterparts, which causing more damage to the bacteria [70, 84,85,86]. Comparing the inhibition zones for each sample against gram-positive and gram-negative bacteria shows that gram-negative bacteria have more significant inhabitation zones. Pervious study have demonstrated that the variance in antibacterial activity is due to the differences in each bacteria type's construction and composition of cell membranes [87]. Gram-negative bacteria have thinner peptidoglycan cell membranes compared to Gram-positive bacteria. Therefore, IONPs penetrates it easier, causing a higher antibacterial activity [88].

Fig. 15
figure 15

The effect of IONPs size on the antibacterial activity against E. coli and S. aureus

The results observed in Figs. 12 and 14 demonstrates a trend behavior for RC Temp effect on the antibacterial activity; increasing the RC Temp decreases the antibacterial activity meanwhile at high temperatures (more than 80 °C in this work) causes a slight increase in IONPs antibacterial activity. This finding broadly supports the work of previous studies linking RC Temp with nanoparticles crystallite size [31]. Which explained this increase of crystallite size with the fact that increasing RC Temp increases the nucleation rate, resulting in more precursor monomers to be consumed and become crystal nucleus. At this point, if the precursor concentration is sufficient, the precursors would grow faster on the nucleus due to the increased growth rate at high temperatures. In contrast, if there is unsatisfaction in precursor concentration, the growth would be limited due to the lack of precursor monomers. Consequently, the crystallite size of the NPs decreases [31]. Decreasing IONPs crystallite size facilitates their penetration throw the bacteria cell causing more damage to the bacteria consequently more antibacterial activity is obtained at lower levels of RC Temp in other words, the decreased RC Temp levels decreases the size of IONPs which enhance their antibacterial activity [70, 84,85,86].

The inverse relation between the antibacterial activity and Perc Con shown in Figs. 12 and 13 can be also explained by the direct proportional correlation between crystallite size and Pre-Con [28, 50]. The increase of the precursor concentration with sufficient surfactants, increases the concentration of monomers by increasing the number of monomers (growth species) at the same volume. Consequently, the diffusion distance between monomers decreases, leading to higher mass transfer and higher growth. As a result, the crystallite size increases which makes it more difficult for the nanoparticles to penetrate the bacteria cell causing a decrease on the IONPs antibacterial activity [28, 70, 84,85,86]

According to Figs. 13 and 14 results, the increase in crystallite size is inversely proportional to ANL Temp. This observation may support the hypothesis that increasing annealing temperature increases the amount of thermal energy given to the nanoparticles, leading them to earn a sufficient energy for diffusive motion in what is known by the Oswald ripening process [89]. which is a diffusion process where bigger particles are formed at the expense of small particles [90, 91]. As a result, the crystallite size increases which restricts the nanoparticles to penetration the bacteria cell causing a decrease on the IONPs antibacterial activity [70, 84,85,86].

3.8 Optimization Using the Desirability Functions

The antibacterial activity of IONPs optimization was performed using the desirability functions. Design expert 13 software allows to set optimization goals to minimize, maximize, obtain a targeted value or obtain a solution in specific range of the response. In this study, the optimization goal was set to maximize the antibacterial activity while setting all the factors ranges between their maximum (+1) and minimum (− 1) levels. Using the previous optimization criteria, a maximum desirability of 0.857 associated with maximum antibacterial activity represented with maximum inhibition zones for both E. coli and S. Aureus of 22.95 mm and 20 mm respectively. The maximum antibacterial activity was achieved by setting all the biosynthesis parameters at their inferior levels; i.e., Pre-Con = 0.03 M, RC Temp = 55 °C and ANL Temp 500 °C.The optimal condition and their related desirability are shown in Fig. 16 The experimental run executed at the suggested optimal conditions exhibited an antibacterial activity of 22.55 mm and 19.15 mm for both E. coli and S. Aureus respectively, which is in close arrangement with the predicted response, approving the model prediction adequacy in the studied range.

Fig. 16
figure 16

Desirability ramp for optimization

3.9 Scanning Electron Microscopy (SEM)

The SEM analysis exhibited an image shown in Fig. 17, between the diverse irregular shapes, it’s possible to recognize a majority trend of distorted cubes (rhombohedral) structure placed as an aggregated form with a minority of dispersed separate particles. Which further support XRD findings, similar results were demonstrated in prior studies [50, 92].

Fig. 17
figure 17

SEM image for the biosynthesized IONPs under the optimum antibacterial activity

3.10 The Energy Dispersive X-Ray Analysis (EDX)

EDX was employed to identify the elemental composition of biosynthesized iron oxide nanoparticles at the optimal conditions (Fig. 18). The spectrum shown that the sample contains of both Iron (Fe) and Oxygen (O) with different quantities. The weight percentages of Iron and Oxygen were 67.84% and 25.71% respectively. The spectrum also shows the presence of unimportant fraction of Chlorine which may be due to the mineral cell used. Similar results were stated in former works [93, 94].

Fig. 18
figure 18

EDX spectrum of Iron oxide NPs at the optimal conditions

4 Conclusion

In this paper, deign of experiments (DoE) was exploited to investigate the combined and individual effect of diverse biosynthesis parameters on the antibacterial activity of IONPs against-gram positive and gram-negative bacteria. The characterization results indicated the successful synthesis of IONPs using M. oleifera extract and their antibacterial activity was tested.

The findings have proven the validity of the generated quadratic model and its adequacy in predicting and fitting the experimental data, that makes it appropriate to study and optimize the antibacterial activity of IONPs. The analysis of variance indicated that the antibacterial activity of IONPs can be significantly affected by precursor concentration, reaction temperature and annealing temperature and their interactive effect. However, the precursor concentration (A) and the interaction between precursor concentration and reaction temperature (AB) has more significant effect on the antibacterial activity of IONPs against both gram positive and gram negative comparing to the other factors.

Optimal antibacterial activity was achieved exploiting the numerical optimization and the desirability function, setting the optimization goal to maximize the antibacterial activity of both gram-positive and gram-negative bacteria. As a result, the maximum antibacterial activity related to inhibition zones of 22.95 mm for E. coli and 20 mm for S. aureus respectively was achieved by setting all the biosynthesis parameters at their inferior levels, i.e., precursor concentration = 0.03 M, reaction temperature = 55 °C and annealing temperature 500 °C. The confirmatory run executed at the suggested optimal conditions exhibited a very close result to the expected value. The current study has proven the efficiency of response surface methodology as an efficient technique to study and optimize the antibacterial activity of nanomaterials.

Further future investigations may consider preforming more comprehensive study by involving more bacteria types and more parameters added to the ones studied in this work, which may permit generating more efficient and comprehensive mathematical model.