Liquid concentration sensing method and device based on machine learning and nano optical fiber taper
Through the liquid concentration sensing method based on machine learning and nanofiber cone, liquid concentration prediction is achieved using clustering and multi-layer perceptron networks, the problem of traditional micro-nano fiber sensors relying on high-precision optical detection instruments is solved, and the cost is low Measure quickly and accurately, responding to intuitive liquid concentration detection.
Patent Information
- Application Number
- CN202411096605.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-12
- Publication Date
- 2024-11-12
AI Technical Summary
Traditional micro-nano fiber optic sensors rely on high-precision optical detection instruments in signal analysis and data analysis, resulting in high costs, limited application range, and require professionals to carry out complex data processing, increasing labor costs and operational complexity.
Using liquid concentration sensing methods based on machine learning and nanofiber cones, optical scattered images are clustered through the K-means algorithm, and multi-layer perceptron network is built, dark field scattered grayscale images are used to predict concentrations, reducing data analysis costs And improve measurement stability and accuracy.
It realizes portable and real-time monitoring, reduces dependence on high-precision optical detection instruments, improves measurement stability and accuracy, simplifies the data analysis process, and is suitable for on-site real-time detection.
Smart Images

Figure CN118941832A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of micro-nano optical fiber sensing, and in particular to a liquid concentration sensing method and device based on machine learning and nano optical fiber cones. Background Art
[0002] With the continuous development of science and technology, micro-nano fiber optic sensors are increasingly used in the fields of optics, biology, chemistry and environmental monitoring. However, traditional micro-nano fiber optic sensors still face some technical bottlenecks and challenges in refractive index sensing. First, in the signal analysis stage, traditional micro-nano fiber optic sensors need to use precision optical analyzers such as spectrometers or power meters for in-depth measurement and analysis. This reliance on high-precision optical detection instruments not only increases the cost of the sensor, but also limits its popularity and scope of application. Secondly, when performing signal processing, traditional micro-nano fiber optic sensors usually require professionals to perform complex data analysis. This not only places high demands on the professional skills of operators, but also increases labor costs and operational complexity.
[0003] Therefore, it has become an urgent need to propose a micro-nano fiber optic sensing method that is low-cost, fast and accurate in measurement, intuitive in response, and easy to integrate. Summary of the invention
[0004] The purpose of this application is to propose a liquid concentration sensing method and device based on machine learning and nano-fiber cones to address the above-mentioned technical problems.
[0005] In a first aspect, the present invention provides a liquid concentration sensing method based on machine learning and nano-fiber cones, comprising the following steps:
[0006] The nano-fiber cone is placed in the liquid to be detected and several sample liquids respectively, and the optical scattering images of the end section of the nano-fiber cone in the liquid to be detected and several sample liquids are obtained respectively to obtain the image to be detected and the sample image;
[0007] The K-means algorithm is used to cluster the sample images to obtain clustering results, which include N cluster centers and the concentration areas they represent. The distances between the image to be detected and the N cluster centers are calculated respectively, and the image is assigned to the concentration area represented by the cluster center with the closest distance to obtain the concentration area of the liquid to be detected.
[0008] Construct N multi-layer perceptron networks, each of which corresponds to the concentration regions represented by the N cluster centers. The multi-layer perceptron networks are trained using sample images in the corresponding concentration regions to obtain a concentration prediction model.
[0009] The concentration prediction model corresponding to the concentration area of the liquid to be detected is called, and the image to be detected is input for concentration prediction to obtain the concentration prediction value of the liquid to be detected.
[0010] Preferably, the multi-layer perceptron network is trained with sample images in the corresponding concentration region to obtain a concentration prediction model, which specifically includes:
[0011] Inputting a sample image in a concentration region corresponding to the multilayer perceptron network into the multilayer perceptron network, and obtaining a concentration prediction value of the sample liquid corresponding to the sample image;
[0012] The multi-layer perceptron network is trained using the gradient descent method, and the ReLU function is used as the activation function of its hidden layer. The root mean square error and R are calculated based on the concentration prediction values of all sample liquids and their corresponding true concentration values. 2 , select the minimum root mean square error and R 2 The largest multi-layer perceptron network is used as the concentration prediction model for the corresponding concentration area.
[0013] Preferably, the nanofiber cone is an optical fiber obtained by heating and drawing a standard single-mode optical fiber. The nanofiber cone includes a standard section and a cone tip section. The excitation light is input from one end of the standard section, and after being transmitted through the standard section, it is transmitted from the other end of the standard section to the cone tip section. The leakage mode of the cone tip section produces optical scattering.
[0014] Preferably, the nanofiber cone is placed in a liquid to be detected and several sample liquids, respectively, and optical scattering images of the end section of the nanofiber cone in the liquid to be detected and several sample liquids are obtained, respectively, to obtain an image to be detected and a sample image, specifically comprising: immersing the nanofiber cone below the liquid surface of the liquid to be detected or the sample liquid, placing the liquid to be detected or the sample liquid under the objective lens of an optical microscope for magnification, placing a camera above the objective lens of the optical microscope, taking a dark field scattering grayscale image of the magnified cone tip section, and using the dark field scattering grayscale image of the cone tip section of the nanofiber cone in the liquid to be detected as the image to be detected, and using the dark field scattering grayscale image of the cone tip section of the nanofiber cone in the sample liquid as the sample image.
[0015] Preferably, a sample image corresponding to a sample liquid includes a plurality of dark field scattering grayscale images at different exposure times.
[0016] Preferably, the diameter of the standard segment is in the range of 20 to 50 nm, the cone angle of the cone tip segment is in the range of 15 to 30°, and the cone length of the cone tip segment is in the range of 125 to 130 mm.
[0017] In a second aspect, the present invention provides a liquid concentration sensing device based on machine learning and nano-fiber cones, comprising:
[0018] An image acquisition module is configured to place the nano-fiber cone in the liquid to be detected and several sample liquids, respectively, and obtain optical scattering images of the end of the nano-fiber cone in the liquid to be detected and several sample liquids, respectively, to obtain an image to be detected and a sample image;
[0019] The concentration classification module is configured to cluster the sample images using the K-means algorithm to obtain clustering results, which include N cluster centers and the concentration areas they represent. The distances between the image to be detected and the N cluster centers are calculated respectively, and the image is assigned to the concentration area represented by the cluster center with the closest distance to obtain the concentration area of the liquid to be detected.
[0020] The model building module is configured to build N multi-layer perceptron networks, the N multi-layer perceptron networks correspond to the concentration areas represented by the N cluster centers respectively, and the multi-layer perceptron networks are trained using sample images in the corresponding concentration areas to obtain a concentration prediction model;
[0021] The concentration prediction module is configured to call a concentration prediction model corresponding to the concentration area of the liquid to be detected, and input the image to be detected to perform concentration prediction to obtain a concentration prediction value of the liquid to be detected.
[0022] In a third aspect, the present invention provides an electronic device comprising one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any implementation manner in the first aspect.
[0023] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in any implementation manner in the first aspect.
[0024] In a fifth aspect, the present invention provides a computer program product, comprising a computer program, which, when executed by a processor, implements the method described in any implementation manner in the first aspect.
[0025] Compared with the prior art, the present invention has the following beneficial effects:
[0026] (1) The liquid concentration sensing method based on machine learning and nano-fiber cone proposed in the present invention collects the dark field scattering grayscale image of the tip section of the nano-fiber cone in the liquid, and analyzes and processes the dark field scattering grayscale image, thereby linking the optical distribution information in the micro-nano fiber structure with the change in liquid concentration, providing modular processing for the signal processing and analysis of the micro-nano fiber sensor, reducing the cost of data analysis, thereby solving the problem of micro-nano fiber sensor's dependence on high-precision optical detection instruments and the need for complex data analysis, and achieving portability and real-time monitoring.
[0027] (2) In the liquid concentration sensing method based on machine learning and nano-fiber cones proposed in the present invention, a clustering algorithm is used to cluster the dark field scattering grayscale image of the tip section of the nano-fiber cone in the sample liquid to obtain a clustering result. The liquid to be detected is classified according to the clustering result and the dark field scattering grayscale image of the tip section of the nano-fiber cone in the liquid to be detected, and then a specific concentration prediction is performed, thereby improving the stability and accuracy of the measurement.
[0028] (3) The liquid concentration sensing method based on machine learning and nano-fiber cones proposed in the present invention predicts the concentration value of the liquid to be detected through a trained multi-layer perceptron network, introduces micro-nano microscopic images with richer detail information into the field of sensing analysis, realizes the sensing of the refractive index of the liquid to be detected, and improves the stability and accuracy of the measurement, so as to realize real-time detection of the liquid on site. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0030] Figure 1 A schematic flow chart of a liquid concentration sensing method based on machine learning and nano-fiber cones according to an embodiment of the present application;
[0031] Figure 2 A schematic diagram of a liquid concentration sensing device based on machine learning and nano-fiber cones according to an embodiment of the present application;
[0032] Figure 3 A schematic diagram of the structure of a nano-fiber cone according to an embodiment of the present application;
[0033] Figure 4 This is a structural diagram of an image acquisition module according to an embodiment of the present application;
[0034] Figure 5 An example of a dark field scattering grayscale image of a nano-fiber cone tip segment obtained according to an embodiment of the present application;
[0035] Figure 6 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present invention.
[0036] Reference numerals: 11, nano-fiber cone; 111, standard section; 112, cone tip section 12, liquid; 13, objective lens of optical microscope; 14, camera. DETAILED DESCRIPTION
[0037] In order to make the purpose, technical scheme and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0038] Figure 1 A liquid concentration sensing method based on machine learning and nano-fiber cones provided in an embodiment of the present application is shown, comprising the following steps:
[0039] S1, placing the nano-fiber cone in a liquid to be detected and several sample liquids respectively, and obtaining optical scattering images of the end of the nano-fiber cone in the liquid to be detected and several sample liquids respectively, to obtain an image to be detected and a sample image.
[0040] In a specific embodiment, the nano-fiber cone is an optical fiber obtained by heating and drawing a standard single-mode optical fiber. The nano-fiber cone includes a standard section and a cone tip section. The excitation light is input from one end of the standard section, and after being transmitted through the standard section, it is transmitted from the other end of the standard section to the cone tip section. The leakage mode of the cone tip section produces optical scattering.
[0041] Specifically, research in micro-nano photonics has shown that drawing micro-nano optical fibers into a conical structure can form a detailed light field scattering field at the tip of the cone. The resulting optical scattering image of the tip of the cone contains rich optical information related to the ambient refractive index.
[0042] In a specific embodiment, the diameter of the standard segment is in the range of 20 to 50 nm, the cone angle of the cone tip segment is in the range of 15 to 30°, and the cone length of the cone tip segment is in the range of 125 to 130 mm.
[0043] In a specific embodiment, the nanofiber cone is placed in a liquid to be detected and several sample liquids, respectively, and optical scattering images of the end section of the nanofiber cone in the liquid to be detected and several sample liquids are obtained, respectively, to obtain an image to be detected and a sample image, specifically comprising: immersing the nanofiber cone below the liquid surface of the liquid to be detected or the sample liquid, placing the liquid to be detected or the sample liquid under the objective lens of an optical microscope for magnification, placing a camera above the objective lens of the optical microscope, taking a dark field scattering grayscale image of the magnified cone tip section, and using the dark field scattering grayscale image of the cone tip section of the nanofiber cone in the liquid to be detected as the image to be detected, and using the dark field scattering grayscale image of the cone tip section of the nanofiber cone in the sample liquid as the sample image.
[0044] In a specific embodiment, a sample image corresponding to a sample liquid includes a plurality of dark field scattered grayscale images at different exposure times.
[0045] Specifically, in the embodiment of the present application, NaCl solution is used as the sample liquid, and its concentration is distributed in the concentration range of 0.1% to 1.5% with a step length of 0.1%, and is divided into three categories according to the concentration: 0.1% to 0.5% is low concentration, 0.6% to 1.0% is medium concentration, and 1.1% to 1.5% is high concentration. Image acquisition is performed according to the following steps:
[0046] (1) The end of a standard single-mode optical fiber is drawn by a heating method to obtain a nano-optical fiber cone, which includes a standard section and a cone tip section.
[0047] (2) Immerse the nanofiber cone below the liquid surface, with the tip of the cone about 0.5 mm away from the upper surface of the liquid; Figure 4 , the liquid is placed under the objective lens of an optical microscope for magnification, the magnification is 500×, a high-resolution camera is used and the camera is placed above the objective lens of the optical microscope.
[0048] (3) The excitation light is input from one end of the standard segment, and after being transmitted through the standard segment, it is transmitted from the other end of the standard segment to the cone tip segment. The leakage mode of the cone tip segment produces optical scattering, and the camera captures the dark field scattering grayscale image of the magnified cone tip segment.
[0049] Specifically, the dark field scattering grayscale image of the nanofiber cone tip in the liquid to be detected or the sample liquid after light is passed through is used as the image to be detected or the sample image, which can link the optical distribution information in the micro-nano fiber structure with the change in liquid concentration, and introduce the micro-nano microscopic image with richer detail information into the field of sensing analysis. In the embodiment of the present application, the nanofiber cone tip is at the level of the dark field scattering grayscale image, with a resolution of not less than 300dpi and an image size of not less than 945 pixels × 619 pixels, with reference to Figure 5 , Figure 5 An example of a dark field scattering grayscale image of a nanofiber cone tip segment with an exposure time of 20ms is given. In different sample liquids, dark field scattering grayscale images of the same nanofiber cone tip segment are collected. Furthermore, the exposure time is adjusted in the range of 10ms to 30ms, and 60 original dark field scattering grayscale images of each concentration sample liquid at different exposure times are obtained. A total of 900 original dark field scattering grayscale images are collected for NaCl solutions in the concentration range of 0.1% to 1.5%. The 900 original dark field scattering grayscale images are expanded by rotation, scaling, translation and other operations to obtain no less than 2700 sample images.
[0050] S2, use K-means algorithm to cluster the sample images and obtain clustering results. The clustering results include N cluster centers and the concentration areas they represent. The distances between the image to be detected and the N cluster centers are calculated respectively, and the images are assigned to the concentration areas represented by the cluster centers closest to them, so as to obtain the concentration areas of the liquid to be detected.
[0051] Specifically, the concentration classification is carried out according to the following steps:
[0052] (1) The K-means algorithm is used to cluster 2700 sample images to obtain clustering results. The clustering results include three cluster centers and the concentration areas they represent. The concentration area represented by the first cluster center is a low-concentration area, the concentration area represented by the second cluster center is a medium-concentration area, and the concentration area represented by the third cluster center is a high-concentration area.
[0053] Specifically, the “Silhouette Coefficient Method” is used to evaluate the clustering effect of the K-means algorithm on 2700 sample images, as shown in Table 1.
[0054] Table 1 Clustering effect analysis of 2700 sample images
[0055] Concentration area Cluster Center Silhouette Coefficient Cohesion Separation Low concentration (80.30,14.97) 0.52 51.05 107.47 Medium concentration (-65.17,21.83) 0.56 50.47 116.86 High concentration (-3.82,-60.57) 0.32 63.18 97.77
[0056] The clustering evaluation indicators for 2700 sample images are: adjusted Rand index ARI is 0.9551, accuracy is 0.9848, precision is 0.9850, recall rate is 0.9850, and F1 score is 0.9848.
[0057] (2) The distances between the image to be detected and the three cluster centers are calculated respectively, and the image to be detected is assigned to the concentration region represented by the cluster center closest to it, thereby obtaining the concentration region of the liquid to be detected.
[0058] S3, constructing N multilayer perceptron networks, the N multilayer perceptron networks correspond one-to-one to the concentration areas represented by the N cluster centers, respectively, and training the multilayer perceptron networks using sample images in the corresponding concentration areas to obtain a concentration prediction model.
[0059] In a specific embodiment, the multi-layer perceptron network is trained using sample images in the corresponding concentration region to obtain a concentration prediction model, which specifically includes:
[0060] Inputting a sample image in a concentration region corresponding to the multilayer perceptron network into the multilayer perceptron network, and obtaining a concentration prediction value of the sample liquid corresponding to the sample image;
[0061] The multi-layer perceptron network is trained using the gradient descent method, and the ReLU function is used as the activation function of its hidden layer. The root mean square error and R are calculated based on the concentration prediction values of all sample liquids and their corresponding true concentration values. 2 , select the minimum root mean square error and R 2 The largest multi-layer perceptron network is used as the concentration prediction model for its corresponding concentration area.
[0062] Specifically, the model is constructed in the following steps:
[0063] (1) Construct three multi-layer perceptron (MLP) networks, which correspond one-to-one to the concentration areas represented by the three cluster centers mentioned above.
[0064] In an embodiment of the present application, a database for constructing a multi-layer perceptron network is also included, and the database includes a dark field scattering grayscale image of the cone tip segment as an input of the multi-layer perceptron network, and the true value of the sample liquid concentration corresponding to each dark field scattering grayscale image. The sample images are divided according to the concentration area of the NaCl solution to obtain a low concentration area sample image, a medium concentration area sample image, and a high concentration area sample image. There are 900 sample image data in each concentration area, and the data in each concentration area is divided into a training set, a validation set, and a test set in a ratio of 7:1:2, for establishing a multi-layer perceptron (MLP) network corresponding to each concentration area.
[0065] (2) The multi-layer perceptron network is trained using sample images in the corresponding concentration region to obtain a concentration prediction model.
[0066] In the embodiment of the present application, all sample images in each concentration region are rearranged in rows as input data of the multilayer perceptron network corresponding to the concentration region, and the output of the multilayer perceptron network is the concentration prediction value. During the training process of the multilayer perceptron network, the weights and biases of the multilayer perceptron network are adjusted by the gradient descent method. The concentration prediction value output by the multilayer perceptron network is compared with the actual concentration value corresponding to the sample image of the training set, and the root mean square error (RMSE) and R 2 As the evaluation criterion. After multiple trainings, the minimum root mean square error and R 2 The structure of the largest multi-layer perceptron network is used as the best model for concentration prediction in the corresponding concentration area, that is, the concentration prediction model.
[0067] In an embodiment of the present application, the hidden layer structure of the concentration prediction model corresponding to the low concentration area is (5 5), each hidden layer contains 5 neurons, and the activation function of each layer adopts the ReLu function, RMSE = 7.36×10-2%, R2 = 0.982; the hidden layer structure of the concentration prediction model corresponding to the medium concentration area is (4 4 4), each of the three hidden layers contains 4 neurons, the activation function is the ReLU function, RMSE = 7.40×10-2%, R2 = 0.983; the hidden layer structure of the concentration prediction model corresponding to the high concentration area is (3 5 4), the number of neurons in the three hidden layers are 3, 4, and 5 respectively, and the activation function of each layer is the ReLU function, RMSE = 7.42×10-2%, R2 = 0.980.
[0068] S4, calling a concentration prediction model corresponding to the concentration area of the liquid to be detected, and inputting the image to be detected to perform concentration prediction, so as to obtain a concentration prediction value of the liquid to be detected.
[0069] Specifically, with the development of image processing technology and machine learning, the deep mining of dark field scattering grayscale image information can be achieved through clustering algorithms assisted by image processing technology. In the liquid concentration sensing method based on machine learning and nano-fiber cones proposed in this application, the liquid to be detected is classified according to the dark field scattering grayscale image of the nano-fiber cone, and the sensing of the refractive index of the liquid to be detected is realized, which provides the possibility of modular processing for the signal processing and analysis of micro-nano fiber optic sensors. A software analysis system for micro-nano fiber optic sensor devices can be established for in-depth analysis and processing, thereby realizing rapid and accurate detection of material composition and structural analysis, better realizing portability and real-time monitoring, meeting the needs of rapid detection in the field or on-site environment, improving the intuitiveness and feasibility of detection, and providing more reliable data for research and application in related fields in real time. Therefore, the liquid concentration sensing method based on machine learning and nano-fiber cones proposed in this application gets rid of the dependence of micro-nano fiber optic sensors on high-precision optical detection instruments, reduces the cost of data analysis, and improves the stability and accuracy of measurement, which is conducive to popularization and promotion.
[0070] The above steps S1-S4 do not necessarily represent the order between the steps, but are represented by step symbols, and the order between the steps can be adjusted.
[0071] Further references Figure 2 As an implementation of the methods shown in the above figures, the present application provides an embodiment of a liquid concentration sensing device based on machine learning and nano-fiber cones. Figure 1 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.
[0072] The embodiment of the present application provides a liquid concentration sensing device based on machine learning and nano-fiber cones, including:
[0073] The image acquisition module 1 is configured to place the nano-fiber cone in the liquid to be detected and several sample liquids, respectively, and obtain the optical scattering images of the end section of the nano-fiber cone in the liquid to be detected and several sample liquids, respectively, to obtain the image to be detected and the sample image;
[0074] The concentration classification module 2 is configured to cluster the sample image using the K-means algorithm to obtain a clustering result, which includes N cluster centers and the concentration areas they represent. The distances between the image to be detected and the N cluster centers are calculated respectively, and the image is assigned to the concentration area represented by the cluster center closest to the image to obtain the concentration area of the liquid to be detected.
[0075] The model building module 3 is configured to build N multi-layer perceptron networks, the N multi-layer perceptron networks correspond to the concentration areas represented by the N cluster centers respectively, and the multi-layer perceptron networks are trained using sample images in the corresponding concentration areas to obtain a concentration prediction model;
[0076] The concentration prediction module 4 is configured to call a concentration prediction model corresponding to the concentration area of the liquid to be detected, and input the image to be detected to perform concentration prediction to obtain a concentration prediction value of the liquid to be detected.
[0077] Specifically, refer to Figure 3 and Figure 4 The image acquisition module 1 includes a nano-fiber cone 11, a liquid 12, an objective lens 13 of an optical microscope, and a camera 14. The nano-fiber cone 11 includes a standard section 111 and a cone tip section 112. The excitation light is input from one end of the standard section 111. The cone tip section 112 of the nano-fiber cone and part of the standard section 111 are immersed in the liquid 12 to be detected or the sample liquid 12, and the distance from the liquid surface of the liquid 12 is about 0.5 mm. The liquid 12 to be detected or the sample liquid 12 is placed under the objective lens 13 of the optical microscope for magnification. The camera 14 is placed above the objective lens 13 of the optical microscope to capture the dark field scattered grayscale image of the magnified cone tip section 112.
[0078] The present application proposes a liquid concentration sensing method and device based on machine learning and nano-fiber cones. The nano-fiber cones are made of standard single-mode optical fibers, and dark-field scattering grayscale images of the cone tip are obtained through optical scattering. The concentration area of the liquid to be detected is classified and predicted using the clustering results. Then, a concentration prediction model based on a multi-layer perceptron is used to further predict the concentration of the specific liquid to be detected, thereby realizing liquid concentration sensing. This eliminates the dependence of micro-nano fiber sensors on high-precision optical detection instruments, reduces the cost of data analysis, and improves the stability and accuracy of measurements, so as to facilitate the on-site real-time detection of liquids. The application of the present application enables micro-nano fiber sensors to have the advantages of simple structure, low cost, real-time, intuitive response, and easy integration. It can achieve portability and real-time monitoring, and has broad application prospects in environmental monitoring, chemical analysis, food safety and other fields.
[0079] Figure 6 Schematic diagram of the hardware structure of the electronic device provided by the embodiment of the present invention. Figure 6 As shown, the electronic device of this embodiment includes: a processor 601 and a memory 602; wherein the memory 602 is used to store computer-executable instructions; the processor 601 is used to execute the computer-executable instructions stored in the memory to implement the various steps performed by the electronic device in the above embodiment. For details, please refer to the relevant description in the above method embodiment.
[0080] Optionally, the memory 602 may be independent or integrated with the processor 601 .
[0081] When the memory 602 is independently provided, the electronic device further includes a bus 603 for connecting the memory 602 and the processor 601 .
[0082] The embodiment of the present invention further provides a computer storage medium, in which computer execution instructions are stored. When the processor 601 executes the computer execution instructions, the above method is implemented.
[0083] The embodiment of the present invention further provides a computer program product, including a computer program. When the computer program is executed by the processor 601, the above method is implemented.
[0084] In the embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules is only a logical function division, and there may be other division methods in actual implementation, such as multiple modules can be combined or integrated into another system, or some features can be ignored or not executed. Another point, the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or modules, which can be electrical, mechanical or other forms.
[0085] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to implement the solution of this embodiment.
[0086] In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, each module may exist physically separately, or two or more modules may be integrated into one unit. The above-mentioned module-composed unit may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0087] The above-mentioned integrated module implemented in the form of a software function module can be stored in a computer-readable storage medium. The above-mentioned software function module is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor 601 to perform some steps of the methods of various embodiments of the present application.
[0088] It should be understood that the processor 601 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or the processor 601 may be any conventional processor 601, etc. The steps of the method disclosed in the invention may be directly embodied in the execution of the hardware processor 601, or may be executed by a combination of hardware and software modules in the processor 601.
[0089] The memory 602 may include a high-speed RAM memory, and may also include a non-volatile storage NVM, such as at least one disk memory, and may also be a USB flash drive, a mobile hard disk, a read-only memory, a magnetic disk, or an optical disk.
[0090] The bus 603 may be an Industry Standard Architecture (ISA), a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus 603 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus 603 in the drawings of the present application is not limited to only one bus 603 or one type of bus 603.
[0091] The above storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The storage medium can be any available medium that can be accessed by a general or special purpose computer.
[0092] An exemplary storage medium is coupled to the processor 601, so that the processor 601 can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor 601. The processor 601 and the storage medium can be located in an application specific integrated circuit (ASIC). Of course, the processor 601 and the storage medium can also exist as discrete components in an electronic device or a main control device.
[0093] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.
[0094] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A liquid concentration sensing method based on machine learning and nano-fiber cones, characterized in that: The following steps are involved: The nano-fiber cone is placed in the liquid to be detected and several sample liquids respectively, and the optical scattering images of the end section of the nano-fiber cone in the liquid to be detected and several sample liquids are obtained respectively to obtain the image to be detected and the sample image; The sample image is clustered using a K-means algorithm to obtain a clustering result, wherein the clustering result includes N cluster centers and the concentration regions represented by them, and the distances between the image to be detected and the N cluster centers are calculated respectively, and the image is assigned to the concentration region represented by the cluster center with the closest distance to obtain the concentration region of the liquid to be detected; Constructing N multilayer perceptron networks, each of which corresponds to the concentration regions represented by the N cluster centers, and training the multilayer perceptron networks using sample images in the corresponding concentration regions to obtain a concentration prediction model; The concentration prediction model corresponding to the concentration area of the liquid to be detected is called, and the image to be detected is input to perform concentration prediction to obtain a concentration prediction value of the liquid to be detected.
2. The liquid concentration sensing method based on machine learning and nano-fiber cones according to claim 1 is characterized in that: The multi-layer perceptron network is trained using sample images in the corresponding concentration region to obtain a concentration prediction model, specifically including: Inputting a sample image in a concentration region corresponding to the multilayer perceptron network into the multilayer perceptron network to obtain a concentration prediction value of the sample liquid corresponding to the sample image; The multi-layer perceptron network is trained using the gradient descent method, and the ReLU function is used as the activation function of its hidden layer. The root mean square error and R are calculated based on the concentration prediction values of all the sample liquids and their corresponding true concentration values. 2 , select the minimum root mean square error and R 2 The largest multi-layer perceptron network is used as the concentration prediction model for the corresponding concentration area.
3. The liquid concentration sensing method based on machine learning and nano-fiber cones according to claim 1 is characterized in that: The nano fiber cone is an optical fiber obtained by heating and drawing a standard single-mode optical fiber. The nano fiber cone includes a standard section and a cone tip section. Excitation light is input from one end of the standard section, and after being transmitted by the standard section, it is transmitted from the other end of the standard section to the cone tip section. The leakage mode of the cone tip section produces optical scattering.
4. The liquid concentration sensing method based on machine learning and nano-fiber cones according to claim 3 is characterized in that: The method of placing the nanofiber cone in a liquid to be detected and a plurality of sample liquids, respectively, and obtaining optical scattering images of the end section of the nanofiber cone in the liquid to be detected and the plurality of sample liquids, respectively, to obtain the image to be detected and the sample image, specifically comprises: immersing the nanofiber cone below the liquid surface of the liquid to be detected or the sample liquid, placing the liquid to be detected or the sample liquid below the objective lens of an optical microscope for magnification, placing a camera above the objective lens of the optical microscope, photographing a dark field scattering grayscale image of the magnified cone tip section, and using the dark field scattering grayscale image of the cone tip section of the nanofiber cone in the liquid to be detected as the image to be detected, and using the dark field scattering grayscale image of the cone tip section of the nanofiber cone in the sample liquid as the sample image.
5. The liquid concentration sensing method based on machine learning and nano-fiber cones according to claim 4 is characterized in that: A sample image corresponding to the sample liquid includes a plurality of dark field scattered grayscale images at different exposure times.
6. The liquid concentration sensing method based on machine learning and nano-fiber cones according to claim 3 is characterized in that: The diameter of the standard section is in the range of 20 to 50 nm, the cone angle of the cone tip section is in the range of 15 to 30 degrees, and the cone length of the cone tip section is in the range of 125 to 130 mm.
7. A liquid concentration sensing device based on machine learning and nano-fiber cones, characterized in that: include: An image acquisition module is configured to place the nano-fiber cone in the liquid to be detected and several sample liquids, respectively, and obtain optical scattering images of the end of the nano-fiber cone in the liquid to be detected and several sample liquids, respectively, to obtain an image to be detected and a sample image; A concentration classification module is configured to cluster the sample image using a K-means algorithm to obtain a clustering result, wherein the clustering result includes N cluster centers and the concentration areas represented by them, respectively calculating the distance between the image to be detected and the N cluster centers, and assigning the image to the concentration area represented by the cluster center closest to it, thereby obtaining the concentration area of the liquid to be detected; The model building module is configured to build N multi-layer perceptron networks, the N multi-layer perceptron networks correspond one-to-one to the concentration areas represented by the N cluster centers, and the multi-layer perceptron networks are trained using sample images in the corresponding concentration areas to obtain a concentration prediction model; The concentration prediction module is configured to call a concentration prediction model corresponding to the concentration area of the liquid to be detected, and input the image to be detected to perform concentration prediction to obtain a concentration prediction value of the liquid to be detected.
8. An electronic device comprising: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
