Seawater salinity quantitative detection method and device
Through liquid crystal sensors and deep learning technology, combined with object detection algorithms and efficient neural networks, the stability and accuracy problems in marine salinity detection are solved, and the automated and high-precision detection of seawater salinity is realized.
Patent Information
- Application Number
- CN202411753455.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-02
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2044-12-02
AI Technical Summary
The existing marine salinity detection technology has stability and accuracy problems, and the sample pre-processing and post-processing processes are complex, which increases the operational complexity and error risks.
The liquid crystal sensor is combined with the object detection algorithm and the efficient neural network, and the optical image of the liquid crystal chip is collected through a polarization microscope, pre-processing, target extraction and feature calculation, and seawater salinity prediction value is generated.
It realizes automated and high-precision detection of seawater salinity, simplifies the operation process, improves the detection ability of subtle changes, and significantly improves the performance and reliability of the sensor.
Smart Images

Figure CN119619016A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the technical field of seawater salinity detection, and in particular to a method and device for quantitatively detecting seawater salinity. Background Art
[0002] Liquid crystal is a new state of matter between liquid and solid. In recent years, due to the optical birefringence of liquid crystal and its highly sensitive response to external stimuli, it has attracted widespread attention in the field of sensing. The working principle of liquid crystal sensors is mainly based on confining liquid crystals in a certain space. When exposed to external environmental stimuli (such as temperature, pressure, physical or chemical interactions, etc.), the alignment orientation of liquid crystal molecules will change. This alignment change can be observed under an orthogonal polarizing microscope, thereby obtaining a series of optical images. At present, nematic liquid crystal (5CB) has been often used as a sensitive element in the field of biosensors due to its chemical stability and optical responsiveness. It can effectively reflect subtle chemical changes in the environment. In the design of liquid crystal sensors, three key parts are usually included: a functionalized substrate, a liquid crystal film, and a liquid-liquid crystal interface system for detecting specific biological or chemical substances. The functionalized substrate is mainly responsible for providing a platform suitable for the attachment and arrangement of liquid crystal molecules. Usually, the vertical or parallel arrangement of liquid crystal molecules on the substrate is achieved by chemical modification. The preparation of liquid crystal film requires controlling the thickness and uniformity of the film. Flexible polydimethylsiloxane (PDMS) material can be used to prepare optofluidic chips with microstructures. Liquid crystals are filled in the microstructures to confine the liquid crystals, and the size and thickness of the liquid crystal film can be controlled by controlling the size of the chip microstructure.
[0003] Although there have been some new developments in the research of liquid crystal sensors, there are still some technical challenges in the specific application field of ocean salinity detection. First, because traditional sensors mostly adopt open system design, this makes the sensors vulnerable to environmental factors such as temperature, humidity and chemical pollution, which affects their stability and detection accuracy. In addition, the pre-treatment and post-treatment process of samples is complicated and involves multiple steps such as sample collection, storage and pretreatment, which not only increases the complexity of operation, but also may introduce additional errors due to improper operation. Therefore, the development of liquid crystal sensors that can automatically obtain salinity readings to reduce human operation is a major challenge in the current development of ocean salinity sensors. Summary of the invention
[0004] The embodiment of the present invention provides a method and device for quantitatively detecting seawater salinity, which can automatically and accurately detect salinity values in a marine environment.
[0005] In order to solve the above technical problems, an embodiment of the present invention provides a method for quantitatively detecting seawater salinity, comprising:
[0006] Obtaining a liquid crystal optical image to be detected, wherein the liquid crystal optical image is formed by collecting a liquid crystal chip soaked in seawater to be detected using a polarizing microscope;
[0007] Preprocessing the liquid crystal optical image;
[0008] Extracting target units from the preprocessed liquid crystal optical image based on a target detection algorithm;
[0009] The extracted target unit is input into a pre-trained target model, and the target model extracts features of the target unit and calculates the extracted image features to generate a predicted value of seawater salinity, wherein the target model is formed by a convolutional neural network that introduces a coordinate attention mechanism;
[0010] The predicted value of seawater salinity output by the target model is received.
[0011] In some embodiments, the preprocessing of the liquid crystal optical image comprises:
[0012] The liquid crystal optical image is subjected to rotation correction and data cleaning processing.
[0013] In some embodiments, the liquid crystal optical image includes a plurality of images, and the rotation correction and data cleaning processing of the liquid crystal optical image includes:
[0014] unifying the sizes of the plurality of liquid crystal optical images to a target size, wherein the target size matches an input requirement of a target model for input data;
[0015] Randomly flipping the size-adjusted liquid crystal optical image horizontally and vertically within a specified angle range;
[0016] The pixel value of the flipped liquid crystal optical image is normalized so that the pixel mean and standard deviation of the processed liquid crystal optical image meet the input requirement.
[0017] In some embodiments, the extracting of target units from the preprocessed liquid crystal optical image based on a target detection algorithm includes:
[0018] The preprocessed liquid crystal optical image is subjected to target detection and segmentation processing based on a specified target detection algorithm, so as to filter out low-quality images based on the confidence in the target detection algorithm, retain high-quality images, and simultaneously determine the cell area corresponding to each group of liquid crystals in the high-quality image, wherein the specified target detection algorithm includes a YOLO series algorithm.
[0019] In some embodiments, the method further comprises:
[0020] Recursively facilitate all submodules in the efficient convolutional neural network model, and introduce the coordinate attention mechanism into the efficient convolutional neural network, so that the coordinate attention mechanism replaces the channel attention mechanism in the efficient convolutional neural network;
[0021] Obtaining the number of input features of the classifier in the efficient convolutional neural network, and setting the last layer of the classifier based on the number of input features so that the classifier forms a linear layer;
[0022] Determine the efficient convolutional neural network obtained by the current processing as the initial model of the target model;
[0023] The initial model is trained to obtain the target model.
[0024] In some embodiments, the training of the initial model includes:
[0025] Obtaining training data, wherein the training data includes different salinity values of seawater and target units of the training liquid crystal optical image corresponding to the seawater with different salinity values;
[0026] Based on the training data, the initial model is trained with mean square error as the loss function, a learning rate of 0.0001, and a number of iterations of 100;
[0027] The 10-fold cross-validation method was used to evaluate the generalization performance of the trained initial model.
[0028] In some embodiments, the method further comprises:
[0029] Dividing the training data into a training set and a validation set;
[0030] In each iterative calculation process, iterating all data batches based on the training set to calculate the loss;
[0031] Back-propagating the loss results and updating the parameters of the initial model accordingly;
[0032] Calculate and record R for each batch 2 value.
[0033] In some embodiments, the use of a 10-fold cross validation method to evaluate the generalization performance of the trained initial model includes:
[0034] The 10-fold cross-validation method is used to evaluate the performance of the initial model that has completed one iteration of calculation on the validation set, and the R value of this performance evaluation is calculated and recorded. 2 value;
[0035] The R 2 The value reaches a new high, or the R value in the training phase or the validation phase2 When the values reach a new high at the same time, the current model state is saved to obtain the target model.
[0036] In some embodiments, the liquid crystal chip is a liquid crystal optofluidic chip, and the liquid crystal optofluidic chip comprises:
[0037] Prepare silicon wafer template based on photolithography technology;
[0038] Using polydimethylsiloxane to mold the silicon wafer template to obtain a polydimethylsiloxane optofluidic chip;
[0039] Placing the polydimethylsiloxane optofluidic chip in a vacuum and dry environment to perform liquid crystal filling to obtain a liquid crystal optofluidic chip;
[0040] The step of obtaining a liquid crystal optical image to be detected comprises:
[0041] The liquid crystal optofluidic chip is placed under the polarizing microscope, and the liquid crystal optofluidic chip is infiltrated with the seawater to be tested, so as to collect a plurality of liquid crystal optical images satisfying the time dimension through the polarizing microscope.
[0042] Another embodiment of the present invention also provides a device for quantitatively detecting seawater salinity, comprising:
[0043] An acquisition module, used for acquiring an optical image of a liquid crystal to be detected, wherein the optical image of the liquid crystal is formed by collecting a liquid crystal chip soaked in seawater to be detected through a polarizing microscope;
[0044] A preprocessing module, used for preprocessing the liquid crystal optical image;
[0045] An extraction module, used for extracting target units from the preprocessed liquid crystal optical image according to a target detection algorithm;
[0046] An input module, used for inputting the extracted target unit into a pre-trained target model, wherein the target model extracts features of the target unit and calculates the extracted image features to generate a predicted value of seawater salinity, wherein the target model is formed by a convolutional neural network that introduces a coordinate attention mechanism;
[0047] A receiving module is used to receive the predicted value of seawater salinity output by the target model.
[0048] Based on the disclosure of the above embodiments, it can be known that the embodiments of the present invention have the following beneficial effects: by combining the target detection algorithm and the efficient neural network, it can effectively identify and analyze the subtle changes in the liquid crystal image, accurately analyze the data, simplify the operation process, and improve the ability to detect subtle changes, thereby significantly improving the performance and reliability of the sensor, and providing more detailed and accurate detection results for seawater salinity prediction. Moreover, it can enable the liquid crystal chip to better adapt to complex environments and changes in practical applications, further improving the performance and application scope of the overall prediction system.
[0049] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or be understood by practicing the present application. The purpose and other advantages of the present application can be realized and obtained by the structures specifically pointed out in the written description, claims, and drawings.
[0050] The technical solution of the present application is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings in the following description are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0052] Figure 1 Schematic diagram of the flow of the method for quantitatively detecting seawater salinity in an embodiment of the present invention.
[0053] Figure 2 Schematic diagram of the flow of a method for quantitatively detecting seawater salinity in another embodiment of the present invention.
[0054] Figure 3 It is a feature selection diagram of the liquid crystal optical image in an embodiment of the present invention.
[0055] Figure 4 4 is a structural block diagram of a device for quantitatively detecting seawater salinity in an embodiment of the present invention. DETAILED DESCRIPTION
[0056] The specific embodiments of the present invention are described in detail below with reference to the accompanying drawings, but are not intended to limit the present invention.
[0057] It should be understood that various modifications may be made to the embodiments disclosed herein. Therefore, the following description should not be considered as limiting, but merely as an example of an embodiment. Other modifications within the scope and spirit of the present disclosure will occur to those skilled in the art.
[0058] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments of the present disclosure and, together with the general description of the present disclosure given above and the detailed description of the embodiments given below, serve to explain the principles of the present disclosure.
[0059] These and other characteristics of the invention will become apparent from the following description of a preferred form of embodiment given as a non-limiting example, with reference to the accompanying drawings.
[0060] It should also be understood that, although the invention has been described with reference to some specific examples, those skilled in the art will be able to realize many other equivalent forms of the invention that have the characteristics recited in the claims and are therefore within the scope of protection defined thereby.
[0061] The above and other aspects, features and advantages of the present disclosure will become more apparent from the following detailed description when taken in conjunction with the accompanying drawings.
[0062] Specific embodiments of the present disclosure are described hereinafter with reference to the accompanying drawings; however, it should be understood that the disclosed embodiments are merely examples of the present disclosure, which may be implemented in a variety of ways. Well-known and / or repeated functions and structures are not described in detail to avoid obscuring the present disclosure with unnecessary or redundant details. Therefore, the specific structural and functional details disclosed herein are not intended to be limiting, but merely serve as a basis and representative basis for the claims to teach those skilled in the art to use the present disclosure in a variety of ways with substantially any suitable detailed structure.
[0063] This specification may use the phrases "in one embodiment," "in another embodiment," "in a further embodiment," or "in other embodiments," all of which may refer to one or more of the same or different embodiments according to the present disclosure.
[0064] The embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0065] like Figure 1 As shown, an embodiment of the present invention provides a method for quantitatively detecting seawater salinity, comprising:
[0066] S1: obtaining an optical image of a liquid crystal to be tested, wherein the optical image of the liquid crystal is formed by collecting a liquid crystal chip soaked in seawater to be tested using a polarizing microscope;
[0067] S2: preprocessing the liquid crystal optical image;
[0068] S3: extracting target units from the preprocessed liquid crystal optical image based on a target detection algorithm;
[0069] S4: inputting the extracted target unit into a pre-trained target model, wherein the target model extracts features of the target unit and calculates the extracted image features to generate a predicted value of seawater salinity, wherein the target model is formed by a convolutional neural network that introduces a coordinate attention mechanism;
[0070] S5: Receive the predicted value of seawater salinity output by the target model.
[0071] The method in this embodiment can be applied to a system model, which includes a target detection model and a target model, wherein the target detection model is based on a target detection algorithm, such as but not limited to a YOLOv8 algorithm, or other YOLO series algorithms, or other types of target detection algorithms, which are not unique. The liquid crystal optical image is obtained by collecting the image presented by the liquid crystal chip infiltrated with the seawater to be tested by a polarizing microscope, and the polarizing microscope will save it after collection for subsequent salinity prediction.
[0072] For example, the liquid crystal chip is a liquid crystal optofluidic chip, and the liquid crystal optofluidic chip includes:
[0073] Prepare silicon wafer template based on photolithography technology;
[0074] Using polydimethylsiloxane to mold the silicon wafer template to obtain a polydimethylsiloxane optofluidic chip;
[0075] Placing the polydimethylsiloxane optofluidic chip in a vacuum and dry environment to perform liquid crystal filling to obtain a liquid crystal optofluidic chip;
[0076] The step of obtaining a liquid crystal optical image to be detected comprises:
[0077] S6: placing the liquid crystal optofluidic chip under the polarizing microscope, and soaking the liquid crystal optofluidic chip with the seawater to be tested, so as to collect a plurality of liquid crystal optical images satisfying the time dimension through the polarizing microscope.
[0078] When the system model obtains the liquid crystal optical image, it will perform image preprocessing operations on it, and then input the preprocessed liquid crystal optical image into the target detection model, which will perform target recognition and segmentation of the target area to obtain each target unit contained in the liquid crystal optical image. After that, the target unit is input into the target model, which will then extract and calculate the image features to obtain the predicted value of seawater salinity.
[0079] Based on the above embodiments, it can be seen that by combining the target detection algorithm and the efficient neural network, it is possible to effectively identify and analyze subtle changes in the liquid crystal image, accurately analyze data, simplify the operation process, and improve the ability to detect subtle changes, thereby significantly improving the performance and reliability of the sensor, and providing more detailed and accurate detection results for seawater salinity prediction. In addition, it can enable the liquid crystal chip to better adapt to complex environments and changes in practical applications, further improving the performance and application scope of the overall prediction system.
[0080] In one embodiment, the preprocessing of the liquid crystal optical image comprises:
[0081] S7: performing rotation correction and data cleaning processing on the liquid crystal optical image.
[0082] Specifically, Figure 2 As shown, the liquid crystal optical image includes a plurality of images, and the rotation correction and data cleaning processing of the liquid crystal optical image includes:
[0083] S8: unifying the sizes of the plurality of liquid crystal optical images to a target size, wherein the target size matches an input requirement of a target model for input data;
[0084] S9: randomly flipping the size-adjusted liquid crystal optical image horizontally and vertically within a specified angle range;
[0085] S10: performing pixel value standardization processing on the flipped liquid crystal optical image, so that the pixel mean and standard deviation of the processed liquid crystal optical image meet the input requirement.
[0086] For example, the image preprocessing process first starts with the input preparation of the image. In this embodiment, these images can be captured and saved by an orthogonal polarizing microscope. Subsequently, the image data enters the automatic correction stage, including steps such as adjusting the image size and normalization, aiming to make the image meet the input specifications of the subsequent target detection model and the target model. Next, data cleaning is performed to remove noise and exclude irrelevant content in the image to ensure the quality of the processed image.
[0087] The image processing algorithm used in this embodiment is transforms.Normalize (mean = [0.485, 0.456, 0.406], std = [0.229, 0.224, 0.225]), which is an image preprocessing method for normalizing the pixel values of an image, including normalizing each color channel (red, green, blue) of the image. The processing of this algorithm can make the value distribution of each color channel of the image more consistent with the input distribution of the target model during training.
[0088] In order to improve the overall generalization ability and robustness of the system model, this embodiment also adopts a series of data enhancement technologies, including uniformly adjusting all image data to be input to 224×224 pixels to adapt to the input requirements of the model (different models have different input requirements, so the adjusted pixels are different, and the above 224×224 is only an example); randomly flipping the pixel-adjusted image horizontally and vertically to increase the diversity of the data, such as randomly rotating the image within the range of ±10 degrees to simulate different shooting angles; finally, standardizing the image pixel values to have a mean of [0.485, 0.456, 0.406] and a standard deviation of [0.229, 0.224, 0.225], which meets the requirements of the subsequent target model for input data and facilitates model recognition processing.
[0089] In another embodiment, the extracting of target units from the preprocessed liquid crystal optical image based on a target detection algorithm includes:
[0090] S11: Performing target detection and segmentation processing on the preprocessed liquid crystal optical image based on a specified target detection algorithm, so as to filter out low-quality images based on the confidence in the target detection algorithm, retain high-quality images, and simultaneously determine the cell area corresponding to each group of liquid crystals in the high-quality image, wherein the specified target detection algorithm includes a YOLO series algorithm.
[0091] For example, after completing the aforementioned data preprocessing, the YOLOv8 algorithm can be used, but is not limited to, to perform target detection and segmentation on the liquid crystal optical image, and accurately identify the small square area corresponding to each group of liquid crystals in the liquid crystal optical image, that is, the target unit, which is equivalent to dividing the liquid crystal optical image into multiple unit areas. For details, please refer to Figure 3 As shown. The YOLOv8 algorithm used in this embodiment is a target detection algorithm with real-time detection capability, which can accurately locate and identify targets in complex backgrounds and reduce the interference of environmental factors on detection. In addition, the system can also use the confidence provided by YOLOv8 to directly filter out bad images with low confidence, thereby improving data quality and the accuracy of subsequent analysis.
[0092] The target model needs to be constructed and trained before application. In one embodiment, the method further includes:
[0093] S12: recursively facilitate all submodules in the efficient convolutional neural network model, and introduce the coordinate attention mechanism into the efficient convolutional neural network, so that the coordinate attention mechanism replaces the channel attention mechanism in the efficient convolutional neural network;
[0094] S13: Obtaining the number of input features of the classifier in the efficient convolutional neural network, and setting the last layer of the classifier based on the number of input features so that the classifier forms a linear layer;
[0095] S14: Determine the efficient convolutional neural network obtained by the current processing as the initial model of the target model;
[0096] S15: Training the initial model to obtain the target model.
[0097] The efficient convolutional neural network in this embodiment preferably uses EfficientNetV2, but it can also be other neural networks, which are not unique. The EfficientNetV2 used in this embodiment introduces the Fused-MBConv module, which combines MBConv (inverted residual structure) with standard convolution, significantly improving the training speed by reducing redundant calculations and optimizing memory usage. At the same time, EfficientNetV2-S fine-tunes the original neural network architecture and introduces more advanced activation functions and regularization techniques, such as SiLU activation function and DropPath regularization technology. These improvements not only improve the expressive power of the model, but also enhance its generalization performance. In this embodiment, the initial model is obtained by improving EfficientNetV2-S, for example, by introducing a coordinate attention mechanism (Coordinate Attention) instead of the original SE attention mechanism, so as to achieve more refined processing of spatial information in the image, so that the model can also better distinguish key information when processing images containing complex backgrounds and diverse objects. That is, the initial model prepared in this embodiment is a more efficient convolutional neural network architecture with higher accuracy and speed, suitable for deployment in resource-constrained environments. The network model optimizes the depth, width and resolution of the network through a composite scaling method, maintaining high performance while reducing computational costs. The introduced coordinate attention mechanism enables the model to focus on the key areas in the image that best reflect salinity changes, improving the model's ability to recognize subtle changes in liquid crystal images caused by salinity. After obtaining the initial model, the constructed initial model is trained to obtain the target model. After obtaining the target model, the system can directly input the extracted features, such as the small square image mentioned above, into the target model, and the salinity value of the seawater to be tested can be obtained accordingly.
[0098] Specifically, in one embodiment, the training of the initial model includes:
[0099] S16: obtaining training data, wherein the training data includes different salinity values of seawater and target units of the training liquid crystal optical image corresponding to the seawater with different salinity values;
[0100] S17: Based on the training data, the initial model is trained with mean square error as the loss function, a learning rate of 0.0001, and an iteration number of 100;
[0101] S18: The generalization performance of the trained initial model was evaluated using a 10-fold cross-validation method.
[0102] Furthermore, the method further comprises:
[0103] S19: Divide the training data into a training set and a validation set;
[0104] S20: in each iterative calculation process, iterate all data batches based on the training set to calculate the loss;
[0105] S21: back-propagating the loss result, and updating the parameters of the initial model accordingly;
[0106] S22: Calculate and record R for each batch 2 value.
[0107] The 10-fold cross validation method is used to evaluate the generalization performance of the trained initial model, including:
[0108] S23: Use the 10-fold cross-validation method to perform performance evaluation on the initial model that has completed one iteration of calculation on the validation set, and calculate and record the R value of this performance evaluation. 2 value;
[0109] S24: Verify the R 2 The value reaches a new high, or the R value in the training phase or the validation phase 2 When the values reach a new high at the same time, the current model state is saved to obtain the target model.
[0110] For example, this embodiment uses the pre-trained EfficientNetV2-S model as the basic network, and makes two major improvements on this basis. First, the original Squeeze-and-Excitation (SE) attention module is replaced by the coordinate attention mechanism (Coordinate Attention). The coordinate attention module enhances the feature expression capability by encoding position information in the spatial dimension. In specific implementation, the CoordAttention class can be defined, and all submodules of the model can be recursively traversed to replace the SE module with the Coordinate Attention module. Secondly, since the task of this embodiment is a regression problem, the original classifier is replaced by a linear layer to output a single continuous value. Specifically, the input feature number num_features of the model classifier can be obtained, and the last layer of the classifier can be replaced with nn.Linear(num_features, 1), thereby achieving the effect of converting the classifier to a linear layer.
[0111] During the model training process, this embodiment uses mean square error (MSE) as the loss function to measure the difference between the predicted concentration and the true concentration. The optimizer selects Adam, the learning rate is set to 0.0001, and the loss function is minimized by optimizing the model parameters. The training in this embodiment is carried out for a total of 100 epochs, and 10-fold cross validation (K-FoldCross Validation) is used to evaluate the generalization performance of the model. In each fold, the training data set is divided into a training set and a validation set. The model is trained on the training set and evaluated on the validation set. Optionally, a batch size of 128 is used in both training and testing to balance the training speed and memory consumption, and 3 worker threads (num_workers=3) are used to speed up the data loading process.
[0112] In each epoch, the model first iterates over all data batches on the training set, calculates the loss, and then backpropagates and updates the model parameters, while recording the MSE value (mean square error value) and R for each batch. 2 Then, the model switches to evaluation mode, evaluates the model performance on the validation set, and calculates and records MSE and R 2 Value. 2 The value reaches a new high, or the R value in the training phase or the validation phase 2 When the values reach new highs at the same time, the state of the current model is saved to ensure its optimal performance. Through the above training process, a target model with a high level of processing capability in the seawater salinity prediction task can be obtained.
[0113] After the training is completed, the optimized deep learning model can be deployed in the system model to analyze the real-time collected liquid crystal images. The specific steps include inputting the optical image captured by the liquid crystal optofluidic chip into the trained system model, and the model outputs the corresponding seawater salinity value. This method can monitor the salinity changes in the marine environment in real time without the need for manual data processing of the liquid crystal sensor after the reaction, and the operation is simple and fast. At the same time, this method avoids the time-consuming and labor-intensive problems of traditional data processing, reduces the influence of subjective factors on the test results, and ensures the objectivity and reliability of the test results. The experimental results show that the model has the best R 2 The value reached 0.992, indicating that the proposed method has superior performance and broad application prospects in seawater salinity detection.
[0114] In summary, the method proposed in this embodiment has at least the following advantages compared with the existing solution:
[0115] High degree of automation
[0116] The deep learning algorithm is used to automatically detect seawater salinity, eliminating the tedious manual data processing steps in traditional methods and improving detection efficiency and consistency. In addition, the system can operate stably in different environments, further reducing dependence on manual operations and realizing a truly fully automated detection process.
[0117] High detection accuracy
[0118] The optimized deep learning model can accurately analyze the optical images produced by the liquid crystal optofluidic chip and achieve accurate quantification of seawater salinity, which is significantly better than traditional methods that rely on visual observation or simple image processing of grayscale values and response time. The deep learning algorithm captures tiny optical changes by learning a large number of samples, thereby improving the sensitivity and accuracy of detection and ensuring the reliability of the results.
[0119] Easy and fast operation
[0120] The entire testing process does not require complicated operations and professional knowledge. Users only need to perform simple sample preparation and equipment operation to complete the salinity test, which lowers the threshold for use. At the same time, the system has a friendly interface and clear operation process, making it easy for non-professionals to get started, greatly simplifying the operation steps and improving the user experience.
[0121] Save time and manpower costs
[0122] The automated detection process reduces human intervention and data processing time, significantly shortens the detection cycle, and reduces dependence on operators and labor costs. Compared with traditional methods, this embodiment can complete the detection of a large number of samples in a shorter time, improves work efficiency, and is suitable for large-scale marine environmental monitoring needs.
[0123] Reduce subjective error
[0124] Automatic analysis of optical images by algorithms avoids subjective errors caused by human judgment and improves the objectivity and reliability of test results. The deep learning model is based on data-driven analysis, ensuring the consistency and accuracy of each test, reducing result fluctuations caused by human factors, and thus providing more stable and reliable test data.
[0125] like Figure 4 As shown, another embodiment of the present invention also provides a device for quantitatively detecting seawater salinity, comprising:
[0126] An acquisition module, used for acquiring an optical image of a liquid crystal to be detected, wherein the optical image of the liquid crystal is formed by collecting a liquid crystal chip soaked in seawater to be detected through a polarizing microscope;
[0127] A preprocessing module, used for preprocessing the liquid crystal optical image;
[0128] An extraction module, used for extracting target units from the preprocessed liquid crystal optical image according to a target detection algorithm;
[0129] An input module, used for inputting the extracted target unit into a pre-trained target model, wherein the target model extracts features of the target unit and calculates the extracted image features to generate a predicted value of seawater salinity, wherein the target model is formed by a convolutional neural network that introduces a coordinate attention mechanism;
[0130] The receiving module is used to receive the predicted value of seawater salinity output by the target model.
[0131] In some embodiments, the preprocessing of the liquid crystal optical image comprises:
[0132] The liquid crystal optical image is subjected to rotation correction and data cleaning processing.
[0133] In some embodiments, the liquid crystal optical image includes a plurality of images, and the rotation correction and data cleaning processing of the liquid crystal optical image includes:
[0134] unifying the sizes of the plurality of liquid crystal optical images to a target size, wherein the target size matches an input requirement of a target model for input data;
[0135] Randomly flipping the size-adjusted liquid crystal optical image horizontally and vertically within a specified angle range;
[0136] The pixel value of the flipped liquid crystal optical image is normalized so that the pixel mean and standard deviation of the processed liquid crystal optical image meet the input requirement.
[0137] In some embodiments, the extracting of target units from the preprocessed liquid crystal optical image based on a target detection algorithm includes:
[0138] The preprocessed liquid crystal optical image is subjected to target detection and segmentation processing based on a specified target detection algorithm, so as to filter out low-quality images based on the confidence in the target detection algorithm, retain high-quality images, and simultaneously determine the cell area corresponding to each group of liquid crystals in the high-quality image, wherein the specified target detection algorithm includes a YOLO series algorithm.
[0139] In some embodiments, the apparatus further comprises:
[0140] A recursive module, used to recursively facilitate all submodules in the efficient convolutional neural network model, and introduce the coordinate attention mechanism into the efficient convolutional neural network, so that the coordinate attention mechanism replaces the channel attention mechanism in the efficient convolutional neural network;
[0141] An acquisition module, used for acquiring the input feature number of the classifier in the efficient convolutional neural network, and setting the last layer of the classifier based on the input feature number so that the classifier forms a linear layer;
[0142] A determination module, used to determine the efficient convolutional neural network obtained by the current processing as the initial model of the target model;
[0143] The training module is used to train the initial model to obtain the target model.
[0144] In some embodiments, the training of the initial model includes:
[0145] Obtaining training data, wherein the training data includes different salinity values of seawater and target units of the training liquid crystal optical image corresponding to the seawater with different salinity values;
[0146] Based on the training data, the initial model is trained with mean square error as the loss function, a learning rate of 0.0001, and a number of iterations of 100;
[0147] The 10-fold cross-validation method was used to evaluate the generalization performance of the trained initial model.
[0148] In some embodiments, the method further comprises:
[0149] Dividing the training data into a training set and a validation set;
[0150] In each iterative calculation process, iterating all data batches based on the training set to calculate the loss;
[0151] Back-propagating the loss results and updating the parameters of the initial model accordingly;
[0152] Calculate and record R for each batch 2 value.
[0153] In some embodiments, the use of a 10-fold cross validation method to evaluate the generalization performance of the trained initial model includes:
[0154] The 10-fold cross-validation method is used to evaluate the performance of the initial model that has completed one iteration of calculation on the validation set, and the R value of this performance evaluation is calculated and recorded. 2 value;
[0155] The R in the training and validation phases 2 When the values reach a new high at the same time, the current model state is saved to obtain the target model.
[0156] In some embodiments, the liquid crystal chip is a liquid crystal optofluidic chip, and the liquid crystal optofluidic chip comprises:
[0157] Prepare silicon wafer template based on photolithography technology;
[0158] Using polydimethylsiloxane to mold the silicon wafer template to obtain a polydimethylsiloxane optofluidic chip;
[0159] Placing the polydimethylsiloxane optofluidic chip in a vacuum and dry environment to perform liquid crystal filling to obtain a liquid crystal optofluidic chip;
[0160] The step of obtaining a liquid crystal optical image to be detected comprises:
[0161] The liquid crystal optofluidic chip is placed under the polarizing microscope, and the liquid crystal optofluidic chip is infiltrated with the seawater to be tested, so as to collect a plurality of liquid crystal optical images satisfying the time dimension through the polarizing microscope.
[0162] Another embodiment of the present invention further provides an electronic device, comprising:
[0163] one or more processors;
[0164] a memory configured to store one or more programs;
[0165] When the one or more programs are executed by the one or more processors, the one or more processors implement the method for quantitatively detecting seawater salinity as described in any one of the embodiments above.
[0166] Furthermore, an embodiment of the present invention also provides a storage medium on which a computer program is stored, and when the program is executed by a processor, the method for quantitatively detecting seawater salinity as described above is implemented. It should be understood that each scheme in this embodiment has the corresponding technical effects in the above method embodiment, and will not be repeated here.
[0167] Furthermore, an embodiment of the present invention also provides a computer program product, which is tangibly stored on a computer-readable medium and includes computer-readable instructions, which, when executed, cause at least one processor to perform a method for quantitatively detecting seawater salinity such as in the embodiment described above.
[0168] It should be noted that the computer storage medium of the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, system or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access storage medium (RAM), a read-only storage medium (ROM), an erasable programmable read-only storage medium (EPROM or flash memory), an optical fiber, a portable compact disk read-only storage medium (CD-ROM), an optical storage medium, a magnetic storage medium, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can send, propagate or transmit a program configured to be used by or in conjunction with an instruction execution system, system or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, antenna, optical cable, RF, etc., or any suitable combination of the above.
[0169] In addition, it will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) containing computer-usable program code.
[0170] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A system that specifies the functions of a box or multiple boxes.
[0171] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a product including an instruction system, which is implemented in the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0172] A person skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of protection of the present application is limited to these examples. In line with the concept of the present application, the technical features in the above embodiments or different embodiments may be combined, the steps may be implemented in any order, and there are many other variations of different aspects of one or more embodiments of the present application as described above, which are not provided in detail for the sake of simplicity.
Claims
1. A method for quantitatively detecting seawater salinity, characterized in that: include: Obtaining a liquid crystal optical image to be detected, wherein the liquid crystal optical image is formed by collecting a liquid crystal chip soaked in seawater to be detected using a polarizing microscope; Preprocessing the liquid crystal optical image; Extracting target units from the preprocessed liquid crystal optical image based on a target detection algorithm; The extracted target unit is input into a pre-trained target model, and the target model extracts features of the target unit and calculates the extracted image features to generate a predicted value of seawater salinity, wherein the target model is formed by a convolutional neural network that introduces a coordinate attention mechanism; The predicted value of seawater salinity output by the target model is received.
2. The method for quantitatively detecting seawater salinity according to claim 1, characterized in that: The preprocessing of the liquid crystal optical image comprises: The liquid crystal optical image is subjected to rotation correction and data cleaning processing.
3. The method for quantitatively detecting seawater salinity according to claim 2, characterized in that: The liquid crystal optical image includes a plurality of images, and the rotation correction and data cleaning processing of the liquid crystal optical image includes: unifying the sizes of the plurality of liquid crystal optical images to a target size, wherein the target size matches an input requirement of a target model for input data; Randomly flipping the size-adjusted liquid crystal optical image horizontally and vertically within a specified angle range; The pixel value of the flipped liquid crystal optical image is normalized so that the pixel mean and standard deviation of the processed liquid crystal optical image meet the input requirement.
4. The method for quantitatively detecting seawater salinity according to claim 1, characterized in that: The extracting of target units from the preprocessed liquid crystal optical image based on the target detection algorithm includes: The preprocessed liquid crystal optical image is subjected to target detection and segmentation processing based on a specified target detection algorithm, so as to filter out low-quality images based on the confidence in the target detection algorithm, retain high-quality images, and simultaneously determine the cell area corresponding to each group of liquid crystals in the high-quality image, wherein the specified target detection algorithm includes a YOLO series algorithm.
5. The method for quantitatively detecting seawater salinity according to claim 1, characterized in that: The method further comprises: Recursively facilitate all submodules in the efficient convolutional neural network model, and introduce the coordinate attention mechanism into the efficient convolutional neural network, so that the coordinate attention mechanism replaces the channel attention mechanism in the efficient convolutional neural network; Obtaining the number of input features of the classifier in the efficient convolutional neural network, and setting the last layer of the classifier based on the number of input features so that the classifier forms a linear layer; Determine the efficient convolutional neural network obtained by the current processing as the initial model of the target model; The initial model is trained to obtain the target model.
6. The method for quantitatively detecting seawater salinity according to claim 5, characterized in that: The training of the initial model comprises: Obtaining training data, wherein the training data includes different salinity values of seawater and target units of the training liquid crystal optical image corresponding to the seawater with different salinity values; Based on the training data, the initial model is trained with mean square error as the loss function, a learning rate of 0.0001, and a number of iterations of 100; The 10-fold cross-validation method was used to evaluate the generalization performance of the trained initial model.
7. The method for quantitatively detecting seawater salinity according to claim 6, characterized in that: The method further comprises: Dividing the training data into a training set and a validation set; In each iterative calculation process, iterate all data batches based on the training set to calculate the loss result; Back-propagating the loss results and updating the parameters of the initial model accordingly; Calculate and record R for each batch 2 value.
8. The method for quantitatively detecting seawater salinity according to claim 7, characterized in that: The 10-fold cross validation method is used to evaluate the generalization performance of the trained initial model, including: The 10-fold cross-validation method is used to evaluate the performance of the initial model that has completed one iteration of calculation on the validation set, and the R value of this performance evaluation is calculated and recorded. 2 value; The R 2 The value reaches a new high, or the R value in the training phase or the validation phase 2 When the values reach a new high at the same time, the current model state is saved to obtain the target model.
9. The method for quantitatively detecting seawater salinity according to claim 1, characterized in that: The liquid crystal chip is a liquid crystal optofluidic chip, and the liquid crystal optofluidic chip comprises: Prepare silicon wafer template based on photolithography technology; Using polydimethylsiloxane to mold the silicon wafer template to obtain a polydimethylsiloxane optofluidic chip; Placing the polydimethylsiloxane optofluidic chip in a vacuum and dry environment to perform liquid crystal filling to obtain a liquid crystal optofluidic chip; The step of obtaining a liquid crystal optical image to be detected comprises: The liquid crystal optofluidic chip is placed under the polarizing microscope, and the liquid crystal optofluidic chip is infiltrated with the seawater to be tested, so as to collect a plurality of liquid crystal optical images satisfying the time dimension through the polarizing microscope.
10. A device for quantitatively detecting seawater salinity, characterized in that: include: An acquisition module, used for acquiring an optical image of a liquid crystal to be detected, wherein the optical image of the liquid crystal is formed by collecting a liquid crystal chip soaked in seawater to be detected through a polarizing microscope; A preprocessing module, used for preprocessing the liquid crystal optical image; An extraction module, used for extracting a target area from the preprocessed liquid crystal optical image according to a target detection algorithm; An input module, used for inputting the extracted target unit into a pre-trained target model, wherein the target model extracts features of the target unit and calculates the extracted image features to generate a predicted value of seawater salinity, wherein the target model is formed by a convolutional neural network that introduces a coordinate attention mechanism; A receiving module is used to receive the predicted value of seawater salinity output by the target model.
Citation Information
Patent Citations
Method for automatically determining salinity in seawater
CN103063594A
Liquid crystal sensor for visually detecting organophosphorus pesticide and detection method thereof
CN114414481A
Liquid crystal alignment layer evaluating device
JP2002365637A
Detecting interactions at biomimetic interfaces with liquid crystals
US20030194753A1
Apparatus and method for measuring salinity, and system for managing salinity
US20220291010A1
Cited By
Ion detection method
CN119595553A