Tap water algae and aquatic organism community classification and identification method
By combining machine vision and deep learning technology, using image enhancement, edge and texture information extraction, color information screening, and integrating data input into deep learning networks, it solves the problem of time-consuming and low efficiency in classification and identification of tap algae and aquatic biological communities in traditional methods. , realizes fast and accurate classification and identification, suitable for large-scale and real-time monitoring.
Patent Information
- Application Number
- CN202411408051.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-10
- Publication Date
- 2024-12-27
AI Technical Summary
Traditional methods are time-consuming, inefficient and susceptible to subjective factors in the classification and identification of tap water algae and aquatic biological communities, making it difficult to achieve large-scale and real-time monitoring.
Combining machine vision and deep learning technology, through image enhancement, edge and texture information extraction, color information screening, data input deep learning network is integrated to construct a classification recognition model for algae and aquatic biological communities.
It realizes rapid and accurate classification and identification of algae and aquatic biological communities in tap water, improves monitoring efficiency and accuracy, and is suitable for large-scale and real-time monitoring scenarios.
Smart Images

Figure CN119206359A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of machine vision, and in particular relates to a method for classifying and identifying tap water algae and aquatic biological communities. Background Art
[0002] Machine vision technology imitates the visual system of the human eye. It has many advantages such as high accuracy, high efficiency, and good safety. It is widely used in many fields such as industry, agriculture, medicine, military, and aerospace. Although machine vision technology has made significant progress, it is currently mainly based on given classification patterns for recognition. It has limited ability to recognize unexpected classifications and still has a certain gap in intelligence. Deep learning is an important branch of artificial intelligence. It can solve various complex problems by simulating the structure and function of the human brain neural network and using multi-layer neural networks to learn and represent data. In some cases, it can even surpass human judgment and bring revolutionary changes to the development of human society.
[0003] The classification and identification of algae and aquatic communities in tap water is crucial, because the presence of algae and aquatic communities not only affects water quality, but may also pose a threat to human health. Algae and aquatic communities are diverse and similar in morphology, making accurate classification a challenge. Traditional algae and aquatic community detection methods rely on manual microscopy, which is not only time-consuming and susceptible to subjective factors, but also time-consuming and labor-intensive, and difficult to meet the needs of large-scale and real-time monitoring. The present invention combines machine vision with deep learning technology to automatically and efficiently process large amounts of image data, extract characteristic information of algae and aquatic organisms, and accurately identify their types, quantities, distribution and other parameters. This can not only improve the efficiency and accuracy of monitoring, but also provide strong data support for water quality assessment, water ecology research, etc. Summary of the invention
[0004] The present invention aims to solve the defects of the prior art and provide a method for classifying and identifying algae and aquatic communities in tap water. The method is based on machine vision and deep learning, which can quickly and accurately classify and identify algae and aquatic communities in tap water.
[0005] To achieve the above object, the present invention adopts the following technical scheme, a method for classifying and identifying tap water algae and aquatic biological communities, comprising the steps of:
[0006] S1. Collect images of known algae and aquatic communities (including cyanobacteria, green algae, diatoms, rotifers and pinworms) and perform image enhancement to reduce the influence of irrelevant impurities and highlight the algae and aquatic communities. The enhanced images are used as the input data source 1 of the deep learning network;
[0007] S2, extracting edge and texture information of the enhanced image to form spatial domain data of algae and aquatic communities as input data source 2 of the deep learning network;
[0008] S3, extracting and filtering the color information of the enhanced image to form color domain data of algae and aquatic communities as input data source 3 of the deep learning network;
[0009] S4, integrating data source 1, data source 2 and data source 3, and inputting them into a deep learning network to obtain an (optimal) network model suitable for classification and identification of algae and aquatic biological communities;
[0010] S5, after image enhancement, spatial domain information extraction, and color domain information screening, the image to be tested is imported into the trained network model in S4 to complete the classification and recognition of algae and aquatic biological communities.
[0011] Furthermore, the image enhancement method in S1 comprises the following steps:
[0012] S1.1. Extract the R, G, and B three-channel color components of the image I(x, y) of known algae and aquatic biological communities:
[0013] R=f(I(x,y)→(0~255,0,0))
[0014] G=f(I(x,y)→(0,0~255,0))
[0015] B=f(I(x,y)→(0,0,0~255))
[0016] Where f(·) is the image color channel extraction function;
[0017] S1.2, divide the R, G, and B three-channel layers into N window areas of size (2m+1)*(2n+1), and accumulate the three-channel color values with v(i, j) as the center, where m and n are both integers;
[0018]
[0019] In the formula and is the sum of the color values of the vth block of the R, G, and B layers, R v (k,l),G v (k,l) and B v (k, l) is the color value represented by the position (k, l) in the vth block area of the R, G, B layer, v∈1, 2, 3..., N, N is the total number of blocks divided for each layer;
[0020] v(i, j) represents the pixel at position (i, j) in the vth block, which is also the center point of the calculation. m and n are integers that control the window size. The window size of the vth block is (2m+1)*(2n+1).
[0021] S1.3. Count the proportion of color value t in the vth block area and add up the average:
[0022]
[0023] Where t = 0, 1, ..., L, R v ′(t) is the cumulative average of the color value t of the R layer in the vth block area, G v ′(t) is the cumulative average of the color value t of the G layer in the vth block area, B v ′(t) is the cumulative average of the color value t of layer B in the vth block area, is the proportion of the color value t of the R layer in the vth block area, is the proportion of the color value t of the G layer in the vth block area, is the proportion of the color value t of layer B in the vth block area, R v (T t ) is the accumulated value of the color value t of the R layer in the vth block area, G v (T t ) is the accumulated value of the color value t of the G layer in the vth block area, B v (T t ) is the accumulated value of the color value t of layer B in the vth block area;
[0024] S1.4. After all regions of the layer are calculated, the enhanced layers R′, G′, and B′ are obtained, and the R, G, and B layers of the original image are replaced. The enhanced image is G enhance =arcf(R′,G′,B′).
[0025] Furthermore, extracting edge and texture information of the enhanced image in S2 includes the following steps:
[0026] S2.1, grayscale the enhanced image according to the R, G, B values in S1.1:
[0027]
[0028] Among them, G gray is the gray value obtained after adjustment, w R 、w G and w B is the component weight, which indicates the sensitivity of human eyes to different colors, and they are 0.299, 0.587 and 0.114 respectively;
[0029] S2.2. Solve the second-order derivatives of the image obtained in S2.1 in the horizontal and vertical directions respectively to obtain the edges of the image in two directions:
[0030]
[0031] Among them, E(x,y) is the edge information corresponding to the grayscale image S(x,y), expressed by grayscale value;
[0032] S2.3, use a 3*3 window to slide row by row on the grayscale image, and move the center pixel (x i ,y i ) is compared with its surrounding pixels. The position where the gray value of the neighboring pixel is greater than the gray value of the central pixel is marked as 1, otherwise it is marked as 0:
[0033]
[0034] Among them, T(x i ,y i ) is the center pixel (x i ,y i ) and its surrounding texture information, S c (x i ,y i ) is the gray value of the center pixel, S p (x i ,y i ) is the gray value of the surrounding pixels, z(·) is the judgment function, the function value is 1 when the independent variable is greater than 0, and the function value is 0 when the independent variable is less than 0; when all pixels are calculated, the texture information T(x, y) corresponding to the gray image S(x, y) can be obtained, expressed in gray values;
[0035] S2.4. Merge the edge information E(x, y) and the texture information T(x, y) to obtain the spatial domain information of the original image:
[0036]
[0037] Among them, G space It is the spatial domain information formed by combining edge information E(x, y) and texture information T(x, y), and is represented by grayscale values.
[0038] Further, in S3, extracting and screening the color information of the enhanced image specifically includes:
[0039] S3.1. Convert the R, G, and B three-channel components obtained in S1.1 into a color representation consisting of hue, saturation, and brightness:
[0040]
[0041] S=((max-min) / max)*100 / 255
[0042] V=max*100 / 255
[0043] H is the hue of the image, S is the saturation of the image, and V is the brightness of the image; max is the maximum value of R, G, and B under the pixel, and min is the minimum value of R, G, and B under the pixel;
[0044] S3.2. According to the actual situation, perform threshold segmentation based on hue (H), saturation (S) and brightness (V) on the whole, and select all color information within the specified threshold range into the selected area. The threshold segmentation operation formula is as follows:
[0045] H′={(x,y) T ∈I|H min ≤H x,y ≤H max}
[0046] S′={(x,y) T ∈I|S min ≤S x,y ≤S max}
[0047] V′={(x,y) T ∈I|V min ≤V x,y ≤V max}
[0048] Where x, y represent the pixel coordinates, H′, S′, V′ represent the hue, saturation and brightness set after segmentation, H max and H min Represents the upper and lower limits of the hue range, S max and S min Represents the upper and lower limits of the saturation range, V max and V min Represents the upper and lower limits of the brightness range;
[0049] S3.3. Convert the image into grayscale values. The conversion formula is as follows:
[0050] G color =w R *(r+m)*255+w G *(g+m)*255+w B *(b+m)*255
[0051] G color is the extracted and filtered color domain information, expressed as grayscale value, w R、w G 、w B are component weights, which are 0.299, 0.587, and 0.114 respectively; r, g, b are the R, G, B color values converted from the HSV space, and m is the brightness offset. The constraint formula is as follows:
[0052]
[0053] where mod(·) is the remainder operation, and C and X are the values of r, g, and b under different constraints.
[0054] Further, in S4, the integrated data source 1, data source 2 and data source 3 are input into the deep learning network to obtain the (optimal) network model suitable for classification and identification of algae and aquatic biological communities, including:
[0055] S4.1. Normalize data source 1, data source 2, and data source 3 to eliminate the influence of different dimensions of the three sets of data. The calculation formula is as follows:
[0056]
[0057] G e ' nhance , G s ' pace and G c ' olor They are the normalized enhanced image, spatial domain and color domain information respectively;
[0058] S4.2. Adjust the contribution of the three groups of data sources to the deep learning network to optimize the overall ratio. The adjustment formula is as follows:
[0059]
[0060] G input is the maximum value of the sum of the two data sources, that is, the optimal integration result; W i is the contribution weight of the data source. The normalization method is the same as that of the data source, and is adjusted by the following method:
[0061] W1(t+1)=W1(t)+α[W1(t)], W2(t+1)=W2(t)+β[W2(t)], W3(t+1)=W3(t)+χ[W3(t)]
[0062] W1(t+1), W2(t+1), and W3(t+1) are the input contribution weights of the three groups of data sources after adjustment, and α, β, and χ are the adjustment parameters of the contribution weights of the three groups of data, with values ranging from 0 to 1;
[0063] S4.3. Input the adjusted data into a deep learning network consisting of six parts: input layer, convolution layer, pooling layer, multi-scale feature fusion layer, connection layer, and output layer:
[0064]
[0065] is the maximum predicted classification probability corresponding to the input image, E(·) is an activation function, which is used to convert the network output into a probability distribution; Fc represents the operation of the fully connected layer, W Fc and b Fc are the weights and biases of the fully connected layer; Fuse represents the multi-scale feature fusion operation, W Fuse is the parameter of the feature fusion layer; Pool represents the pooling operation, W Pool is the parameter of the pooling layer; CV represents the convolution operation, W CV are the weights and biases of the convolutional layer; to ensure the accuracy of the prediction, Closer to the original input labels, the process is described as:
[0066]
[0067] Ψ(·) is the loss function used to measure the prediction classification of the model The difference between the true label Y and the real label Y; W and b represent the weight and bias parameters in the network respectively. These parameters are the goals of deep learning network optimization.
[0068] Furthermore, S5 specifically includes:
[0069] S5.1. Use the methods of S1, S2 and S3 to perform image enhancement, spatial domain information extraction and color domain information screening on the image to be tested respectively;
[0070] S5.2. After the data source is integrated, the integrated data is input into the deep learning network pre-trained in the S4 process to obtain the classification result:
[0071]
[0072] O output To input three sets of data into the pre-trained deep learning network, the output classification results are: E(·) is the activation function, For bias.
[0073] Compared with the prior art, the present invention has beneficial effects.
[0074] The present invention aims to combine actual needs and propose a method for classifying and identifying algae and aquatic communities in tap water using machine vision and deep learning technology. The method can quickly and accurately complete the classification and identification tasks. By combining traditional machine vision technology with advanced deep learning algorithms, the present invention effectively solves the problems of time-consuming and low efficiency of traditional manual detection methods. It is particularly suitable for large-scale and real-time monitoring scenarios, and significantly improves the efficiency and accuracy of detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0075] The present invention is further described below in conjunction with the accompanying drawings and specific implementation methods. The protection scope of the present invention is not limited to the following description.
[0076] Figure 1 The overall flow chart of the method of the present invention is as follows;
[0077] Figure 2 It is the image enhancement flow chart;
[0078] Figure 3 It is a schematic diagram of the spatial domain information extraction process;
[0079] Figure 4 This is a schematic diagram of the color domain information screening process;
[0080] Figure 5 Schematic diagram of the deep learning network training process;
[0081] Figure 6 Schematic diagram of the classification process of algae and aquatic communities. DETAILED DESCRIPTION
[0082] In order to make the purpose, technical scheme and beneficial effects of the embodiments of the present invention clearer, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments.
[0083] like Figure 1 Shown are the process steps of the method for classifying and identifying tap water algae and aquatic biological communities based on machine vision and deep learning of the present invention.
[0084] The present invention first collects a large number of images of known types of tap water algae and aquatic biological communities. After collection, these images are manually annotated to ensure that each sample has an accurate category label. Subsequently, in order to improve the effect of subsequent processing, these annotated images are enhanced to increase the diversity and robustness of the data set.
[0085] The enhanced images will be used for training the deep learning network. On the one hand, the enhanced images without additional processing are directly provided to the deep learning network as data source 1. On the other hand, spatial domain information is further extracted and color domain information is filtered from these enhanced images to form data source 2 and data source 3 respectively. The purpose of this is to enable the model to learn richer feature information from different angles and levels.
[0086] Next, the deep learning network is iteratively trained using the prepared data source. The network parameters are continuously adjusted until the optimal performance is achieved, and finally an efficient and accurate classification and recognition model is obtained.
[0087] Finally, in actual applications, when new images need to be detected, the system will first perform the same preprocessing steps as in the training phase, including image enhancement, spatial domain information extraction, and color domain information screening. After the processing is completed, these preprocessed images are input into the trained deep learning model to obtain accurate classification and recognition results.
[0088] like Figure 2 As shown, the image enhancement process and steps are:
[0089] 1. Divide the image area: First, divide the image to be processed into multiple small areas, and the size of each area is set to a (2m+1)*(2n+1) window.
[0090] 2. Calculate the color channel average: For each divided small area, calculate the average color value of all pixels in the area in the three color channels of red (R), green (G), and blue (B).
[0091] 3. Update pixel values: When the color value averages of all regions have been calculated, the calculated averages are used to replace the R, G, and B values of the central pixels of the corresponding regions in the original image.
[0092] 4. Complete image enhancement: Repeat steps 2 and 3 until all areas in the image have been processed. At this point, the original image has been enhanced to form a new, processed image with improved contrast and details, which is more conducive to subsequent analysis or recognition tasks.
[0093] like Figure 3 As shown in the figure, the steps of spatial domain information extraction process are as follows:
[0094] 1. Grayscale processing: First, the original color image is grayscaled based on human eye correction. This step is to reduce the impact of color information on subsequent processing while retaining the main structural features of the image.
[0095] 2. Edge and texture extraction: Based on the grayscale image, edge and texture extraction are performed respectively. Edge extraction aims to capture the information of the outline and boundary of the object in the image, while texture extraction aims to reveal the details of the surface characteristics in the image.
[0096] 3. Average the edge image and texture image extracted in the previous step. This process is to add the corresponding pixel values of the two images and take the average value to generate a new image that combines edge and texture information. The image obtained in this way contains important spatial domain information.
[0097] 4. After the above steps are performed, the final image is the spatial domain information described in the present invention, which concentrates on the structural and texture features in the image and is used to improve the accuracy and efficiency of subsequent processing tasks.
[0098] like Figure 4 As shown in the figure, the steps of the color domain information screening process are as follows: first, the R, G, B spatial color information of the enhanced image is extracted, and then converted to obtain a color representation based on hue (H), saturation (S), and brightness (V). In the HSV color space, by selecting a suitable threshold, useful information that is conducive to classification and recognition is screened out. Finally, after an inverse transformation, the screened image is converted back to the RGB color space and converted into a grayscale image.
[0099] like Figure 5 As shown, the steps of deep learning training process are:
[0100] A. First, image preprocessing is performed, including image enhancement, edge and texture extraction, and color screening.
[0101] Image enhancement: First, enhance the original image to make it more suitable for subsequent processing.
[0102] Edge and texture extraction: Extract edge and texture information from the enhanced image. These features are crucial for identifying objects in the image.
[0103] Color screening: Finally, color screen your image to select a specific color range or color channel to better highlight the object of interest or the background.
[0104] B. Reconstruct the database, where:
[0105] Database 1: consists of enhanced images.
[0106] Database 2: Contains edge and texture information extracted from the original image.
[0107] Database 3: consists of images after color filtering.
[0108] C. Input into the deep learning network: Integrate the image information in the above three databases and use them as input data to send into the deep learning network for training.
[0109] D. Perform deep learning network processing:
[0110] Input layer: receives input image data.
[0111] Convolutional layer: detects local features in the image by applying multiple filters.
[0112] Pooling layer: reduces the dimensionality of the data while retaining important structural information.
[0113] Multi-scale feature fusion layer: combines features from different scales to improve the model's ability to recognize multi-scale targets.
[0114] Connection layer (fully connected layer): connects the features extracted by the previous layers to form a complete feature vector.
[0115] Output layer: produces the final prediction results, such as classification labels.
[0116] E. Perform iterative training: The deep learning network continuously adjusts network parameters through repeated iterative training to minimize the error between the predicted results and the actual labels.
[0117] F. Implement model optimization:
[0118] After multiple iterations of training, we finally get an optimal model that can efficiently and accurately complete the classification and recognition task. It performs well on the training set and has good generalization ability, and can be applied to unseen data.
[0119] like Figure 6 As shown in the figure, the classification process of algae and aquatic biological communities is as follows: first, the image is enhanced, edges and textures are extracted, and colors are screened. Then, the obtained image information is input into a trained deep learning network. After processing through the six parts of input layer, convolution layer, pooling layer, multi-scale feature fusion layer, connection layer, and output layer, the classification and recognition results of algae and aquatic biological communities are finally obtained.
[0120] In summary, the present invention proposes a method that combines machine vision with deep learning technology for automatic classification and identification of algae and aquatic communities in tap water. Through deep learning and machine vision technology, it aims to achieve an automated and efficient classification and identification process. The comprehensive approach of "manual + machine + algorithm" not only reduces the common false detection, missed detection and wrong detection problems in manual detection, but also has the significant advantages of fast detection speed and high recognition accuracy.
[0121] 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, it should be understood by those skilled in the art that the technical solutions described in the aforementioned embodiments may still be modified, or some or all of the technical features therein may be replaced by equivalents. Therefore, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope defined by the claims of the present invention.
Claims
1. A method for classifying and identifying tap water algae and aquatic biological communities, characterized in that: Includes steps: S1. Collect images of known algae and aquatic communities and perform image enhancement to reduce the influence of irrelevant impurities and highlight the algae and aquatic communities. The enhanced images are used as input data source 1 of the deep learning network; S2, extracting edge and texture information of the enhanced image to form spatial domain data of algae and aquatic communities as input data source 2 of the deep learning network; S3, extracting and filtering the color information of the enhanced image to form color domain data of algae and aquatic communities as input data source 3 of the deep learning network; S4, integrating data source 1, data source 2 and data source 3, and inputting them into a deep learning network to obtain a network model suitable for classification and identification of algae and aquatic biological communities; S5, after image enhancement, spatial domain information extraction, and color domain information screening, the image to be tested is imported into the trained network model in S4 to complete the classification and recognition of algae and aquatic biological communities.
2. The method for classifying and identifying tap water algae and aquatic biological communities according to claim 1, characterized in that: The image enhancement method described in S1 comprises the following steps: S1.
1. Extract the R, G, and B three-channel color components of the image I(x, y) of known algae and aquatic biological communities: R=f(I(x,y)→(0~255,0,0)) G=f(I(x,y)→(0,0~255,0)) B=f(I(x,y)→(0,0,0~255)) Where f(·) is the image color channel extraction function; S1.2, divide the R, G, and B three-channel layers into N window areas of size (2m+1)*(2n+1), and accumulate the three-channel color values with v(i, j) as the center, where m and n are both integers; In the formula and is the sum of the color values of the vth block of the R, G, and B layers, R v (k,l),G v (k,l) and B v (k, l) is the color value represented by the position (k, l) in the vth block area of the R, G, B layer, v∈1, 2, 3..., N, N is the total number of blocks divided for each layer; v(i, j) represents the pixel at position (i, j) in the vth block, which is also the center point of the calculation. m and n are integers that control the window size. The window size of the vth block is (2m+1)*(2n+1). S1.
3. Count the proportion of color value t in the vth block area and add up the average: Where t = 0, 1, ..., L, R v ′(t) is the cumulative average of the color value t of the R layer in the vth block area, G v ′(t) is the cumulative average of the color value t of the G layer in the vth block area, B v ′(t) is the cumulative average of the color value t of layer B in the vth block area, is the proportion of the color value t of the R layer in the vth block area, is the proportion of the color value t of the G layer in the vth block area, is the proportion of the color value t of layer B in the vth block area, R v (T t ) is the accumulated value of the color value t of the R layer in the vth block area, G v (T t ) is the accumulated value of the color value t of the G layer in the vth block area, B v (T t ) is the accumulated value of the color value t of layer B in the vth block area; S1.
4. After all regions of the layer are calculated, the enhanced layers R′, G′, and B′ are obtained, and the R, G, and B layers of the original image are replaced. The enhanced image is G enhance =arcf(R′,G′,B′).
3. The method for classifying and identifying tap water algae and aquatic biological communities according to claim 1, characterized in that: Extracting edge and texture information of the enhanced image in S2 includes the following steps: S2.
1. Grayscale the enhanced image according to the R, G, B values in S1.1: Among them, G gray is the gray value obtained after adjustment, w R 、w G and w B is the component weight, which indicates the sensitivity of human eyes to different colors, and they are 0.299, 0.587 and 0.114 respectively; S2.
2. Solve the second-order derivatives of the image obtained in S2.1 in the horizontal and vertical directions respectively to obtain the edges of the image in two directions: Among them, E(x,y) is the edge information corresponding to the grayscale image S(x,y), expressed by grayscale value; S2.3, use a 3*3 window to slide row by row on the grayscale image, and move the center pixel (x i ,y i ) is compared with its surrounding pixels. The position where the gray value of the neighboring pixel is greater than the gray value of the central pixel is marked as 1, otherwise it is marked as 0: Among them, T(x i ,y i ) is the center pixel (x i ,y i ) and its surrounding texture information, S c (x i ,y i ) is the gray value of the center pixel, S p (x i ,y i ) is the gray value of the surrounding pixels, z(·) is the judgment function, the function value is 1 when the independent variable is greater than 0, and the function value is 0 when the independent variable is less than 0; when all pixels are calculated, the texture information T(x, y) corresponding to the gray image S(x, y) can be obtained, expressed in gray values; S2.
4. Merge the edge information E(x, y) and the texture information T(x, y) to obtain the spatial domain information of the original image: Among them, G space It is the spatial domain information formed by combining edge information E(x, y) and texture information T(x, y), and is represented by grayscale values.
4. The method for classifying and identifying tap water algae and aquatic biological communities according to claim 1, characterized in that: In S3, extracting and screening the color information of the enhanced image specifically includes: S3.
1. Convert the R, G, and B three-channel components obtained in S1.1 into a color representation consisting of hue, saturation, and brightness: S=((max-min) / max)*100 / 255 V=max*100 / 255 H is the hue of the image, S is the saturation of the image, and V is the brightness of the image; max is the maximum value of R, G, and B under the pixel, and min is the minimum value of R, G, and B under the pixel; S3.
2. According to the actual situation, perform threshold segmentation based on hue (H), saturation (S) and brightness (V) on the whole, and select all color information within the specified threshold range into the selected area. The threshold segmentation operation formula is as follows: H′={(x,y) T ∈I|H min ≤H x,y ≤H max } S′={(x,y) T ∈I|S min ≤S x,y ≤S max } V′={(x,y) T ∈I|V min ≤V x,y ≤V max } Where x, y represent the pixel coordinates, H′, S′, V′ represent the hue, saturation and brightness set after segmentation, H max and H min Represents the upper and lower limits of the hue range, S max and S min Represents the upper and lower limits of the saturation range, V max and V min Represents the upper and lower limits of the brightness range; S3.
3. Convert the image into grayscale values. The conversion formula is as follows: G color =w R *(r+m)*255+w G *(g+m)*255+w B *(b+m)*255 G color is the extracted and filtered color domain information, expressed as grayscale value, w R 、w G 、w B are component weights, which are 0.299, 0.587, and 0.114 respectively; r, g, b are the R, G, B color values converted from the HSV space, and m is the brightness offset. The constraint formula is as follows: where mod(·) is the remainder operation, and C and X are the values of r, g, and b under different constraints.
5. The method for classifying and identifying tap water algae and aquatic biological communities according to claim 1, characterized in that: In S4, the integrated data sources 1, 2 and 3 are input into the deep learning network to obtain a network model suitable for classification and identification of algae and aquatic biological communities, including: S4.
1. Normalize data source 1, data source 2, and data source 3 to eliminate the influence of different dimensions of the three sets of data. The calculation formula is as follows: G e ' nhance , G s ' pace and G c ' olor They are the normalized enhanced image, spatial domain and color domain information respectively; S4.
2. Adjust the contribution of the three groups of data sources to the deep learning network to optimize the overall ratio. The adjustment formula is as follows: G input is the maximum value of the sum of the two data sources, that is, the optimal integration result; W i is the contribution weight of the data source. The normalization method is the same as that of the data source, and is adjusted by the following method: W1(t+1)=W1(t)+α[W1(t)], W2(t+1)=W2(t)+β[W2(t)], W3(t+1)=W3(t)+χ[W3(t)] W1(t+1), W2(t+1), and W3(t+1) are the input contribution weights of the three groups of data sources after adjustment, and α, β, and χ are the adjustment parameters of the contribution weights of the three groups of data, with values ranging from 0 to 1; S4.
3. Input the adjusted data into a deep learning network consisting of six parts: input layer, convolution layer, pooling layer, multi-scale feature fusion layer, connection layer, and output layer: is the maximum predicted classification probability corresponding to the input image, E(·) is an activation function, which is used to convert the network output into a probability distribution; Fc represents the operation of the fully connected layer, W Fc and b Fc are the weights and biases of the fully connected layer; Fuse represents the multi-scale feature fusion operation, W Fuse is the parameter of the feature fusion layer; Pool represents the pooling operation, W Pool is the parameter of the pooling layer; CV represents the convolution operation, W CV are the weights and biases of the convolutional layer; to ensure the accuracy of the prediction, Closer to the original input labels, the process is described as: Ψ(·) is the loss function used to measure the prediction classification of the model The difference between the true label Y; W and b represent the weight and bias parameters in the network respectively.
6. The method for classifying and identifying tap water algae and aquatic biological communities according to claim 1, characterized in that: S5 specifically includes: S5.
1. Use the methods of S1, S2 and S3 to perform image enhancement, spatial domain information extraction and color domain information screening on the image to be tested respectively; S5.
2. After the data source is integrated, the integrated data is input into the deep learning network pre-trained in the S4 process to obtain the classification result: O output To input three sets of data into the pre-trained deep learning network, the output classification results are: E(·) is the activation function, For bias.
Citation Information
Cited By
Diffusion model-based algae detection method, device, equipment and medium
CN119941696A
A water algae detection method, device, equipment and medium based on a diffusion model
CN119941696B