Machine learning-assisted nanozyme nanosensor for instantaneous quantitative analysis of antitubercular drugs Authors: Chendi Qin, Xuehong Min, Linjian Fang, Xiaoqing Yang, Xian Zhao, Yixin Xiao, Yansong Yang, Xiaoqing Yi, Liyu Zheng, Jinyan Chen, Leiying Zhang, Man Zhou Published: 2026 ABSTRACT AbstractThe dynamic concentration of drugs in the blood reflect pharmacokinetic characteristics and serves as crucial indicators of therapeutic efficacy and medication safety. This underscores the necessity of real-time monitoring to guide individualized dosing and reduce adverse effects, thus requiring rapid and accurate therapeutic drug monitoring (TDM) to optimize patient outcomes and minimize side effects. To this end, a colorimetric nanozyme-based nanosensor was constructed for the detection of isoniazid (INH). In the presence of INH, ·O2− generated by the nanozyme with excellent oxidase-like activity were effectively scavenged, thereby inhibiting the chromogenic reaction of the nanozyme substrate and enabling the rapid quantification of INH in biological samples. In this study, two methods were developed: UV-Visible spectrophotometry and a smartphone-based RGB extraction method for rapid quantification of INH in tablets and biological samples. Smartphone imaging integrated with machine learning compared Convolutional Neural Network (CNN), Random Forest (RF), and Logistic Regression (LR) models under dark box condition, followed by training the best model under dark box and ambient lighting. The results showed that under optimized conditions (pH 5 buffer, 25℃, 10 min), UV-Visible spectrophotometry achieved a detection range of 1–30 µM (LOD: 0.582 µM), while the smartphone-based RGB method achieved 3–30 µM (LOD: 1.368 µM). Spiked recovery rates were 98.08%-111.25% for INH tablets and 97.10%-100.51% for rat serum. Machine learning results showed CNN outperforming RF and LR under dark-box conditions, with consistent prediction accuracy under dark-box and ambient lighting (MAE: 1.230 and 1.160 µM, respectively), validating robustness under varying environments. Ultimately, this integrated nanoprobe-based detection platform stands to significantly improve clinical anti-tuberculosis therapeutic drug monitoring by substantially increasing the accessibility, reliability, and scalability of INH concentration detection.Graphical Abstract Supplementary InformationThe online version contains supplementary material available at https://doi.org/10.1186/s12951-026-04735-1.Keywords: Therapeutic drug monitoring (TDM), Isoniazid (INH), Nanozyme, Colorimetric nanosensor, Machine learning Introduction Tuberculosis (TB), which is primarily caused by M. tuberculosis, remains a major global public health challenge despite being a curable disease. It has now surpassed HIV/AIDS to become the world’s second leading infectious cause of death. Isoniazid (INH), a cornerstone first-line anti-TB agent, is widely used in clinical practice owing to its high selectivity and potent bactericidal activity against M. tuberculosi [1]. According to the World Health Organization guidelines, the therapeutic blood concentration of INH should be maintained at 22–44 µM (approximately 3–6 µg/mL) to ensure anti-tuberculosis efficacy [2]. However, long-term or high-dose administration carries a significant risk of toxicity, most commonly presenting as peripheral neuritis and drug-induced liver injury [3–5]. Subtherapeutic levels may result in insufficient bacterial suppression and treatment failure, whereas elevated concentrations increase the likelihood of adverse events such as neurotoxicity and may even promote the emergence of drug-resistant M. tuberculosis. Therefore, TDM has become an essential tool in precision medicine, enabling individualized treatment adjustments to optimize drug efficacy while minimizing side effects and costs, and serving to guide personalized medication and control drug toxicity. Current analytical techniques for INH detection include high-performance liquid chromatography (HPLC) [6, 7], fluorescence spectroscopy [8], gas chromatography (GC) [9, 10], liquid chromatography-mass spectrometry (LC-MS) [11–13], and electrochemical methods [14–16]. Although these approaches provide accurate and reliable results, they often involve expensive and sophisticated instrumentation, require specialized operational expertise, and entail time-consuming sample preparation, which collectively limits their broad adoption. In comparison, colorimetric methods present distinct advantages, including rapid detection, operational simplicity, minimal sample pretreatment, low cost, high sensitivity, and visual signal readout, thereby effectively overcoming the limitations associated with conventional techniques [17–19]. The rapid proliferation of smartphones has further revolutionized the field of analytical chemistry by transforming these ubiquitous devices into powerful platforms for innovative sensing applications, a development that offers a unique combination of portability, computational power, and advanced imaging capabilities that can be harnessed for sophisticated detection purposes [20–23]. In particular, the integration of colorimetric sensing with smartphone technology has given rise to a new paradigm in analytical techniques [24–26]. By leveraging the smartphone’s camera and image processing algorithms, color changes resulting from chemical reactions can be quantitatively analyzed through red-green-blue (RGB) colorimetry, thereby enabling the rapid and accurate detection of target analytes in a highly accessible [27–30]. However, the use of smartphone-based RGB colorimetry for quantitative analysis in outdoor settings is susceptible to variations in illumination, shooting distance and shooting angle, leading to inconsistent image quality and compromised analytical accuracy. Although physical light-shielding strategies are low-cost and easy to implement, they often lack adaptability to changing environmental conditions. In recent years, machine learning approaches, particularly convolutional neural networks (CNNs), have gained considerable attention in the field of optical sensing. By training on colorimetric image datasets that encompass complex illumination interferences, an adaptive ambient light compensation model can be developed to effectively capture the nonlinear relationship between optical noise and true detection values, thereby enabling intelligent optical correction. This approach not only enhances accuracy and sensitivity but also achieves faster analysis speed and real-time processing capabilities, while reducing manual intervention and overall processing time. Recent studies have confirmed the potential of machine learning-enhanced colorimetric sensing [31–35]. However, its application in TDM for INH remains underexplored. This study provides a practical, low-cost, and field-deployable ML-enhanced colorimetric sensing solution that fills this gap, holding promise for broader applications in personalized medicine and resource-limited settings. In this study, intelligent detection system was developed for the detection of INH in tablets and blood. This platform comprises MnO2 nanodots and 3,3’,5,5’-tetramethylbenzidine (TMB): MnO2 nanodots generate ·O2− to catalyze TMB oxidation, producing a blue oxidized TMB (oxTMB) product for a signal-on state, while the hydrazine-pyridine moiety of INH scavenges ·O2− to inhibit TMB oxidation, reducing or eliminating the blue color for a signal-off response. This specific ·O2−-scavenging mechanism endows the nanoprobes with excellent INH recognition capability, enabling efficient analyte capture, signal transduction, and quantitative detection of INH. Therefore, a dual-mode sensor based on colorimetric sensing was developed, incorporating UV-Vis spectrophotometry and a smartphone-based RGB extraction method. To improve the quantitative accuracy and environmental adaptability of the latter, smartphone photography was integrated with machine learning technology (Fig. 1). This approach effectively mitigates the effects of image resolution variability and illumination heterogeneity on analytical results, enabling the synergistic optimization of color signal recognition, data processing, and interference correction. Consequently, it provides an efficient solution for the on-site rapid detection of INH. This intelligent detection system enables precise lab analysis and TDM-guided smartphone monitoring, facilitating individualized dosing and medication safety. Schematic illustration of the BSA/MnO2 nanodots based colorimetric detection system integrated with a smartphone imaging platform for the detection of INH Experimental section Reagents The KMnO4, acetonitrile, and anhydrous sodium acetate were purchased from Guangfu Reagent Company (Tianjin, China), Yingkai Technology Co., Ltd. (Beijing, China), and Fuchen Chemical Reagent Co., Ltd. (Tianjin, China), respectively. Bovine serum albumin (BSA), INH (both analytical grade and HPLC grade), and TMB, 2,2’-azinobis(3-ethylbenzothiazoline-6-sulfonic acid) (ABTS), o-phenylenediamine (OPD) were obtained from Macklin Biochemical Technology Co., Ltd. (Shanghai, China), as were all other reagents. All chemicals were of analytical grade and used without further purification. Throughout the experiment, ultrapure water was used, and a 0.01 M phosphate buffered saline (PBS, pH 7.4) was prepared in-house for subsequent experiments. Equipment A Hitachi H-7650 transmission electron microscope (TEM) from Japan was used for high-resolution morphology characterization of the samples; X-ray photoelectron spectroscopy (XPS) analysis was conducted using a Shimadzu Axis Supra+ multi-functional photoelectron spectrometer from Japan; the zeta potential of nanodots was measured by a Malvern ZetaSizer Nano ZS instrument from the UK. electron paramagnetic resonance (EPR) spectroscopy, performed on a Bruker EMX Plus spectrometer, was employed to identify the types of reactive oxygen species present; and the absorbance changes of the samples were recorded by a Hitachi UH5700 ultraviolet visible (UV-Vis)/near-infrared spectrophotometer system from Japan. Fourier transform infrared (FTIR) spectroscopy was performed using a Thermo Fisher Scientific Nicolet iS20 infrared spectrometer (USA). The crystal structure of the samples was characterized by X-ray diffraction (XRD) using a Bruker D8 ADVANCE X-ray diffractometer (Germany). Energy-dispersive X-ray spectroscopy (EDS) analysis was conducted using a JEOL JEM-2100 F scanning transmission electron microscope (STEM, Japan) to determine the elemental composition of the samples. Synthesis of BSA/MnO2 nanodots BSA/MnO2 nanodots were synthesized via biomineralization. Briefly, 0.1 g of BSA was dissolved in 5 mL of PBS (0.01 M, pH 7.4) by vortexing. Subsequently, 5 mL of KMnO4 solution (25.3 mM) was combined with an equal volume of BSA solution, and the mixture was stirred for 10 min at room temperature. The color change to red-brown indicated BSA/MnO2 nanodots formation. The product was then freeze-dried and stored at 4 °C for further use. Enzyme-like activity and steady-state kinetics of BSA/MnO2 nanodots The oxidase-like activity of BSA/MnO2 nanodots was assessed by incubating 5 µL of the nanodot solution with 30 µL of TMB (10 mM) in HAc-NaAc buffer (50 mM, pH 5.0) at room temperature. The absorbance at 652 nm was monitored over time by UV-Vis spectrophotometer. Steady-state kinetics were analyzed by varying the TMB concentration (0.05–0.3 mM) with a fixed amount of nanodots. The data were fitted to the Michaelis-Menten model using Eqs. (1) and (2): The parameters vₘₐₓ (maximum rate) and Kₘ (Michaelis constant) were derived from the fit of the Michaelis-Menten equation to the data, where v0 is the initial rate and [S] is the TMB concentration. Colorimetric detection of INH The detection conditions, including buffer pH, temperature, and time, were first optimized. The established procedure involves mixing 5 µL of BSA/MnO2 nanodots stock solution with 40 µL of INH sample in HAc-NaAc buffer (pH 5.0), incubating for 10 min at room temperature, and then adding 30 µL of TMB solution to a final volume of 1.2 mL. The absorbance was measured at 652 nm after 1 min. For calibration, various concentrations of INH standard solutions were analyzed, and the signal was quantified as ΔA = A0 - A, where A0 and A represent the absorbance at 652 nm in the absence and presence of INH, respectively. Detection of INH in tablets and rat serum INH tablets (specification: 0.1 g) were obtained from multiple pharmaceutical suppliers, including Guizhou Hongyun (Tablet-1), Hangzhou Minsheng (Tablet-2), and Shanxi Yunpeng (Tablet-3). The sample pretreatment protocol followed the Chinese Pharmacopoeia (Part II) (2025 Edition). After being ground and dispersed with ultrapure water and diluted, the samples were filtered through a 0.22 μm filter membrane and further diluted to the corresponding concentrations for storage (the concentration was further determined through UV-Vis analysis.). Healthy Wistar rats (6–8 weeks old) were selected as experimental animals. Blood was collected from the jugular vein under normal feeding conditions. After centrifugation, the upper serum was separated and stored for later use. During the analysis, the rat serum samples were diluted 30-fold with HAc-NaAc buffer (pH 5.0) to minimize matrix effects and maintain the optimal reaction pH of 5.0. Then, known concentrations of INH standard were spiked into the diluted serum samples and analyzed using the established method.The resulting solutions were measured both by absorbance at 652 nm and by a smartphone for RGB value extraction, enabling the determination of INH concentration in tablets and rat serum and subsequent calculation of the recovery rates. Evaluation of a machine learning-based quantitative detection model for INH For rapid smartphone-based INH detection, this study developed a machine learning-assisted colorimetric strategy based on INH’s inhibitory effect on BSA/MnO2 nanodot-catalyzed TMB oxidation, where the blue color fades progressively with increasing INH concentration. Ten INH concentration gradients (3–30 µM) were prepared according to the procedure described in Sect. "Colorimetric detection of INH". An aliquot of 200 µL of the reaction solution was transferred to a 96-well plate, and a white background plate was placed beneath it. Image acquisition was performed under the following two lighting conditions: (1) Dark box condition: The removable 96-well plate was placed inside a custom-made dark box (25 cm ×25 cm ×25 cm) equipped with an adjustable LED fill light (power 0.3–9.3 W, 96 lamp beads). The LED light was set to 100% brightness with white light mode. A smartphone (Honor Magic7) was fixed on a tripod at a distance of 10 cm from the sample. For each concentration, five images were captured from five different angles, yielding 250 raw images, which were augmented to 500 images after enhancement processing. Three models were implemented using Python 3.8 along with TensorFlow 2.10 and scikit-learn 1.2.0: a CNN, a random forest (RF) model based on handcrafted RGB color statistical features, and a linear regression (LR) model as a baseline for comparison. Evaluation metrics included R2, MSE, MAE, and RMSE, and the optimal model was selected through comparative analysis. (2) Ambient light condition: Image acquisition was performed independently under natural daylight illumination (without dark box, illuminance 2000–4500 lx). The same smartphone, tripod, distance, sample preparation procedure, and imaging protocol were used. The optimal model obtained under the dark box condition was trained and validated on this dataset using the same evaluation metrics. Results and discussion Characterization of BSA/MnO2nanodots This study employed a simple and green biomineralization approach, using BSA as both a template and a reducing agent, to successfully synthesize BSA/MnO2 nanodots. The successful synthesis of BSA/MnO2 nanodots was validated by both visual and spectral analyses. The resulting solution displayed a homogeneous brown color and a pronounced Tyndall effect (Fig. 2A and B). This transformation was further confirmed by UV-Vis spectroscopy, which showed the complete disappearance of characteristic KMnO4 peaks at 507 nm, 525 nm and 545 nm, concomitant with the emergence of a broad absorption band spanning 250–500 nm, a feature absent in pure BSA. Furthermore, in aqueous solution, the BSA/MnO2 nanodots exhibited a more negative zeta potential of −15.70 mV compared to BSA alone, primarily due to the presence of Mn-O- groups derived from the MnO2 (Fig. 2C). The BSA/MnO2 nanodots also demonstrated excellent zeta potential stability over five days, attributed to the inhibition of nanodot aggregation by BSA surface modification, which enhances colloidal stability (Fig. 2D). The BSA/MnO2 nanodots exhibited a monodisperse character under TEM examination, possessing a homogeneous particle size distribution centered around 2.74 nm.(FigureS1, Fig. 2E and F). Further elemental analysis of the BSA/MnO2 nanodots was performed using energy-dispersive EDS. As shown in Figure S2, both the EDS quantification results and the elemental distribution maps clearly show the presence of C, N, O, and Mn. In addition, to determine the elemental composition and chemical states of the BSA/MnO2 nanodots, we performed a systematic analysis using XPS. As shown in Fig. 2G, the full-spectrum scanning results of BSA/MnO2 nanodots confirm that the sample mainly contains three characteristic electronic energy levels: N 1 s, O 1 s and Mn 2p. The N 1 s signal and part of the O 1 s signal originate from the BSA structure. The high-resolution Mn 2p spectrum shows that there is a pair of spin-orbit coupling peaks at the binding energy of 641.18 eV and 652.78 eV, corresponding to Mn 2p3/2 and Mn 2p1/2 respectively, indicating that the Mn element exists in the form of MnO2. The N 1 s fine spectrum shows an obvious characteristic peak at 399.18 eV, which belongs to the typical N-C or (N-C)3 chemical environment in proteins. In addition, the fitted peak located at 530.78 eV in the O 1 s spectrum can be attributed to the contribution of the MnO2 characteristic structural unit Mn-O-Mn [36].The above XPS analysis unanimously confirmed that BSA/MnO2 nanodots have been successfully synthesized, and their elemental chemical states are highly consistent with the expected structure. Then, FTIR was used to characterize the functional groups of the samples. As shown in Figure S3A, characteristic peaks appeared at 3422.01, 1649.85, 1535.15, and 522.73 cm− 1. The peak at 3422.01 cm− 1 corresponds to the N-H stretching vibration. The peaks at 1649.85 cm− 1 and 1535.15 cm− 1 are attributed to the amide I and amide II bands of BSA, respectively, confirming the successful incorporation of BSA into the nanodots. The weak peak at 522.73 cm− 1 is assigned to the Mn-O stretching vibration, confirming the existence of MnO2 [37]. Moreover, the phase composition of the BSA/MnO2 nanodots was analyzed by XRD (Figure S3B). No obvious sharp diffraction peaks were observed in the 2θ range of 10°−70°, except for a broad diffuse peak at approximately 20°−40°, indicating the amorphous nature of the MnO2 nanodots. This amorphous structure facilitates the exposure of more surface defects and unsaturated coordination sites, thereby enhancing their enzyme-like catalytic activity and enabling highly sensitive colorimetric sensing [38]. Taken together, the above characterization results demonstrate that the BSA/MnO2 nanodots have been successfully synthesized. Characterization of BSA/MnO2 nanodots. (A) Digital photos of BSA, KMnO4 and BSA/MnO2 nanodots solutions. (B) Representative UV-Vis absorption spectra of KMnO4, BSA and the as-synthesized BSA/MnO2 nanodots. The inset shows a digital photograph of the colloidal aqueous dispersion of the BSA/MnO2 nanodots. (C) Zeta potential of BSA and BSA/MnO2 nanodots. (D) The stability of the zeta potential of BSA/MnO2 nanodots. (E) The TEM image of BSA/MnO2 nanodots. Scale bar: 20 nm. (F) Histogram of particle size frequency distribution of BSA/MnO2 nanodots based on TEM image statistics. (G) XPS full spectra and high-resolution N 1 s, O 1 s and Mn 2p spectra of BSA/MnO2 nanodots Study of the oxidase-like activity and catalytic mechanism of BSA/MnO2 nanodots To assess the oxidase-like activity of the BSA/MnO2 nanodots, the catalytic performance in the oxidation of TMB was evaluated systematically. As shown in Fig. 3A and C, incubation of the nanodots of BSA/MnO2 with TMB resulted in the conversion of colorless TMB to its blue oxidized form of oxTMB, accompanied by the appearance of characteristic absorption peaks at 652 nm. This confirms the significant oxidase-mimetic catalytic activity of the BSA/MnO2 nanodots. As shown in Fig. 3D, the oxidase-like activity was further evaluated using chromogenic substrates such as TMB, ABTS, and OPD. The most pronounced enhancement in UV-Vis absorption was observed at 652 nm for oxTMB. Due to its non-toxic and non-carcinogenic properties, TMB was selected for subsequent studies on the detection of INH. Enzyme kinetic assays were performed to evaluate the catalytic activity of BSA/MnO2 nanodots. Based on preliminary experiments, the TMB concentration range of 0.05–0.35 mM was selected, covering the linear region (0.05–0.1 mM) and saturation region (0.2–0.35 mM). Nonlinear regression fitting of the Lineweaver-Burk plot yielded Km = 0.173 mM and Vmax = 5.298 × 10− 6 mM·s− 1(Fig. 3E and F). This Km value guided the optimization of TMB concentration in subsequent INH detection assays: operating near or slightly above Km generally provides optimal sensitivity. Therefore, a TMB concentration of 0.25 mM was selected (Sect. "Colorimetric detection of INH") to ensure a robust colorimetric signal while preserving dynamic range for detecting INH-mediated inhibition. The oxidase-like activity and catalytic mechanism of BSA/MnO2 nanodots. (A) The mechanism of TMB oxidation to oxTMB by BSA/MnO2 nanodots. (B) Digital photos of BSA/MnO2 nanodots, TMB, and BSA/MnO2 nanodots after incubation with TMB. (C) UV-Vis spectra of BSA/MnO2 nanodots, TMB, and BSA/MnO2 nanodots after incubation with TMB. (D) UV-Vis spectra of BSA/MnO2 nanodots, TMB, and BSA/MnO2 nanodots incubated with different chromogenic substrates. (E) Michaelis-Menten and (F) Lineweaver-Burk plots of the BSA/MnO2 nanodots at varying TMB concentrations. (G) UV-Vis spectra and absorbance intensity at 652 nm of BSA/MnO2 + TMB system incubated with PBQ, Trp, and IPA with different concentration, respectively. (H) EPR spectrum for ·O2− detection in BSA/MnO2 nanodots To elucidate the catalytic mechanism of the BSA/MnO2 nanodots, we first employed a colorimetric method to identify the type of ROS generated. As shown in Fig. 3G, specific scavengers were employed, including p-benzoquinone (PBQ) for scavenging ·O2−, L-tryptophan (Trp) for scavenging ¹O2, and isopropanol (IPA)for scavenging ·OH. The results demonstrated that, relative to the Trp or IPA treatment groups, the absorbance at 652 nm exhibited a marked reduction following the introduction of PBQ, suggesting a pronounced suppression of oxTMB formation. This finding indicates that the TMB oxidation reaction catalyzed by BSA/MnO2 nanodots primarily relies on the involvement of ·O2−. To further corroborate the presence of specific ROS, EPR analysis was conducted using DMPO as the spin trap. The obtained spectrum exhibited a characteristic signal that was unambiguously assigned to the DMPO-·O2− adduct, thereby providing direct evidence for the generation of ·O2− during the catalytic process (Fig. 3H) [39]. Collectively, these findings demonstrate that the BSA/MnO2 nanodots exhibit efficient oxidase-like activity via a catalytic mechanism predominantly dependent on the generation of the ·O2−. Optimization of INH detection conditions Based on the aforementioned findings, it has been established that BSA/MnO2 nanodots effectively emulate the catalytic functionality of natural oxidases, facilitating the oxidation of colorless TMB to blue oxTMB. The inherent reducibility of the hydrazide groups within the INH structure enables them to suppress TMB oxidation, consequently attenuating the chromogenic reaction. Leveraging this principle, INH detection was accomplished by monitoring the chromatic transition in the TMB-based system (Fig. 4A). As illustrated in Fig. 4B, C and a substantial diminution in UV-Vis absorption intensity at 652 nm was observed in the BSA/MnO2 + TMB + INH system compared to the BSA/MnO2 + TMB system, accompanied by a visible fading of the solution color from blue to pale, indicating effective suppression of TMB oxidation by INH. To further corroborate this inhibitory phenomenon from an interfacial perspective, zeta potential measurements were performed. The BSA/MnO2 + TMB system exhibited a zeta potential of −3.98 mV, whereas the incorporation of INH elevated the absolute value to −6.75 mV, thereby substantiating the inhibitory role of INH in the catalytic process (Fig. 4D). Collectively, a colorimetric sensing platform has been successfully constructed for INH detection based on the robust oxidase-mimicking activity of BSA/MnO2 nanodots. Optimization of detection conditions for INH. (A) Schematic illustration of INH detection using BSA/MnO2 nanodots. (B) Digital photos of the BSA/MnO2 nanodots system in the absence and presence of TMB and INH. (C) UV-Vis spectra of BSA/MnO2 nanodots, TMB, and INH in their respective systems. (D) Zeta potentials of BSA/MnO2 nanodots, TMB and INH in their respective systems. (E and F) temperature, (G and H) buffer pH, and (I and J) reaction time for the BSA/MnO2 + TMB system in the absence and presence of INH To achieve optimal detection performance, key parameters such as reaction temperature, buffer pH, and reaction time were systematically investigated. The optimization was performed by employing the absorbance difference (ΔA = A0 - A) at 652 nm as the quantitative indicator, where A0 and A represent the absorbance of the BSA/MnO2 + TMB system in the absence and presence of INH, respectively. As shown in Fig. 4E and F, the value of ΔA gradually increased with increasing temperature up to 25 °C, which was accordingly selected as the optimal reaction temperature, offering the additional benefit of energy efficiency. Since TMB is readily oxidized to blue oxTMB under acidic conditions, buffers with pH values ranging from 3.5 to 6.0 were evaluated. As shown in Fig. 4G and H, the maximum ΔA was achieved at pH 5.0, consequently establishing it as the optimal pH for the assay. Furthermore, as shown in Fig. 4I and J, the ΔA value reached a plateau within 1 min after the addition of TMB, leading to the selection of 1 min as the optimal reaction time. In summary, the optimal conditions for the BSA/MnO2 + TMB + INH system were determined to be 25 °C, pH 5.0, and a reaction time of 1 min. These results confirm the strong potential of this smartphone-assisted colorimetric sensing platform, consequently providing a robust foundation for developing a simple, rapid, and efficient method for INH quantification. Smartphone-assisted colorimetric detection of INH using BSA/MnO2 nanodots This study investigated the performance of engineered BSA/MnO2 nanodots for the detection of INH and assessed their potential for practical deployment. As illustrated in Fig. 5A, within the BSA/MnO2 + TMB system, the characteristic absorbance at 652 nm exhibited a consistent decrease in response to elevated INH concentrations. To establish a robust foundation for quantitative analysis, a calibration curve was established by plotting the absorbance change (ΔA) against INH concentration. The results revealed a strong linear correlation between ΔA and INH concentration across the range of 1–30 µM (Fig. 5B). The corresponding regression equation was determined to be ΔA = 0.044 + 0.040 (R2 = 0.999), with a calculated limit of detection (LOD) of 0.582 µM (based on 3σ/k). In summary, the developed sensor demonstrates outstanding analytical reliability, high sensitivity, and an extensive linear dynamic range, underscoring its considerable promise for real-world application in clinical point-of-care testing. A central objective in sensor development is to translate laboratory designs into standardized functionalities accessible to everyday users. Modern smartphones, equipped with high-performance cameras and advanced color perception capabilities, have been widely adopted for portable sensing and detection applications. By leveraging smartphones as portable colorimetric readers, the proposed detection strategy can be developed into a point-of-care testing platform for INH monitoring. Using a smartphone application, RGB values were extracted from solution images, which exhibited a color fade with increasing INH concentration. These values were then subjected to quantitative analysis. As shown in Fig. 5C and D and Table S1, the R value increased progressively with INH concentration. A linear regression analysis was performed with the R value as the dependent variable and INH concentration as the independent variable. The results indicated a good linear relationship between the two within the concentration range of 3–30 µM, represented by the equation R = 78.97 + 4.263 [INH] (R2 = 0.995), with a calculated LOD of 1.368 µM (Fig. 5E and F). According to the World Health Organization guidelines, the therapeutic plasma concentration of INH should be maintained at 22–44 µM to ensure anti-tuberculosis efficacy. The linear ranges of the UV-Vis colorimetric method and the smartphone-based RGB detection method established in this study both cover the minimum concentration requirement corresponding to the 22–44 µM therapeutic window. These results confirm that the smartphone-assisted colorimetric sensing platform can meet the practical demands of TDM of INH. Smartphone-assisted colorimetric detection of INH utilizing BSA/MnO2 nanodots. (A) UV-Vis spectra of the BSA/MnO2 + TMB system with various INH concentrations. (B) the linear relationship between absorbance change against INH concentration. (C) Extraction of R, G, and B values of the BSA/MnO2 + TMB system incubated with varying INH concentrations. (D) R, G, and B values of the BSA/MnO2 + TMB system incubated with varying INH concentrations. (E) Variation of the R value against INH concentration. (F) The linear relationship between R value against INH concentration Specific INH probe with BSA/MnO2 nanodots To evaluate the selectivity of the BSA/MnO2 nanodots-based colorimetric sensor for INH detection, we investigated 19 common interfering substances, including cations, anions, small biomolecules, and drugs, such as quinine sulfate (QS), azithromycin (AZM), vancomycin (VAN), ampicillin (AMP), levofloxacin (LEV), and metronidazole (MNZ). As shown in Fig. 6A and C, and Table S2, even at concentrations 10-fold higher than that of INH, these interferents induced negligible changes in both the absorbance of the BSA/MnO2 + TMB system and the solution color. In contrast, the system exhibited a robust response to INH. Furthermore, smartphone-based colorimetric analysis confirmed these findings, with no significant differences in the RGB values observed between the blank group and the groups containing individual interferents. Collectively, these results demonstrate the excellent selectivity of our proposed sensor for INH. Additionally, the addition of potential interferents to the INH detection system caused virtually unaltered absorbance and colorimetric responses compared to the system containing only INH, validating the negligible effect of these substances on INH detection (Fig. 6D and F, and Table S3). Furthermore, glutathione (GSH), uric acid (UA), and ascorbic acid (AA), as the major reducing species in blood, exist at normal physiological concentrations of 2.0, 114, and 428 µM, respectively. We therefore examined the selectivity and anti-interference performance of the BSA/MnO2 nanodot-based colorimetric sensor for INH in the presence of these three interferents at their respective serum concentrations. As shown in Figure S4, the introduction of these reducing agents caused negligible changes in both the absorbance at 652 nm and the RGB values of the BSA/MnO2 + TMB and BSA/MnO2 + TMB + INH systems. In addition, the high sensitivity of this method allows controlled dilution of serum samples. Such a dilution strategy significantly reduces serum matrix interference, thereby further enhancing the robustness and reliability of the detection. Collectively, these findings demonstrate that the BSA/MnO2 nanodots-based probe possesses excellent specificity and robust anti-interference capability, underscoring its strong potential for the rapid and accurate monitoring of INH in complex samples. Selectivity and anti-interference performance of BSA/MnO2 nanodots for INH detection. (A) Absorbance intensity at 652 nm of the BSA/MnO2 + TMB system after incubation with INH and 19 potential interferents, respectively. (B) Corresponding color changes and the extracted RGB values.(C) R, G, and B values extracted from the images in (B). (D) The absorbance intensity at 652 nm after BSA/MnO2 + TMB + INH system incubated with 19 potential interferents. (E) Color changes and corresponding R, G, and B color extraction. (F) Extraction of R, G, and B values from (E) Detect INH in actual sample To validate the accuracy of the sensor in real sample detection, this study employed INH tablets from three manufacturers and rat serum as representative analytical matrices. Quantitative analysis was first performed on the INH samples, followed by spiked recovery experiments in which standard INH solutions at different concentrations were added to both the tablet solutions and rat serum samples. The accuracy and reliability of the BSA/MnO2 nanodots-based sensor were evaluated using both UV-Vis spectroscopy and smartphone-based colorimetric analysis. As shown in Table 1, the UV-Vis analysis showed no significant difference between the measured INH concentrations in the pretreated and diluted real tablet and rat serum samples and the reference values. The spiked recovery rates ranged from 97.00% to 104.60%, with relative standard deviations (RSD) between 0.27% and 2.81%, indicating high accuracy and precision. Smartphone-based colorimetric analysis, utilizing captured color information, also demonstrated excellent performance, with recoveries of 97.10%−111.25% and RSD in the range of 0.66%−2.79%, showing strong agreement with the UV-Vis results. These results demonstrate that both methods exhibit good adaptability in complex real biological samples, meet the accuracy requirements of clinical TDM, and can be used to guide individualized drug dosing. Furthermore, comparison with HPLC results confirmed the consistency and reliability of the proposed method, providing a solid scientific foundation for the analytical outcomes. This study demonstrates that the BSA/MnO2 nanodots-based colorimetric method serves as a reliable and practical platform for the determination of INH. Its high performance in the analysis of clinical samples highlights its potential for on-site application, with significant implications for advancing drug safety management and quality assurance Table 1Determination of INH in real samples (n = 3) Determination of INH in real samples (n = 3) To validate the accuracy of the proposed method, Pearson correlation analysis was performed among the UV-Vis method, the RGB method, and the HPLC method. As shown in Figure S5A-B, both the UV-Vis method (R = 0.999, P < 0.0001) and the RGB method (R = 0.999, P < 0.0001) exhibited excellent correlations with the HPLC results, with regression equation slopes close to unity and intercepts near zero. These results demonstrate that the dual-mode nanosensor provides reliable INH quantification comparable to the gold-standard method, indicating its promising potential for TDM applications. Evaluation of a machine learning-based quantitative detection model for INH Accurate quantification of INH concentration in blood samples is essential for clinical TDM and overall health assessment. To improve analytical efficiency and reduce bias, we introduced an artificial intelligence (AI)-driven learning algorithm to optimize the INH detection workflow. This method effectively reduces background noise interference while enhancing throughput and accuracy. We comprehensively evaluated three models including CNN, RF, and LR for prediction accuracy and robustness in INH quantification. Four metrics were used: coefficient of determination (R2), mean absolute error (MAE), mean squared error (MSE), and root mean squared error (RMSE). R2 reflects explanatory power (closer to 1 is better); lower MAE, MSE, and RMSE indicate smaller prediction bias and fewer severe errors. As shown in Fig. 7A and C, CNN consistently outperformed the other models across all metrics. Its R2 reached 0.9616, significantly higher than RF (0.7007) and LR (0.6008). CNN’s MSE was 1.5, approximately 1/7.5 and 1/11 of RF and LR, respectively. Its MAE was 1.23, two to three times lower than the other models. In contrast, the poor performance of RF and LR models is mainly due to their inability to effectively extract nonlinear features from mobile phone images and their low robustness to color deviation caused by light interference, while CNN’s end-to-end feature learning ability can effectively solve this problem. These results demonstrate CNN’s superior automatic feature extraction and nonlinear fitting capabilities, with minimal prediction bias. Thus, CNN was selected as the optimal model for quantitative INH detection. Performance evaluation of the CNN model for INH concentration detection in a dark box condition. (A) Comparison of MAE among CNN, RF, and linear LR models. (B) Comparison of RMSE among CNN, RF, and LR models. (C) Comparison of coefficient of determination (R2) among CNN, RF, and LR models. (D) Training and validation loss curves of the CNN model over 100 epochs. (E) Training and validation MAE curves for INH concentration using the CNN model over 100 epochs. (F) Training and validation RMSE curves for INH concentration using the CNN model over 100 epochs. (G) Learning rate scheduling curve of the CNN model over 100 epochs. (H) Histogram of training and validation loss distribution for the CNN model. (I) Comparison of training and validation performance metrics for INH concentration detection using the CNN model after 100 epochs, including MAE and RMSE After selecting CNN, we further trained and validated it in a dark box condition to systematically assess convergence, generalization, and overfitting risk. Data were split into training and validation sets. Training and validation loss and convergence trends were monitored, and MAE and RMSE were compared to evaluate overfitting and generalization. Close errors between training and validation sets indicate low overfitting risk and generalizable learning. Synchronized decreasing and stabilization of loss values indicate good convergence. Lower MAE and RMSE imply smaller prediction bias, and similar values suggest no severe errors. CNN showed good convergence (Fig. 7D). After 100 epochs, loss decreased to 0.0032 µM, and validation MAE was only 1.03 µM. Training and validation curves declined together without divergence, indicating low overfitting risk and strong generalization for real-world detection. Further error analysis (Fig. 7E and F) showed validation MAE decreased from 5.47 µM to 1.03 µM (81% reduction) and validation RMSE from 6.55 µM to 1.54 µM (76% reduction). Training and validation errors decreased together within reasonable fluctuations, indicating controlled prediction bias and robust performance. Additionally, the learning rate scheduling strategy (Fig. 7G) aided stable convergence. The learning rate decayed stepwise from 0.0001 to 2 × 10− 6 over five steps, each decay corresponding to further convergence. This strategy ensured sufficient speed and reduced oscillations, enhancing robustness. Regarding loss distribution (Fig. 7H), both training and validation losses were below 0.003, highly concentrated and overlapping, further confirming no overfitting and excellent generalization. Final model evaluation (Fig. 7I) showed training MAE of 1.101 µM and validation MAE of 1.048 µM, very close, again verifying strong generalization. Validation RMSE of 1.538 µM indicates minimal prediction bias, meeting accuracy requirements for practical INH quantification. These results demonstrate excellent convergence, stability, and generalization, with close training and validation errors, low overfitting risk, and minimal bias, satisfying precision needs for clinical TDM and health assessment. By introducing this CNN algorithm to optimize detection, background noise is reduced, and throughput and accuracy are improved. After training and validation, we further evaluated CNN’s predictive performance in the same dark box condition. Validation set predictions are shown in Fig. 8. Under dark-box conditions, CNN achieved the best performance. Figure 8A shows points closely scattered around the diagonal, with R2 = 0.963, indicating high correlation between predicted and true values and good fit. Figure 8B shows residuals symmetrically distributed around zero with no trend across concentrations, MAE = 1.230 µM, indicating uniform prediction error without systematic bias. Figure 8C shows errors concentrated in −1 µM to 2 µM, peaking near 0 µM, indicating small bias and uniform error distribution. Figure 8D shows that across the 3–30 µM concentration range, MAE at each concentration was below 2.2 µM, and mean error near zero, indicating stable performance without systematic bias. In summary, the CNN model exhibits high goodness-of-fit, low prediction bias, uniform error distribution, and good adaptability across concentration ranges, meeting accuracy requirements for INH quantification with good application value. Prediction performance of the CNN model in a dark box condition. (A) Fitting curve between predicted and actual INH concentrations. (B) Distribution of model residuals as a function of actual INH concentration. (C) Histogram of frequency distribution of prediction errors for INH concentration. (D) Comparison of mean error and MAE across different INH concentrations To further evaluate CNN’s robustness under different lighting conditions, the same protocol was performed under normal ambient light (without dark box). CNN was applied to images captured under normal light. Figure S6 shows training and validation results under ambient light conditions, including loss curves (Figure S6A), MAE (Figure S6B), RMSE (Figure S6C), learning rate schedule (Figure S6D), loss distribution, and final performance metrics (Figure S6E). The model shows no overfitting and good generalization, with close training/validation errors. A marginally higher validation RMSE is acceptable, indicating minor prediction variance on unseen data (Figure S6F). Figure 9 A and D summarizes prediction performance under ambient light conditions. The correlation coefficient between predicted and true values was 0.978, MAE was 1.160 µM, and residuals mainly ranged from −3 µM to 4 µM. Mean error was −0.09 µM (near zero, no systematic bias), and residual standard deviation was 1.37 µM (small error fluctuation). Overall, the model shows high accuracy, low bias, and good stability for INH quantification. Although dark box conditions offer optimal consistency, the platform performs accurately under normal light, with comparable MAE values (1.230 µM vs. 1.160 µM), confirming robustness to ambient light variations. This underscores the clinical value of CNN-based INH TDM for optimizing tuberculosis dosing, reducing hepatotoxicity risk, and improving treatment outcomes. Prediction performance of the CNN model under ambient light conditions. (A) Fitting curve between predicted and actual INH concentrations. (B) Distribution of model residuals as a function of actual INH concentration. (C) Histogram of frequency distribution of prediction errors for INH concentration. (D) Comparison of mean error and MAE across different INH concentrations Furthermore, as summarized in Table S4, by comparing the analytical platforms reported in the past five years for INH detection, the BSA/MnO2 nanodots developed in this work exhibitfavorable performance in terms of linear range, LOD and total time. More importantly, this study represents the first integration of machine learning algorithms with smartphone-based RGB image recognition for the intelligent auxiliary readout of INH detection. Conclusion In this study, we successfully constructed a colorimetric nanosensor based on nanozymes for the detection of INH and integrated it with a smartphone-deep learning scheme to establish a comprehensive detection platform. This integrated platform possesses offers several core advantages. Firstly, the excellent oxidase-like activity of the nanozyme provides a solid foundation for rapid and specific colorimetric detection. Secondly, the innovative integration of smartphone and deep learning breaks through the bottlenecks of traditional colorimetric detection, including heavy reliance on professional equipment, poor anti-interference capability, and limited scalability. Furthermore, the CNN-based machine learning image processing method effectively mitigates the effects of image resolution variability and illumination heterogeneity on analytical results, enabling the synergistic optimization of color signal recognition, data processing, and interference correction, thereby providing an efficient solution for the on-site rapid detection of INH. Taken together, this integrated detection platform based on nanozymes significantly improves the accessibility, reliability, and scalability of INH concentration detection. It is expected to provide strong technical support for clinical TDM of anti-tuberculosis therapy, thereby optimizing the level of clinical anti-tuberculosis treatment and holding great potential for practical clinical application. Nevertheless, several limitations exist in this study. First, the long-term stability and batch-to-batch reproducibility of the nanozyme require systematic validation. Second, the deep learning model was trained entirely on simulated samples, and its predictive performance in real clinical matrices remains to be confirmed through clinical cohort studies. Third, hardware variations among different smartphone models may introduce image acquisition bias, necessitating further device compatibility studies. Looking forward, the platform can be integrated into wearable devices for remote, real-time TDM, supporting personalized and home-based care. It is extendable to other drugs by replacing recognition elements. In resource-limited settings, it serves as a low-cost screening tool. Future work includes clinical validation and multiplexed detection. This study offers a novel strategy for intelligent nanosensors in precision medicine. Supplementary Information Supplementary Material 1 Acknowledgements This work is supported by the National Natural Science Foundation of China (22364004), the Natural Science Foundation of Jiangxi Province (20252BAC240287), the Natural Science Foundation of Hubei Province of China (2024AFB870), the PhD Research Fund Project of Wuhan Business University (2023KB009), the Research and development of testing standards for prohibited substances in sports horses (2024TD021), and the Talents’ Start-up Fund of Gannan Medical University (QD202303). The authors gratefully acknowledge this financial support. Author contributions C. Q. : Data curation, Conceptualization, Formal analysis, Methodology, Writing – original draft. X. M. : Validation, Conceptualization, Funding acquisition. L. F. : Methodology. X. Yang : Supervision. X. Z. : Data curation. Y. X. : Data curation. L. W. : Supervision. Y. Y. : Visualization. X. Yi : Writing – review and editing, Funding acquisition. L. Z. : Data curation, Visualization. J. C. : Supervision, Project administration. L. Z. : Writing – review and editing, Supervision. M. Z. : Conceptualization, Formal analysis, Supervision, Project administration, Funding acquisition, Writing – review and editing. Funding This work is supported by the National Natural Science Foundation of China (22364004), the Natural Science Foundation of Jiangxi Province (20252BAC240287), the Natural Science Foundation of Hubei Province of China (2024AFB870), the PhD Research Fund Project of Wuhan Business University (2023KB009), the Research and development of testing standards for prohibited substances in sports horses (2024TD021), and the Talents’ Start-up Fund of Gannan Medical University (QD202303). The authors gratefully acknowledge this financial support. Data availability No datasets were generated or analysed during the current study. Declarations Ethics approval and consent to participate All animal experiments were approved by the Institutional Animal Care and Use Committee of Gannan Medical University (Approval No. 2025543). All procedures were performed in accordance with the National Institutes of Health Guide for the Care and Use of Laboratory Animals and the ARRIVE guidelines. Competing interests The authors declare no competing interests. Footnotes Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations. Contributor Information Xuehong Min, Email: mxh201270267@163.com. Jinyan Chen, Email: 1185475124@qq.com. Leiying Zhang, Email: zhangleiying@gmu.edu.cn. Man Zhou, Email: baiyuwawa-zhouman@163.com. References Associated Data Supplementary Materials Supplementary Material 1 Data Availability Statement No datasets were generated or analysed during the current study.