Method and system for detecting blood hemoglobin concentration of tegillarca granosa based on image recognition

Through image recognition-based detection methods, convolutional neural networks are used to identify hemoglobin concentration in mud blood samples, solving the problems of cumbersome and high cost in the existing technology, and achieving a fast, convenient and accurate detection effect.

CN119626382APending Publication Date: 2025-03-14ZHEJIANG WANLI UNIV NINGHAI MARINE BIOLOGICAL SEED IND RES INST
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411669058.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-21
Publication Date
2025-03-14

AI Technical Summary

Technical Problem

In the prior art, the detection of hemoglobin concentration of mud cypress relies on chemical reagent methods and requires professional instruments, reagents and operators. The cost is high and the detection process is cumbersome, making it difficult to meet the needs of rapid detection.

Method used

Using image recognition-based detection methods, a deep neural network prediction model is constructed through convolutional neural networks, and the images of mud blood samples are obtained using photography imaging equipment, white balance correction and data enhancement are performed, and the model is trained to identify hemoglobin concentration.

Benefits of technology

It realizes fast, convenient and accurate hemoglobin concentration detection, reduces detection costs, reduces artificial errors, and improves detection efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119626382A_ABST
    Figure CN119626382A_ABST
Patent Text Reader

Abstract

The invention discloses a tegillarca granosa blood hemoglobin concentration detection method and system based on image recognition, and belongs to the technical field of biology and computer crossover, and the method comprises the following steps: based on a tegillarca granosa blood sample, obtaining a sample image with a PyTorch tensor format; based on a convolutional neural network, the hemoglobin concentration of a sample image is marked, whether data is close to normal distribution is detected, the uniformly distributed data is used as a data set to train the convolutional neural network, a mean square error is used as a loss function, an Adam optimizer is used to carry out gradient descent optimization, and a detection model is constructed; and obtaining a blood sample of the tegillarca granosa to be detected, and identifying the hemoglobin concentration in the blood sample of the tegillarca granosa to be detected through the detection model. The method can quickly and conveniently complete determination and reduce the cost. The method can be used for rapidly and accurately measuring the hemoglobin concentration of tegillarca granosa, can also be used for measuring the hemoglobin concentration of other organisms, and has wide application and popularization values.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of biological and computer intersection technology, and in particular to a method and system for detecting blood hemoglobin concentration of mud clams based on image recognition. Background Art

[0002] Anadara granosa, commonly known as blood clams, is one of the few bivalve molluscs containing hemoglobin and is also an important tidal flat aquaculture variety in the southeastern coast of my country. During the aquaculture process, mud clams with bright red blood and high hemoglobin content usually show stronger vitality and higher nutritional value, and are therefore favored by consumers. As a key protein responsible for oxygen transport in the blood, the concentration of hemoglobin is not only an important indicator for measuring the health status of organisms, but also directly affects the market competitiveness of mud clams. At present, the detection of hemoglobin mainly relies on chemical reagent methods, such as ferric cyanide method and sodium dodecyl sulfate method. These methods convert hemoglobin into stable colored derivatives through chemical reactions, and then use a spectrophotometer to measure its absorbance to calculate the hemoglobin concentration. Although these methods have high accuracy, the detection process requires professional instruments, reagents and operators, which is not only costly, but also has strict requirements on the detection environment. In addition, these methods require a certain reaction time, which is difficult to meet the actual needs of rapid detection, limiting their application in actual production.

[0003] In contrast, image recognition technology has become an efficient detection tool by virtue of its rapid extraction and analysis of image feature information. With the rapid development of artificial intelligence and neural network technology, image recognition technology has been widely used in industrial production, greatly improving production efficiency and automation level. In the field of medical testing, this technology can accurately identify human blood color characteristics by analyzing the color information in the image, providing strong support for medical diagnosis. However, in agriculture, especially in aquaculture, the application of image recognition technology is still in its infancy, and related research and reports are relatively scarce. There is huge room for development, and its potential is expected to promote the upgrading of agricultural detection technology and improve the efficiency and effectiveness of precision detection.

[0004] In summary, compared with traditional chemical detection methods, image recognition technology does not require complex experimental equipment and chemical reagents, is easy to operate, significantly reduces detection costs, and at the same time reduces human errors, greatly improving detection efficiency, providing a new solution for hemoglobin detection in the fields of agriculture and aquaculture. Summary of the invention

[0005] In order to solve the above problems, the purpose of the present invention is to provide a method and system for detecting the hemoglobin concentration in the blood of mud clam based on image recognition, which aims to construct a deep neural network prediction model for hemoglobin in the blood of mud clam by adopting a convolutional neural network method, so as to quickly, conveniently and accurately detect the hemoglobin concentration and reduce the cost of hemoglobin detection.

[0006] In order to achieve the above technical objectives, the present application provides a method for detecting blood hemoglobin concentration of mud clams based on image recognition, comprising the following steps:

[0007] Based on the blood sample of mud clam, obtain sample images in PyTorch tensor format;

[0008] Based on the convolutional neural network, after marking the hemoglobin concentration of the sample image and checking whether the data is close to the normal distribution, the uniformly distributed data is used as the data set to train the convolutional neural network, using the mean square error as the loss function and the Adam optimizer for gradient descent optimization to build a detection model;

[0009] Obtain a blood sample of the mud clam to be tested, and identify the hemoglobin concentration in the blood sample of the mud clam to be tested through the detection model.

[0010] Preferably, in the process of acquiring the sample image, the blood sample of mud clam is dropped into a cell culture dish and placed in a closed studio. The image is captured and white balance correction is performed to generate the sample image while ensuring that the ambient light source is stable and the light sources of all images are consistent.

[0011] Preferably, in the process of obtaining a sample image in PyTorch tensor format, the sample image after white balance correction is converted into RGB format; and after random rotation, flipping, and brightness adjustment are performed to generate diversified image samples, the torchvision.transforms module is used to convert the RGB format into PyTorch tensor format to generate a sample image in PyTorch tensor format.

[0012] Preferably, in the process of data annotation, the hemoglobin concentration of the blood sample is detected by a sodium dodecyl sulfate-hemoglobin kit, and the concentration value is associated with the corresponding image to form an annotated data set.

[0013] Preferably, in the process of checking whether the data is close to a normal distribution, a CSV file of hemoglobin concentration values ​​is obtained and a histogram is drawn to check whether the data is close to a normal distribution.

[0014] Preferably, in the process of constructing a convolutional neural network, a convolutional neural network is constructed through multiple convolutional layers, pooling layers and fully connected layers, wherein the convolutional layer adopts a ReLU activation function; the pooling layer adopts maximum pooling; and the fully connected layer is used to map features to predicted values ​​of hemoglobin concentration.

[0015] Preferably, during the model training process, an early stopping strategy is used to prevent overfitting.

[0016] Preferably, in the process of constructing the detection model, multiple identical models are constructed and trained independently; the prediction results of these models are used to calculate the average value to form the integrated model prediction value.

[0017] Preferably, in the process of constructing the detection model, the mean_squared_error, mean_absolute_error and r2_score functions in the scikit-learn library are used to calculate the MSE, MAE and R2 values ​​of the detection model respectively, so as to evaluate the performance of the constructed detection model.

[0018] The present invention discloses a system for detecting blood hemoglobin concentration of mud clams based on image recognition, which is used to implement the above-mentioned method for detecting blood hemoglobin concentration of mud clams based on image recognition. The system comprises:

[0019] A data acquisition module, used to obtain sample images in PyTorch tensor format based on blood samples of mud clams;

[0020] The model building module is used to train the convolutional neural network based on the convolutional neural network by annotating the hemoglobin concentration of the sample image and checking whether the data is close to the normal distribution. The uniformly distributed data is used as the data set to train the convolutional neural network, using the mean square error as the loss function and using the Adam optimizer for gradient descent optimization to build a detection model;

[0021] The detection module is used to obtain the blood sample of the mud clam to be tested, and identify the hemoglobin concentration in the blood sample of the mud clam to be tested through the detection model.

[0022] The present invention discloses the following technical effects:

[0023] The present invention only requires conventional photographic imaging equipment, does not require high resolution of images, does not require professionals, instruments and equipment, and a hemoglobin determination kit, can quickly and conveniently complete the determination, and reduces costs. In addition to being used for the rapid and accurate determination of the hemoglobin concentration of mud clams, it can also be used for the determination of the hemoglobin concentration of other organisms, and has a wide range of application and promotion value. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in 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.

[0025] Figure 1 Schematic diagram of the shooting device of the present invention, wherein 1-imaging device, 2-mud clam blood, 3-LED light source;

[0026] Figure 2 It is a schematic diagram of the method flow of the present invention;

[0027] Figure 3 is a normal distribution histogram of the hemoglobin concentration of the mud clam of the present invention;

[0028] Figure 4 It is a fitting diagram of the measured value and the predicted value of the hemoglobin concentration of mud clam described in the present invention. DETAILED DESCRIPTION

[0029] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.

[0030] like Figure 1-4 As shown, the present invention provides a blood hemoglobin concentration detection technology for mud clams based on image recognition, which specifically includes the following contents:

[0031] (1) Image collection and preprocessing:

[0032] (1-1) Sample preparation and shooting environment setting: Randomly select 200 healthy mud clams, absorb 50 μL of blood, and drip it into a transparent cell culture dish to ensure that the blood is evenly distributed and there are no obvious bubbles. The cell culture dish containing blood is placed in a closed small studio, which is designed to be a non-reflective environment without interference from external light sources (see Figure 1 ). Turn on the shadowless lamp inside the studio to ensure that the light is evenly irradiated on the cell culture dish;

[0033] (1-2) Image acquisition and white balance processing: Under fixed lighting conditions, a high-resolution digital camera (Nikon Z30) was used to capture blood images of mud cockles in cell culture dishes. When shooting, ensure that the camera lens is perpendicular to the cell culture dish to reduce image distortion. Ten images were taken in each group. Image processing software (Adobe Photoshop) was used to perform white balance processing on the collected original images to eliminate the influence of different light sources on the image color.

[0034] (1-3) Image scaling and cropping: Use the OpenCV visual library to read the processed image, and use the cv2.resize() function to scale the image to a uniform size of the preset resolution (64×64 pixels). Remove unnecessary edges and ensure that the blood area is located in the center of the image and occupies an appropriate proportion;

[0035] (1-4) Image enhancement: Use the PIL (Python Imaging Library) library to convert the processed images into RGB format, and perform enhancement operations such as random rotation, flipping, and brightness adjustment on the images to increase the diversity of the dataset and the generalization ability of the model.

[0036] (1-5) Format conversion: Use the torchvision.transforms module to convert the image to PyTorch tensor format.

[0037] (2) Training of deep learning models:

[0038] (2-1) Data annotation and division: For each blood image sample, the SLS-Hb kit is used to detect the corresponding hemoglobin concentration value, and the value is associated with the image file to form an annotated data set. The annotated data set is divided into a training set (80%) and a test set (20%) to ensure that the model can also show good generalization ability when facing the blood of unknown mud clams;

[0039] (2-2) Data verification: Use the pandas library to read the CSV file containing the image path and hemoglobin concentration value, and use torch.utils.data.Dataset to define the dataset. Use torch.utils.data.DataLoader to build a data loader and perform a normal distribution test on the hemoglobin concentration label. The results are shown in Figure 3 ;

[0040] (2-3) Model architecture design: Design a convolutional neural network architecture that includes multiple convolutional layers, pooling layers, and fully connected layers. The convolutional layer is used to extract local features of the image. The convolution function is nn.Conv2d, and the calculation method is as follows:

[0041]

[0042] where y i,j,k is a value in the output feature map; x m,i+p,j+q represents the position in the input image x, which is moved according to the stride and filter size in the convolution operation; w k,m,p,q is the weight in the convolution kernel; b k is the bias term of the convolution kernel. C is the number of input channels, K h is the height of the convolution kernel, K w is the width of the convolution kernel.

[0043] The pooling layer is used to reduce the size of the feature map, retain significant features, and reduce computational complexity. The pooling function is nn.MaxPool2d, and the calculation method is as follows:

[0044]

[0045] Among them, y i,j,k is the pixel value of position i, j in the output feature map on channel k; Kh, Kw are the height and width of the pooling window; x k,i+p,j+q It is the pixel value at position (i+p, j+q) on channel k of the input feature map.

[0046] The fully connected layer is used to map the extracted features to the hemoglobin concentration value. The fully connected function is nn.Linear. The mathematical formula is as follows: y = x WT + b, where x is the input feature, W is the weight matrix, and b is the bias vector;

[0047] (3) Optimization and performance evaluation of prediction models:

[0048] (3-1) Prediction model optimization: The mean squared error (MSE) is used as the loss function to measure the difference between the predicted value of hemoglobin concentration predicted by the model and the measured value. The calculation method is as follows:

[0049]

[0050] Among them, yi is the measured value, is the predicted value and N is the number of samples.

[0051] The Adam optimization algorithm is used for gradient descent optimization. The calculation method is as follows:

[0052]

[0053]

[0054]

[0055]

[0056]

[0057] in, is the parameter θ t For the loss function L(θ t ) gradient; m t is the first-order momentum of the gradient; v t is the second-order momentum of the gradient; β1 is the attenuation coefficient of the first-order momentum, and β2 is the attenuation coefficient of the second-order momentum; is the first-order momentum of the gradient after bias correction; is the second-order momentum of the gradient after bias correction; α is the learning rate (step size); ∈ is a small value to prevent the denominator from being zero and causing numerical instability. During the training process, an early stopping strategy is used to prevent the model from overfitting. By continuously monitoring the loss value on the validation set, when the validation set loss does not drop significantly within 10 consecutive rounds, the training is stopped and the current best model weight is saved;

[0058] (3-2) Integrated model construction: In order to further improve the prediction accuracy and stability of the model, 5 identical convolutional neural network model instances are constructed and trained independently. These model instances may differ slightly in initialization parameters, data augmentation methods, etc. to increase the diversity of the model. In the prediction stage, the images to be tested are input into these model instances for prediction, and the average of all model prediction results is calculated as the final hemoglobin concentration prediction value;

[0059] (3-3) Model performance evaluation: The mean_squared_error function and mean_absolute_error function are used to calculate the mean square error (MSE) and mean absolute error (MAE) between the predicted results and the actual measured values ​​to measure the prediction accuracy of the model. At the same time, the r2_score function is used to calculate R 2 value (coefficient of determination) to assess how well the model fits the data.

[0060] The calculation method of MSE is the same as above.

[0061] MAE and R 2 The calculation method is as follows:

[0062]

[0063]

[0064] Among them, y i is the measured value, is the predicted value, is the mean of the actual value, and N is the number of samples. The smaller the values ​​of MAE and MSE, the better the prediction performance of the model; R 2 The closer the value is to 1, the better the model fit is.

[0065] like Figure 4 As shown, the results show that the hemoglobin concentration sample data set of 200 mud clams conforms to the normal distribution after the Kolmogorov-Smirnov test (P=0.2>0.05). The mean of this hemoglobin concentration data set is 20.11 and the standard deviation is 4.57. The MSE and MAE values ​​of the method of the present invention are 0.4647 and 0.4264, indicating that the overall prediction error of the model is small; R 2 The value is 0.9917, indicating that the model fitting effect is good. The above results all prove the effectiveness of the method of the present invention.

[0066] 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 device that provides the functions specified in a block or multiple blocks.

[0067] In the description of the present invention, it should be understood that the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.

[0068] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.

Claims

1. A method for detecting blood hemoglobin concentration of mud clams based on image recognition, characterized in that: The following steps are involved: Based on the blood sample of mud clam, obtain sample images in PyTorch tensor format; Based on the convolutional neural network, after marking the hemoglobin concentration of the sample image and checking whether the data is close to a normal distribution, the uniformly distributed data is used as a data set to train the convolutional neural network, the mean square error is used as a loss function, and the Adam optimizer is used for gradient descent optimization to build a detection model; Obtain a blood sample of the mud clam to be tested, and identify the hemoglobin concentration in the blood sample of the mud clam to be tested using the detection model.

2. The method for detecting hemoglobin concentration in blood of mud clams based on image recognition according to claim 1, characterized in that: In the process of acquiring the sample image, the blood sample of mud clam is dropped into a cell culture dish and placed in a closed studio. Under the condition that the ambient light source is stable and the light source of all images is consistent, the image is captured and white balance correction is performed to generate the sample image.

3. The method for detecting blood hemoglobin concentration of mud clam based on image recognition according to claim 2, characterized in that: In the process of obtaining sample images in PyTorch tensor format, the sample images after white balance correction are converted into RGB format. After random rotation, flipping, and brightness adjustment are performed to generate diverse image samples, the torchvision.transforms module is used to convert the RGB format into the PyTorch tensor format to generate sample images in PyTorch tensor format.

4. The method for detecting blood hemoglobin concentration of mud clams based on image recognition according to claim 3 is characterized in that: In the process of data annotation, the hemoglobin concentration of the blood sample is tested using a sodium dodecyl sulfate-hemoglobin kit, and the concentration value is associated with the corresponding image to form a labeled data set.

5. The method for detecting blood hemoglobin concentration of mud clams based on image recognition according to claim 4 is characterized in that: In the process of checking whether the data is close to a normal distribution, a CSV file of hemoglobin concentration values ​​is obtained and a histogram is drawn to check whether the data is close to a normal distribution.

6. The method for detecting hemoglobin concentration in blood of mud clams based on image recognition according to claim 5, characterized in that: In the process of constructing a convolutional neural network, the convolutional neural network is constructed through multiple convolutional layers, pooling layers and fully connected layers, wherein the convolutional layer adopts a ReLU activation function; the pooling layer adopts maximum pooling; and the fully connected layer is used to map features to predicted values ​​of hemoglobin concentration.

7. The method for detecting blood hemoglobin concentration of mud clams based on image recognition according to claim 6, characterized in that: During model training, an early stopping strategy is used to prevent overfitting.

8. The method for detecting blood hemoglobin concentration of mud clam based on image recognition according to claim 7, characterized in that: In the process of building the detection model, multiple identical convolutional neural network models are constructed and trained independently; the prediction results of these models are used to calculate the average value to form the integrated model prediction value.

9. The method for detecting blood hemoglobin concentration of mud clam based on image recognition according to claim 8, characterized in that: In the process of building the detection model, the mean_squared_error, mean_absolute_error, and r2_score functions in the scikit-learn library are used to calculate the MSE, MAE, and R² values ​​of the detection model, respectively, to evaluate the performance of the constructed detection model.

10. The blood hemoglobin concentration detection system of mud clam based on image recognition is characterized in that: The system is used to implement the method for detecting the hemoglobin concentration of blood of mud clams based on image recognition as claimed in any one of claims 1 to 9, and the system comprises: A data acquisition module, used to obtain sample images in PyTorch tensor format based on blood samples of mud clams; A model building module, which is used to train the convolutional neural network based on a convolutional neural network by annotating the hemoglobin concentration of the sample image and checking whether the data is close to a normal distribution, using the uniformly distributed data as a data set, using the mean square error as a loss function, and using the Adam optimizer for gradient descent optimization to build a detection model; The detection module is used to obtain the blood sample of the mud clam to be tested, and identify the hemoglobin concentration in the blood sample of the mud clam to be tested through the detection model.

Citation Information

Cited By

  • Preparation method of paper-based chip assisted by machine learning

    CN120427552A

  • Hemoglobin test paper and application thereof

    CN120468437A