Micro-scale fiber-optic force sensor fabricated using direct laser writing and calibrated using machine learning

: Fiber-optic sensors have numerous existing and emerging applications spanning areas from industrial process monitoring to medical diagnosis. Two of the most common fiber sensors are based on the fabrication of Bragg gratings or Fabry-Perot etalons. While these techniques offer a large array of sensing targets, their utility can be limited by the difficulties involved in fabricating forward viewing probes (Bragg gratings) and in obtaining sufficient signal-to-noise ratios (Fabry-Perot systems). In this article we present a micro-scale fiber-optic force sensor produced using direct laser writing (DLW). The fabrication entails a single-step process that can be undertaken in a reliable and repeatable manner using a commercial DLW system. The sensor is made of a series of thin plates (i.e. Fabry-Perot etalons), which are supported by springs that compress under an applied force. At the proximal end of the fiber, the interferometric changes that are induced as the sensor is compressed are read out using reflectance spectroscopy, and the resulting spectral changes are calibrated with respect to applied force. This calibration is performed using either singular value decomposition (SVD) followed by linear regression or artificial neural networks. We describe the design and optimization of this device, with a particular focus on the data analysis required for calibration. Finally, we demonstrate proof-of-concept force sensing over the range 0-50 μ N, with a measurement error of approximately 1.5 μ N.


Introduction
Fiber-optic sensors offer a multitude of potential applications ranging from medical diagnosis to industrial process monitoring due to their small scale, versatility, and capability to provide remote detection. A wide variety of sensors has been reported to date with important examples including systems for remote spectroscopic measurements (e.g. diffuse reflectance [1,2], Raman [3,4] and (time-resolved) fluorescence spectrometers [2,5,6]), fiber-based chemical sensors (e.g. sol-gel sensors for measurements of pH or other ion concentrations [7,8]), and devices based on Bragg gratings [9,10] or distal Fabry-Perot etalons [11,12].
The Bragg grating and Fabry-Perot systems can provide measurements of a number of physical indices such as strain, pressure, refractive index and temperature [9][10][11][12], and can also be extended to further measurands through the incorporation of specific sensing fluids into the devices (e.g. magnetic field [13] and relative humidity [14]). In all cases the sensing is based on detection of interferometric changes caused by deformation or displacement of the grating/etalon or changes in the refractive index of the surrounding medium (or the sensing fluid). While Bragg grating and Fabry-Perot based fiber sensors have been widely reported and, in some cases, used commercially, they still have drawbacks. In the case of Bragg gratings, it is difficult to develop forward viewing probes while Fabry-Perot systems typically suffer from low signal-to-noise ratios (SNRs) and have non-trivial fabrication protocols. As such, alternative or complementary methods for the fabrication of environmental sensors of the sort described above (i.e. displacement, strain, pressure, force, temperature sensors) would be advantageous.
Two-photon polymerization, or direct laser writing (DLW), is a micro-scale 3D printing technique that has been developed and commercialized over the past 10-20 years [15,16]. It allows the fabrication of sub-mm 3D structures with feature sizes as small as 150 nm using a single-step protocol [15,16]. The polymer material fabricated using DLW is optically transparent with a refractive index close to that of glass. Thus, DLW has been widely applied to the production of micro-optical components such as photonic crystal structures [17], microlens arrays [18], diffraction gratings [19] and photonic wire bonds [20,21].
Despite its capability to fabricate advanced, micro-scale optical components, relatively few fiber-optic devices have been developed using DLW. A fiber-tip anti-reflection coating was reported by Kowalczyk et al [22] and an optimized method for the fabrication of distal micro-lenses was presented by Zukauskas et al [23]. More advanced fiber-tip lens assemblies have been produced on fiber bundles, with the resulting devices used to demonstrate endoscopic imaging [24]. Wang et al have also reported an optical fiber microphone -for the detection of ultrasonic pressure waves -that is based on a DLW-fabricated resonant grating waveguide [25]. In addition, a distal fiber assembly for surface enhanced Raman spectroscopy (SERS) has been presented, which provided both optical focusing for improved light collection and a nanostructured surface for Raman signal enhancement [26]. This device represented one of the more advanced fiber sensors produced using DLW, however, it required a multi-step fabrication procedure involving DLW combined with multiple metal deposition steps. Finally, we recently presented a micro-scale robotic gripper printed at the tip of a single mode optical fiber using DLW that contained an integrated interferometric force sensor [27].
In this article we report a similar 'sensor-only' device that permits remote, real-time force sensing. The sensor consists of multiple Fabry-Perot etalons suspended above the distal face of the fiber via attachment to a series of springs. The entire device is under 130 μm in each dimension and is printed using DLW in a single-step procedure. Compression of the sensor brings the Fabry-Perot etalons closer together and effects changes in the reflected light spectrum. We read out these changes using a spectrometer and calibrate them with respect to applied force using a commercial micro-electro-mechanical systems (MEMS) force sensor. We describe the design, fabrication and testing of this sensor, and present proof-of-concept results demonstrating real-time, remote force sensing with a 250 μm diameter fiber-optic device (125 μm diameter cladding, 250 μm diameter outer jacket). This system has potential applications in both remote industrial monitoring (e.g. flow rate monitoring) and in biomedical investigations (e.g. in vivo elastography of cells or tissues). In addition, the design can be adapted to provide measurements of other factors such as pressure, which illustrates the potential of DLW for the fabrication of a wide range of advanced fiber-optic sensors.

Sensor design
The optical force sensor (shown in Fig. 1(a-c)) consists of three 1.5 μm thick polymer plates suspended above the output face of a single mode optical fiber (SM800-5.6-125, Thorlabs, Inc., USA) via attachment to four springs, with a plate-plate separation of 13 μm. Above the 1.5 μm plates there is a thicker (~10 μm) fourth plate, which is also attached to the four springs and serves as a pad onto which forces can be applied without damaging the sensor. As an object comes into contact with the upper pad and exerts a force, the springs compress and bring the polymer plates closer together, and it is this effect that underpins the force (or compression) sensing capability. The white, blue and red arrowheads respectively indicate the polymer plates that act as Fabry-Perot etalons for compression/force sensing, the springs that support the sensing plates, and the upper pad onto which forces are applied. Scale bar 25 μm. (d) Optical setup used for sensor readout. SLsupercontinuum laser; ND -variable neutral density filter; BS -50/50 beam splitter; Ppolarizer; WP -quarter waveplate; L1 -10x microscope objective; L2 -lens (f = 20 mm); Sspectrometer; SMF -single mode fiber with force sensor fabricated at distal tip.
As the sensor is printed on the tip of an optical fiber, it can be addressed optically by coupling white light illumination into the optical fiber. At the distal output, this illumination is partially reflected and partially transmitted by each of the polymer plates (i.e. each plate acts as a Fabry-Perot etalon), with the reflected light collected by the optical fiber. The multiple reflections lead to interference effects in the reflected light as the rays returning from each of the faces of the three polymer plates have different optical path lengths. These interference effects are functions of both wavelength and the distances between the sensing plates (which vary as the sensor is compressed). Thus, by directing the collected reflected light onto a proximal spectrometer it is possible to read out changes in the compression of the sensor by monitoring changes in the reflected light spectrum. These changes can be calibrated as a function of force to provide subsequent real-time force sensing.
Plate thicknesses of 1.5 μm and separations of 13 μm were chosen to provide interference effects at visible wavelengths, while ensuring that the structure of the sensor was stable and robust (it is possible to fabricate thinner plates but these naturally become more fragile). A total of three sensing plates were used as this provided sufficient SNR and contrast between the peaks and troughs in the reflected light spectra (larger numbers of plates will provide both improved SNR and improved contrast), but also allowed a small sensor footprint (50 μm x 130 μm x 130 μm) to be maintained.

Sensor fabrication
The sensor was fabricated on the tip of a 30 cm length of optical fiber using a commercial DLW system (Photonic Professional GT, Nanoscribe GmbH, Germany). The fiber had first been cleaved at both ends using a manual cleaving tool (Swift CI-02 Cleaver, Opticus, UK) to ensure a flat surface for printing. A drop of IP-Dip photoresist (Nanoscribe GmbH, Germany) was placed on a coverslip mounted in the DLW microscope chamber. The tip of the optical fiber was then clamped in position within the drop of resist using a 3D printed mount, which acted to fix the fiber in the center of the microscope's field of view at a height of approximately 100 μm above the coverslip. The center of the fiber was located manually and DLW was then undertaken in a downward direction using the so-called 'dip-in' configuration, with fabrication beginning at the face of the fiber.
The sensor was designed using Solidworks (Solidworks Corporation, USA) with the resulting file converted into a format readable by the DLW system using Describe software (Nanoscribe GmbH, Germany).
After the printing process was complete, the fiber was removed from the microscope chamber and placed in a bath of developer solution (Propylene glycol monomethyl ether acetate (PGMEA), Sigma-Aldrich Ltd., UK) for 30 min to dissolve any remaining photoresist. Finally, the fiber-optic sensor was rinsed in isopropyl alcohol (IPA) and left to dry for 30 minutes.
Following fabrication of the sensor, the proximal (non-sensing) end of the 30 cm fiber was spliced to a longer length of fiber (approx. 1 m) using a fusion splicer (Arc Master FSM-100P, Fujikura Europe Ltd., UK). This final step was performed in order to permit simple testing of the force sensor and because it was problematic to place longer sections of fiber within the DLW chamber.

Optical setup for sensor readout
In order to address the fiber-optic force sensor, broadband light from a supercontinuum light source (Fianium SC400, NKT Photonics A/S, Denmark) was coupled into the single mode fiber and the light reflected by the sensor was collected by the fiber and delivered to a spectrometer (FLAME-VIS-NIR, Ocean Optics, The Netherlands). Prior to fiber coupling, the collimated output from the supercontinuum source was directed through a variable neutral density (ND) filter to allow control of the optical power and then through an assembly consisting of a linear polarizer and a λ/4 plate (with the fast axis of the λ/4 plate oriented at 45° to the linear polarizer). A 10x microscope objective was used to focus light into the fiber. The returning light followed the same beam path as the input light but was directed onto the input slit of the spectrometer using a 50/50 beamsplitter and focusing lens (focal length, f = 20 mm). The optical setup is depicted in Fig. 1(d).
The polarizer-waveplate combination was used to ensure that light reflected from the proximal face of the single mode fiber did not reach the detector, as this acted to reduce the dynamic range of the peaks and troughs (i.e. the interference fringes) in the detected spectra (which were used to provide the force measurement). With the fast axis of the λ/4 plate oriented at 45° to the polarizer, this assembly acted to convert the unpolarized light from the supercontinuum laser into circularly polarized light. Light reflected from the input face of the optical fiber was then also circularly polarized but with the opposite handedness, meaning that after the second pass through the λ/4 plate the light was linearly polarized perpendicular to the plane of the polarizer. The polarization of this directly reflected light had effectively been rotated by 90° and was, hence, blocked by the polarizer. The light that was coupled into the optical fiber and delivered to the sensor returned to the proximal end with a random polarization (as the fiber used was not polarization maintaining). Therefore, approximately 50% of the light from the sensor reached the detector while light reflected from the input face of the fiber (i.e. background light) was strongly suppressed. This background suppression was required as the intensity of the light reflected from the proximal face of the fiber was many times more intense than the signal from the sensor. Although the background suppression was not perfect (due to the wide wavelength range used), it was sufficient to allow collection of spectra with a suitable SNR for force sensing. We also note that the randomization of the polarization that was induced by transmission through the fiber meant that the specular reflections from each surface in the sensor (i.e. the top and bottom surfaces of the sensing plates and the surfaces of the upper pad) were able to pass the waveplate-polarizer assembly and reach the detector. Furthermore, diffuse reflections from the sensor were minimal due to the semi-transparent nature of the polymer plates (i.e. the plates behaved in a similar manner to thin sheets of glass). Taken together, this meant that the signal reaching the detector was predominantly the specular reflections from the sensing plates (which provided the force/compression-sensitive signal) and had a high enough SNR to allow real-time measurements.

Force calibration
The spectra detected by the spectrometer changed in response to compression of the optical sensor. Furthermore, the spectra recorded with different sensors varied (even for sensors with identical designs) due to inherent variations in the fabrication procedure. Thus, to use the system as a force sensor it was first necessary to calibrate each individual sensor with respect to applied force. To achieve this, the sensing tip of the fiber was mounted on a commercial micromanipulator (miBot, Imina Technologies SA, Switzerland) and was then positioned under an optical microscope (Axio Zoom, Carl Zeiss Microscopy GmbH, Germany) and imaged using 168x magnification. A MEMS force sensor (FT-S1000, FemtoTools AG, Switzerland) was also positioned under the microscope using a second micromanipulator and was used to compress the optical sensor while making measurements of the applied force. The fiber-optic sensor was compressed up to a force of between 10 and 50 μN in 1 μN steps, and was then released in the same stepwise manner. Both spectra and MEMS force readings were recorded at each step with approximately 100 spectra/force pairs collected for each compression-decompression cycle. The acquisition time used for the collection of reflectance spectra was 50 ms. Multiple data sets were collected and these were used to calibrate and then to test the force sensor in either a leave-one-out protocol or in a train-test protocol in which the trained system was tested on entirely unseen data.

Data analysis
It was observed that the reflected light spectra varied as a function of the compression of the sensor and, hence, as a function of the applied force. However, the spectral changes were complex, with many peaks and troughs altering both their wavelengths and relative intensities as the compression status changed. While it is theoretically possible to design the sensor such that the optical signal provides a simple readout of compression/force (e.g. a single reflected peak that changes its wavelength in response to applied compression/force), the limitations of the fabrication procedure meant that this was challenging at the chosen wavelength range. In addition, because the printing protocol was not 100% repeatable (i.e. small misalignments, fluctuations in laser power, etc. led to variations between devices), it was not practical to produce an analytical expression to convert measured spectra into force values (as this analytical expression would have been different for each sensor). Therefore, we instead chose to use two separate machine learning protocols to convert the complex spectra into force measurements. The first approach entailed the use of singular value decomposition (SVD) and linear regression while the second involved training an artificial neural network. Both methods -which are described in detail below -provided a means by which individual sensors could be calibrated (i.e. the relationship between applied force and detected spectra could be obtained) in an automated and repeatable manner.

Singular value decomposition and linear regression
To relate the spectral changes to the applied force, we used SVD to break the spectra down into a number of base spectral components [28]. The spectra for all applied forces were first cropped to only include the wavelength range over which significant signal and a dynamic force response were observed (500-840 nm). The spectra were then collated into a matrix, M, where each row represented an applied force value and each column represented a wavelength band. Software written in Matlab (MathWorks) was then used to decompose this matrix into a series of constituent spectral components according to where the variable tr represents the point at which the data is truncated -i.e. if tr = 5 then only the first 5 loadings, scores and singular values are included in the calculation of the approximated matrix M . This truncation acts to reduce the dimensionality of the spectral data and, hence, allows it to be processed in order to calculate force values in real time (the use of fewer spectral components implies simpler processing). It is possible to choose a truncation by plotting Σ on a log scale and observing the point at which the contributions of subsequent loadings become insignificant. However, in this case we attempted the spectral force prediction using a range of truncations and then chose the optimum value, which was defined as the point at which increasing the truncation provided only negligible improvements in the force prediction accuracy (based on a qualitative visual examination of the data).
Having performed SVD on the spectra, we mapped the scores (U) onto the known force values for each spectrum using linear regression. This involved fitting the data to a multivariate relationship so that, for the i th spectrum, the force, F, was given by: Here, the values x 1-tr act as effective gradients for the corresponding U values, and c represents a constant. The linear least-squares fitting required to obtain the x and c values was performed using the inherent regression functions in Matlab. Once x and c had been determined, Eq. (3) could be used to calculate the force based on an unknown spectrum. To test the force prediction, we plotted the calculated force against the known applied force (measured using the MEMS sensor). This was first performed in a leaveone-out approach. For a single data set (i.e. one compression-decompression cycle comprising circa 100 force/spectra pairs), SVD was applied to all spectra. All but one spectrum were then used in the linear regression to obtain the force prediction equation -i.e. Equation (3). This equation was then tested by calculating the force for the one remaining spectrum. The regression step in the analysis was then repeated leaving out the next spectrum to yield a second equation, which was again tested on the left-out spectrum. This process was repeated until all spectra had been left out and each equation tested. The leave-one-out analysis was repeated for truncations ranging from 1 to 20 in order to determine the optimum value.
The above protocol has the drawback that it assumes that there is no variation between different compression-decompression cycles. Thus, to test the force prediction in a more robust manner we also used a second experimental approach that entailed determining the constants of Eq. (3) using a training data set (which comprised multiple compressiondecompression cycles) and then testing the equation on an entirely separate, unseen test data set (i.e. a subsequent compression-decompression cycle). In this case, SVD and linear regression were performed on all spectra in the training set to ascertain the force prediction equation, as described above. For each individual spectrum in the unseen test data set, we then first needed to calculate the scores of each spectral component. This was achieved not by using SVD (as performing SVD using even a slightly different spectral matrix would yield different spectral loadings) but by using linear regression. Thus, the values of V and Σ were fixed to those obtained from SVD on the training data set, and the inherent Matlab regression function was used to fit the scores of each test spectrum. The fitted scores were used as inputs for the force prediction equation and we then plotted the resulting values against the ground truth from the MEMS sensor to demonstrate the reliability of the force sensing in this 'traintest' approach. We note that this second protocol represents a realistic method for real-time force measurements, as the processing requirements for linear regression are much lower than those for SVD.

Neural networks
To investigate whether the reliability of the force sensing could be improved through the use of alternative analysis procedures, we also explored neural networks as a method of force determination. In this case, a calibration data set comprising five or more compressiondecompression cycles was used to train a neural network to convert 2D spectral data into force readings. This was achieved using Matlab software written in-house that incorporated the inherent functions of the Neural Network Toolbox. For a given calibration data set, the trained network was tested both by re-using the calibration data as an input and by using an unseen data set as an input. We optimized the training parameters -including the method of training, the number of hidden neurons, the maximum number of training epochs and the number of validation tests -by visually examining the force prediction results and found that optimal performance was obtained when using the scaled conjugate gradient method ('trainscg' function in Matlab) to train networks with 15 hidden neurons. In addition, using 150 validation checks and a maximum of 5000 training epochs allowed successful training to be achieved in a reliable manner with acceptable timescales (i.e. under 1-2 minutes). As for the SVD analysis, the spectra were cropped to a wavelength range of 500-840 nm, as this range contained the important spectral information and provided improved force sensing relative to the use of the entire spectra (which spanned 340-1025 nm). The results of the neural network analysis were compared to those from the SVD-regression approach.

Spectral compression sensing
We first confirmed that the fiber-optic sensor was sensitive to compression (and, hence, force) by positioning it under a microscope and measuring spectra while the sensor was compressed using the MEMS force sensor (which was controlled by a robotic micromanipulator). As the optical force sensor was compressed (Fig. 2(a&b)), the positions and relative intensities of the spectral peaks changed in a continuous manner (Visualization 1), with clear differences observable between the spectra recorded in the compressed and uncompressed states (Fig. 2(c)). The spectral peaks appeared to translate in one direction (with respect to wavelength) during compression (whilst their intensities also changed) and then in the reverse direction during decompression (Visualization 1).
We confirmed that the fiber-optic device did not act as a proximity sensor by measuring spectra as it approached the MEMS tool. No spectral changes were observed as the distance between the optical and MEMS force sensors was altered. It is also important to note that the spectral/interferometric method of force/compression sensing provided much higher sensitivity than was achievable using optical imaging. As indicated by the red dotted lines in Fig. 2(a&b), the compression of the optical sensor corresponded to a change in length of only a few pixels when imaging with 168x magnification. Thus, only a small number of discrete compression states could be detected using optical imaging, while a large number of distinct spectra (≥ 50) were recorded over the same range.

Force sensing based on singular value decomposition and linear regression
To convert the recorded spectra into force measurements it was necessary to calibrate the optical sensor. To this end, we recorded a calibration data set consisting of a series of reflectance spectra for a range of known applied forces (which were measured using the MEMS force sensor). An example calibration data set is shown in Fig. 3(a). As discussed above, the spectral signature varied in a continuous manner as the applied force changed.
In order to investigate whether the changing spectral signature could be used to read out force, we broke the data set down into a series of base spectral components (loadings) using SVD and plotted the relative contributions of the spectral components (scores) as functions of the applied force. The relative contribution vs. force plots for the second and third spectral components are shown in Fig. 3(b&c). It is apparent that there is a clear but complex relationship between the relative contributions of the spectral components and the applied force. In addition, we note that there is a small discrepancy between the scores recorded during compression and decompression. This lag effect was caused by the imperfect elasticity of the sensor, which meant that there was a small time delay in the recovery of the system to its initial state. Nonetheless, this time lag was not found to have a detrimental impact on the force sensing capabilities.
Due to the complexity of the data, we used linear regression to determine the relationship between the scores of the spectral loadings and the applied force. Having determined the relationship, we could then apply it to individual unseen spectra in order to calculate the force. We first performed this test using a leave-one-out protocol and plotted the predicted force for each unseen spectrum as a function of the applied force measured using the MEMS sensor (Fig. 3(d)). The force measured using the optical force sensor was found to be in excellent agreement with the ground truth values provided by the MEMS device, with an average error (for the data set shown in Fig. 3) of 1.08 μN. Fig. 3. Fiber-optic force sensing using SVD and linear regression in a leave-one-out protocol. (a) 2D array of spectra -acquired over a range of known applied forces -that is used as a calibration data set for the optical force sensor. The blue and yellow arrows indicate the areas of the array in which the force, F, is increasing and decreasing respectively. The spectrum for the maximum applied force occurs at the center of the graph. (b&c) Relative contributions (scores) of the second (b) and third (c) base spectral components (loadings) extracted using SVD as functions of the applied force. (d) Graph showing the force calculated using the SVDregression algorithm (using a leave-one-out protocol) against the ground truth force values measured using the commercial MEMS force sensor.
In Fig. 3, the optical force sensing was based on the scores of the first 15 loadings obtained from the SVD. We chose to truncate the data after the 15th spectral component in this way as this provided reliable force measurements while also minimizing the data used and, hence, the processing required. We tested a range of truncations to determine the point at which using additional spectral components ceased to improve the accuracy of the force measurements (Fig. 4). It is clear from the data shown in Fig. 4 that greater numbers of spectral components provided more accurate force measurements. However, this ceased to be the case above approximately 15 components. Therefore, we chose to truncate the data at this point and all subsequent measurements were made using the scores of the first 15 loadings only.
Of course, in any application of the optical force sensor it will not be possible to analyze the data in a leave-one-out manner as described above. Instead, the sensor will need to be calibrated prior to use and, ideally, subsequent measurements will then be made in real time. For this reason, we also devised a calibration protocol suitable for real-time use. The relationship between the spectral loadings and the applied force was determined using SVD and linear regression on a training data set, in an identical manner to that described above. To apply the regression equation to an unseen spectrum -for which SVD had not been performed -we then first estimated the scores of the spectral components for the unseen spectrum using a second linear regression step (see section 2.5.1 for details). The fitted scores were then used as inputs for the force prediction equation (i.e. Equation (3)). Importantly, the numerical processing required for this method of force calculation could be undertaken in real time. Fig. 4. Effect of SVD truncation on force prediction accuracy. Graphs show the force predicted using the SVD-regression algorithm (in a leave-one-out-protocol) as a function of the known applied force for a range of SVD truncations. For panels (a) to (f), the force prediction algorithm was generated using the relative contributions of the first 3, 5, 8, 10, 15 and 20 SVD spectral components respectively. Only negligible improvements were observed in the force prediction accuracy above a truncation of 15 (e).
To test this approach, we generated a force prediction equation based on between 5 and 10 calibration data sets (i.e. 5-10 compression-decompression cycles) and applied it to a separate test data set. To permit comparison to the leave-one-out method, we also generated and tested a force prediction equation using only the test data set. In this case, the algorithm was generated and tested in a leave-one-out protocol, but the scores of each test spectrum were fitted using linear regression rather than being calculated using SVD (as was the case for the leave-one-out results presented earlier). The results of this experiment, for two separate optical force sensors, are shown in Fig. 5. Fig. 5. Force prediction with the SVD-regression algorithm using separate training and test data sets for two example sensors. (a) Predicted force vs. applied force for the first sensor using separate training and test data sets. An algorithm was generated using a large training set and then tested on an unseen data set. (b) Predicted force vs. applied force for the data shown in (a) calculated using a leave-one-out protocol. In panel (b), the relative contributions for each 'left out' spectrum were fitted using linear regression (rather than being directly calculated using SVD) in order to allow a fair comparison to the train-test approach. (c&d) Predicted force vs. applied force graphs for a second sensor generated using the train-test approach (c) and the leave-one-out protocol with regression-based fitting of the relative contributions (d).
In many cases the train-test approach provided force measurements that were in agreement with the ground truth values, as shown in the example data set presented in Fig.  5(a). In addition, the performance was similar to that provided by the leave-one-out analysis approach (Fig. 5(b)). However, for some sensors the force sensing broke down above certain applied force thresholds (Fig. 5(c)) and this problem was not completely resolved even when increasing the SVD truncation value. Interestingly, this failure in the force sensing was not reproduced in the leave-one-out data (Fig. 5(d)), where good performance was obtained for all sensors and all data sets. Furthermore, we confirmed that significant errors were not introduced by the regression-based fitting of the spectral component scores, as this approach (applied in a leave-one-out protocol) was also compared to the method in which the relative contributions were obtained directly from SVD (i.e. the protocol used in Fig. 3 and Fig. 4). In all cases, we observed excellent force prediction performance using regression-based fitting of the relative contributions as well as excellent agreement with the results obtained using the direct SVD protocol (results from the direct SVD analysis are presented in Fig. 6). This indicates that the poor performance seen in Fig. 5(c) is caused by differences between the training and test data sets that are not resolved or detected by the force prediction algorithm. Thus, it should be possible to improve on these inaccuracies either by using photoresists that provide improved elasticity (so that the differences between the training and test data sets are reduced) or by using alternative training algorithms that can more accurately account for the variations across data sets. Fig. 6. Predicted force vs. applied force graphs generated using a leave-one-out protocol with direct SVD calculation of the relative contributions. (a) Leave-one-out SVD force prediction based on the data presented in Fig. 5(a&b). (b) Leave-one-out SVD force prediction based on the data presented in Fig. 5(c&d). Note that when using a leave-one-out protocol, the regression-based fitting of the relative contributions of the spectral components (shown in Fig.  5(b&d)) provides near identical results to those obtained with direct SVD calculation of the relative contributions (shown in this Fig.). Importantly, this is true both in the case where we observe good force prediction using a train-test protocol ((a); Fig. 5(a&b)) and in the case that the train-test approach provides poor performance ((b); Fig. 5(c&d)). This demonstrates that the errors observed when using separate training and test data are not a result of the regressionbased fitting of the relative contributions.

Force sensing using neural networks
We investigated whether alternative calibration algorithms could improve the accuracy of the force sensing by training an artificial neural network to convert detected spectra into force measurements. As above, the training/calibration data set consisted of between 5 and 10 compression-decompression cycles and entailed a 2D array of reflectance spectra and a 1D array of force readings. After training, we then tested the neural network on unseen data. In order to provide a direct comparison to the SVD 'train-test' approach, we applied the neural network method to identical data (i.e. the data presented in Fig. 5 and Fig. 6). Importantly, we also confirmed that the optimized networks provided consistent force prediction results over several repeated training regimes (data not shown).
We found that neural networks (trained using the scaled conjugate gradient method with the training parameters described in section 2.5.2) were able to provide reliable force prediction for all data sets, even in scenarios where the SVD-regression approach failed. Figure 7 shows the force prediction results obtained when neural networks were applied to data for which we obtained good ( Fig. 7(a)) and poor ( Fig. 7(b)) force prediction performance using SVD. In both cases the optical force measurements are in good agreement with the ground truth. Interestingly, however, the spread in the data was typically larger than that obtained when using SVD (in the case of good SVD performance). For example, the average force measurement error for the data shown in Fig. 7(a) is 2.19 μN, which compares to an error of 1.47 μN when applying the SVD train-test approach to the same datatset ( Fig. 5(a)). We note that commercial MEMS-based force sensors are available that provide better measurement resolutions than those reported here. For example, the FemtoTools sensor used for calibration provided a resolution of 0.136 μN under the chosen conditions (measurement frequency: 200 Hz; measurement range: −1000 μN < F < + 1000 μN) and similar devices are available that offer even lower resolutions when operated at lower frequencies and over a smaller range of forces (e.g. the FemtoTools FT-S100 sensor provides a resolution of 0.005 μN when operated over the range −100 μN < F < + 100 μN at a frequency of 10 Hz). It is important to note, however, that the fiber-optic sensor presented here is smaller and more versatile (due to both the customizable nature of the fabrication process and the physical flexibility of the fiber) than any currently available MEMS device. In addition, the force measurement accuracies reported above are in fact limited by the minimum step size used in the calibration procedure, which was determined by the micromanipulators used in the experiments. Hence, these do not represent inherent limitations of the sensor (i.e. if smaller calibration steps are used then improved accuracies should be attainable). Thus, all of the above implies that it will be feasible to further improve the accuracy of the optical force sensor. As discussed above, this could be achieved by developing and using photoresists with improved elastic properties to reduce variations between data sets and/or by testing and deploying alternative analysis/calibration protocols. Our future work will involve the investigation of both approaches. Fig. 7. Neural network force prediction (using separate training and test data). Graphs show the force calculated using a trained artificial neural network as a function of the known applied force for: (a) the data shown in Fig. 5(a&b); (b) the data shown in Fig. 5(c&d). In both cases the trained networks have been applied to entirely unseen test data.

Conclusions
We have presented a micro-scale (50 μm x 130 μm x 130 μm) optical force sensor that was fabricated on the tip of an optical fiber using DLW. The force sensing capability is based on the use of reflectance spectroscopy to readout interferometric changes induced as the force sensor is compressed. To extract force measurements from the complex spectral data, we used both SVD-regression analysis and artificial neural networks, obtaining reliable and accurate force prediction in both cases. In some scenarios we observed errors in the optical force prediction, and the most serious of these discrepancies were attributed to differences between the calibration and test data that were not sufficiently detected or accounted for in the training algorithm. Thus, future work will involve investigating the use of alternative photoresists or analysis procedures that can mitigate these problems.
Overall, this work demonstrates the feasibility of the use of DLW for the fabrication of micro-scale dynamic structures for fiber-based sensing. Importantly, this involves a simple and repeatable fabrication protocol that allows for the production of forward viewing probes. In the future, we expect that devices similar to the one presented in this article (as well as others produced using DLW-based methods) will become useful for a wide range of remote sensing applications including, for example, flow rate monitoring and in vivo elastography.