AI-based power transmission line country lane image segmentation method and device, and medium

Through AI-based methods, using user clicks to obtain color values ​​and calculate attention weights, the problem of difficult to accurately segment rural trails in GIS images in traditional technology is solved, and the accuracy and economic evaluation of transmission line transportation planning is improved.

CN119251493APending Publication Date: 2025-01-03SOUTHWEST ELECTRIC POWER DESIGN INST OF CHINA POWER ENG CONSULTING GROUP CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411246604.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-06
Publication Date
2025-01-03

AI Technical Summary

Technical Problem

Traditional technology is difficult to accurately and automatically segment special roads such as country roads in GIS images, resulting in limited accuracy and economic evaluation of transmission line transportation planning.

Method used

Using an AI-based method, the user clicks on any point in the GIS image to obtain the color value to form a query vector matrix, combines the color values ​​of all pixels to form a key vector matrix, calculates attention scores and weights, and performs weight summing to generate the segmented Image, label specific areas.

Benefits of technology

It significantly improves the segmentation accuracy of specific color areas, especially suitable for segmenting specific areas such as country roads from GIS images, and improves the calculation accuracy of the transmission line terrain and transportation condition evaluation system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119251493A_ABST
    Figure CN119251493A_ABST
Patent Text Reader

Abstract

The invention provides an AI-based power transmission line country lane image segmentation method and device and a medium, and the method comprises the steps: selecting any point representing a country lane in a GIS image, obtaining the color value of the point, and forming a query vector matrix; extracting color values of all pixels from the GIS image to form a key vector matrix; calculating the correlation of each pixel according to the query vector matrix and the key vector matrix to obtain an attention score; a Softmax function is applied to the attention score, and an attention weight is obtained through calculation; the attention weight is used to carry out weighted summation on the GIS image, the original GIS image is remodeled to generate a segmented image, and in the segmented image, the pixel value of the country lane is marked and displayed. According to the method, the image segmentation precision can be effectively improved, and the method is particularly suitable for segmenting specific areas such as country lanes from the GIS image. The method is simple and efficient, the calculation accuracy of the small transportation and unloading points can be remarkably improved, and the terrain and transportation condition evaluation system of the power transmission line is optimized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of power transmission line image processing, and in particular to an AI-based power transmission line country road image segmentation method, device and medium. Background Art

[0002] With the rapid development of power grids, the coverage of power transmission networks is increasing day by day. The construction of power transmission lines involves a large number of new or modified power transmission line projects. When designing power transmission lines, it is necessary to comprehensively monitor the natural environment, geology, topography, climate conditions and other factors in the construction area, and propose executable solutions that match them to ensure the rationality of the design. It is crucial to choose the right mode of transportation for different terrain conditions. For example, under different terrain conditions such as flat land, river network swamps, hills, mountains and high mountains and ridges, different modes of transportation such as light trucks, crawler transporters, cableways, wetland land boats, and amphibious transporters can be selected. Under some special terrain conditions, such as places where roads cannot be built, cableway transportation can be used. Under different terrain conditions, the costs of manual transportation and cableway transportation are also different. For example, in flat terrain, the cost of manual transportation is relatively low; while in hilly, mountainous, high mountains and steep terrain, the cost threshold of the two modes of transportation needs to be considered.

[0003] In order to judge the economic and reliability indicators of different transportation schemes, a comprehensive evaluation system for the terrain and transportation conditions of power transmission lines is proposed. In the comprehensive evaluation system for the terrain and transportation conditions of power transmission lines, accurate identification of terrain features is crucial to improve the calculation accuracy of small transportation and unloading points. In traditional schemes, detailed road data is usually obtained through on-site surveys to form a reliable planning scheme, but this method greatly wastes manpower and material resources. There are also some technologies that can plan and design transportation schemes through road network data. Road network data refers to geographic information data used to describe and analyze road networks; however, this technology relies too much on existing road network data, which may be incomplete or inaccurate. For example, some special roads such as country roads and temporary narrow roads are often missing in road network data. GIS image technology can effectively solve the above problems. GIS images (Geographic Information System images) refer to images generated or processed by geographic information systems. These images are usually used to display and analyze spatial data. Since the special roads missing from the road network data mentioned above can be obtained in GIS images, how to effectively identify these special roads in GIS images for application in power transmission line transportation planning needs to be solved urgently; traditional image segmentation methods are difficult to automatically and accurately segment these specific areas. Summary of the invention

[0004] The present invention aims to solve at least one of the technical problems existing in the prior art.

[0005] To this end, the first aspect of the present invention provides an AI-based method for segmenting images of power transmission line country roads.

[0006] A second aspect of the present invention provides a computer device.

[0007] A third aspect of the present invention provides a computer-readable storage medium.

[0008] The AI-based transmission line country road image segmentation method proposed in the present invention includes:

[0009] Select any point representing a country road in the GIS image, obtain the color value of the point, and form a query vector matrix;

[0010] Extract the color values ​​of all pixels from the GIS image to form a key vector matrix;

[0011] Calculate the relevance of each pixel based on the query vector matrix and the key vector matrix to get the attention score;

[0012] Apply the Softmax function to the attention score and calculate the attention weight;

[0013] The GIS image is weighted and summed using the attention weights, and the original GIS image is reshaped to generate a segmented image. In the segmented image, the pixel values ​​of the country roads will be marked and displayed.

[0014] The AI-based power transmission line country road image segmentation method according to the above technical solution of the present invention may also have the following additional technical features:

[0015] In the above technical solution, the step of selecting any point representing a country road in the GIS image, obtaining the color value of the point, and forming a query vector matrix includes:

[0016] Select any point representing the country road in the GIS image by clicking the mouse;

[0017] The query vector matrix Q is expressed as:

[0018] Q = image[y,x,:]

[0019] Where image represents the input GIS image; [y,x,:] represents the color value of the image at the position (y,x), and (y,x) is the coordinate of the point clicked by the user.

[0020] In the above technical solution, the color values ​​of all pixels are extracted from the GIS image to form a key vector matrix, including:

[0021] k=image.reshape(-1,image.shape[-1])

[0022] Among them, K represents the key vector matrix; reshape represents the matrix reshaping function; shape represents the shape function, which is used to return the dimension of the matrix.

[0023] In the above technical solution, the calculation of the correlation of each pixel according to the query vector matrix and the key vector matrix to obtain the attention score includes:

[0024] AttentionScores = Q·K T

[0025] Among them, AttentionScores represents the attention score.

[0026] In the above technical solution, the calculation of the correlation of each pixel according to the query vector matrix and the key vector matrix to obtain the attention score also includes:

[0027] The attention scores obtained by dot product calculation are scaled. The scaling methods include:

[0028]

[0029] Among them, Scaled Scores represents the scaled attention score, d k Dimension representing the color values.

[0030] In the above technical solution, the Softmax function is applied to the attention score to calculate the attention weight, including:

[0031] AttentionWeights=Softmax(ScaledScores)

[0032] Among them, AttentionWeights represents the attention weight;

[0033] The expression of the Softmax function is:

[0034]

[0035] Among them, x i represents the i-th element in the input vector of the Softmax function, j represents the index variable, x j represents the j-th element in the input vector representing the Softmax function.

[0036] In the above technical solution, the weighted summation of the GIS image using the attention weights includes:

[0037] By setting the similarity threshold, the attention weights are filtered, including:

[0038] AttentionWeights[AttentionWeights <threshold]=0

[0039] Among them, threshold represents the set similarity threshold;

[0040] The GIS image is weighted summed according to the filtered attention weights, including:

[0041]

[0042] Among them, SegmentationOutput(y,x) represents the pixel value of the final segmented image at the position (y,x), AttentionWeights(i) represents the attention weight of the i-th pixel, and Color(i) represents the color value of the i-th pixel in the original GIS image.

[0043] In the above technical solution, the reshaping of the original GIS image to generate the segmented image includes:

[0044] SegmentationOutput

[0045] =AttentionWeights.reshape(image.shape[0],image.shape[1])

[0046] Among them, SegmentationOutput represents the final segmented image.

[0047] The present invention provides a computer device, comprising a processor and a memory, wherein the memory stores a computer program, and when the computer program is loaded and executed by the processor, an AI-based transmission line country road image segmentation method as described in any one of the above technical solutions is implemented.

[0048] The present invention provides a computer-readable storage medium storing a program, which, when loaded by a processor, implements the AI-based power transmission line country road image segmentation method as described in any one of the above technical solutions.

[0049] In summary, due to the adoption of the above technical features, the beneficial effects of the present invention are:

[0050] The present invention provides an image segmentation method based on the color value clicked by the user. When the user clicks a certain point in the image, the color value of the point is obtained as a query vector matrix, and the color similarity is calculated in combination with the key vector matrix to generate attention weights, thereby realizing the segmentation of specific color areas. The method of the present invention is simple and efficient, and can significantly improve the segmentation accuracy of specific areas such as country roads.

[0051] Specifically, the present invention can effectively improve the segmentation accuracy of specific color areas in images, and is particularly suitable for segmenting specific areas such as country roads from GIS images. The method is simple, efficient, and has high practical application value. It can significantly improve the accuracy of small transport and unloading point calculations and optimize the terrain and transportation condition evaluation system of power transmission lines.

[0052] Additional aspects and advantages of the present invention will become apparent in the following description or may be learned by practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] The above and / or additional aspects and advantages of the present invention will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:

[0054] Figure 1 It is a flowchart of an AI-based power transmission line country road image segmentation method according to an embodiment of the present invention. DETAILED DESCRIPTION

[0055] In order to more clearly understand the above-mentioned purpose, features and advantages of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.

[0056] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways different from those described herein. Therefore, the protection scope of the present invention is not limited to the specific embodiments disclosed below.

[0057] Refer to the following Figure 1 To describe the AI-based power transmission line country road image segmentation method provided according to some embodiments of the present invention.

[0058] Some embodiments of the present application provide an AI-based method for segmenting images of power transmission line country roads.

[0059] like Figure 1 As shown, the first embodiment of the present invention proposes an AI-based power transmission line country road image segmentation method, including the following steps S1-S5.

[0060] S1. Select any point representing a country road in the GIS image, obtain the color value of the point, and form a query vector matrix.

[0061] Specifically, step S1 includes:

[0062] Select any point representing the country road in the GIS image by clicking the mouse;

[0063] The query vector matrix Q is expressed as:

[0064] Q = image[y,x,:]

[0065] Where image represents the input GIS image; [y,x,:] represents the color value of the image at the position (y,x), and (y,x) is the coordinate of the point clicked by the user.

[0066] It should be noted that the color value referred to in the present disclosure can be a color value in any applicable color space, such as RGB color space, HSV color space, CMYK color space, etc. When the RGB color space is selected, [y,x,:] can use the values ​​of the three RGB channels to represent the color value of the image at the position (y,x). Mouse click is not the only way to select a point, and it can also be selected by other methods such as entering coordinates.

[0067] S2. Extract the color values ​​of all pixels from the GIS image to form a key vector matrix.

[0068] Specifically, step S2 includes:

[0069] k=image.reshape(-1,image.shape[-1])

[0070] Where K is the key vector matrix; reshape is the matrix reshaping function; shape is the shape function, which is used to return the dimension of the matrix. The K matrix contains the color values ​​of all pixels in the GIS image.

[0071] In some embodiments, color differences may be used to determine which color values ​​are close to the color values ​​of the Q matrix. Specifically, after determining the color value of the pixel in the Q matrix, the Euclidean distance between the color value in the K matrix and the color value to be queried is calculated, and the color value close to the color value to be queried is determined based on the Euclidean distance.

[0072] S3. Calculate the relevance of each pixel based on the query vector matrix and the key vector matrix to obtain the attention score.

[0073] Specifically, step S3 includes:

[0074] The calculation of the correlation of each pixel according to the query vector matrix and the key vector matrix to obtain the attention score includes:

[0075] AttentionScores = Q·K T

[0076] Among them, AttentionScores represents the attention score.

[0077] In some embodiments, calculating the relevance of each pixel according to the query vector matrix and the key vector matrix to obtain an attention score further includes:

[0078] The attention scores obtained by dot product calculation are scaled. The scaling methods include:

[0079]

[0080] Among them, Scaled Scores represents the scaled attention score, d k The dimension representing the color value. The dot product result is scaled to prevent the value from being too large.

[0081] S4. Apply the Softmax function to the attention score and calculate the attention weight.

[0082] Specifically, step S4 includes:

[0083] The Softmax function is applied to the attention score to calculate the attention weight, including:

[0084] AttentionWeights=Softmax(ScaledScores)

[0085] Among them, AttentionWeights represents the attention weight;

[0086] The expression of the Softmax function is:

[0087]

[0088] Among them, x i represents the i-th element in the input vector of the Softmax function, j represents the index variable, x j represents the j-th element in the input vector representing the Softmax function.

[0089] S5. Use the attention weights to perform weighted summation on the GIS image, reshape the original GIS image to generate a segmented image, and in the segmented image, the pixel values ​​of the country roads will be marked and displayed. The marking display can be in the form of highlighting, special color marking, etc.

[0090] Specifically, the method of using the attention weights to perform weighted summation on the GIS image and reshaping the original GIS image to generate a segmented image includes:

[0091] By setting the similarity threshold, the attention weights are filtered, including:

[0092] AttentionWweights[AttentionWweights <threshold]=0

[0093] Among them, threshold represents the set similarity threshold; the similarity threshold can be set according to the accuracy requirements and experience. The filtering process of attention weight is the process of threshold segmentation definition. In this step, the attention weight value with an attention weight lower than the similarity threshold is set to 0. By filtering the attention weight, over-segmentation or overly strict segmentation can be effectively prevented.

[0094] The GIS image is then weighted summed according to the filtered attention weights, including:

[0095]

[0096] Among them, SegmentationOutput(y,x) represents the pixel value at the position (y,x) of the final generated segmented image, AttentionWweights(i) represents the attention weight of the i-th pixel, and Color(i) represents the color value of the i-th pixel in the original GIS image. By weightedly combining the attention weight with the pixel value in the GIS image, pixels in specific areas such as country roads can be highlighted.

[0097] Reshape the original GIS image to generate a segmented image, including:

[0098] SegmentationOutput

[0099] =AttentionWeights.reshape(image.shape[0],image.shape[1])

[0100] Among them, SegmentationOutput represents the final segmented image.

[0101] Some other embodiments of the present invention provide a computer device, including a processor and a memory, wherein the memory stores a computer program, and when the computer program is loaded and executed by the processor, the AI-based power transmission line country road image segmentation method as described in any of the above embodiments is implemented.

[0102] In some embodiments, the setting of the parameter of the similarity threshold is input by the user and can be performed simultaneously with step S1.

[0103] Still other embodiments of the present invention provide a computer-readable storage medium storing a program, which, when loaded by a processor, implements the AI-based power transmission line country road image segmentation method as described in any of the above embodiments.

[0104] In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.

[0105] Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A power transmission line country road image segmentation method based on AI, characterized in that: include: Select any point representing a country road in the GIS image, obtain the color value of the point, and form a query vector matrix; Extract the color values ​​of all pixels from the GIS image to form a key vector matrix; Calculate the relevance of each pixel based on the query vector matrix and the key vector matrix to get the attention score; Apply the Softmax function to the attention score and calculate the attention weight; The GIS image is weighted and summed using the attention weights, and the original GIS image is reshaped to generate a segmented image. In the segmented image, the pixel values ​​of the country roads will be marked and displayed.

2. The AI-based power transmission line country road image segmentation method according to claim 1, characterized in that: The method of selecting any point representing a country road in the GIS image and obtaining the color value of the point to form a query vector matrix includes: Select any point representing the country road in the GIS image by clicking the mouse; The query vector matrix Q is expressed as: Q = image[y,x,:] Where image represents the input GIS image; [y,x,:] represents the color value of the image at the position (y,x), and (y,x) is the coordinate of the point clicked by the user.

3. The AI-based power transmission line country road image segmentation method according to claim 2 is characterized in that: The color values ​​of all pixels are extracted from the GIS image to form a key vector matrix, including: K=image.reshape(-1,image.shape[-1]) Among them, K represents the key vector matrix; reshape represents the matrix reshaping function; shape represents the shape function, which is used to return the dimension of the matrix.

4. The AI-based power transmission line country road image segmentation method according to claim 3 is characterized in that: The calculation of the correlation of each pixel according to the query vector matrix and the key vector matrix to obtain the attention score includes: AttentionScores=Q·K T Among them, AttentionScores represents the attention score.

5. The AI-based power transmission line country road image segmentation method according to claim 4 is characterized in that: The step of calculating the relevance of each pixel according to the query vector matrix and the key vector matrix to obtain an attention score also includes: The attention scores obtained by dot product calculation are scaled. The scaling methods include: Among them, Scaled Scores represents the scaled attention score, d k Dimension representing the color values.

6. The AI-based power transmission line country road image segmentation method according to claim 5, characterized in that: The Softmax function is applied to the attention score to calculate the attention weight, including: AttentionWeights=Softmax(ScaledScores) Among them, AttentionWeights represents the attention weight; The expression of the Softmax function is: Among them, x i represents the i-th element in the input vector of the Softmax function, j represents the index variable, x j represents the j-th element in the input vector representing the Softmax function.

7. The AI-based power transmission line country road image segmentation method according to claim 6, characterized in that: The method of using attention weights to perform weighted summation on GIS images includes: By setting the similarity threshold, the attention weights are filtered, including: AttentionWeights[AttentionWeights <threshold]=0 Among them, threshold represents the set similarity threshold; The GIS image is weighted summed according to the filtered attention weights, including: Among them, SegmentationOutput(y,x) represents the pixel value of the final segmented image at the position (y,x), AttentionWeights(i) represents the attention weight of the i-th pixel, and Color(i) represents the color value of the i-th pixel in the original GIS image.

8. The AI-based power transmission line country road image segmentation method according to claim 6, characterized in that: The reshaping of the original GIS image to generate a segmented image includes: SegmentationOutput =AttentionWeights.reshape(image.shape[0],image.shape[1]) Among them, SegmentationOutput represents the final segmented image.

9. A computer device, characterized in that: It comprises a processor and a memory, wherein a computer program is stored in the memory, and when the computer program is loaded and executed by the processor, the AI-based power transmission line country road image segmentation method as described in any one of claims 1 to 8 is implemented.

10. A computer-readable storage medium, characterized in that: A program is stored, and when the program is loaded by a processor, the AI-based power transmission line country road image segmentation method as described in any one of claims 1 to 8 is implemented.