Flexible Insole Sensors with Stably Connected Electrodes for Gait Phase Detection

Gait analysis is an important assessment tool for analyzing vital signals collected from individuals and for providing physical information of the human body, and it is emerging in a diverse range of application scenarios, such as disease diagnosis, fall prevention, rehabilitation, and human–robot interaction. Herein, a kind of surface processed conductive rubber was designed and investigated to develop a pressure-sensitive insole to monitor planar pressure in a real-time manner. Due to a novel surface processing method, the pressure sensor was characterized by stable contact resistance, simple manufacturing, and high mechanical durability. In the experiments, it was demonstrated that the developed pressure sensors were easily assembled with the inkjet-printed electrodes and a flexible substrate as a pressure-sensitive insole while maintaining good sensing performance. Moreover, resistive signals were wirelessly transmitted to computers in real time. By analyzing sampled resistive data combined with the gait information monitored by a visual-based reference system based on machine learning method (k-Nearest Neighbor algorithm), the corresponding relationship between plantar pressure distribution and lower limb joint angles was obtained. Finally, the experimental validation of the ability to accurately divide gait into several phases was conducted, illustrating the potential application of the developed device in healthcare and robotics.


Introduction
Gait monitoring is able to diagnosis certain diseases by analyzing human gait patterns, especially for chronic diseases threatening the elderly in the aging society [1,2]. Fall prevention for disabled and older people is another essential application of gait monitoring [3]. Moreover, gait monitoring plays an important role in athletic training to help athletes improve their performance [4,5] and in the gait design and control of bipedal humanoid robots [6,7]. In addition, gait phase is broadly investigated in the field of wearable exoskeleton robots [8,9], because only when the rotation movement of the exoskeleton's joints changes reasonably with the human gait can it provide favorable walking assistance and comfort for the wearer [10]. for pressure sensing [25]. Piezoresistive conductive rubber is a kind of promising flexible material to be complementary to FSRs since, during the fabrication process, it can be reinforced to reduce creep by adding carbon nanotubes [26] or by changing the electrode configuration of the integrated sensor [27]. Some researchers have demonstrated that conductive rubber has a long lifetime [28] and low production cost [29]. Generally, the traditional conductive rubber sensors are usually connected with electrodes by using silver conductive paste or polymer adhesive, which can effectively reduce the impact of contact resistance. However, this connection mode easily falls off due to fatigue, especially when it is used for an insole sensor for long-term and high-load monitoring. Saito et al. [30] used conductive rubber to make a pressure-sensitive insole directly in contact with electrodes, but the resistance data fluctuated during static calibration.
In terms of lightweight algorithms of machine learning methods for wearable applications, Krause et al. [31] deployed machine leaning methods based on Kohonen Self-Organizing Maps (KSOMs) and k-Means clustering on a mobile phone to realize a classifier to identify user states and to automatically modify algorithms' settings based on experience. LeMoyne et al. [32] utilized the multilayer perceptron neural network as a machine learning platform to classify gait patterns based on data from wearable inertial sensors. However, the data of the above methods were post-processed in additional computer or cloud computing resources. To reduce the network and privacy cost of sending data to the cloud and to make machine-learning algorithms scalable, Rawassizadeh et al. [33] presented lightweight algorithms to identify daily human behavioral patterns on small wearable devices. All these efforts illustrate the feasibility to leverage machine learning methods to recognize physical activity based on wearable devices. In this work, machine-learning classification, as a popular method, was used to validate the feasibility of developed flexible insole sensors for gait phase detection.

Structure Design
In this paper, we developed a kind of flexible pressure sensor for planar pressure detection by using multi-wall carbon nanotubes (MWCNTs) and Polydimethylsiloxane (PDMS). MWCNTs were chosen due to their electrical conductivity [34]. PDMS was chosen because it has good flexibility and the stiffness of PDMS can be adjusted by changing the hardening agent to PDMS base ratio [35], which is suitable for personalized products of users of different weights. An interdigital electrodes array was printed on the polyimide (PI) substrate, as shown in Figure 1a,b. Figure 1c presents the multi-layers of one sensing unit. From top to bottom, they are adhesive material layer (to fix the sensing unit on the flexible circuit), MWCNTs/PDMS pressure-sensitive layer (where the resistance is sensitive to applied pressure), interdigital electrodes [which are made of silver nanoparticles (AgNPs) printed by an inkjet printer], and PI substrate (as the carrier of flexible circuits and sensitive units). Here, we did not use any conductive adhesive material (such as conductive silver adhesive and conductive polymer) [36,37] but directly mounted the sensing unit on the surface of the electrode through the adhesive material layer (tape) and realized electrical connection through direct contact. The sensing mechanism can be described in the following statements. When a load pressure is applied on the top surface of the sensor, the PDMS layer deforms, and MWCNTs uniformly dispersed inside PDMS gradually close to each other. Then, the number of connected conductive paths between carbon nanotubes increase, and thus the resistance of the sensing unit declines. The sensor thus functions as a force-to-resistance transducer. The cylindrical sensing unit has a diameter of 1 cm and a height of 1 mm. As shown in Figure 1d, the resistance was detected by using a digital multimeter (DMM, Keysight Truevolt 34461A, Keysight Technologies, Shanghai, China), and the external force was applied by a testing system (ZQ-990B, Zhiqu Precision Instrument Co., Ltd., Dongguan, China). The comparison between the proposed design and the state-of-the-art design is summarized in Table 1.   [38] Inertial sensors Ding et al.
The inertial measurement unit was attached onto the anterior surface of a shoe and measured the three-axis angular velocity and the acceleration of the foot [10] Electromyograp hy (EMG) sensors Joshi et al.
The reflective markers were attached on limbs to detect the EMG signal [15] Multi-axis force sensors Lind et al.
Unique multi-axis foot force/torque sensors were integrated into a military style boot to measure the forces on the human foot [39] Conductive rubbers Saito et al.
The flexible conductive rubber sensors were fixed to the insole with traditional circuit for electrical connection [30] Our work Conductive rubber sensors processed by laser cutting were fixed on flexible insoles.

Fabrication
The fabrication process of the pressure-sensitive layer is shown in Figure 2. In order to obtain a sensitive conductive layer, firstly, we mixed MWCNTs (MK1858, Nanjing Muke Nano Technology Co., Ltd., Nanjing, China), PDMS prepolymer (Sylgard 184, Wuxi Changxu Technology Co., Ltd., Wuxi, China), and N-Hexane (Aladdin reagent Shanghai Co., Ltd., Shanghai, China) at a mass ratio of 20:40:1. Then, the mixed solution was stirred at 1200 RPM for 10 min to obtain a uniform mixture by using magnetic stirrer (98-1, Shanghai Sile Instrument Co., Ltd., Shanghai, China). After evenly dispersing MWCNTs in the mixture, we added a 10 wt% curing agent (in PDMS ratio) followed by magnetic stirring for 10 min. Secondly, to cure the mixture, it was placed in a vacuum oven (Bangxi  Our work Conductive rubber sensors processed by laser cutting were fixed on flexible insoles.

Fabrication
The fabrication process of the pressure-sensitive layer is shown in Figure 2. In order to obtain a sensitive conductive layer, firstly, we mixed MWCNTs (MK1858, Nanjing Muke Nano Technology Co., Ltd., Nanjing, China), PDMS prepolymer (Sylgard 184, Wuxi Changxu Technology Co., Ltd., Wuxi, China), and N-Hexane (Aladdin reagent Shanghai Co., Ltd., Shanghai, China) at a mass ratio of 20:40:1. Then, the mixed solution was stirred at 1200 RPM for 10 min to obtain a uniform mixture by using magnetic stirrer (98-1, Shanghai Sile Instrument Co., Ltd., Shanghai, China). After evenly dispersing MWCNTs in the mixture, we added a 10 wt% curing agent (in PDMS ratio) followed by magnetic stirring for 10 min. Secondly, to cure the mixture, it was placed in a vacuum oven (Bangxi Instruments Technology Co., Ltd., Shanghai, China) and heated at 50 • C for 24 h. After the curing process, we used the laser cutting machine (FD-300, Shanghai Fengying Computer Technology Development Co., Ltd., Shanghai, China) to modify the surface of the mixture at 50% of energy (in the total energy of 30 watts) and 5% of cutting speed. Finally, the shapes of pressure-sensitive units could be cut by punchers or laser cutting machine. When packaging the sensing unit, the inkjet printer (Functional nanomaterial deposition system, Shanghai Ruidu Photoelectric Technology Co., Ltd., Shanghai, China) was used to print interdigital electrodes on a PI substrate, and the number of repeated printing cycles was set to three times. Then, the sensing unit was directly placed above the inkjet-printed interdigital electrodes, the up layer of which was packaged by tape. Instruments Technology Co., Ltd., Shanghai, China) and heated at 50 °C for 24 h. After the curing process, we used the laser cutting machine (FD-300, Shanghai Fengying Computer Technology Development Co., Ltd., Shanghai, China) to modify the surface of the mixture at 50% of energy (in the total energy of 30 watts) and 5% of cutting speed. Finally, the shapes of pressure-sensitive units could be cut by punchers or laser cutting machine. When packaging the sensing unit, the inkjet printer (Functional nanomaterial deposition system, Shanghai Ruidu Photoelectric Technology Co., Ltd., Shanghai, China) was used to print interdigital electrodes on a PI substrate, and the number of repeated printing cycles was set to three times. Then, the sensing unit was directly placed above the inkjet-printed interdigital electrodes, the up layer of which was packaged by tape.

Sensing Unit Stabilizing
In the fabrication process, the surface of the sensing unit was modified by a laser processing method. Before laser processing, the surface of the sensing unit was condensed with a large amount of PDMS due to gravity during the curing period. During the laser treatment, the PDMS on the surface of the sensing unit was ablated, and the surface of the sensor was covered with MWCNTs so that the sensing unit resistance significantly dropped and became stable. The resistance was detected by using the interdigital electrodes array. The test results are shown in Figure 3, in which the sample was loaded with a cyclic force ranged from 0 N to 5 N with a time interval of 30 s. It can be seen that the surface resistance had adverse impacts on the resistance in two aspects: the mean of resistance value and the fluctuation of resistance variation. In Figure 3a,d, Rmax represents the maximum resistance during the sampling time; Rmin represents the minimum value; R represents the average value of the resistance; σ represents the standard deviation of the resistance data. As illustrated in Figure 3a,d, after laser processing, the resistance value of the unloaded sensing unit dramatically reduced from 215 kΩ to 1.78 kΩ, and the fluctuation of resistance decreased obviously from 13.49% to 0.51%. Statistical analysis of two kinds of sensing units when loaded with the cyclic force is illustrated in Figure 3b,e. The corresponding resistive responses of two kinds of sensing units are also illustrated in Figure 3c,f to show the effects of laser processing intuitively.
As shown in Figure 4, a laser confocal scanning microscope (VK-150, Keyence Corporation, Japan) was used to observe the surface topography of laser-processed and non-processed sensing units. As illustrated in Figure 4a-c, there were clear parallel traces induced by laser treatment. Compared with the results in Figure 4d-f, the surface roughness of the laser-processed unit was relatively larger than that of the non-processed unit, indicating that the polymer on the surface of the sensing unit was removed effectively, thereby enabling more MWCNTs inside PDMS to be exposed to air. Hence, when the laser-processed one directly assembled on the electrodes, it showed good stability compared to the non-processed one, since the MWCNTs of the non-processed one were mostly wrapped inside the PDMS concentrated on the surface. Therefore, it can be concluded that

Sensing Unit Stabilizing
In the fabrication process, the surface of the sensing unit was modified by a laser processing method. Before laser processing, the surface of the sensing unit was condensed with a large amount of PDMS due to gravity during the curing period. During the laser treatment, the PDMS on the surface of the sensing unit was ablated, and the surface of the sensor was covered with MWCNTs so that the sensing unit resistance significantly dropped and became stable. The resistance was detected by using the interdigital electrodes array. The test results are shown in Figure 3, in which the sample was loaded with a cyclic force ranged from 0 N to 5 N with a time interval of 30 s. It can be seen that the surface resistance had adverse impacts on the resistance in two aspects: the mean of resistance value and the fluctuation of resistance variation. In Figure 3a,d, R max represents the maximum resistance during the sampling time; R min represents the minimum value; R represents the average value of the resistance; σ represents the standard deviation of the resistance data. As illustrated in Figure 3a,d, after laser processing, the resistance value of the unloaded sensing unit dramatically reduced from 215 kΩ to 1.78 kΩ, and the fluctuation of resistance decreased obviously from 13.49% to 0.51%. Statistical analysis of two kinds of sensing units when loaded with the cyclic force is illustrated in Figure 3b,e. The corresponding resistive responses of two kinds of sensing units are also illustrated in Figure 3c,f to show the effects of laser processing intuitively.
As shown in Figure 4, a laser confocal scanning microscope (VK-150, Keyence Corporation, Japan) was used to observe the surface topography of laser-processed and non-processed sensing units. As illustrated in Figure 4a-c, there were clear parallel traces induced by laser treatment. Compared with the results in Figure 4d-f, the surface roughness of the laser-processed unit was relatively larger than that of the non-processed unit, indicating that the polymer on the surface of the sensing unit was removed effectively, thereby enabling more MWCNTs inside PDMS to be exposed to air. Hence, when the laser-processed one directly assembled on the electrodes, it showed good stability compared to the non-processed one, since the MWCNTs of the non-processed one were mostly wrapped inside the PDMS concentrated on the surface. Therefore, it can be concluded that the static performance of the sensitive layer was effectively improved after removing the surface resistance. the static performance of the sensitive layer was effectively improved after removing the surface resistance.

Sensing Unit Characterization
Sensing characteristics of the sensing units were measured and analyzed under a pressuresensing mode in both dynamic and static experiments. The resistance of the inkjet-printed electrodes decreased as the number of prints increased, as shown in Figure 5a, which was detected by a digital  the static performance of the sensitive layer was effectively improved after removing the surface resistance.

Sensing Unit Characterization
Sensing characteristics of the sensing units were measured and analyzed under a pressuresensing mode in both dynamic and static experiments. The resistance of the inkjet-printed electrodes decreased as the number of prints increased, as shown in Figure 5a, which was detected by a digital

Sensing Unit Characterization
Sensing characteristics of the sensing units were measured and analyzed under a pressure-sensing mode in both dynamic and static experiments. The resistance of the inkjet-printed electrodes decreased as the number of prints increased, as shown in Figure 5a, which was detected by a digital multimeter (DMM). At the same time, it can be seen that, under the change of external loading force (from 5 N to 25 N), the resistance of inkjet-printed electrodes-of which the printing cycle number was three or more-showed good stability. Therefore, when selecting the number of printing cycles of the interdigital electrodes, we chose to print three times to obtain stable conductive electrodes with a lower resistance.
the sensing unit, and ΔI is the present current value minus the initial current value) of one sensing unit as a function of force is presented in Figure 5b. Here, we chose a force range of 0-25 N, which was equivalent to 0-320 kPa that was calculated by contact area (a circle with a diameter of 10 mm) of the sensing unit as the measure range to be consistent with daily plantar pressure. After linear fitting independently in three ranges (0-5 N, 5-15 N, and 15-25 N), the calibration result showed an approximately linear relationship between ΔI/I0 and applied force with three force sensitivities of S = 0.29 N −1 , 0.12 N −1 , and 0.04 N −1 , respectively, where the force sensitivity is defined as S = (ΔI/I0)/ΔF (ΔF is the variation of force in corresponding detection range). Figure 5c shows the resistive hysteresis of the pressure sensor during five kinds of loading-unloading cycles (0-5 N, 0-10 N, 0-15 N, 0-20 N, and 0-25 N). The maximum hysteresis was approximately 8.9% at 5 N when the sensing unit was applied with a force range of 0-25 N. To verify the adaptability of the sensing unit to be applied to gait phase detection with different wearers and whether the frequency response of the developed sensing unit matched the normal step cadence (from 0.76-1.04 Hz in [38]; around 0.7 Hz in [40]; below 5 Hz in [41]; and around 1.18 Hz in our work, see more details in Section 5.3), an experiment of the sensing unit regarding the stability at different levels of pressure (i.e., different weights) and several time intervals (i.e., different genders) was carried out, as shown in Figure 6. Since the test machine (ZQ-990B described in Figure 1d) can only realize step inputs with a maximum loading speed of 500 mm/min, the experiment protocol here was to apply multiple levels of constant/step force with different loading speeds by leveraging the test machine. Figure 6a-c show results of the sensing response of a sensing unit at a loading range 0-20 N and nine time intervals, illustrating that the developed sensor had a frequency response range of 0.012-1.25 Hz. As illustrated in Figure 6d, the pressure sensor was capable of steadily measuring different levels of external force (5 N, 10 N, 15 N, 20 N, and 25 N). In Figure 6e, cyclic force (including loading and unloading process) between 0 and 25 N at a speed of 50 mm/min without pause was applied to the sensing unit, and loading and unloading speeds were the same. The deformation-totime relationship could be regarded as a triangle waveform, because the load cell of test machine could only be actuated according to speed and force threshold rather than designated input (force) signal. Figure 6e shows the sensing response of the sensing unit in part of the durability test under a force range of 0-25 N (or a pressure range of 0-320 kPa) at a loading speed of 50 mm/min. The sensing The relative current change (defined as ∆I/I 0 , where I 0 is the initial current value flowing through the sensing unit, and ∆I is the present current value minus the initial current value) of one sensing unit as a function of force is presented in Figure 5b. Here, we chose a force range of 0-25 N, which was equivalent to 0-320 kPa that was calculated by contact area (a circle with a diameter of 10 mm) of the sensing unit as the measure range to be consistent with daily plantar pressure. After linear fitting independently in three ranges (0-5 N, 5-15 N, and 15-25 N), the calibration result showed an approximately linear relationship between ∆I/I 0 and applied force with three force sensitivities of S = 0.29 N −1 , 0.12 N −1 , and 0.04 N −1 , respectively, where the force sensitivity is defined as S = (∆I/I 0 )/∆F (∆F is the variation of force in corresponding detection range). Figure 5c shows the resistive hysteresis of the pressure sensor during five kinds of loading-unloading cycles (0-5 N, 0-10 N, 0-15 N, 0-20 N, and 0-25 N). The maximum hysteresis was approximately 8.9% at 5 N when the sensing unit was applied with a force range of 0-25 N.
To verify the adaptability of the sensing unit to be applied to gait phase detection with different wearers and whether the frequency response of the developed sensing unit matched the normal step cadence (from 0.76-1.04 Hz in [38]; around 0.7 Hz in [40]; below 5 Hz in [41]; and around 1.18 Hz in our work, see more details in Section 5.3), an experiment of the sensing unit regarding the stability at different levels of pressure (i.e., different weights) and several time intervals (i.e., different genders) was carried out, as shown in Figure 6. Since the test machine (ZQ-990B described in Figure 1d) can only realize step inputs with a maximum loading speed of 500 mm/min, the experiment protocol here was to apply multiple levels of constant/step force with different loading speeds by leveraging the test machine. Figure 6a-c show results of the sensing response of a sensing unit at a loading range 0-20 N and nine time intervals, illustrating that the developed sensor had a frequency response range of 0.012-1.25 Hz. As illustrated in Figure 6d, the pressure sensor was capable of steadily measuring different levels of external force (5 N, 10 N, 15 N, 20 N, and 25 N). In Figure 6e, cyclic force (including loading and unloading process) between 0 and 25 N at a speed of 50 mm/min without pause was applied to the sensing unit, and loading and unloading speeds were the same. The deformation-to-time relationship could be regarded as a triangle waveform, because the load cell of test machine could only be actuated according to speed and force threshold rather than designated input (force) signal. Figure 6e shows the sensing response of the sensing unit in part of the durability test under a force range of 0-25 N (or a pressure range of 0-320 kPa) at a loading speed of 50 mm/min. The sensing response of the developed pressure sensor remained substantially stable after 5000 loading-unloading cycles, indicating excellent repeatability and durability of the sensing unit. The dynamic resistance response in Figure 6a-e was constant with the results in Figure 5b. In addition, the developed sensing unit showed a fast response time (30 ms) and recovery time (90 ms) in the transient test, as illustrated in Figure 6f. To clearly quantify the repeatability, the data shown in Figure 6d were further processed and showcased in Figure 7. Figure 7a depicts that the non-repeatability (defined as the maximum deviation of three loading/unloading times divided by the entire output range in percentage) was about 5.9%, while that shown in Figure 7b was about 7.9%. response of the developed pressure sensor remained substantially stable after 5000 loadingunloading cycles, indicating excellent repeatability and durability of the sensing unit. The dynamic resistance response in Figure 6a-e was constant with the results in Figure 5b. In addition, the developed sensing unit showed a fast response time (30 ms) and recovery time (90 ms) in the transient test, as illustrated in Figure 6f. To clearly quantify the repeatability, the data shown in Figure 6d were further processed and showcased in Figure 7. Figure 7a depicts that the non-repeatability (defined as the maximum deviation of three loading/unloading times divided by the entire output range in percentage) was about 5.9%, while that shown in Figure 7b was about 7.9%. The above results illustrate that the flexible MWCNTs/PDMS pressure sensor had excellent and stable electromechanical characteristics, while it was manufactured by a simple fabrication process. All specific details about the developed sensors mentioned above were summarized in Table 2.  response of the developed pressure sensor remained substantially stable after 5000 loadingunloading cycles, indicating excellent repeatability and durability of the sensing unit. The dynamic resistance response in Figure 6a-e was constant with the results in Figure 5b. In addition, the developed sensing unit showed a fast response time (30 ms) and recovery time (90 ms) in the transient test, as illustrated in Figure 6f. To clearly quantify the repeatability, the data shown in Figure 6d were further processed and showcased in Figure 7. Figure 7a depicts that the non-repeatability (defined as the maximum deviation of three loading/unloading times divided by the entire output range in percentage) was about 5.9%, while that shown in Figure 7b was about 7.9%. The above results illustrate that the flexible MWCNTs/PDMS pressure sensor had excellent and stable electromechanical characteristics, while it was manufactured by a simple fabrication process. All specific details about the developed sensors mentioned above were summarized in Table 2.  The above results illustrate that the flexible MWCNTs/PDMS pressure sensor had excellent and stable electromechanical characteristics, while it was manufactured by a simple fabrication process. All specific details about the developed sensors mentioned above were summarized in Table 2.

Integration of Flexible Insole Sensor
There are several key pressure points on a foot, which reflect gait information. If the pressure detection points are not selected properly, important gait information will be lost to some extent [42]. Figure 8a shows the natural bone composition of the human foot, which guides us to focus on some critical pressure detection areas on the plantar. Here, we measured six parts of plantar pressure distribution under dynamic and static conditions, including heel, arch, first metatarsal, second metatarsal, third to fifth metatarsal, and first toe. Therefore, we printed six interdigital electrodes in these six areas on PI substrate, as presented in Figure 8b. Then, we mounted six sensing units on the six printed interdigital electrodes, as shown in Figure 8c. As illustrated in Figure 8d, the readout circuit for resistive signals based on a voltage divider rule is widespread [43]. Here, we used this principle to detect resistances of six sensing units of the insole. In Figure 8e, in order to improve the comfort of wearing, we used wireless Bluetooth for signal transmission. As presented in Figure 8f, the micro control unit (MCU, MEGA2560), the circuit board (R-board), and the battery (9 V) were mounted on a wearable band. The R-board consisted of an array of resistive dividers. Then, we connected the flexible flat cable (FFC) with the smart pressure-sensitive insole by using silver conductive adhesive. Moreover, the MCU and the R-board were connected by conductive wires.

Integration of Flexible Insole Sensor
There are several key pressure points on a foot, which reflect gait information. If the pressure detection points are not selected properly, important gait information will be lost to some extent [42]. Figure 8a shows the natural bone composition of the human foot, which guides us to focus on some critical pressure detection areas on the plantar. Here, we measured six parts of plantar pressure distribution under dynamic and static conditions, including heel, arch, first metatarsal, second metatarsal, third to fifth metatarsal, and first toe. Therefore, we printed six interdigital electrodes in these six areas on PI substrate, as presented in Figure 8b. Then, we mounted six sensing units on the six printed interdigital electrodes, as shown in Figure 8c. As illustrated in Figure 8d, the readout circuit for resistive signals based on a voltage divider rule is widespread [43]. Here, we used this principle to detect resistances of six sensing units of the insole. In Figure 8e, in order to improve the comfort of wearing, we used wireless Bluetooth for signal transmission. As presented in Figure 8f, the micro control unit (MCU, MEGA2560), the circuit board (R-board), and the battery (9 V) were mounted on a wearable band. The R-board consisted of an array of resistive dividers. Then, we connected the flexible flat cable (FFC) with the smart pressure-sensitive insole by using silver conductive adhesive. Moreover, the MCU and the R-board were connected by conductive wires.

Gait Reference System Based on Vision
The image processing method is one of the effective ways to divide the gait phase because it can obtain a great deal of information about gaits, such as leg swing angle, stride length, stride time, and stride frequency [44]. In order to facilitate comparison, reference, and analysis of gait signals collected by pressure-sensitive insole, we used the kNN machine learning method to recognize images captured by a camera (picture acquisition rate is 30 frames per second). The kNN machine learning model was trained to identify three gait phases by using three kinds of angles in each image. As shown in Figure 9a, we attached five markers to the hip, the knee, the ankle, the heel, and the toe of the volunteer's right leg. Markers were identified by the MATLAB images recognition method. Then, the positions of the five markers were drawn on raw original pictures. After that, the shapes of the thigh, the calf, and the feet were sketched to show the gait of the volunteer, and the angle data of each joint were calculated based on the shape. After the above steps, we obtained images and angle data of volunteers walking (2 km per hour). Then, as shown in Figure 8c, we labeled the obtained angle data by referring to the corresponding photo according to the gait phase division method proposed by Perry [45], as shown in Figure 9b. Finally, by adjusting test-total ratio and K value, the recognition accuracy of gait recognition could be improved. After comparison (see more details in Section 5.2), it was found that when K = 1 and ratio = 0.1 (where ratio means prediction data as a proportion of the total data), the overall accuracy of the test was significantly improved. The success rate of recognition in almost all gait phases was up to 97%. The accuracy of Phase 2 and 3 was 100%, while that of Phase 1 was 93.5%. We applied the model to automatically classify the gait cycle in Figure 9d, and the results of the automatic phase classification of angles were almost consistent with those of manual phase classification. There was a sample point from Phase 3 of the former cycle that was incorrectly classified to Phase 1 of the next cycle.

Gait Reference System Based on Vision
The image processing method is one of the effective ways to divide the gait phase because it can obtain a great deal of information about gaits, such as leg swing angle, stride length, stride time, and stride frequency [44]. In order to facilitate comparison, reference, and analysis of gait signals collected by pressure-sensitive insole, we used the kNN machine learning method to recognize images captured by a camera (picture acquisition rate is 30 frames per second). The kNN machine learning model was trained to identify three gait phases by using three kinds of angles in each image. As shown in Figure 9a, we attached five markers to the hip, the knee, the ankle, the heel, and the toe of the volunteer's right leg. Markers were identified by the MATLAB images recognition method. Then, the positions of the five markers were drawn on raw original pictures. After that, the shapes of the thigh, the calf, and the feet were sketched to show the gait of the volunteer, and the angle data of each joint were calculated based on the shape. After the above steps, we obtained images and angle data of volunteers walking (2 km per hour). Then, as shown in Figure 8c, we labeled the obtained angle data by referring to the corresponding photo according to the gait phase division method proposed by Perry [45], as shown in Figure 9b. Finally, by adjusting test-total ratio and K value, the recognition accuracy of gait recognition could be improved. After comparison (see more details in Section 5.2), it was found that when K = 1 and ratio = 0.1 (where ratio means prediction data as a proportion of the total data), the overall accuracy of the test was significantly improved. The success rate of recognition in almost all gait phases was up to 97%. The accuracy of Phase 2 and 3 was 100%, while that of Phase 1 was 93.5%. We applied the model to automatically classify the gait cycle in Figure 9d, and the results of the automatic phase classification of angles were almost consistent with those of manual phase classification. There was a sample point from Phase 3 of the former cycle that was incorrectly classified to Phase 1 of the next cycle.

Validation of Gait Phase Detection based on Flexible Insole Sensor
In order to demonstrate that the pressure-sensitive insole has a good static and dynamic response performance, a healthy adult male volunteer with a weight of 70 kg (volunteer #1, who also participated in the visual system experiment below) was invited to wear the pressure-sensitive insole. After obtaining the plantar pressure data of him, we analyzed the pressure distribution, classified his gait phase according to the classical gait classification criteria [45], and automatically forecasted classified gait phase through the kNN machine learning method.
First of all, the pressure-sensitive insole can be comfortably worn on a foot. As shown in Figure 10a, after wearing the pressure-sensitive insole, the volunteer's actions were not greatly hindered. To obtain the static response of the pressure-sensitive insole, the resistive data of the sensing units were recorded when the volunteer was sitting or standing. The pressure cloud chart of the plantar could be drawn according to the resistance changes of the sensing units. It was obvious that the color of the sensing points on the pressure cloud chart was darker when the volunteer was standing than that when he was sitting. When the volunteer was standing up, the body's mass was all applied to the feet. Thereby, the pressure on the planar was higher than that in the sitting condition where the body's mass was partly borne by the seated buttocks. After several standing-sitting cycles, we found that the changes in the resistance of each sensing unit had obvious repeatability in Figure 10b. This proved that the pressure-sensitive insole had good static performance. Walking is an appropriate way to test the dynamic characteristics of the pressure-sensitive insole. As shown in Figure 10c, 60-gait-cycle data were selected from the middle of total recorded cycles during the walking experiment. Therefore, the 60-gait-cycle data were regarded as steady state during the entire walking task. After analyzing the dynamic resistance-to-time curve of the pressure sensors, the results generally showed good reproducibility. Along with the repeat gait phase of the volunteer, the resistance also showed the phenomenon of reciprocating changes. In order to analyze the gait of the volunteers through resistance data and to automatically classify the data with machine learning later, here, we introduce Perry's gait phase division method [45] (Figure 9b) as the basis for our gait division.

Validation of Gait Phase Detection based on Flexible Insole Sensor
In order to demonstrate that the pressure-sensitive insole has a good static and dynamic response performance, a healthy adult male volunteer with a weight of 70 kg (volunteer #1, who also participated in the visual system experiment below) was invited to wear the pressure-sensitive insole. After obtaining the plantar pressure data of him, we analyzed the pressure distribution, classified his gait phase according to the classical gait classification criteria [45], and automatically forecasted classified gait phase through the kNN machine learning method.
First of all, the pressure-sensitive insole can be comfortably worn on a foot. As shown in Figure  10a, after wearing the pressure-sensitive insole, the volunteer's actions were not greatly hindered. To obtain the static response of the pressure-sensitive insole, the resistive data of the sensing units were recorded when the volunteer was sitting or standing. The pressure cloud chart of the plantar could be drawn according to the resistance changes of the sensing units. It was obvious that the color of the sensing points on the pressure cloud chart was darker when the volunteer was standing than that when he was sitting. When the volunteer was standing up, the body's mass was all applied to the feet. Thereby, the pressure on the planar was higher than that in the sitting condition where the body's mass was partly borne by the seated buttocks. After several standing-sitting cycles, we found that the changes in the resistance of each sensing unit had obvious repeatability in Figure 10b. This proved that the pressure-sensitive insole had good static performance. Walking is an appropriate way to test the dynamic characteristics of the pressure-sensitive insole. As shown in Figure 10c, 60gait-cycle data were selected from the middle of total recorded cycles during the walking experiment. Therefore, the 60-gait-cycle data were regarded as steady state during the entire walking task. After analyzing the dynamic resistance-to-time curve of the pressure sensors, the results generally showed good reproducibility. Along with the repeat gait phase of the volunteer, the resistance also showed the phenomenon of reciprocating changes. In order to analyze the gait of the volunteers through resistance data and to automatically classify the data with machine learning later, here, we introduce Perry's gait phase division method [45] (Figure 9b) as the basis for our gait division.  From a zoomed view of walking cycle resistance data in Figure 10d, the resistance variation trends of these sensing units were obviously different, because where the foot landed varied with gait phases. Approximately, a gait cycle of a single foot had a time interval of 1.7 s, which was equivalent to a stride frequency of 1.18 Hz. Since resistance data of the pressure-sensitive insole were collected only on the right foot, based on the above resistance data, the gait was divided into three phases during a walking cycle: Phase 1 (loading response and mid-stance), Phase 2 (terminal stance and pre-swing) and Phase 3 (initial swing, mid-swing, and terminal swing). A single walking cycle can be illustrated by the following description. The whole gait cycle starts from the landing of the heel of the right foot (marked as number 1 in Figure 10b), and the resistance of the sensing unit at the heel point decreases in the following short period. When the arch bone starts to be under pressure, the force on the heel starts to decrease, which means the heel is going to rise (marked as number 2 in Figure 10d). This is also known by the dropped resistance of the sensor unit located at the arch bone point and the rise in resistance of the sensor unit located at the heel point. Phase 1 (including loading response and mid-stance) is defined by the interval from marked number 1 to number 2 in Figure 10d. Then, this is followed by a dropped resistance of the sensing unit both located at the toe point and the metatarsal bone point, which means that the pressure of these areas is increasing. Meanwhile, overall plantar pressure is centralized on the forefoot. As the left foot lands, the left foot takes over from the right foot as the main supporting foot. Next, the resistance of the sensing unit located at the toe point and the metatarsal bone point increases due to the decreased pressure loaded on these areas. Finally, the resistance of the sensing unit located at the toe point, as the last unit, returns to a non-pressurized resistance value, which is symbolized as number 3 in Figure 10d to mark the end of Phase 2 (terminal stance and pre-swing). The dangling state of the right foot is classified as Phase 3 (initial swing, mid-swing, and terminal swing) because, during this phase, the resistances of sensing units are almost constant.
Since the resistive data of walking cycles had good repeatability, we adopted the machine learning method to process the data and then automatically classified the gait phase. Here, we used the basic kNN method to classify the phase. After adjusting parameters and comparing accuracy (see more details in Section 5.2), we determined the set-up parameters (K = 100, ratio = 0.025). As shown in Figure 11b, the total recognition accuracy of visual-based gait information was up to 98%. The accuracy of Phase 1 and 2 was 100%, while that of Phase 3 was 96%. We applied the model to automatically classify the gait cycle in Figure 9d, and results (illustrated in Figure 10d) of automatic phase classification of resistive data were completely consistent with those of manual phase classification. These results reflected that the resistive data set collected by the pressure-sensitive insole was suitable for automatic classification by the machine learning kNN method.

Key Factors of kNN Algorithm and Data Processing
The kNN algorithm, as a basic kind of non-parametric methods, is used for classification and regression [46]. The principle of the kNN algorithm is that the labeled data sets constitute a point cloud in the n-dimensional space, and the raw data are put into the n-dimensional space. The data to be identified are automatically classified into the label of which the number in a certain category is the largest among the K nearest existing data of the data to be identified. Appropriate K value and training ratio parameters in kNN algorithm can effectively improve the accuracy of automatic classification. We altered K values (1, 5, 10, 50, and 100) and training ratio parameters (0.025, 0.1, and 0.4) int he kNN algorithm in turn to make the model more suitable for the classification of visual data and resistance data.
With the continuous development of mobile Internet, most wearable systems have equipped with the smart phone to transport and process wearable data in a cost-effective manner [47]. However, the limited power and computational capabilities of a smart phone may have impacts on the complex tasks of data transportation and processing. To address these issues, wearable systems based on the Internet-of-Things (IoT) cloud was proposed, enhanced by powerful severs where the wearable data can be stored and analyzed efficiently for computation-intensive data processing [48]. The IoT-cloud technology is promoting the new revolution of wearable healthcare system, called Wearable 2.0, one primary challenge of which is the end-to-end latency limiting the application in real time monitoring [49]. To cope with this challenge, edge computing has attracted many researchers to devote significant efforts to developing a novel approach by leveraging additional

Key Factors of kNN Algorithm and Data Processing
The kNN algorithm, as a basic kind of non-parametric methods, is used for classification and regression [46]. The principle of the kNN algorithm is that the labeled data sets constitute a point cloud in the n-dimensional space, and the raw data are put into the n-dimensional space. The data to be identified are automatically classified into the label of which the number in a certain category is the largest among the K nearest existing data of the data to be identified. Appropriate K value and training ratio parameters in kNN algorithm can effectively improve the accuracy of automatic classification. We altered K values (1, 5, 10, 50, and 100) and training ratio parameters (0.025, 0.1, and 0.4) int he kNN algorithm in turn to make the model more suitable for the classification of visual data and resistance data.
With the continuous development of mobile Internet, most wearable systems have equipped with the smart phone to transport and process wearable data in a cost-effective manner [47]. However, the limited power and computational capabilities of a smart phone may have impacts on the complex tasks of data transportation and processing. To address these issues, wearable systems based on the Internet-of-Things (IoT) cloud was proposed, enhanced by powerful severs where the wearable data can be stored and analyzed efficiently for computation-intensive data processing [48]. The IoT-cloud technology is promoting the new revolution of wearable healthcare system, called Wearable 2.0, one primary challenge of which is the end-to-end latency limiting the application in real time monitoring [49]. To cope with this challenge, edge computing has attracted many researchers to devote significant efforts to developing a novel approach by leveraging additional processing resources [50]. Moreover, with the advanced technological innovations and massive production in hardware, on-device data analysis without the reliance on the cloud is possible [51]. In this work, all collected data were wirelessly transferred to a personal computer (PC) via Bluetooth for data storage and off-line data analysis. The communication tool for data storage between PC and flexible insole sensors was based on MATLAB. The post-processing of data classification based on the machine-learning method was also conducted on the same PC separately. In the future, we hope to deploy all algorithms on a compactable processer integrated with flexible insole sensors to explore the feasibility of on-device data analysis.

Performance Evaluation and Comparison of Classifiers
Appropriate K value and training ratio parameters in kNN algorithm can effectively improve the accuracy of automatic classification. We altered K values (1, 5, 10, 50, and 100) and training ratio parameters (0.025, 0.1, and 0.4) in the kNN algorithm in turn to make the model more suitable for the classification of visual data and resistance data. To completely evaluate the classifier, we computed the related assessment parameters of the training results, including total accuracy, precision, recall rate, and F1score, which are summarized in Tables A1-A4, respectively. These data can illustrate the effect of automatic classification. In some appropriate parameters, these classification indicators are relatively high. This shows that our framework can be applied to the collection and the analysis of human gait data.
As shown in Figure 11a,b, by comparing the prediction accuracy of these two data sets, if the parameters are appropriate (K = 100, ratio = 0.025 for pressure sensors; K = 1, ratio = 0.1 for vision systems), the prediction accuracy of both can reach above 95% (97% for pressure sensors and 98% for vision system). In addition, the classifier precision of three phases (Phase 1, Phase 2, and Phase 3) that were divided based on visual data was 93%, 100%, and 100%, respectively, while that based on pressure sensors was 100%, 100%, and 95%, respectively. Moreover, the classifier F1-scores of the three phases that were divided based on visual data were 0.967, 0.971, and 0.977, respectively, while those of pressure sensors were 1.000, 0.957, and 0.978, respectively. What is more, it was found that the quality of the data set obtained by using the pressure-sensitive insole was not inferior to that obtained by the image processing method in the machine learning algorithm using kNN.

Statistical Analysis and Comparison of Two Methods
The statistical analysis of stride time based on visual signals and plantar pressure distribution was carried out, as shown in Figure 12. Although the total stride time of a walking cycle is almost the same, the time length of each gait phase divided by the two kinds of data was not consistent. This was attributed to the difference of labeling between visual data and pressure data. The visual data were classified based on the contact between the shoe and the treadmill, while plantar pressure data were classified based on the contact between the foot and the insole. There is a time difference between the two kinds of contact modes.
Meanwhile, vision and plantar pressure, as two kinds of information sources for gait phase recognition, have advantages over each other. For example, the heel strike and rise point can be recorded more accurately through the pressure-sensitive insole, while the feet adjacent and tibia vertical status could be obtained only through the visual system. Here, we combined the two gait recognition methods to make up for each other's limitations, as shown in Figure 11c. The whole gait recognition system can provide a lot of visual and plantar pressure data for subsequent machine learning methods. By analyzing the characteristics between the two kinds of data, we hope to find the corresponding relationship between them. This method is beneficial for the monitoring of human health and the recovery of disease as well as for providing sufficient information for the control of an exoskeleton.

Adaptability Analysis of Pressure-Sensitive Insole
To verify that the results from the developed pressure-sensitive insole for gait phase division are generalizable, more volunteers were invited to participate in experiments. The detailed information about health condition of volunteers, including gender, weight, and body mass ndex (BMI (kg/m 2 ), defined as a person's weight in kilograms divided by the square of the person's height in meters), are summarized in Table 3. All volunteers were requested to wear the developed pressure-sensitive insole while walking on a treadmill. The walking speed of treadmill was set as 2 km/h. The machine learning model used to process the data collected from these experiments was the same one with K = 100, ratio = 0.025. All the results, such as stride frequency, stride time, overall accuracy, precision, and F1-score, of five users are summarized in Table 4, illustrating the good adaptability of the pressuresensitive insole.

Future Work
This paper focused on addressing the inherent design and implementation challenges with detailed prototype design and fabrication, an exploratory flexible sensors characterization experiment, and detailed experimental validation. In the current status, these pressure-sensitive

Adaptability Analysis of Pressure-Sensitive Insole
To verify that the results from the developed pressure-sensitive insole for gait phase division are generalizable, more volunteers were invited to participate in experiments. The detailed information about health condition of volunteers, including gender, weight, and body mass ndex (BMI (kg/m 2 ), defined as a person's weight in kilograms divided by the square of the person's height in meters), are summarized in Table 3. All volunteers were requested to wear the developed pressure-sensitive insole while walking on a treadmill. The walking speed of treadmill was set as 2 km/h. The machine learning model used to process the data collected from these experiments was the same one with K = 100, ratio = 0.025. All the results, such as stride frequency, stride time, overall accuracy, precision, and F1-score, of five users are summarized in Table 4, illustrating the good adaptability of the pressure-sensitive insole.

Future Work
This paper focused on addressing the inherent design and implementation challenges with detailed prototype design and fabrication, an exploratory flexible sensors characterization experiment, and detailed experimental validation. In the current status, these pressure-sensitive insoles were not applied to the elderly, young children, disabled people, pregnant women, and other groups with special plantar pressure as well as a human exoskeleton to detect the heterogeneous distribution of plantar pressure. We look forward to further applying the developed devices to those areas until the compatibility of it is improved by the highly intensive integration design of all components, such as power supply, data acquisition, data processing, and data transmission. Meanwhile, our machine learning algorithm in the visual reference system is basic and can be adopted for classification. There is a need for developing a specific algorithm to tackle the challenges in accurate gait phase prediction considering possible effects of acceleration and deceleration phases at the start and the stop of the walking task. In future research, we plan to detect the plantar pressure distribution of more types of people under the whole walking process through this system, collect enough planar pressure and visual data, and try to establish individual differences in the corresponding relationship between plantar pressure and the angle of lower limb joints [52]. In this way, the exoskeleton control model can be trained to achieve the goal of personalized control in which exoskeleton control information is only obtained through plantar pressure signals.

Conclusions
In summary, a pressure-sensitive insole with the laser-processed surface was designed and fabricated. The highlight of the pressure sensors was that reduced and stabilized resistances of sensing units were obtained by the laser process. Furthermore, a pressure sensing insole was assembled by employing laser-processed sensing units and inkjet-printed electrodes. The characteristics of the pressure-sensitive insole were demonstrated by the experiment, where it was worn by a healthy human walking on a treadmill. The static characteristics of the pressure-sensitive insole were verified by the experiment of alternative standing and sitting. The dynamic characteristics of the pressure-sensitive insole were presented, the planar pressure signals obtained from the pressure-sensitive insole were analyzed by referring to the visual detection system based on machine learning, and the gait phase of the human was further divided. This work further compared the performance of the plantar pressure-sensitive insole with the image processing method by using machine learning. Finally, the gait monitoring system composed of the pressure-sensitive insole and visual aids is expected to provide an effective tool to obtain the corresponding data of lower extremity joint angle and plantar pressure to facilitate the subsequent exoskeleton control.