Particle identification method and system for use in water flow measurement
Patent Information
- Application Number
- CN202611206050.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-10
- Publication Date
- 2026-10-13
AI Technical Summary
[0003]有鉴于此,本申请的目的在于提供一种应用于水流测量的投放粒子识别方法及系统,以改善现有技术中存在的投放粒子识别的可靠度相对不高的问题
[0014]本申请提供的应用于水流测量的投放粒子识别方法及系统,首先,基于目标投放粒子的尺寸,对获取到的目标水流区域的水流表面图像进行至少一种分割,形成至少一个水流图像块序列;其次,分别提取每一个水流图像块序列中的潜在语义信息和水流表面图像中的潜在语义信息,形成对应的每一个水流局部语义特征和水流全局语义特征;然后,基于每一个水流局部语义特征和水流全局语义特征,分析出水流表面图像中的每一个目标投放粒子的分布位置。基于上述内容,一方面,由于在提取水流表面图像中的潜在语义信息的过程中,基于目标投放粒子的表征信息进行粒子相关的潜在语义信息的增强,并基于水流表面的表征信息进行水流背景相关的潜在语义信息的抑制,如此,可以提高形成的水流全局语义特征对于投放粒子的语义信息的表征能力,并且,能够降低水流背景导致的干扰,使得目标投放粒子的分布位置的分析依据的准确度更高。另一方面,由于会基于目标投放粒子的尺寸对水流表面图像进行分割,并对分割形成的水流图像块序列进行潜在语义信息的提取,以作为分布位置分析的依据,如此,可以使得分析依据不仅包括高可靠度的全局语义信息,还包括与目标投放粒子匹配的局部语义信息,进一步提高分析依据的准确度。因此,基于本申请提供的方案,可以提高投放粒子识别的可靠度,从而改善现有技术中存在的投放粒子识别的可靠度相对不高的问题。
Smart Images

Figure CN122906466A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data analysis technology, and more specifically, to a method and system for identifying projected particles used in water flow measurement. Background Technology
[0002] Particle tracking velocimetry (PTV) typically tracks the trajectory of individual discrete tracer particles frame by frame, calculating the velocity vector at a single point based on the displacement of each particle, rather than the average velocity over a region. The core assumption of the PTV mathematical model is that the tracer particles completely follow the water flow (without relative slippage), and the particle's trajectory is the same as the water flow's trajectory; in adjacent frames, the displacement of a single particle is less than a preset maximum displacement threshold. In other words, the accuracy of PTV depends heavily on the detection and identification of the tracer particles; inaccurate detection and identification will lead to unreliable water flow measurements. However, due to the presence of considerable interference in water flow images, traditional image recognition schemes cannot reliably identify tracer particles. Summary of the Invention
[0003] In view of this, the purpose of this application is to provide a method and system for identifying projected particles used in water flow measurement, so as to improve the problem of relatively low reliability of projected particle identification in the prior art.
[0004] To achieve the above objectives, this application adopts the following technical solution: A method for identifying projected particles used in water flow measurement, comprising: Based on the size of the target particles, the water surface image of the target water flow region is segmented in at least one way to form at least one sequence of water flow image blocks. The latent semantic information in each of the water flow image block sequences and the latent semantic information in the water flow surface images are extracted respectively to form corresponding local semantic features and global semantic features of each water flow. In the process of extracting the latent semantic information in the water flow surface images, the latent semantic information related to particles is enhanced based on the characterization information of the target particles, and the latent semantic information related to the water flow background is suppressed based on the characterization information of the water flow surface. Based on each of the local semantic features and the global semantic features of the water flow, the distribution position of each target particle in the water flow surface image is analyzed. The difference between the distribution positions of the target particles in two adjacent frames of water flow surface images is used to determine the moving distance of the target particles in the corresponding time during water flow measurement. This moving distance is used to reflect the water flow velocity in the target water flow region.
[0005] In a preferred embodiment of this application, in the above-described method for identifying projected particles used in water flow measurement, the step of performing at least one segmentation on the water flow surface image of the acquired target water flow region based on the size of the target projected particle to form at least one sequence of water flow image blocks includes: Based on the size of the target particle, at least one segmentation rectangle is determined, wherein the area of each segmentation rectangle in the acquired water flow surface image of the target water flow region is greater than the area of the target particle in the water flow surface image, such that the segmentation rectangle can completely cover the target particle in the water flow surface image. For each of the segmentation rectangles, the water surface image of the target water flow region is segmented by sliding window based on the segmentation rectangle to form a corresponding water flow image block. Based on the order of the sliding window segmentation, the water flow image blocks are sorted to form a sequence of water flow image blocks corresponding to the segmentation rectangle.
[0006] In a preferred embodiment of this application, in the above-described method for identifying projected particles used in water flow measurement, the step of extracting latent semantic information from each sequence of water flow image blocks and from each water flow surface image to form corresponding local semantic features and global semantic features of the water flow includes: Each water flow image block in the sequence of water flow image blocks is convolved to form a local convolutional feature of water flow corresponding to each water flow image block. Based on the local convolutional feature of water flow corresponding to each water flow image block, the corresponding local semantic features of water flow are determined. The characterization information of the target deployed particles and the characterization information of the water flow background of the target water flow region are embedded to form particle characterization embedding features and water flow background embedding features. The water flow surface image is then convolved to form water flow surface convolution features. The characterization information of the target deployed particles includes at least the color information of the target deployed particles, and the characterization information of the water flow background of the target water flow region includes at least the color information of the water flow background. The semantic information of the water flow surface convolution feature is enhanced based on the particle representation embedding feature, and the semantic information of the water flow surface convolution feature is suppressed based on the water flow background embedding feature, so as to form a global semantic feature of water flow.
[0007] In a preferred embodiment of this application, in the above-described method for identifying projected particles applied to water flow measurement, the steps of enhancing the semantic information of the water flow surface convolutional features based on the particle representation embedding features, and suppressing the semantic information of the water flow surface convolutional features based on the water flow background embedding features to form global semantic features of the water flow include: The semantic association between the particle representation embedding features and the water flow surface convolution features is analyzed to form particle surface association features. Based on the particle surface association features, the semantic information of the water flow surface convolution features is enhanced to form water flow surface enhancement features. The semantic association between the water flow background embedding features and the water flow surface enhancement features is analyzed to form background surface association features. Based on the background surface association features, the semantic information of the water flow surface enhancement features is suppressed to form global semantic features of the water flow.
[0008] In a preferred embodiment of this application, in the above-described method for identifying deployed particles applied to water flow measurement, the steps of analyzing the semantic association between the particle representation embedding features and the water flow surface convolutional features to form particle surface association features, and enhancing the semantic information of the water flow surface convolutional features based on the particle surface association features to form enhanced water flow surface features, include: Based on the attention mechanism, the semantic association between the particle representation embedding features and the water flow surface convolution features is analyzed to form particle surface association features; The particle surface correlation features are subjected to a focus weight mapping to form a particle focus weight, wherein the focus weight mapping includes at least linear relationship mining and nonlinear relationship capture; Based on the particle focusing weights, the feature parameters of the water flow surface convolution features are weighted accordingly to enhance the semantic information of the particles and form enhanced water flow surface features.
[0009] In a preferred embodiment of this application, in the above-described method for identifying projected particles applied to water flow measurement, the steps of analyzing the semantic association between the water flow background embedding features and the water flow surface enhancement features to form background surface association features, and suppressing the semantic information of the water flow surface enhancement features based on the background surface association features to form global semantic features of the water flow, include: Based on the attention mechanism, the semantic association between the water flow background embedding features and the water flow surface enhancement features is analyzed to form background surface association features; The background surface association features are subjected to focus weight mapping to form background focus weights, wherein the focus weight mapping includes at least linear relationship mining and nonlinear relationship capture; The background focusing weights are inverted to form background suppression weights; Based on the background suppression weights, the feature parameters of the water flow surface enhancement features are weighted accordingly to suppress background semantic information and form global semantic features of the water flow.
[0010] In a preferred embodiment of this application, in the above-described method for identifying projected particles used in water flow measurement, the steps of performing convolution processing on each water flow image block in the sequence of water flow image blocks to form local convolutional features corresponding to each water flow image block, and determining the corresponding local semantic features of the water flow based on the local convolutional features corresponding to each water flow image block, include: Each water flow image block in the sequence of water flow image blocks is convolved to form the local convolutional feature of water flow corresponding to each water flow image block. Based on the sequential relationship of each water flow image patch in the water flow image patch sequence, the similarity parameter between the local convolutional features of adjacent water flow image patches is calculated respectively, and the similarity parameters are combined to form a local similarity representation matrix. For each of the water flow local convolutional features, mean fusion is performed, and the result of mean fusion is concatenated with the local similarity representation matrix to form water flow local semantic features.
[0011] In a preferred embodiment of this application, in the above-described method for identifying projected particles applied to water flow measurement, the step of analyzing the distribution location of each target projected particle in the water flow surface image based on each of the local semantic features and the global semantic features of the water flow includes: Based on each of the local semantic features of the water flow, the global semantic features of the water flow are decoded and output to form a global feature map of the water flow, wherein the size of the global feature map of the water flow is the same as the size of the water flow surface image; The global feature map of the water flow is probabilistically mapped to form a particle deployment probability map, wherein the size of the particle deployment probability map is the same as the size of the water flow surface image, and each probability value in the particle deployment probability map is used to characterize the probability that a pixel at a corresponding position in the water flow surface image belongs to the target particle deployment. The distribution location of each target particle in the water flow surface image is determined based on the particle deployment probability map.
[0012] In a preferred embodiment of this application, in the above-described method for identifying projected particles applied to water flow measurement, the step of decoding and outputting the global semantic features of the water flow based on each of the local semantic features of the water flow to form a global feature map of the water flow includes: The number of decoding stages and the number of local semantic features of the water flow are determined, wherein the number of decoding stages is greater than or equal to the number of local semantic features of the water flow; When the number of decoding stages is greater than 1, the number of local semantic features of water flow is greater than 1, and the number of decoding stages is greater than the number of local semantic features of water flow, the multiple local semantic features of water flow and the multiple decoding stages are associated based on the feature similarity between the multiple local semantic features of water flow, so that one local semantic feature of water flow is associated with one decoding stage; In the first decoding stage, if the decoding stage is associated with the local semantic features of the water flow, then after attention processing is performed on the global semantic features of the water flow based on the local semantic features of the water flow, the result of the attention processing is upsampled to obtain the output features of the first decoding stage. If the decoding stage is not associated with the local semantic features of the water flow, then the global semantic features of the water flow are upsampled to obtain the output features of the first decoding stage. In each of the second and subsequent decoding stages, if the current decoding stage is associated with the local semantic features of the water flow, then after performing attention processing on the output features of the previous decoding stage based on the local semantic features of the water flow, the result of the attention processing is upsampled to obtain the output features of the current decoding stage. If the current decoding stage is not associated with the local semantic features of the water flow, then the output features of the previous decoding stage are upsampled to obtain the output features of the current decoding stage. Based on the output characteristics of the last stage, the global feature map of the water flow is determined.
[0013] Based on the above, this application also provides a particle recognition system for water flow measurement, comprising: Memory, used to store computer programs; A processor connected to the memory is used to execute the computer program stored in the memory to implement the above-described method for identifying released particles applied to water flow measurement.
[0014] The method and system for identifying projected particles used in water flow measurement provided in this application firstly segment the acquired water flow surface image of the target water flow region based on the size of the target projected particles, forming at least one sequence of water flow image blocks. Secondly, latent semantic information is extracted from each water flow image block sequence and from the water flow surface image, forming corresponding local and global semantic features of the water flow. Then, based on each local and global semantic feature of the water flow, the distribution position of each target projected particle in the water flow surface image is analyzed. Based on the above, on the one hand, because the latent semantic information related to particles is enhanced based on the representation information of the target projected particles during the extraction of latent semantic information from the water flow surface image, and the latent semantic information related to the water flow background is suppressed based on the representation information of the water flow surface, the ability of the formed global semantic features of the water flow to represent the semantic information of the projected particles can be improved. Furthermore, interference caused by the water flow background can be reduced, resulting in higher accuracy in analyzing the distribution position of the target projected particles. On the other hand, since the water surface image is segmented based on the size of the target particle, and latent semantic information is extracted from the resulting sequence of water flow image blocks as a basis for distribution location analysis, the analysis basis includes not only highly reliable global semantic information but also local semantic information matching the target particle, further improving the accuracy of the analysis. Therefore, based on the solution provided in this application, the reliability of particle recognition can be improved, thereby addressing the problem of relatively low reliability in particle recognition in existing technologies. Attached Figure Description
[0015] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings.
[0016] Figure 1 This is a structural block diagram of a particle recognition system for water flow measurement provided in an embodiment of this application.
[0017] Figure 2 This is a flowchart illustrating a particle identification method for water flow measurement provided in an embodiment of this application.
[0018] Figure 3 This is a schematic diagram of decoding provided in an embodiment of this application. Detailed Implementation
[0019] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. The components of the embodiments of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.
[0020] Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
[0021] like Figure 1 As shown in the figure, this application provides a particle recognition system for water flow measurement. The particle recognition system for water flow measurement may include a memory, a processor, and a particle recognition device for water flow measurement.
[0022] In detail, the memory and the processor are electrically connected directly or indirectly to enable data transmission or interaction. For example, the memory and the processor can be electrically connected via one or more communication buses or signal lines. The particle detection device for water flow measurement includes at least one software functional module stored in the memory in the form of software or firmware. The processor is used to execute executable computer programs stored in the memory, such as the software functional modules and computer programs included in the particle detection device for water flow measurement, to implement the particle detection method for water flow measurement provided in this application embodiment.
[0023] Optionally, the memory may be, but is not limited to, random access memory (RAM), read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), etc.
[0024] Optionally, the processor may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), a system on chip (SoC), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0025] Optionally, the particle identification device applied to water flow measurement may include: The image segmentation module is used to perform at least one segmentation on the water surface image of the target water flow region based on the size of the target deployed particles, forming at least one sequence of water flow image blocks. The semantic extraction module is used to extract the latent semantic information in each of the water flow image block sequences and the latent semantic information in the water flow surface images, forming corresponding local semantic features and global semantic features of each water flow. In the process of extracting the latent semantic information in the water flow surface images, the latent semantic information related to the particles is enhanced based on the characterization information of the target particles, and the latent semantic information related to the water flow background is suppressed based on the characterization information of the water flow surface. The location analysis module is used to analyze the distribution position of each target particle in the water flow surface image based on each of the local semantic features and the global semantic features of the water flow. The difference between the distribution positions of the target particles in two adjacent frames of water flow surface images is used to determine the moving distance of the target particles in the corresponding time during water flow measurement. This moving distance is used to reflect the water flow velocity in the target water flow region.
[0026] Understandable, Figure 1 The structure shown is for illustrative purposes only. The particle recognition system for water flow measurement may also include a ratio Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown may include, for example, a communication unit for exchanging information with other devices, such as image acquisition devices.
[0027] Combination Figure 2 This application also provides a method for detecting projected particles used in water flow measurement, applicable to the aforementioned projected particle recognition system for water flow measurement. The method steps defined in the process of the projected particle recognition method for water flow measurement can be implemented by the projected particle recognition system for water flow measurement. The following will describe... Figure 2The specific process shown will be explained in detail.
[0028] Step S110: Based on the size of the target particle, the water surface image of the acquired target water flow region is segmented in at least one way to form at least one sequence of water flow image blocks.
[0029] In this embodiment, the particle recognition system for water flow measurement can segment the acquired surface image of the target water flow region based on the size of the target particle, forming at least one sequence of water flow image blocks. That is, the size of each water flow image block in the segmented sequence must match the size of the target particle, ensuring effective coverage of the target particle's image information and avoiding the problem that arbitrary segmentation makes it difficult to effectively capture the potential semantic information representing the target particle in subsequent semantic extraction.
[0030] Step S120: Extract the latent semantic information from each of the water flow image block sequences and the latent semantic information from the water flow surface images to form corresponding local semantic features and global semantic features of each water flow.
[0031] In this embodiment, after obtaining the water flow image patch sequence, the particle recognition system applied to water flow measurement can extract latent semantic information from each water flow image patch sequence and the latent semantic information from the water flow surface image, forming corresponding local semantic features (corresponding to the water flow image patch sequence) and global semantic features (corresponding to the water flow surface image). Specifically, during the extraction of latent semantic information from the water flow surface image, particle-related latent semantic information is enhanced based on the representation information of the target particle, and background-related latent semantic information is suppressed based on the representation information of the water flow surface. Thus, in the global semantic features, emphasis is placed on representing the latent semantic information related to the target particle, while ignoring the representation of background-related latent semantic information. This effectively improves the interference problem of the water flow background in subsequent recognition and analysis.
[0032] Step S130: Based on each of the local semantic features of the water flow and the global semantic features of the water flow, analyze the distribution position of each target particle in the water flow surface image.
[0033] In this embodiment, after obtaining the local semantic features and global semantic features of the water flow, the particle recognition system applied to water flow measurement can analyze the distribution position of each target particle in the water flow surface image based on each of the local and global semantic features. The difference in the distribution positions of target particles between two adjacent frames of water flow surface images is used to determine the distance the target particle moves at a given time during water flow measurement; this distance reflects the water flow velocity in the target water flow region.
[0034] Based on the above, on the one hand, during the extraction of latent semantic information from the water flow surface image, the latent semantic information related to the particles is enhanced based on the representation information of the target particles, and the latent semantic information related to the water flow background is suppressed based on the representation information of the water flow surface. This improves the representational ability of the global semantic features of the water flow for the semantic information of the deployed particles and reduces interference caused by the water flow background, resulting in higher accuracy in the analysis of the distribution location of the target particles. On the other hand, since the water flow surface image is segmented based on the size of the target particles, and latent semantic information is extracted from the resulting sequence of water flow image blocks as a basis for distribution location analysis, the analysis basis includes not only highly reliable global semantic information but also local semantic information matching the target particles, further improving the accuracy of the analysis basis. Therefore, based on the solution provided in this application, the reliability of particle recognition can be improved, thereby addressing the problem of relatively low reliability in particle recognition in existing technologies.
[0035] Firstly, regarding step S110, it should be noted that the specific method of forming at least one sequence of water flow image blocks is not limited and can be selected according to actual needs.
[0036] For example, in an alternative implementation, in order to achieve accurate segmentation and avoid the problems of low semantic accuracy caused by coarse-grained segmentation and incomplete semantics caused by fine-grained segmentation, the above-mentioned step S120 may further include steps S121 and S122, wherein the specific contents of each step are as follows.
[0037] Step S121: Determine at least one segmentation rectangle based on the size of the target particle.
[0038] In this embodiment, at least one segmentation rectangle can be determined based on the size of the target particle. Each segmentation rectangle has an area in the acquired water flow surface image of the target water flow region that is larger than the area of the target particle in the water flow surface image, ensuring that the segmentation rectangle completely covers the target particle in the water flow surface image. For example, the segmentation rectangle can be the smallest bounding rectangle of the target particle. Furthermore, it should be noted that after obtaining multiple segmentation rectangles, the smallest segmentation rectangle is the smallest bounding rectangle, and the other segmentation rectangles can be enlarged versions of the smallest bounding rectangle (scaled proportionally).
[0039] Step S122: For each of the segmentation rectangles, the water surface image of the target water flow region is segmented by sliding window based on the segmentation rectangle to form a corresponding water flow image block; and, based on the order of the sliding window segmentation, the water flow image blocks are sorted to form a sequence of water flow image blocks corresponding to the segmentation rectangle.
[0040] In this embodiment, after obtaining the segmentation rectangle, for each segmentation rectangle, a sliding window segmentation can be performed on the water surface image of the target water flow region to form a corresponding water flow image block. Furthermore, based on the order of the sliding window segmentation, the water flow image blocks are sorted to form a sequence of water flow image blocks corresponding to that segmentation rectangle. It should be noted that the step size of the sliding window can be selected according to actual needs. For example, when high accuracy is required, the step size can be smaller; when computational overhead is low, the step size can be larger.
[0041] Secondly, regarding step S120, it should be noted that the specific methods for forming each local semantic feature and global semantic feature of the water flow are not restricted and can be selected according to actual needs.
[0042] For example, in an alternative implementation, in order to effectively enhance the latent semantic information related to particles and effectively suppress the latent semantic information related to the water flow background, the above step S120 may further include steps S121, S122 and S123, wherein the specific contents of each step are as follows.
[0043] Step S121: Perform convolution processing on each water flow image block in the water flow image block sequence to form local convolution features of water flow corresponding to each water flow image block, and determine the corresponding local semantic features of water flow based on the local convolution features of water flow corresponding to each water flow image block.
[0044] In this embodiment, each water flow image block in the sequence of water flow image blocks can be convolved to form local convolutional features corresponding to each water flow image block. Based on these local convolutional features, corresponding local semantic features of the water flow are determined. The convolutional processing can be implemented using a trained convolutional neural network model, and the specific architecture of the convolutional neural network model (referring to relevant existing technologies) is not limited.
[0045] Step S122: Embedding the characterization information of the target particles and the characterization information of the water flow background of the target water flow region to form particle characterization embedding features and water flow background embedding features, and performing convolution processing on the water flow surface image to form water flow surface convolution features.
[0046] In this embodiment, the characterization information of the target deployed particles and the characterization information of the water flow background of the target water flow region can be embedded to form particle characterization embedding features and water flow background embedding features. The water flow surface image is then convolved to form water flow surface convolution features. The characterization information of the target deployed particles includes at least the color information of the target deployed particles (e.g., it may also include size and shape information), and the characterization information of the water flow background of the target water flow region includes at least the color information of the water flow background. Furthermore, the embedding process can be implemented using a word embedding model (refer to relevant prior art).
[0047] Step S123: Enhance the semantic information of the water flow surface convolution feature based on the particle representation embedding feature, and suppress the semantic information of the water flow surface convolution feature based on the water flow background embedding feature, so as to form a global semantic feature of water flow.
[0048] In this embodiment, after obtaining the particle representation embedding features and the water flow background embedding features, the semantic information of the water flow surface convolution features can be enhanced based on the particle representation embedding features, and the semantic information of the water flow surface convolution features can be suppressed based on the water flow background embedding features, thereby forming a global semantic feature of the water flow. That is, in this embodiment, since there is a significant difference in color between the target particles and the water flow background, enhancing and suppressing semantic information based on color-related semantic features can result in a higher accuracy of the semantic representation of the formed global semantic feature of the water flow.
[0049] It is understood that the specific method for determining the local semantic features of the water flow in step S121 above is not limited. For example, in an alternative implementation, in order to further improve the semantic representation capability of the determined local semantic features of the water flow, step S121 above may further include steps S121a, S121b and S121c, wherein the specific contents of each step are as follows.
[0050] Step S121a: Perform convolution processing on each water flow image block in the water flow image block sequence to form the local convolutional features of water flow corresponding to each water flow image block.
[0051] In this embodiment, each water flow image block in the sequence can be convolved to form local convolutional features of the water flow corresponding to each water flow image block. As mentioned above, the convolution process can be implemented using a convolutional neural network model.
[0052] Step S121b: Based on the sequential relationship of each water flow image patch in the water flow image patch sequence, calculate the similarity parameter between the local convolutional features of adjacent water flow image patches respectively, and combine the similarity parameters to form a local similarity representation matrix.
[0053] In this embodiment of the application, after obtaining the local convolutional features of the water flow, similarity parameters between the local convolutional features of adjacent water flow image blocks can be calculated based on the sequential relationship of each water flow image block in the sequence of water flow image blocks. Furthermore, the similarity parameters can be combined to form a local similarity representation matrix. For example, the similarity parameters between the local convolutional features of the first and second water flow image blocks can be calculated, as can the similarity parameters between the local convolutional features of the second and third water flow image blocks, and the similarity parameters between the local convolutional features of the third and fourth water flow image blocks can be calculated.
[0054] Step S121c: Perform mean fusion on each of the water flow local convolutional features, and concatenate the result of mean fusion with the local similarity representation matrix to form water flow local semantic features.
[0055] In this embodiment, after obtaining the local similarity representation matrix, mean fusion can be performed on each of the local convolutional features of the water flow, and the result of mean fusion can be concatenated with the local similarity representation matrix to form local semantic features of the water flow. It should be noted that while mean fusion can represent each of the local convolutional features of the water flow, this representation is holistic, and some semantic information of each individual feature may be overlooked. Therefore, by concatenating the similarity parameters between the local convolutional features represented by the local similarity representation matrix, the differences (or similarities) among the local convolutional features can be considered, thereby improving the semantic representation capability of the formed local semantic features of the water flow.
[0056] It is understood that the specific method for determining the local semantic features of the water flow in step S123 above is not limited. For example, in an alternative implementation, in order to further improve the semantic representation capability of the determined local semantic features of the water flow, step S123 above may further include steps S123a and S123b, wherein the specific contents of each step are as follows.
[0057] Step S123a: Analyze the semantic association between the particle representation embedding features and the water flow surface convolution features to form particle surface association features; and enhance the semantic information of the water flow surface convolution features based on the particle surface association features to form water flow surface enhancement features.
[0058] In this embodiment, the semantic association between the particle representation embedding features and the water flow surface convolution features can be analyzed to form particle surface association features. Furthermore, based on the particle surface association features, the semantic information of the water flow surface convolution features is enhanced to form water flow surface enhancement features. It should be noted that since the particle representation embedding features are obtained by embedding the representation information of the target deployed particle itself, they have a strong correlation with the target deployed particle. Therefore, by analyzing the semantic association between the particle representation embedding features and the water flow surface convolution features, it is possible to extract the semantics related to the target deployed particle from the water flow surface convolution features. This allows the formed particle surface association features to focus on or emphasize the representation of the semantics related to the target deployed particle. Thus, by further enhancing the water flow surface convolution features through the particle surface association features, the potential semantic information related to the particles can be enhanced.
[0059] Step S123b: Analyze the semantic association between the water flow background embedding features and the water flow surface enhancement features to form background surface association features; and based on the background surface association features, suppress the semantic information of the water flow surface enhancement features to form global semantic features of the water flow.
[0060] In this embodiment, the semantic association between the water flow background embedding features and the water flow surface enhancement features can be analyzed to form background surface association features. Furthermore, based on the background surface association features, the semantic information of the water flow surface enhancement features is suppressed to form global water flow semantic features. It should be noted that since the water flow background embedding features are obtained by embedding the representational information of the water flow background itself, they have a strong correlation with the water flow background. Therefore, by analyzing the semantic association between the water flow background embedding features and the water flow surface convolutional features, it is possible to extract semantics related to the water flow background from the water flow surface convolutional features. This allows the formed background surface association features to emphasize or focus on representing the semantics related to the water flow background. Thus, by further suppressing the water flow surface convolutional features through the background surface association features, the potential semantic information related to the water flow background can be suppressed.
[0061] It is understood that the specific method of forming the water flow surface enhancement feature in step S123a above is not limited. For example, in an alternative implementation, in order to balance the accuracy of semantic analysis and the consumption of computing resources, step S123a above may further include steps a1, a2 and a3, wherein the specific contents of each step are as follows.
[0062] Step a1: Based on the attention mechanism, analyze the semantic association between the particle representation embedding features and the water flow surface convolution features to form particle surface association features.
[0063] In this embodiment, the semantic association between the particle representation embedding features and the water flow surface convolution features can be analyzed based on an attention mechanism to form particle surface associated features. For example, the water flow surface convolution features can be subjected to cross-attention processing based on the particle representation embedding features to form particle surface associated features. In other words, the effective capture of associated semantics can be achieved by utilizing the attention mechanism's ability to effectively capture associated semantics.
[0064] Step a2: Perform focus weight mapping on the particle surface correlation features to form particle focus weights.
[0065] In this embodiment, after obtaining the particle surface association features, a focused weight mapping can be performed on the particle surface association features to form particle focused weights. The focused weight mapping includes at least linear relationship mining and nonlinear relationship capture. For example, linear relationship mining can be achieved by multiplying with the weight matrix and adding the result of the multiplication to the bias parameter. This facilitates mapping the features to the semantic space representing the weights. Nonlinear relationship capture can be achieved using functions such as sigmoid, which, while capturing complex nonlinear relationships, also maps the parameters to 0-1, thus facilitating subsequent calculations.
[0066] Step a3: Based on the particle focusing weight, the feature parameters of the water flow surface convolution feature are weighted accordingly to enhance the particle semantic information and form the water flow surface enhancement feature.
[0067] In this embodiment, after obtaining the particle focusing weights, the feature parameters of the water flow surface convolution features can be weighted accordingly based on the particle focusing weights. That is, the feature parameters and weight parameters at corresponding positions are multiplied to enhance the semantic information of the particles and form enhanced water flow surface features. It should be noted that since the particle surface association features are obtained based on the cross-attention mechanism, they focus on representing the semantic information related to the target deployed particles. Thus, after further focusing weight mapping, the resulting particle focusing weights can focus more on representing the semantic information related to the target deployed particles. This allows the weighting to fully consider the semantic information related to the target deployed particles in the water flow surface convolution features while ignoring other interfering information.
[0068] It is understood that the specific method of forming the global semantic features of water flow in step S123b above is not limited. For example, in an alternative implementation, in order to balance the accuracy of semantic analysis and the consumption of computing resources, step S123b above may further include steps b1, b2, b3 and b4, wherein the specific contents of each step are as follows.
[0069] Step b1: Based on the attention mechanism, analyze the semantic association between the water flow background embedding features and the water flow surface enhancement features to form background surface association features.
[0070] In this embodiment, the semantic association between the water flow background embedding features and the water flow surface enhancement features can be analyzed based on an attention mechanism to form background surface association features. For example, the water flow surface convolutional features can be cross-attention processed based on the water flow background embedding features to form background surface association features. In other words, the effective capture of association semantics can be achieved by utilizing the attention mechanism's ability to effectively capture association semantics.
[0071] Step b2: Perform focus weight mapping on the background surface associated features to form background focus weights.
[0072] In this embodiment, after obtaining the background surface association features, a focus weight mapping can be performed on the background surface association features to form background focus weights. The focus weight mapping includes at least linear relationship mining and nonlinear relationship capture. For example, linear relationship mining can be achieved by multiplying with the weight matrix and adding the result of the multiplication to the bias parameter. This facilitates mapping features to the semantic space representing the weights. Nonlinear relationship capture can be achieved using functions such as sigmoid, which, while capturing complex nonlinear relationships, also maps the parameters to 0-1, thus facilitating subsequent calculations.
[0073] Step b3: Invert the background focusing weights to form background suppression weights.
[0074] In this embodiment, after obtaining the background focusing weight, the background focusing weight can be inverted to form a background suppression weight. It should be noted that since the background focusing weight focuses on representing semantics related to the water flow background, inversion can yield a background suppression weight used to suppress semantic information related to the water flow background. The inversion process can be: Background suppression weight = 1 - Background focusing weight.
[0075] Step b4: Based on the background suppression weight, the feature parameters of the water flow surface enhancement feature are weighted accordingly to suppress background semantic information and form global semantic features of water flow.
[0076] In this embodiment, after obtaining the background suppression weight, the feature parameters of the water flow surface enhancement feature can be weighted accordingly based on the background suppression weight to suppress background semantic information and form a global semantic feature of the water flow. It should be noted that, since the formed background suppression weight can focus more on suppressing semantic information related to the water flow background—that is, it can focus on representing semantic information related to the target particle—the weighting process can further focus on the semantic information related to the target particle in the water flow surface enhancement feature, while suppressing semantic information related to the water flow background.
[0077] Thirdly, regarding step S130, it should be noted that the specific method for analyzing the distribution position of each target particle in the water flow surface image is not limited and can be selected according to actual needs.
[0078] For example, in an alternative implementation, in order to achieve accurate analysis of the distribution location, the above step S130 may further include steps S131, S132 and S133, wherein the specific contents of each step are as follows.
[0079] Step S131: Based on each of the local semantic features of the water flow, decode and output the global semantic features of the water flow to form a global feature map of the water flow.
[0080] In this embodiment, the global semantic features of the water flow can be decoded and output based on each of the local semantic features of the water flow to form a global feature map of the water flow. The size of the global feature map of the water flow is the same as the size of the water flow surface image. That is, the parameters in the global feature map of the water flow correspond one-to-one with the pixels in the water flow surface image.
[0081] Step S132: Perform probability mapping on the global feature map of the water flow to form a particle deployment probability map.
[0082] In this embodiment, after obtaining the global feature map of the water flow, a probability mapping (such as using a sigmoid function) can be performed on the global feature map to form a particle deployment probability map. The size of the particle deployment probability map is the same as the size of the water flow surface image, and each probability value in the particle deployment probability map represents the probability that a pixel at a corresponding position in the water flow surface image belongs to the target particle. It should be noted that the target particle can be one or multiple.
[0083] Step S133: Determine the distribution position of each target particle in the water flow surface image based on the particle deployment probability map.
[0084] In this embodiment, after obtaining the particle deployment probability map, the distribution position of each target particle in the water flow surface image can be determined based on the particle deployment probability map. For example, each pixel with a probability greater than a set threshold can be identified first. Then, the connected components of these identified pixels can be determined. In this way, the pixels included in each connected component whose size and shape match the target particle (e.g., similarity greater than a preset similarity) can be determined as the distribution position of the target particle.
[0085] It is understood that the specific method of decoding and outputting the global semantic features of water flow in step S131 above is not limited. For example, in an alternative implementation, in order to ensure the reliability of decoding, step S131 above may further include steps S131a, S131b, S131c, S131d and S131e, wherein the specific contents of each step are as follows.
[0086] Step S131a: Determine the number of decoding stages and the number of local semantic features of the water flow.
[0087] In this embodiment, the number of decoding stages and the number of local semantic features of the water flow can be determined. The number of decoding stages is greater than or equal to the number of local semantic features of the water flow.
[0088] Step S131b: When the number of decoding stages is greater than 1, the number of local semantic features of water flow is greater than 1, and the number of decoding stages is greater than the number of local semantic features of water flow, the multiple local semantic features of water flow and the multiple decoding stages are associated based on the feature similarity between the multiple local semantic features of water flow, so that one local semantic feature of water flow is associated with one decoding stage.
[0089] In this embodiment, when the number of decoding stages is greater than 1, the number of local semantic features of water flow is greater than 1, and the number of decoding stages is greater than the number of local semantic features of water flow, the multiple local semantic features of water flow and the multiple decoding stages are associated based on the feature similarity between them, so that one local semantic feature of water flow is associated with one decoding stage. For example, to avoid attention overfitting in the decoding stage, after obtaining the feature similarity, the multiple local semantic features of water flow can be sorted based on the feature similarity to form a target feature sequence. This target feature sequence has the highest mean feature similarity between two adjacent local semantic features compared to other sorted feature sequences. Thus, in subsequent steps, excessively similar attention processing in adjacent decoding stages can be avoided as much as possible. Furthermore, it should be noted that during the association process, the association can be based on the principle that the decoding stages associated with the local semantic features of water flow are evenly distributed across all decoding stages. Furthermore, when the number of decoding stages is greater than or equal to 1 and the number of local semantic features of water flow is equal to 1, any decoding stage can be associated with the local semantic features of water flow. When the number of decoding stages is greater than 1, the number of local semantic features of water flow is greater than 1, and the number of decoding stages is equal to the number of local semantic features of water flow, the order in the target feature sequence can be mapped one-to-one with the order of the decoding stages, so that the local semantic features of water flow are associated one-to-one with the decoding stages.
[0090] In step S131c, in the first decoding stage, if the decoding stage is associated with the local semantic features of the water flow, then after performing attention processing on the global semantic features of the water flow based on the local semantic features of the water flow, the result of the attention processing is upsampled to obtain the output features of the first decoding stage. If the decoding stage is not associated with the local semantic features of the water flow, then the global semantic features of the water flow are upsampled to obtain the output features of the first decoding stage.
[0091] In the embodiments of this application, combined with Figure 3 In the first decoding stage, if the decoding stage is associated with the local semantic features of the water flow, then after attention processing is applied to the global semantic features of the water flow based on the local semantic features, the result of the attention processing is upsampled (e.g., deconvolution, unpooling, etc.) to obtain the output features of the first decoding stage. If the decoding stage is not associated with the local semantic features of the water flow, then upsampling processing is applied to the global semantic features of the water flow to obtain the output features of the first decoding stage. In other words, when the local semantic features of the water flow are associated, the decoding of the global semantic features of the water flow is constrained based on the local semantic features of the water flow.
[0092] In step S131d, in each of the second and subsequent decoding stages, if the current decoding stage is associated with the local semantic features of the water flow, then after performing attention processing on the output features of the previous decoding stage based on the local semantic features of the water flow, the result of the attention processing is upsampled to obtain the output features of the current decoding stage. If the current decoding stage is not associated with the local semantic features of the water flow, then the output features of the previous decoding stage are upsampled to obtain the output features of the current decoding stage.
[0093] In the embodiments of this application, in each of the second and subsequent decoding stages, if the current decoding stage is associated with the local semantic features of the water flow, then after performing attention processing on the output features of the previous decoding stage based on the local semantic features of the water flow, the result of the attention processing is upsampled to obtain the output features of the current decoding stage. If the current decoding stage is not associated with the local semantic features of the water flow, then the output features of the previous decoding stage are upsampled to obtain the output features of the current decoding stage.
[0094] Step S131e: Based on the output features of the last stage, determine the global feature map of the water flow.
[0095] In this embodiment of the application, after obtaining the output features of the last stage, a global feature map of the water flow can be determined based on the output features of the last stage. For example, the output features of the last stage can be determined as the global feature map of the water flow.
[0096] In summary, the particle identification method and system for water flow measurement provided in this application firstly segment the acquired water flow surface image of the target water flow region based on the size of the target particle, forming at least one sequence of water flow image blocks; secondly, extract the latent semantic information from each water flow image block sequence and the latent semantic information from the water flow surface image, forming corresponding local and global semantic features of the water flow; then, analyze the distribution position of each target particle in the water flow surface image based on each local and global semantic feature of the water flow. Based on the above, on the one hand, because the latent semantic information related to particles is enhanced based on the representation information of the target particle during the extraction of latent semantic information from the water flow surface image, and the latent semantic information related to the water flow background is suppressed based on the representation information of the water flow surface, the representation ability of the formed global semantic features of the water flow for the semantic information of the particle is improved, and interference caused by the water flow background is reduced, resulting in higher accuracy in the analysis of the distribution position of the target particle. On the other hand, since the water surface image is segmented based on the size of the target particle, and latent semantic information is extracted from the resulting sequence of water flow image blocks as a basis for distribution location analysis, the analysis basis includes not only highly reliable global semantic information but also local semantic information matching the target particle, further improving the accuracy of the analysis. Therefore, based on the solution provided in this application, the reliability of particle recognition can be improved, thereby addressing the problem of relatively low reliability in particle recognition in existing technologies.
[0097] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A method for identifying projected particles applied to water flow measurement, characterized in that, include: Based on the size of the target particles, the water surface image of the target water flow region is segmented in at least one way to form at least one sequence of water flow image blocks. The latent semantic information in each of the water flow image block sequences and the latent semantic information in the water flow surface images are extracted respectively to form corresponding local semantic features and global semantic features of each water flow. In the process of extracting the latent semantic information in the water flow surface images, the latent semantic information related to particles is enhanced based on the characterization information of the target particles, and the latent semantic information related to the water flow background is suppressed based on the characterization information of the water flow surface. Based on each of the local semantic features and the global semantic features of the water flow, the distribution position of each target particle in the water flow surface image is analyzed. The difference between the distribution positions of the target particles in two adjacent frames of water flow surface images is used to determine the moving distance of the target particles in the corresponding time during water flow measurement. This moving distance is used to reflect the water flow velocity in the target water flow region.
2. The particle identification method for water flow measurement according to claim 1, characterized in that, The step of performing at least one segmentation on the water surface image of the target water flow region based on the size of the target deployed particles to form at least one sequence of water flow image blocks includes: Based on the size of the target particle, at least one segmentation rectangle is determined, wherein the area of each segmentation rectangle in the acquired water flow surface image of the target water flow region is greater than the area of the target particle in the water flow surface image, such that the segmentation rectangle can completely cover the target particle in the water flow surface image. For each of the segmentation rectangles, the water surface image of the target water flow region is segmented by sliding window based on the segmentation rectangle to form a corresponding water flow image block. Based on the order of the sliding window segmentation, the water flow image blocks are sorted to form a sequence of water flow image blocks corresponding to the segmentation rectangle.
3. The particle recognition method for water flow measurement according to claim 1, characterized in that, The step of extracting latent semantic information from each of the water flow image block sequences and the latent semantic information from the water flow surface images to form corresponding local semantic features and global semantic features of the water flow includes: Each water flow image block in the sequence of water flow image blocks is convolved to form a local convolutional feature of water flow corresponding to each water flow image block. Based on the local convolutional feature of water flow corresponding to each water flow image block, the corresponding local semantic features of water flow are determined. The characterization information of the target deployed particles and the characterization information of the water flow background of the target water flow region are embedded to form particle characterization embedding features and water flow background embedding features. The water flow surface image is then convolved to form water flow surface convolution features. The characterization information of the target deployed particles includes at least the color information of the target deployed particles, and the characterization information of the water flow background of the target water flow region includes at least the color information of the water flow background. The semantic information of the water flow surface convolution feature is enhanced based on the particle representation embedding feature, and the semantic information of the water flow surface convolution feature is suppressed based on the water flow background embedding feature, so as to form a global semantic feature of water flow.
4. The particle identification method for water flow measurement according to claim 3, characterized in that, The steps of enhancing the semantic information of the water flow surface convolutional features based on the particle representation embedding features, and suppressing the semantic information of the water flow surface convolutional features based on the water flow background embedding features to form global semantic features of the water flow include: The semantic association between the particle representation embedding features and the water flow surface convolution features is analyzed to form particle surface association features. Based on the particle surface association features, the semantic information of the water flow surface convolution features is enhanced to form water flow surface enhancement features. The semantic association between the water flow background embedding features and the water flow surface enhancement features is analyzed to form background surface association features. Based on the background surface association features, the semantic information of the water flow surface enhancement features is suppressed to form global semantic features of the water flow.
5. The particle identification method for water flow measurement according to claim 4, characterized in that, The steps of analyzing the semantic association between the particle representation embedding features and the water flow surface convolution features to form particle surface association features, and enhancing the semantic information of the water flow surface convolution features based on the particle surface association features to form water flow surface enhancement features, include: Based on the attention mechanism, the semantic association between the particle representation embedding features and the water flow surface convolution features is analyzed to form particle surface association features; The particle surface correlation features are subjected to a focus weight mapping to form a particle focus weight, wherein the focus weight mapping includes at least linear relationship mining and nonlinear relationship capture; Based on the particle focusing weights, the feature parameters of the water flow surface convolution features are weighted accordingly to enhance the semantic information of the particles and form enhanced water flow surface features.
6. The particle identification method for water flow measurement according to claim 4, characterized in that, The steps of analyzing the semantic association between the water flow background embedding features and the water flow surface enhancement features to form background surface association features, and based on the background surface association features, suppressing the semantic information of the water flow surface enhancement features to form global semantic features of the water flow, include: Based on the attention mechanism, the semantic association between the water flow background embedding features and the water flow surface enhancement features is analyzed to form background surface association features; The background surface association features are subjected to focus weight mapping to form background focus weights, wherein the focus weight mapping includes at least linear relationship mining and nonlinear relationship capture; The background focusing weights are inverted to form background suppression weights; Based on the background suppression weights, the feature parameters of the water flow surface enhancement features are weighted accordingly to suppress background semantic information and form global semantic features of the water flow.
7. The particle identification method for water flow measurement according to claim 3, characterized in that, The steps of performing convolution processing on each water flow image block in the sequence of water flow image blocks to form local convolutional features of water flow corresponding to each water flow image block, and determining the corresponding local semantic features of water flow based on the local convolutional features of water flow corresponding to each water flow image block, include: Each water flow image block in the sequence of water flow image blocks is convolved to form the local convolutional feature of water flow corresponding to each water flow image block. Based on the sequential relationship of each water flow image patch in the water flow image patch sequence, the similarity parameter between the local convolutional features of adjacent water flow image patches is calculated respectively, and the similarity parameters are combined to form a local similarity representation matrix. For each of the water flow local convolutional features, mean fusion is performed, and the result of mean fusion is concatenated with the local similarity representation matrix to form water flow local semantic features.
8. The method for identifying projected particles applied to water flow measurement according to any one of claims 1-7, characterized in that, The step of analyzing the distribution location of each target particle in the water flow surface image based on each of the local semantic features and the global semantic features of the water flow includes: Based on each of the local semantic features of the water flow, the global semantic features of the water flow are decoded and output to form a global feature map of the water flow, wherein the size of the global feature map of the water flow is the same as the size of the water flow surface image; The global feature map of the water flow is probabilistically mapped to form a particle deployment probability map, wherein the size of the particle deployment probability map is the same as the size of the water flow surface image, and each probability value in the particle deployment probability map is used to characterize the probability that a pixel at a corresponding position in the water flow surface image belongs to the target particle deployment. The distribution location of each target particle in the water flow surface image is determined based on the particle deployment probability map.
9. The particle identification method for water flow measurement according to claim 8, characterized in that, The step of decoding and outputting the global semantic features of the water flow based on each of the local semantic features of the water flow to form a global feature map of the water flow includes: The number of decoding stages and the number of local semantic features of the water flow are determined, wherein the number of decoding stages is greater than or equal to the number of local semantic features of the water flow; When the number of decoding stages is greater than 1, the number of local semantic features of water flow is greater than 1, and the number of decoding stages is greater than the number of local semantic features of water flow, the multiple local semantic features of water flow and the multiple decoding stages are associated based on the feature similarity between the multiple local semantic features of water flow, so that one local semantic feature of water flow is associated with one decoding stage; In the first decoding stage, if the decoding stage is associated with the local semantic features of the water flow, then after attention processing is performed on the global semantic features of the water flow based on the local semantic features of the water flow, the result of the attention processing is upsampled to obtain the output features of the first decoding stage. If the decoding stage is not associated with the local semantic features of the water flow, then the global semantic features of the water flow are upsampled to obtain the output features of the first decoding stage. In each of the second and subsequent decoding stages, if the current decoding stage is associated with the local semantic features of the water flow, then after performing attention processing on the output features of the previous decoding stage based on the local semantic features of the water flow, the result of the attention processing is upsampled to obtain the output features of the current decoding stage. If the current decoding stage is not associated with the local semantic features of the water flow, then the output features of the previous decoding stage are upsampled to obtain the output features of the current decoding stage. Based on the output characteristics of the last stage, the global feature map of the water flow is determined.
10. A particle recognition system for water flow measurement, characterized in that, include: Memory, used to store computer programs; A processor connected to the memory is used to execute the computer program stored in the memory to implement the particle identification method for water flow measurement as described in any one of claims 1-9.