A water quality fluoride detection method based on digital image colorimetric analysis
By constructing a digital image colorimetric analysis method based on zirconium-based nanozyme probes and paper-based microfluidic chips, the problems of colorimetric system specificity and environmental interference correction in water fluoride detection have been solved, achieving efficient and safe fluoride detection, which is suitable for resource-limited or on-site testing scenarios.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ZHONGWU RENJU JIANGSU ENVIRONMENTAL TESTING CO LTD
- Filing Date
- 2025-08-05
- Publication Date
- 2026-04-10
AI Technical Summary
Existing methods for detecting fluoride in water suffer from insufficient specificity of colorimetric systems, inadequate correction for environmental interference, and low data security and reliability, making it difficult to meet the needs of rapid on-site testing and resource-constrained scenarios.
A digital image colorimetric analysis method was adopted. A zirconium-based nanozyme probe with reversible color development function was constructed. Combined with a three-layer paper-based microfluidic chip and a smartphone-controlled multi-band light source, the reflectance and fluorescence dual-modal images were acquired simultaneously. A dynamic compensation matrix was constructed to correct matrix interference, and the detection data was encrypted and written into the blockchain to realize data verification and over-limit alarm.
It achieves specific recognition of fluoride ions, eliminates the influence of environmental factors, improves the accuracy and stability of detection, ensures the security and reliability of data, and meets the portability and practicality requirements of rapid on-site detection.
Smart Images

Figure CN120870101B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of water quality detection, and particularly relates to a water quality fluoride detection method based on digital image colorimetric analysis. BACKGROUND
[0002] Currently, water quality fluoride detection mainly relies on traditional chemical analysis methods, such as ion chromatography, spectrophotometry and electrochemical method. These methods have high detection accuracy, but have many shortcomings. For example, ion chromatography requires expensive equipment and professional operators, and is complex and costly; spectrophotometry requires the use of complex color reagents and spectrophotometers, and has high requirements for environmental conditions; the stability and repeatability of the electrode of the electrochemical method are poor, and it is difficult to meet the demand of on-site rapid detection. Therefore, the existing technology has many limitations in practical application, especially in resource-limited or on-site detection scenarios.
[0003] In recent years, with the rapid development of smart phones and image processing technology, digital image colorimetric analysis technology has gradually emerged. This technology uses the camera of a smart phone to capture images after color development, and extracts color information through image processing algorithms to realize quantitative analysis of target substances. This method has the advantages of simple operation, low cost and strong portability, and is suitable for on-site rapid detection. However, the existing digital image colorimetric analysis technology still faces challenges in the application of water quality fluoride detection, such as the specificity of the color development system, the correction of environmental interference, and the reliability and security of the data.
[0004] In the prior art, although there are some water quality detection methods based on digital image colorimetric analysis, these methods usually use a single color development system, such as zirconium alizarin sulfonate or dimethyl phenol orange, which has limited specific recognition ability for fluoride ions and is easily disturbed by the water quality matrix. In addition, the existing technology also has shortcomings in environmental interference correction, lacking effective dynamic compensation mechanism, resulting in low accuracy and reliability of the detection results.
[0005] In water quality fluoride detection, the security and reliability of data are crucial. In the prior art, detection data is usually stored in local devices or cloud servers, which is vulnerable to tampering, loss or leakage. Therefore, the present application proposes a water quality fluoride detection method based on digital image colorimetric analysis. SUMMARY
[0006] The purpose of the present application is to solve the problems of insufficient specificity of the color development system, imperfect environmental interference correction and low data security and reliability in the prior art, and to propose a water quality fluoride detection method based on digital image colorimetric analysis.
[0007] In order to achieve the above object, the application adopts the following technical scheme: A water quality fluoride detection method based on digital image colorimetric analysis, comprising the following steps:
[0008] Step S1, a zirconium-based nanoscale enzyme probe with reversible color development function is constructed, Zr-Mn bimetallic coordination and boronic acid modification are used to realize specific recognition of fluoride ions;
[0009] Step S2, a three-layer paper-based microfluidic chip is developed, the zirconium-based nanoscale enzyme probe is fixed in the hydrophilic channel, and an optical reference array and a distributed temperature control network are integrated;
[0010] Step S3, the multi-band light source switching is controlled by the smart phone, and the reflection and fluorescence dual-mode images are synchronously collected;
[0011] Step S4, multi-color space features are extracted from the dual-mode images, and a dynamic compensation matrix is constructed by fusing environmental parameters to correct the matrix interference;
[0012] Step S5, a lightweight neural network with attention mechanism is used to process the corrected features, and the fluoride concentration and confidence interval are output;
[0013] Step S6, the detection data is encrypted and written into the blockchain, and the data verification and over-limit alarm are realized through the smart contract.
[0014] Further, in step S1, the following sub-steps are further included:
[0015] S1-1, under an inert atmosphere, a soluble zirconium source, a manganese source and an organic ligand containing a boronic acid group are dissolved in a polar organic solvent in a predetermined ratio to form a precursor solution;
[0016] S1-2, the precursor solution is transferred to a pressure-resistant reaction container, and a hydrothermal reaction is carried out in a sealed environment to generate a zirconium-manganese bimetallic organic framework material;
[0017] S1-3, after the hydrothermal reaction is completed, the precipitate is collected by a solid-liquid separation method, and is washed alternately with a low-boiling point organic solvent and deionized water to obtain a zirconium-manganese bimetallic organic framework precipitate;
[0018] S1-4, the zirconium-manganese bimetallic organic framework precipitate is dispersed in deionized water again and subjected to freeze-drying treatment to obtain a porous nanoscale enzyme powder;
[0019] S1-5, the nanoscale enzyme powder is mixed with a weak acid buffer solution, and is uniformly dispersed by stirring to form a nanoscale enzyme suspension with reversible color development function;
[0020] S1-6, after the nanoscale enzyme suspension is mixed with a freeze-drying protective agent, it is added dropwise into a mold and subjected to secondary freeze-drying to form a solid color development detection unit;
[0021] S1-7, the dried color developing detection unit is sealed and stored in a light-proof and dry condition to obtain a zirconium-based nanoscale enzyme probe with reversible color developing function, which can be used for fluoride ion detection.
[0022] Further, in step S2, the following sub-steps are further included:
[0023] S2-1, cellulose-based filter paper is selected as the base material, a hydrophobic barrier pattern is formed on the surface of the base material by photolithography technology, and a hydrophilic channel is defined;
[0024] S2-2, three independent patterned substrates are prepared and used as sample introduction layer, probe reaction layer and optical detection layer respectively;
[0025] S2-3, the three independent patterned substrates are aligned and stacked, and are bonded by ultraviolet curing adhesive to form a vertical flow channel through the three layers;
[0026] S2-4, zirconium-based nanoscale enzyme probes are fixed in the middle of the probe reaction layer by micro-droplet technology;
[0027] S2-5, a reference array containing cyan, magenta and yellow three primary colors is printed on the optical detection layer;
[0028] S2-6, a polyimide heating film is attached to the back of the chip under vacuum, and at least three temperature sensors are integrated to form a distributed temperature control network.
[0029] Further, in step S3, the following sub-steps are further included:
[0030] S3-1, a two-way digital communication connection between a smart phone and a multi-band light source is established, digital control instructions are generated and sent through a mobile phone application, the multi-band light source has visible light band and ultraviolet band emission capability, and the digital control instructions include wavelength selection function, light intensity adjustment function and trigger timing control function;
[0031] S3-2, according to the digital control instructions, the light source alternately outputs the continuous spectrum required for reflection imaging and the pulsed narrow-band spectrum required for fluorescence excitation;
[0032] S3-3, the mobile phone camera is synchronously controlled to continuously capture images in reflection imaging mode, and starts fluorescence image acquisition after detecting the fluorescence trigger signal, and obtains paired reflection and fluorescence dual-mode images;
[0033] S3-4, the environment parameters are obtained by the built-in environment sensor of the smart phone, and the environment parameters are written into the metadata storage area of the dual-mode image file.
[0034] Further, in step S4, the following sub-steps are further included:
[0035] S4-1, a recognizable color change is formed by the coordination reaction of the zirconium-based nanometric enzyme probe with fluoride ions, locating the color development reaction area in the dual-mode image;
[0036] S4-2, the color development reaction area is segmented at the pixel level, and multi-color space features are extracted from the segmented area, including channel intensity features based on the RGB color space and chroma features based on the Lab color space;
[0037] S4-3, the environmental parameters in the metadata storage area are fused with the multi-color space features at the feature level to construct an environment-aware feature representation;
[0038] S4-4, a dynamic compensation matrix is generated by a distribution alignment algorithm, which can eliminate the feature distribution offset caused by the difference in water quality matrix;
[0039] S4-5, the environment-aware feature representation is linearly transformed with the dynamic compensation matrix to obtain the standardized feature output after matrix effect correction.
[0040] Further, in step S5, the following sub-steps are further included:
[0041] S5-1, a lightweight neural network with attention mechanism is constructed to receive the dynamically compensated feature input, and a weighted feature representation is generated by automatically learning the importance relationship between feature channels;
[0042] S5-2, the lightweight neural network is trained using fluoride concentration labeled data, and the network parameters are optimized through a back propagation algorithm, while outputting concentration prediction values and confidence intervals based on Monte Carlo Dropout calculation;
[0043] S5-3, the trained neural network is subjected to mobile terminal adaptation processing, including weight quantization, computation graph fusion and hardware adaptation instruction set optimization;
[0044] S5-4, the adapted neural network is deployed to a portable device to establish an offline detection process.
[0045] Further, in step S6, the following sub-steps are further included:
[0046] S6-1, a distributed storage network is constructed by selecting a blockchain platform that supports smart contract execution, and at least three consensus nodes are configured to form a Byzantine fault-tolerant cluster, each consensus node deploying a data verification service and maintaining a complete copy of the ledger;
[0047] S6-2, the detection result is digitally signed using an asymmetric encryption algorithm, the signed data is packaged with a collection timestamp and a device identifier to generate a data block, and the data block is appended to the end of the blockchain after consensus verification;
[0048] S6-3, an automatic verification logic code is written and deployed as an on-chain smart contract, the signature validity, timestamp continuity and device identity legality are verified when the data is chained, and data that does not meet the preset rules is rejected;
[0049] S6-4, a fluoride concentration threshold judgment condition is preset in the smart contract, when the detection data exceeds the threshold, an alarm message is automatically sent to the preset supervision platform, and the data is marked as a high-risk record;
[0050] S6-5, a data access interface service conforming to the REST specification is developed, the interface is authenticated by a digital certificate, authorized users can query historical detection records on the blockchain through the interface and verify data integrity.
[0051] The technical scheme provided by the application has at least the following beneficial effects:
[0052] The application realizes specific recognition of fluoride ions by constructing a zirconium-based nanoscale enzyme probe with reversible color development function, improves the sensitivity and selectivity of detection, effectively avoids the interference of other ions, and significantly improves the accuracy and reliability of detection.
[0053] The application realizes real-time correction of water quality matrix interference by constructing a dynamic compensation matrix, effectively eliminates the influence of environmental factors on the detection result, and ensures the stability and accuracy of the detection result.
[0054] The application writes the detection data into the blockchain after encryption, and realizes data verification and over-limit alarm by using a smart contract, significantly improves the security and reliability of the data, ensures the authenticity and integrity of the data, can timely discover and process abnormal data, and meets the needs of supervision and emergency response.
[0055] The application realizes on-site rapid detection by controlling the switching of multi-band light sources through a smart phone and synchronously collecting reflection and fluorescence dual-mode images, which is not only simple and low in cost, but also meets the needs of scenes with limited resources or on-site detection, and significantly improves the portability and practicality of water quality fluoride detection. BRIEF DESCRIPTION OF DRAWINGS
[0056] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art and the advantages thereof, the following will briefly introduce the drawings needed in the embodiments or prior art description. Obviously, the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained from these drawings without creative effort.
[0057] Figure 1 Method flow chart provided by the embodiments of the present application. DETAILED DESCRIPTION
[0058] In order to further illustrate the technical means and effects adopted by the present application to achieve the predetermined invention purpose, the following will combine the drawings and preferred embodiments to specifically describe the specific implementation, structure, features and effects of the water quality fluoride detection method based on digital image colorimetric analysis according to the present application. In the following description, different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. In addition, the specific features, structures or characteristics in one or more embodiments can be combined in any suitable form.
[0059] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which the present application belongs.
[0060] The following embodiments are for illustrative purposes only and are not intended to limit the scope of the present application.
[0061] The following will specifically describe the specific scheme of the water quality fluoride detection method based on digital image colorimetric analysis provided by the present application in combination with the drawings.
[0062] Please refer to Figure 1 , which shows the method flow chart of the water quality fluoride detection method based on digital image colorimetric analysis provided by one embodiment of the present application. The method comprises the following steps:
[0063] Step S1, constructing a zirconium-based nanoscale enzyme probe with reversible color development function, realizing specific recognition of fluoride ions through Zr-Mn bimetallic coordination and boronic acid modification;
[0064] In step S1, the following sub-steps are further included:
[0065] S1-1, under an inert atmosphere, dissolving a soluble zirconium source, a manganese source and an organic ligand containing a boronic acid group in a polar organic solvent according to a predetermined ratio to form a precursor solution;
[0066] S1-2, transferring the precursor solution to a pressure-resistant reaction container and performing a hydrothermal reaction in a sealed environment to generate a zirconium-manganese bimetallic organic framework material;
[0067] S1-3, after the hydrothermal reaction is completed, the precipitate is collected by a solid-liquid separation method, and is washed alternately with a low-boiling organic solvent and deionized water to obtain a zirconium-manganese bimetallic organic framework precipitate;
[0068] S1-4, the zirconium-manganese bimetallic organic framework precipitate is redispersed in deionized water and subjected to freeze-drying treatment to obtain a porous nanoscale enzyme powder;
[0069] S1-5, the nanoscale enzyme powder is mixed with a weakly acidic buffer solution, and is uniformly dispersed by stirring to form a nanoscale enzyme suspension with a reversible color development function;
[0070] S1-6, after the nanoscale enzyme suspension is mixed with a freeze-drying protective agent, it is added dropwise into a mold, and is subjected to secondary freeze-drying to form a solid-state color development detection unit;
[0071] S1-7, the dried color development detection unit is sealed and stored in a light-proof and dry condition to obtain a zirconium-based nanoscale enzyme probe with a reversible color development function, which can be used for fluoride ion detection.
[0072] It should be noted that the soluble zirconium source refers to any compound that can release zirconium in an aqueous solution or a polar organic solvent, including zirconium chloride, zirconyl nitrate and zirconium sulfate, which provides zirconium metal nodes for the final framework.
[0073] The manganese source refers to a soluble salt that can release manganese in the reaction medium, including manganese sulfate, manganese chloride and manganese acetate. The introduction of manganese can endow the framework with additional electronic / magnetic centers, and cooperates with the zirconium nodes to enhance the catalytic activity.
[0074] The organic ligand containing a boronic acid group refers to a compound containing a -B(OH)2 or -B(OR)2 structure in the molecule, including phenylboronic acid, 4-carboxyphenylboronic acid and 2-aminophenylboronic acid. The boronic acid group can reversibly chelate with fluoride ions when the pH changes, achieving specific recognition of fluoride.
[0075] The polar organic solvent refers to a polar solvent that can dissolve inorganic salts and organic ligands, including N,N-dimethylformamide (DMF), dimethyl sulfoxide (DMSO), ethanol, methanol, ethylene glycol and their mixtures. The polarity helps the coordination reaction of metal ions and ligands.
[0076] The precursor solution refers to a uniform transparent solution formed after the zirconium source, manganese source and boronic acid-containing ligand are completely dissolved in the solvent, which is the raw material solution for subsequent hydrothermal reaction.
[0077] The pressure-resistant reaction vessel refers to a sealed container that can withstand the autogenous pressure of the reaction system and does not react with the reactants, including a polytetrafluoroethylene-lined stainless steel autoclave and a glass-lined reaction kettle.
[0078] Hydrothermal reaction: refers to the synthesis reaction in a closed system at a temperature higher than the boiling point of the solvent. Hydrothermal conditions promote the self-assembly of metal ions and ligands to form a three-dimensional porous metal-organic framework (MOF) structure.
[0079] Solid-liquid separation: includes centrifugation, filtration or vacuum filtration, which is used to separate the generated solid product from the mother liquor and remove unreacted impurities.
[0080] Low-boiling-point organic solvent: refers to volatile solvents with a boiling point below 120℃, including methanol, ethanol and acetone, which are used for multiple washing to remove residual ligands and metal ions.
[0081] Deionized water: high-purity water with a resistivity of ≥18 MΩ·cm, which is used for final washing to remove ionic impurities and avoid salt precipitation during subsequent freeze-drying.
[0082] Freeze-drying: also known as lyophilization, which involves rapid freezing of the sample and sublimation of the solvent under vacuum to obtain a fluffy, non-collapsed, high-specific-surface-area dry powder that maintains the integrity of the skeleton channels.
[0083] Weakly acidic buffer: a buffer system with a pH range of 3.5-5.0, including acetic acid-sodium acetate and citric acid-sodium citrate, which ensures that the color reaction occurs within the optimal acidity of the probe and is reversible.
[0084] Lyoprotectant: an additive such as a sugar, a polyol or a polymer (trehalose, mannitol, PVP) that prevents the collapse and aggregation of protein or skeleton structure during lyophilization.
[0085] Mold: includes silica gel microporous plates, polytetrafluoroethylene templates and 3D printed microcavities, which are used to control the shape, thickness and consistency of dry micropellets.
[0086] Lightproof, dry and sealed storage: refers to placing the final solid-state color developing unit in an aluminum foil bag, an inert gas-filled bag or a vacuum bag to avoid performance degradation caused by light, moisture and oxygen.
[0087] Step S2, develop a three-layer paper-based microfluidic chip, immobilize zirconium-based nanenzyme probes in the hydrophilic channel, integrate optical reference arrays and distributed temperature control networks;
[0088] In step S2, the following sub-steps are also included:
[0089] S2-1, select cellulose-based filter paper as the base material, form a hydrophobic barrier pattern on the surface of the base by photolithography technology, and define the hydrophilic channel;
[0090] S2-2, prepare three independent patterned substrates as sample introduction layers, probe reaction layers and optical detection layers;
[0091] S2-3, three independently patterned substrates are aligned and stacked, bonded by UV curing adhesive, forming vertical flow channels throughout the three layers;
[0092] S2-4, zirconium-based nanoscale enzyme probes are fixed in the middle of the probe reaction layer by micro-droplet technology;
[0093] S2-5, a reference array containing cyan, magenta, and yellow three primary colors is printed on the optical detection layer;
[0094] S2-6, a polyimide heating film is attached to the back of the chip under vacuum, and at least three temperature sensors are integrated to form a distributed temperature control network.
[0095] It should be noted that the specific process of developing a three-layer paper-based microfluidic chip is as follows:
[0096] 1. Material pretreatment: cellulose filter paper is placed in a 105°C oven for 30 minutes to dry, remove residual moisture, and ensure uniform adhesion of the photoresist.
[0097] 2. Photoresist patterning: spin 15μm thick photoresist on the paper surface; place the mask under the UV lamp for 30s; develop, rinse, and form 0.2–0.4mm wide hydrophilic channels.
[0098] 3. Preparation of three independent patterned substrates: introduce a layer by laser drilling a 1mm diameter sample inlet; reserve a 3mm×3mm probe area for the reaction layer; and print a CMY dot array with 0.5mm spacing on the detection layer by silk screen printing.
[0099] 4. Interlayer alignment bonding: use UV-LED curing for 3s, vertical hole alignment error <50μm, to ensure liquid flow from top to bottom.
[0100] 5. Probe fixation: micro-droplet 5×5 array, 2nL per point, 0.5mm spacing; after vacuum drying for 30 minutes, the probe is firmly embedded in the fiber network.
[0101] 6. Reference array curing: after silk screen printing, bake at 120°C for 5 minutes to crosslink the pigments and prevent diffusion.
[0102] 7. Heating film attachment: PI film is pre-punched and positioned to vacuum adhere to the back of the chip, and silver paste is spot welded to form a distributed temperature measurement closed loop.
[0103] 8. Sealing and storage: the completed chip is placed in an aluminum foil bag filled with desiccant, vacuum sealed, and stored at room temperature in the dark for ≥12 months.
[0104] Cellulose-based filter paper: a porous filter material made from plant cellulose as the main raw material, commonly with a grammage of 80–250g / m 2 , with good hydrophilicity and mechanical strength, which can be used as a flexible substrate for microfluidic chips.
[0105] Photolithography: UV exposure, mask patterning and development process are used to form a hydrophobic wax or photocured resin barrier on the filter paper surface, thereby defining the shape and size of the hydrophilic channel. The typical wax pattern thickness is 20-50 μm, and the width can be designed according to fluid requirements.
[0106] Hydrophobic barrier: refers to the hydrophobic layer left on the filter paper surface after lithography, which allows water to flow only in the uncovered area, forming a "wall-channel" structure to prevent lateral diffusion of liquid.
[0107] Hydrophilic channel: the area of the filter paper not covered by the hydrophobic layer, which has the ability to capillary absorb liquid, serving as the flow path and reaction site for samples, probes and color development products.
[0108] Patterned substrate: refers to the filter paper sheet with a specific microchannel pattern after lithography. This invention uses three independent substrates, which are sample introduction layer: inlet and distribution channel; probe reaction layer: fixed color development probe; optical detection layer: provides optical signal reading and reference.
[0109] Vertical flow channel: a through-hole formed by laser drilling or mechanical punching after aligning the three layers of filter paper, allowing liquid to pass through each layer in the Z direction, achieving "top-down" interlayer transport.
[0110] UV-cured adhesive: a kind of acrylate or epoxy adhesive that quickly cures under UV light, used to permanently bond the three layers of filter paper, preventing interlayer leakage while maintaining transparency and not affecting the optical path.
[0111] Micro-dispensing technology: using a micro-syringe, piezoelectric nozzle or inkjet dispenser to accurately drop picoliter to nanoliter level liquid probes in the designated channel area, forming a solid-state microarray after drying, ensuring consistent probe position and dosage.
[0112] Zirconium-based nanenzyme probe: the final product of step S1, in the form of solid pellets or dry powder, containing a reversible color development function of zirconium-manganese bimetallic organic framework, which undergoes reversible color / fluorescence changes when encountering fluoride ions.
[0113] Optical reference array: formed by screen printing or inkjet printing of cyan, magenta and yellow inks on the optical detection layer, forming a 3x2 or 4x3 color block matrix, used for real-time correction of light source fluctuations, camera white balance and background interference.
[0114] Polyimide heating film: a flexible, heat-resistant thin film heater that can uniformly heat the entire chip, with a thickness of 25-75 μm and a power density of 0.1-0.5 W / cm 2 , which realizes distributed resistance strips through screen printing of silver paste circuit.
[0115] Distributed temperature control network: refers to the integration of ≥3 micro temperature sensors (NTC thermistors or digital temperature chips) on the back or side edge of the chip, which controls the polyimide (PI) heating film through the MCU closed loop to achieve the constant temperature of ±0.5℃ in the whole reaction zone.
[0116] Bonding and packaging: through UV curing adhesive, three layers of filter paper are aligned, pressed, and UV irradiated for 5-10s to complete bonding, and then the whole is packaged in a transparent PET bag or aluminum foil bag to avoid moisture absorption and pollution.
[0117] Step S3, through the intelligent mobile phone, the multi-band light source switching is cooperatively controlled, and the reflection and fluorescence dual-mode images are synchronously collected;
[0118] In step S3, the following sub-steps are further included:
[0119] S3-1, a bidirectional digital communication connection between the intelligent mobile phone and the multi-band light source is established, a digital control instruction is generated and sent through the mobile phone application program, the multi-band light source has visible and ultraviolet emission capabilities, and the digital control instruction includes wavelength selection function, light intensity adjustment function and trigger timing control function;
[0120] S3-2, according to the digital control instruction, the light source alternately outputs the continuous spectrum required for reflection imaging and the pulsed narrowband spectrum required for fluorescence excitation;
[0121] S3-3, the mobile phone camera is synchronously controlled to continuously collect images in the reflection imaging mode, and the fluorescence image collection is started after detecting the fluorescence trigger signal, so that the paired reflection and fluorescence dual-mode images are obtained;
[0122] S3-4, the environmental parameters are obtained through the built-in environmental sensors of the intelligent mobile phone, and the environmental parameters are written into the metadata storage area of the dual-mode image file.
[0123] It should be noted that the intelligent mobile phone refers to a general mobile terminal (Android or iOS mobile phone) with a camera, Bluetooth / Wi-Fi, accelerometer, ambient light / temperature and humidity sensor, and a custom APP that can run, which is used for light source control, image collection, data caching and uploading.
[0124] Bidirectional digital communication connection: refers to the point-to-point or star network established between the mobile phone and the light source through Bluetooth 4.0 / 5.0, Wi-Fi or USB-C / OTG protocol, so that the mobile phone can send instructions and receive light source state feedback in real time.
[0125] Mobile phone application program: refers to the user-side software, which is responsible for generating digital control instructions (JSON, BLE byte package or custom protocol), and providing UI for users to select wavelength, light intensity, trigger timing and one-key start / stop detection.
[0126] Multi-band light source: refers to a composite light source that can cover both visible light (400-700 nm) and ultraviolet light (300-400 nm). Typical devices include: multiple narrow-band LED arrays (470 nm, 530 nm, 610 nm, 365 nm), white light LED + filter wheel / liquid crystal adjustable filter, and miniature xenon lamp + optical fiber coupling.
[0127] Wavelength selection function: refers to the APP controlling the light source driving circuit to switch or scan the wavelength according to the detection requirements, avoiding manual replacement of the filter and improving the degree of automation.
[0128] Light intensity adjustment function: refers to continuously adjusting the LED current through PWM duty cycle or constant current drive to ensure that the signal-to-noise ratio of the reflected and fluorescent images is consistent.
[0129] Trigger timing control function: refers to the APP defining the timing table of "reflected long bright → fluorescent pulse" to ensure that the camera and light source are synchronized in time, avoiding frame loss or overexposure.
[0130] Continuous spectrum: refers to the continuous wave visible light output by white light LED or wide spectrum LED array, used for reflected imaging (color change observation).
[0131] Pulsed narrow-band spectrum: refers to the short pulse ultraviolet light output by 365 nm or 420 nm narrow-band ultraviolet LED, used for exciting fluorescent signals.
[0132] Reflected imaging mode: refers to the mode in which the camera continuously captures at a high frame rate under visible light illumination, used to capture the color change of the color reaction.
[0133] Fluorescent trigger signal: refers to the TTL pulse or GPIO level jump generated by the APP or hardware, which informs the camera to switch to long exposure + ultraviolet cutoff filter mode and start fluorescent image acquisition.
[0134] Paired reflected and fluorescent dual-mode images: refers to the RGB reflected image and grayscale / pseudo-color fluorescent image captured at the same time or at the same pixel coordinate, which complement each other.
[0135] Mobile phone camera: refers to the main camera or macro lens of a mobile phone, which needs to support manual focus, manual exposure, RAW output, and external triggering (through HAL).
[0136] Environmental sensors: refers to the temperature sensor, humidity sensor, and ambient light sensor built into the mobile phone, whose data is obtained in real time through AndroidSensorManager or iOSCoreMotion.
[0137] Metadata storage area: refers to the EXIF header, JPEG APP1, private TIFF field, or independent JSON side-car file, used to write temperature, humidity, light intensity, device ID, and timestamp.
[0138] Step S4, extracting multi-color space features from the dual-mode image, fusing environmental parameters to construct a dynamic compensation matrix to correct the matrix interference;
[0139] In step S4, the following sub-steps are further included:
[0140] S4-1, forming a recognizable color change by the coordination reaction of the zirconium-based nanometer enzyme probe and fluoride ions, and locating the color reaction area in the dual-mode image;
[0141] S4-2, pixel-level segmentation of the color reaction area, and extraction of multi-color space features from the segmented area, the multi-color space features including channel intensity features based on RGB color space and chroma features based on Lab color space;
[0142] S4-3, feature-level fusion of environmental parameters in the metadata storage area and multi-color space features to construct an environment-aware feature representation;
[0143] S4-4, generating a dynamic compensation matrix by a distribution alignment algorithm, the dynamic compensation matrix being capable of eliminating feature distribution deviation caused by water quality matrix difference;
[0144] S4-5, linear transformation of the environment-aware feature representation and the dynamic compensation matrix to obtain a standardized feature output after correction of matrix effect.
[0145] It should be noted that the zirconium-based nanometer enzyme probe refers to the solid-state color developing unit prepared in step S1, containing a zirconium-manganese bimetallic active center, after coordination of fluoride ions, reversible electron transfer occurs in the color developing group, resulting in visible color or fluorescence change.
[0146] Dual-mode image: refers to the reflection image collected at the same time: the RGB image obtained under white light illumination and the fluorescence image: the gray or pseudo-color image obtained after ultraviolet / blue light excitation; the two complement each other, improving the signal-to-noise ratio and anti-interference ability.
[0147] Color reaction area: refers to the pixel set where the color / fluorescence changes after the reaction of the probe with fluoride ions, which needs to be accurately located by segmentation algorithm to avoid background interference.
[0148] Pixel-level segmentation: refers to separating the color developing area from the background by taking a single pixel as the smallest unit, including threshold segmentation, improved U-Net, and MaskR-CNN deep learning model.
[0149] Multi-color space features: refer to the extraction of numerical values from the following color descriptors:
[0150] RGB: red, green, and blue channel intensity;
[0151] Lab: L* lightness, a* green-red, b* blue-yellow color components.
[0152] Metadata storage area: refers to the image file header, used to save the environmental parameters of temperature, humidity, light intensity, device ID.
[0153] Feature-level fusion: refers to splicing color features (12-18 dimensions) and environmental parameters (3-5 dimensions) into 15-23 dimensional vectors to form an "environmentally aware" input, so that the subsequent model can "see" both color and surrounding conditions.
[0154] Distribution alignment algorithm: refers to a method that can align the feature distribution of different batches / different water quality samples without a large number of labels, including CORAL, MMD, Adversarial Domain Adaptation, which outputs a compensation matrix to map the "offset" features to a unified space.
[0155] Dynamic compensation matrix: refers to a linear transformation matrix M that is updated in real time with environmental changes, which satisfies the corrected feature = M x original feature; in the online inference stage, M is recalculated in real time according to the on-site temperature and turbidity to ensure detection accuracy.
[0156] Matrix effect: refers to the color / fluorescence signal drift caused by turbidity, chroma, and coexisting ions in the water sample, which must be eliminated by a compensation matrix, otherwise false positives or false negatives will occur.
[0157] Normalized feature output: refers to the feature vector after linear transformation by the compensation matrix, which has the same numerical range and distribution center as the calibration data set, and can be directly input into the neural network regression model without further calibration.
[0158] Step S5, using a lightweight neural network with attention mechanism to process the corrected features, outputting the fluoride concentration and confidence interval;
[0159] In step S5, the following sub-steps are also included:
[0160] S5-1, construct a lightweight neural network with attention mechanism, receive dynamic compensated feature input, and generate weighted feature representation by automatically learning the importance relationship between feature channels;
[0161] S5-2, train the lightweight neural network using fluoride concentration labeled data, optimize network parameters through back propagation algorithm, and output concentration prediction value and confidence interval based on Monte Carlo Dropout calculation;
[0162] S5-3, mobile terminal adaptation processing is performed on the trained neural network, which includes weight quantization, computation graph fusion, and hardware adaptation instruction set optimization;
[0163] S5-4, deploy the adapted neural network to a portable device and establish an offline detection process.
[0164] Note that the attention mechanism is an algorithm that allows the network to automatically "focus" on important channels / pixels. In lightweight CNNs, channel attention (SE-block) or spatial-channel hybrid attention is usually used. The weights are generated by global average pooling + two fully connected layers, and then multiplied by the original feature map to achieve "important information amplification and redundant information suppression".
[0165] Lightweight neural network: refers to a deep model with parameter quantity ≤1MB and inference delay ≤50ms, including MobileNet-V3, EfficientNet-Lite, and GhostNet. The core means include depth separable convolution: the standard convolution is divided into "channel-wise convolution + 1x1 point convolution", and the calculation amount is reduced to 1 / 8-1 / 9; channel pruning: remove channels with small contribution; quantization: compress 32-bit floating-point weights to 8-bit integers or 4-bit mixed precision.
[0166] Dynamic compensation feature input: refers to the 15-23 dimensional feature vector (color + environmental parameter) after S4 dynamic compensation matrix correction, which is directly input into the first layer of the network without additional manual feature engineering.
[0167] Fluoride concentration labeled data: refers to a sample set with true concentration labels, including groundwater, tap water, and river water samples measured by ion chromatography; 0.001-10mg / L gradient standard solution prepared in the laboratory.
[0168] Backpropagation algorithm: refers to the conventional training process of error backpropagation + Adam / SDG optimizer: forward: network output predicted concentration; loss: mean square error of predicted value and true value + confidence error; backward: gradient is transmitted back to each layer along the computation graph, and the weights are updated.
[0169] Monte Carlo Dropout: keep Dropout on (usually p=0.1) during inference, repeat forward propagation N times (N≥50), get N predicted values; concentration = mean of N predictions; confidence interval = mean ± 1.96 x standard deviation. No additional model is needed to give the model uncertainty.
[0170] Mobile adaptation processing: refers to converting the trained model into a complete optimization that can run offline on mobile phones, Raspberry Pi, and MCUs.
[0171] Weight quantization: INT8 / FP16 / mixed precision.
[0172] Compute graph fusion: merge Conv+BN+ReLU into a single operator to reduce memory read / write.
[0173] Instruction set optimization: rewrite convolution kernel and matrix multiplication for ARM NEON, Qualcomm Hexagon, Apple AMX SIMD instructions.
[0174] Offline detection process: refers to the detection without cloud or server: collection→image preprocessing→dynamic compensation→network inference→result output→blockchain chaining; all codes and weights are fixed in the APP or embedded firmware, which can still work offline.
[0175] Step S6, write the encrypted detection data to the blockchain, and realize data verification and over-standard alarm through the smart contract;
[0176] In step S6, the following substeps are further included:
[0177] S6-1, select a blockchain platform supporting smart contract execution to build a distributed evidence network, configure at least three consensus nodes to form a Byzantine fault-tolerant cluster, and deploy a data verification service on each consensus node and maintain a complete copy of the ledger;
[0178] S6-2, use an asymmetric encryption algorithm to digitally sign the detection result, package the signed data with the collection timestamp and device identifier to generate a data block, and append it to the end of the blockchain after consensus verification;
[0179] S6-3, write automatic verification logic code and deploy it as a smart contract on the chain, verify the validity of the signature, the continuity of the timestamp, and the legality of the device identity when the data is chained, and refuse to write data that does not meet the preset rules;
[0180] S6-4, preset the fluoride concentration threshold condition in the smart contract, and automatically send an alarm message to the preset supervision platform when the detection data exceeds the threshold, and mark the data as a high-risk record;
[0181] S6-5, develop a data access interface service that meets the REST specification, the interface is authenticated by a digital certificate, authorized users can query historical detection records on the blockchain through the interface and verify data integrity.
[0182] It should be noted that the blockchain platform refers to a distributed ledger technology that supports smart contracts, and the present embodiment selects Hyperledger Fabric (consortium chain) to provide pluggable consensus, private data sets and identity management, which is suitable for water quality supervision.
[0183] Distributed evidence network: a P2P network composed of ≥3 consensus nodes, nodes can be deployed on cloud servers and edge gateways, nodes communicate through gRPC or libp2p, and maintain a unique ledger together to prevent single-point tampering.
[0184] Byzantine Fault Tolerant Cluster: Consensus algorithm adopts PBFT, tolerates ≤1 / 3 nodes to be malicious or down, ensures agreement even in the presence of malicious or faulty nodes.
[0185] Data Verification Service: Each node runs chaincode, capable of verifying digital signatures, checking timestamp continuity, checking device identity whitelist, and executing threshold alarm logic.
[0186] Ledger Copy: Contains the world state database and the blockchain log, records all transaction hashes, timestamps, signatures, and alarm markers. All nodes save a complete copy to ensure data redundancy and traceability.
[0187] Asymmetric Encryption Algorithm: ECC-256 is used to generate a pair of public and private keys. The device-side private key performs SHA-256 hashing and ECDSA signing on the original detection data. The public key is public and used for on-chain verification.
[0188] Consensus Verification: After receiving a new block, the node runs the consensus algorithm endorsement→ordering→submission three-stage process, confirms that the signature is valid, the timestamp is increasing, and the device certificate is in the on-chain whitelist, and then appends it to the end of the ledger.
[0189] Fluoride Concentration Threshold Judgment Condition: Write a global variable threshold during contract initialization, support on-chain governance, alarm message contains: over-standard value, block height, device ID and timestamp.
[0190] Digital Certificate Identity Authentication: X.509 certificate (CA issued) is used, and the client certificate must be carried in the interface request. The server uses mTLS handshake to verify the certificate chain to ensure that only authorized users or regulatory platforms can read the data.
[0191] Data Integrity Verification: After receiving the historical record, the client can recalculate SHA-256 for each record and compare it with the on-chain hash. If they are inconsistent, it is considered tampered with, and the system refuses service and automatically alarms.
[0192] The above-described embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand: it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for part of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application.
Claims
1. A method for detecting fluoride in water quality based on colorimetric analysis of digital images, characterized by, The method comprises the following steps: Step S1, constructing a zirconium-based nanoscale enzyme probe with reversible color development function, realizing specific recognition of fluoride ions through Zr-Mn bimetallic coordination and boronic acid modification; Step S2, developing a three-layer paper-based microfluidic chip, fixing the zirconium-based nanoscale enzyme probe in the hydrophilic channel, integrating an optical reference array and a distributed temperature control network; Step S3, switching the multi-band light source through a smart phone, and synchronously collecting the reflection and fluorescence dual-mode images; Step S4, extracting multi-color space features from the dual-mode images, fusing environmental parameters to construct a dynamic compensation matrix to correct matrix interference; Step S5, using a lightweight neural network with an attention mechanism to process the corrected features, and outputting the fluoride concentration and confidence interval; Step S6, encrypting the detection data and writing it into the blockchain, and realizing data verification and over-limit alarm through a smart contract; In step S1, the following sub-steps are further included: S1-1, under an inert atmosphere, dissolving a soluble zirconium source, a manganese source and an organic ligand containing a boronic acid group in a polar organic solvent at a predetermined ratio to form a precursor solution; S1-2, transferring the precursor solution to a pressure-resistant reaction container, and performing a hydrothermal reaction in a sealed environment to generate a zirconium-manganese bimetallic organic framework material; S1-3, after the hydrothermal reaction is completed, collecting the precipitate by a solid-liquid separation method, and alternately washing it with a low-boiling organic solvent and deionized water to obtain a zirconium-manganese bimetallic organic framework precipitate; S1-4, dispersing the zirconium-manganese bimetallic organic framework precipitate in deionized water again, and performing freeze-drying treatment to obtain a porous nanoscale enzyme powder; S1-5, mixing the nanoscale enzyme powder with a weak acid buffer solution, uniformly dispersing it through stirring to form a nanoscale enzyme suspension with reversible color development function; S1-6, mixing the nanoscale enzyme suspension with a freeze-drying protective agent, then dropping it into a mold, and performing secondary freeze-drying to form a solid color development detection unit; S1-7, sealing and storing the dried color development detection unit in a light-proof and dry condition to obtain a zirconium-based nanoscale enzyme probe with reversible color development function, which can detect fluoride ions; In step S2, the following sub-steps are further included: S2-1, selecting a cellulose-based filter paper as a base material, forming a hydrophobic barrier pattern on the surface of the base material through photolithography technology, and defining a hydrophilic channel; S2-2, preparing three independent patterned substrates as a sample introduction layer, a probe reaction layer and an optical detection layer, respectively; S2-3, aligning and stacking the three independent patterned substrates, bonding them through ultraviolet curing adhesive to form a vertical flow channel through the three layers; S2-4, fixing the zirconium-based nanoscale enzyme probe in the middle of the probe reaction layer through micro-droplet technology; S2-5, printing a reference array containing cyan, magenta and yellow three primary colors on the optical detection layer; S2-6, vacuum attaching a polyimide heating film on the back of the chip, and integrating at least three temperature sensors to form a distributed temperature control network; In step S4, the following sub-steps are further included: S4-1, forming a recognizable color change through the coordination reaction of the zirconium-based nanoscale enzyme probe and fluoride ions to locate the color development reaction area in the dual-mode image; S4-2, pixel-level segmentation is performed on the color development reaction area, and multi-color space features are extracted from the segmented area, the multi-color space features including channel intensity features based on an RGB color space and chroma features based on an Lab color space; S4-3, the environmental parameters in the metadata storage area are fused with the multi-color space features at a feature level to construct an environment-aware feature representation; S4-4, a dynamic compensation matrix is generated through a distribution alignment algorithm, the dynamic compensation matrix being capable of eliminating feature distribution deviation caused by water quality matrix differences; S4-5, the environment-aware feature representation is linearly transformed with the dynamic compensation matrix to obtain a matrix effect corrected standardized feature output.
2. The water quality fluoride detection method based on digital image colorimetric analysis according to claim 1, wherein in step S3, the following sub-steps are further included: S3-1, a bidirectional digital communication connection is established between the smartphone and the multi-band light source, a digital control instruction is generated and sent through the mobile phone application program, the multi-band light source has visible light band and ultraviolet band emission capability, and the digital control instruction includes wavelength selection function, light intensity adjustment function and trigger timing control function; S3-2, according to the digital control instruction, the light source is controlled to alternately output continuous spectrum required for reflection imaging and pulsed narrow-band spectrum required for fluorescence excitation; S3-3, the smartphone camera is synchronously controlled to continuously capture images in reflection imaging mode, and fluorescence image acquisition is started after detecting a fluorescence trigger signal, paired reflection and fluorescence dual-mode images are obtained; S3-4, environmental parameters are acquired through the built-in environmental sensor of the smartphone, and the environmental parameters are written into the metadata storage area of the dual-mode image file.
3. The water quality fluoride detection method based on digital image colorimetric analysis according to claim 1, wherein in step S5, the following sub-steps are further included: S5-1, a lightweight neural network with attention mechanism is constructed to receive dynamic compensation feature input, and a weighted feature representation is generated by automatically learning the importance relationship between feature channels; S5-2, the lightweight neural network is trained using fluoride concentration labeled data, network parameters are optimized through a back propagation algorithm, and concentration prediction values and confidence intervals based on Monte Carlo Dropout calculation are simultaneously output; S5-3, mobile terminal adaptation processing is performed on the trained neural network, the mobile terminal adaptation processing including weight quantization, computation graph fusion and hardware adaptation instruction set optimization; S5-4, the adapted neural network is deployed to a portable device to establish an offline detection process.
4. The water quality fluoride detection method based on digital image colorimetric analysis according to claim 1, wherein in step S6, the following sub-steps are further included: S6-1, a distributed storage network is constructed by selecting a blockchain platform supporting smart contract execution, at least three consensus nodes are configured to form a Byzantine fault-tolerant cluster, and each consensus node deploys a data verification service and maintains a complete copy of the ledger. S6-2, use asymmetric encryption algorithm to digitally sign the test results, package the signed data with the collection timestamp and device identifier to generate a data block, and append it to the end of the blockchain after consensus verification; S6-3, write automatic verification logic code and deploy it as a smart contract on the chain. Verify the validity of the signature, the continuity of the timestamp, and the legality of the device identity when the data is chained. Reject data that does not meet the preset rules; S6-4, preset fluoride concentration threshold judgment condition in the smart contract. When the detection data exceeds the threshold, automatically send an alarm message to the preset supervision platform and mark the data as a high-risk record; S6-5, develop a data access interface service that complies with REST specifications. The interface is authenticated through a digital certificate. Authorized users can query historical test records on the blockchain and verify data integrity through this interface.