Detailed Description
It should be noted that, without conflict, the embodiments of the present application and features of the embodiments may be combined with each other. The application will be described in detail below with reference to the drawings in connection with embodiments.
In order that those skilled in the art will better understand the present application, a technical solution in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present application without making any inventive effort, shall fall within the scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present application and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate in order to describe the embodiments of the application herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
As described in the background art, the data and the electronic of the power grid engineering drawing in the prior art depend on technicians with expert knowledge, the accuracy and the engineering safety depend on the expertise of the technicians, and the efficiency is low, so as to solve the problem of low efficiency of manually storing the drawing in the prior art.
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.
The method embodiments provided in the embodiments of the present application may be performed in a mobile terminal, a computer terminal or similar computing device. Taking the operation on the mobile terminal as an example, fig. 1 is a hardware structure block diagram of the mobile terminal of the intelligent recognition method of the power grid engineering drawing according to the embodiment of the application. As shown in fig. 1, a mobile terminal may include one or more (only one is shown in fig. 1) processors 102 (the processor 102 may include, but is not limited to, a microprocessor MCU or a processing device such as a programmable logic device FPGA) and a memory 104 for storing data, wherein the mobile terminal may also include a transmission device 106 for communication functions and an input-output device 108. It will be appreciated by those skilled in the art that the structure shown in fig. 1 is merely illustrative and not limiting of the structure of the mobile terminal described above. For example, the mobile terminal may also include more or fewer components than shown in fig. 1, or have a different configuration than shown in fig. 1.
The memory 104 may be used to store a computer program, for example, a software program of application software and a module, such as a computer program corresponding to a display method of device information in an embodiment of the present invention, and the processor 102 executes the computer program stored in the memory 104 to perform various functional applications and data processing, that is, to implement the above-described method. Memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include memory remotely located relative to the processor 102, which may be connected to the mobile terminal via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof. The transmission device 106 is used to receive or transmit data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, simply referred to as a NIC) that can connect to other network devices through a base station to communicate with the internet. In one example, the transmission device 106 may be a Radio Frequency (RF) module, which is configured to communicate with the internet wirelessly.
In this embodiment, a method for intelligently identifying a power grid engineering drawing operating on a mobile terminal, a computer terminal, or a similar computing device is provided, and it should be noted that the steps illustrated in the flowchart of the drawing may be performed in a computer system such as a set of computer executable instructions, and that although a logical order is illustrated in the flowchart, in some cases, the steps illustrated or described may be performed in an order different from that illustrated herein.
Fig. 2 is a flowchart of a method for intelligently identifying a power grid engineering drawing according to an embodiment of the application. As shown in fig. 2, the method comprises the steps of:
Step S201, acquiring an alternative first target image, wherein the alternative first target image is a power grid engineering drawing image stored in an engineering drawing database;
Specifically, the paper power grid engineering drawing is converted into an electronic image through an image scanning device and is stored in a target database, so that an engineering drawing database is obtained. And reading the electronic image data of the drawing from the engineering drawing database to obtain the first target image.
Step S202, preprocessing the first target image to obtain a first target image, inputting the first target image into a first target model to obtain a plurality of second target images, wherein the second target images are partial images of the first target image containing preset elements, the first target model is used for dividing and recognizing the first target image to obtain the second target image, and the preprocessing at least comprises graying, filtering and sharpening;
Specifically, because the electronic image has the influence of factors such as photoelectric elements in the data conversion process, the alternative first target image obtained by image scanning has the defects of noise interference, characteristic loss and the like, and in order to improve the accuracy of intelligent identification, the application sets the electronic image to be subjected to the processes such as graying, filtering, sharpening and the like before the image is input into a model, reduces the influence of interference factors, and highlights the detail characteristics of important information related to equipment and the like in the electronic image. And inputting the image into a first target model to perform feature extraction to determine the part comprising important information such as equipment and the like to obtain the second target image. Cutting an electronic image into an image in a unified format which accords with preset parameters of a model, and further carrying out convolution on the image data through the model to extract characteristic data, wherein the characteristic data are characteristic information of equipment in a pre-stored power grid engineering drawing; after the feature data extraction is completed, analyzing and determining a candidate area where the feature information is located according to the feature data, further carrying out further refinement identification on the candidate area, and determining a target area to obtain the second target image.
Step S203, inputting all the second target images into a second target model to obtain a third target image, where the third target image is the editable power grid engineering drawing image, and the second target model is used to splice the second target images to obtain the third target image.
Specifically, after the second target image is identified, the second target image is input into the second target model for integration, and the output result of the first target model is integrated and compiled to become an editable electronic drawing, so that the third target image is obtained.
Through the embodiment, first, an alternative first target image is acquired, wherein the alternative first target image is a power grid engineering drawing image stored in an engineering drawing database; then, preprocessing the first target image to obtain a first target image, inputting the first target image into a first target model to obtain a plurality of second target images, wherein the second target images are partial images of the first target image containing preset elements, the first target model is used for dividing and identifying the first target image to obtain the second target image, and the preprocessing at least comprises graying, filtering and sharpening; and inputting all the second target images into a second target model to obtain a third target image, wherein the third target image is the editable power grid engineering drawing image, and the second target model is used for splicing the second target images to obtain the third target image. According to the scheme, the acquired power grid engineering drawing image is identified through the neural network model, the characteristic elements in the acquired power grid engineering drawing image are extracted to obtain the identification result, and the identification result is integrated through the neural network model to obtain the editable power grid engineering drawing image.
In order to obtain the second target image, in an alternative embodiment, the first target model includes a feature extraction sub-model, a filtering sub-model, and an element identification sub-model, and the step S202 includes:
Step S2021, inputting the first target image into the feature extraction sub-model to obtain a fourth target image, where the feature extraction sub-model is configured to segment the first target image into a first preset size and perform a convolution operation on the first target image to extract a feature image therein to obtain the fourth target image;
specifically, the first target image is input into the feature extraction sub-model, the first target image is cut according to a preset format and is cut into a plurality of fourth target images meeting the first preset size, and feature data in the image are convolutionally identified through a CNN model, so that power grid feature data are obtained.
Step S2022, inputting the fourth target image into the screening sub-model to obtain a fifth target image, where the screening sub-model is used to screen the fourth target image to obtain the fifth target image containing the preset element;
Specifically, the fourth target image and the power grid characteristic data are input into the screening submodel, and the candidate region including the preset element, namely the power grid characteristic data conforming to the target object, is subjected to re-analysis to obtain an element analysis result, namely the fourth target image is screened to obtain the fifth target image.
Step S2023, inputting the fifth target image into the element recognition sub-model to obtain the second target image, where the element recognition sub-model is used to downsample and depth convolve the fifth target image to obtain the second target image.
Specifically, the fifth target image is input into the element recognition sub-model, the element recognition sub-model reads a candidate region in the image, that is, the fifth target image, and the preset elements included in the candidate region are classified to obtain a classification result, so that the second target image is determined.
In order to acquire the fifth target image according to the fourth target image, in an alternative embodiment, the step S2022 includes:
Step S20221, performing convolution operation on the fourth target image and inputting the fourth target image into a classifier to obtain a classification result;
specifically, two parallel data streams which are the same are arranged on a convolution layer, wherein one data stream is used for judging the image background type by a classifier, namely, the data stream is obtained by carrying out convolution operation on the fourth target image, and then the data stream is input into the distributor to obtain a classification result.
Step S20222, performing regression processing on the fourth target image to obtain a regression result, and determining a sixth target image according to the classification result and the regression result;
Specifically, the application sets two parallel and identical data streams in the convolution layer, wherein one data stream is used for regression processing of the anchor frame and the real frame. And performing regression processing on the data stream obtained by performing convolution operation on the fourth target image to obtain the regression result. And integrating the classification result and the regression result to obtain a region of interest, thereby obtaining the sixth target image.
Step S20223, calculating a classification loss function f a (x) according to the classification result:
Wherein f a (x) represents the above-mentioned classification loss function, and α' i represents whether the i-th anchor frame includes the above-mentioned preset element;
Specifically, in order to ensure the accuracy of the fifth target image, the application trains the screening submodel according to the loss function. Wherein, the loss function is calculated respectively for the classification process and the regression process for integration. Firstly, analyzing according to the classification result, determining whether each anchor frame comprises preset elements, and substituting the preset elements into the formula to obtain a loss function value.
Step S20224, calculating a regression loss function f b (x) according to the above regression result:
Wherein f b (x) represents the regression loss function, βi is the regression parameter of the ith prediction frame relative to the ith anchor frame, and β i' represents the regression parameter of the ith real frame relative to the ith anchor frame;
Specifically, in order to ensure the accuracy of the fifth target image, the application trains the screening submodel according to the loss function. Wherein, the loss function is calculated respectively for the classification process and the regression process for integration. And secondly, analyzing the regression result, respectively determining regression parameters between the prediction frame and the anchor frame and between the real frame and the anchor frame, and substituting the regression parameters into the formula to obtain the loss function value.
Step S20225, calculating a target loss value according to the classification loss function and the regression loss function:
Wherein S (alpha i,βi) is the target loss value, The method comprises the steps of presetting a weight for a first preset weight;
Specifically, the target loss value is obtained by integrating the loss function value of the classification loss function and the loss function value of the regression loss function according to the above formula. I.e. the current loss function value of the sub-model is screened.
Step S20226, determining the sixth target image as an alternative fifth target image when the target loss value is smaller than a first preset value, and training the screening submodel according to the target loss value when the fifth target value is greater than or equal to the first preset value until the target loss value is smaller than the first preset value, determining the sixth target image as the alternative fifth target image;
Specifically, when the target loss value is smaller than the first preset value, determining that the accuracy of the screening sub-model meets the requirement, determining that the output result of the screening sub-model, that is, the sixth target image is an alternative fifth target image, when the target loss value is greater than or equal to the first preset value, determining that the accuracy of the screening sub-model does not meet the requirement, training the screening sub-model according to the target loss value until the accuracy of the screening sub-model meets the requirement, and then processing the fourth target image through the screening sub-model again to obtain the sixth target image and determining the sixth target image as the fifth target image.
Step S20227, calculating a confidence coefficient according to the fifth target image, and determining the fifth target image with the confidence coefficient greater than a second preset value as the fifth target image.
Specifically, in order to further improve the precision of the drawing, the method and the device of the application are used for sequentially calculating the confidence coefficient according to the fifth target image candidate, and further rejecting the fifth target image candidate with the confidence coefficient which does not meet the requirement to obtain the fifth target image.
In order to screen out the fifth target image satisfying the requirement, in an alternative embodiment, the step S20227 includes:
Step S02271, obtaining a plurality of confidence probabilities and a second preset weight, and calculating the confidence rate according to the confidence probabilities and the second preset weight, wherein the confidence probabilities are in one-to-one correspondence with the anchor frames:
Wherein, P i * is the confidence coefficient, P is the candidate frame with the highest confidence coefficient, IOU (P, P i) is the intersection ratio of the anchor frame P i and the candidate frame, ω is the second preset weight;
Specifically, since at least two candidate frames with different confidence probabilities are selected, in order to reduce the interference of unnecessary anchor frames, a desired target candidate frame is obtained, and the present embodiment eliminates the interference frame according to the obtained confidence probabilities. In the prior art, a candidate frame with the maximum confidence probability is obtained through calculation, then the intersection ratio of any anchor frame and the candidate frame with the maximum confidence probability is calculated, and finally the anchor frame with the ratio exceeding a preset value is directly removed, wherein the corresponding expression is as follows: the expression of IOU (P, P i) is: /(I) Wherein J (P, P i) is the intersection area of the anchor frames P i and P, and B (P, P i) is the union area of the anchor frames P i and P. Because the feature map output by the feature extraction module has errors in the actual intercepting process, the phenomenon that an effective frame is proposed can be caused by directly eliminating an anchor frame with the ratio exceeding a preset value, and the embodiment optimizes the acquisition mode of the probability of correspondence of the defect to obtain the expression.
And step S02272, when the confidence coefficient corresponding to the anchor frame is larger than the second preset value, determining the fifth target image corresponding to the anchor frame as the fifth target image, wherein the anchor frame corresponds to the fifth target image one by one.
Specifically, the fifth target image is determined as the fifth target image as the image corresponding to the anchor frame, when the confidence coefficient corresponding to the anchor frame is greater than the second preset value.
In order to ensure the accuracy of the second target image obtained according to the fifth target model process, in an alternative embodiment, the step S2023 includes:
Step S20231, performing convolution operation on the fifth target image to obtain a downsampled feature map;
Specifically, as shown in fig. 3, in order to improve the detection capability of the element recognition sub-model on a small target, the embodiment performs feature extraction on the element recognition sub-model from different scales, and performs data analysis by adopting lightweight convolution instead of traditional convolution. The method comprises Conv convolution, two GSconv convolutions, a connection layer and Conv convolution in sequence, wherein data of the connection layer is derived from the first data subjected to Conv convolution and GSConv processed data. In the data processing process of GSConv, as shown in fig. 4, conv convolution is performed on the received fifth target image to implement downsampling, so as to obtain a downsampled feature map.
Step S20232, performing depth convolution on the downsampled feature map to obtain a depth feature map;
specifically, further, a depth convolution operation is performed on the downsampled feature map to obtain a depth feature map.
Step S20233 is to splice the downsampled feature map and the depth feature map to obtain an alternative second target image, and to perform a shuffle process to obtain the second target image, where the shuffle process is used to locate the downsampled feature map and a corresponding channel of the depth feature map in adjacent positions.
Specifically, the downsampled feature map and the depth feature map are spliced to obtain a fusion feature map, namely the alternative second target image. And finally, carrying out a shuffle process on the second target image to obtain the second target image, wherein the channel corresponding to the downsampling feature map and the depth feature map is positioned at the adjacent position.
In order to improve the accuracy of intelligent image recognition, the interference factor in the conversion process of the value-only image and the electronic image is removed, and in an optional embodiment, the step S202 includes:
Step S2024, performing graying processing on the first target image to obtain a seventh target image;
specifically, drawing image data in an engineering drawing database is read to obtain the first target image, and graying processing is performed to obtain a gray scale image, namely the seventh target image.
Step S2025, performing gray enhancement processing on the seventh target image by using a gray conversion function to obtain an eighth target image;
Specifically, gray enhancement processing is performed on the seventh target image by using a gray conversion function, so as to obtain image data after gray enhancement, namely the eighth target data, so as to improve the contrast between the target object and the background, and facilitate the recognition of a subsequent model.
Step S2026, performing median filtering on the eighth target image, and performing mean filtering on the eighth target image after the median filtering to obtain a ninth target image;
Specifically, the application executes the filtering operation on the drawing image data with enhanced gray scale, and in the process of executing the image filtering processing, the median filtering and the mean filtering are sequentially executed, and the defect of a single filtering mode in the denoising process is overcome by a mode of combining the median filtering and the mean filtering. Specifically, an average value of a current gray value is obtained by a sliding mode of a preset window template on drawing image data in the process of executing average value filtering. In the process of executing the median filtering, the reference pixel point and the field are selected first, then all gray values in the reference point field are ordered, and gray values corresponding to the intermediate serial numbers are output.
In step S2027, the ninth target image is sharpened by the laplace operator to obtain the first target image.
In particular, in order to reduce the blurring effect generated by filtering, the application sets the target object details of sharpening the image after filtering to be more prominent.
In order to sharpen the ninth target image, in an alternative embodiment, the step S2027 includes:
Step S20271, determining any pixel point in the image as a target pixel point, and determining a preset Laplacian as the Laplacian corresponding to the target pixel point;
specifically, a laplacian v 2 f (x, y) is preset at any one point in the ninth target image, where
Step S20272, solving the Laplacian corresponding to all pixel points in the image based on the target pixel points and the preset Laplacian to obtain a plurality of target Laplacian;
specifically, the ninth target image is represented by a dot, where f=f (x, y) is the ninth target image. Thereby obtaining the second partial derivative of F on the number axis AndAnd solving the Laplace operator corresponding to each point based on the property of the Laplace linear transformation.
And S20273, substituting each target Laplacian into a preset formula to obtain the first target image.
Specifically, based on the first target image g=g (x, y) after the obtained image sharpening enhancement, the corresponding formula is:
In order to enable the technical scheme of the application to be more clearly understood by the person skilled in the art, the implementation process of the intelligent recognition method of the power grid engineering drawing of the application will be described in detail below with reference to specific embodiments.
The embodiment relates to an intelligent identification method of a specific power grid engineering drawing, as shown in fig. 5, comprising the following steps:
step S1: the method comprises the steps of constructing an engineering drawing database for storing electronic images of power grid engineering drawings, converting paper drawings into an electronic image mode through image scanning equipment, and storing the electronic image mode into the engineering drawing database;
Step S2: reading an electronic image in an engineering drawing database, inputting an element acquisition model, and performing recognition analysis on the electronic image by using the element acquisition model to obtain an element storage table for storing a recognition result of the element acquisition model, namely, image information comprising preset elements;
Step S3: inputting the element storage table into an integration model, and re-integrating the identification result into a complete editable electronic image of the editable power grid engineering drawing through the integration model;
Step S4: transmitting the editable electronic image to a corresponding professional, and supplementing and correcting the blank part and the error part of the editable electronic image;
step S5: and storing the corrected editable electronic image into an engineering drawing database to replace the electronic image.
It should be noted that the steps illustrated in the flowcharts of the figures may be performed in a computer system such as a set of computer executable instructions, and that although a logical order is illustrated in the flowcharts, in some cases the steps illustrated or described may be performed in an order other than that illustrated herein.
The embodiment of the application also provides an intelligent recognition device for the power grid engineering drawing, and the intelligent recognition device for the power grid engineering drawing can be used for executing the intelligent recognition method for the power grid engineering drawing. The device is used for realizing the above embodiments and preferred embodiments, and is not described in detail. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. While the means described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware, is also possible and contemplated.
The intelligent recognition device of the power grid engineering drawing provided by the embodiment of the application is introduced as follows.
Fig. 6 is a block diagram of a smart identification device for a power grid engineering drawing according to an embodiment of the present application. As shown in fig. 6, the apparatus includes:
an obtaining unit 10, configured to obtain an alternative first target image, where the alternative first target image is a power grid engineering drawing image stored in an engineering drawing database;
Specifically, the paper power grid engineering drawing is converted into an electronic image through an image scanning device and is stored in a target database, so that an engineering drawing database is obtained. And reading the electronic image data of the drawing from the engineering drawing database to obtain the first target image.
A first input unit 20, configured to perform preprocessing on the first target image to obtain a first target image, input the first target image into a first target model to obtain a plurality of second target images, where the second target image is a partial image of the first target image including a preset element, and the first target model is configured to divide and identify the first target image to obtain the second target image, where the preprocessing at least includes graying, filtering, and sharpening;
Specifically, because the electronic image has the influence of factors such as photoelectric elements in the data conversion process, the alternative first target image obtained by image scanning has the defects of noise interference, characteristic loss and the like, and in order to improve the accuracy of intelligent identification, the application sets the electronic image to be subjected to the processes such as graying, filtering, sharpening and the like before the image is input into a model, reduces the influence of interference factors, and highlights the detail characteristics of important information related to equipment and the like in the electronic image. And inputting the image into a first target model to perform feature extraction to determine the part comprising important information such as equipment and the like to obtain the second target image. Cutting an electronic image into an image in a unified format which accords with preset parameters of a model, and further carrying out convolution on the image data through the model to extract characteristic data, wherein the characteristic data are characteristic information of equipment in a pre-stored power grid engineering drawing; after the feature data extraction is completed, analyzing and determining a candidate area where the feature information is located according to the feature data, further carrying out further refinement identification on the candidate area, and determining a target area to obtain the second target image.
And a second input unit 30, configured to input all the second target images into a second target model to obtain a third target image, where the third target image is the editable power grid engineering drawing image, and the second target model is configured to stitch the second target images to obtain the third target image.
Specifically, after the second target image is identified, the second target image is input into the second target model for integration, and the output result of the first target model is integrated and compiled to become an editable electronic drawing, so that the third target image is obtained.
According to the embodiment, an acquisition unit acquires an alternative first target image, wherein the alternative first target image is a power grid engineering drawing image stored in an engineering drawing database; the first input unit is used for preprocessing the first target image to obtain a first target image, inputting the first target image into a first target model to obtain a plurality of second target images, wherein the second target images are partial images of the first target image containing preset elements, the first target model is used for dividing and identifying the first target image to obtain the second target image, and the preprocessing at least comprises graying, filtering and sharpening; and the second input unit inputs all the second target images into a second target model to obtain a third target image, wherein the third target image is the editable power grid engineering drawing image, and the second target model is used for splicing the second target images to obtain the third target image. According to the scheme, the acquired power grid engineering drawing image is identified through the neural network model, the characteristic elements in the acquired power grid engineering drawing image are extracted to obtain the identification result, and the identification result is integrated through the neural network model to obtain the editable power grid engineering drawing image.
In order to obtain the second target image, in an alternative embodiment, the first target model includes a feature extraction sub-model, a filtering sub-model, and an element identification sub-model, and the first input unit includes:
the first input subunit is used for inputting the first target image into the feature extraction submodel to obtain a fourth target image, and the feature extraction submodel is used for dividing the first target image into a first preset size and performing convolution operation on the first target image to extract the feature image to obtain the fourth target image;
specifically, the first target image is input into the feature extraction sub-model, the first target image is cut according to a preset format and is cut into a plurality of fourth target images meeting the first preset size, and feature data in the image are convolutionally identified through a CNN model, so that power grid feature data are obtained.
The second input subunit is configured to input the fourth target image into the screening sub-model to obtain a fifth target image, where the screening sub-model is configured to screen the fourth target image to obtain the fifth target image including the preset element;
Specifically, the fourth target image and the power grid characteristic data are input into the screening submodel, and the candidate region including the preset element, namely the power grid characteristic data conforming to the target object, is subjected to re-analysis to obtain an element analysis result, namely the fourth target image is screened to obtain the fifth target image.
And the third input subunit is used for inputting the fifth target image into the element identification submodel to obtain the second target image, and the element identification submodel is used for downsampling and depth convolution of the fifth target image and fusing the fifth target image to obtain the second target image.
Specifically, the fifth target image is input into the element recognition sub-model, the element recognition sub-model reads a candidate region in the image, that is, the fifth target image, and the preset elements included in the candidate region are classified to obtain a classification result, so that the second target image is determined.
In order to obtain the fifth target image according to the fourth target image, in an alternative embodiment, the second input subunit includes:
The first input module is used for carrying out convolution operation on the fourth target image and inputting the fourth target image into the classifier to obtain a classification result;
specifically, two parallel data streams which are the same are arranged on a convolution layer, wherein one data stream is used for judging the image background type by a classifier, namely, the data stream is obtained by carrying out convolution operation on the fourth target image, and then the data stream is input into the distributor to obtain a classification result.
The first processing module is used for carrying out regression processing on the fourth target image to obtain a regression result, and determining a sixth target image according to the classification result and the regression result;
Specifically, the application sets two parallel and identical data streams in the convolution layer, wherein one data stream is used for regression processing of the anchor frame and the real frame. And performing regression processing on the data stream obtained by performing convolution operation on the fourth target image to obtain the regression result. And integrating the classification result and the regression result to obtain a region of interest, thereby obtaining the sixth target image.
A first calculation module, configured to calculate a classification loss function f a (x) according to the classification result:
Wherein f a (x) represents the above-mentioned classification loss function, and α' i represents whether the i-th anchor frame includes the above-mentioned preset element;
Specifically, in order to ensure the accuracy of the fifth target image, the application trains the screening submodel according to the loss function. Wherein, the loss function is calculated respectively for the classification process and the regression process for integration. Firstly, analyzing according to the classification result, determining whether each anchor frame comprises preset elements, and substituting the preset elements into the formula to obtain a loss function value.
A second calculation module, configured to calculate a regression loss function f b (x) according to the regression result:
Wherein f b (x) represents the regression loss function, β i represents the regression parameter of the ith prediction frame relative to the ith anchor frame, and β' i represents the regression parameter of the ith real frame relative to the ith anchor frame;
Specifically, in order to ensure the accuracy of the fifth target image, the application trains the screening submodel according to the loss function. Wherein, the loss function is calculated respectively for the classification process and the regression process for integration. And secondly, analyzing the regression result, respectively determining regression parameters between the prediction frame and the anchor frame and between the real frame and the anchor frame, and substituting the regression parameters into the formula to obtain the loss function value.
A third calculation module, configured to calculate a target loss value according to the classification loss function and the regression loss function:
Wherein S (alpha i,βi) is the target loss value, The method comprises the steps of presetting a weight for a first preset weight;
Specifically, the target loss value is obtained by integrating the loss function value of the classification loss function and the loss function value of the regression loss function according to the above formula. I.e. the current loss function value of the sub-model is screened.
A first determining module, configured to determine the sixth target image as an alternative fifth target image when the target loss value is smaller than a first preset value, and train the screening sub-model according to the target loss value when the fifth target value is greater than or equal to the first preset value until the target loss value is smaller than the first preset value, and determine the sixth target image as the alternative fifth target image;
Specifically, when the target loss value is smaller than the first preset value, determining that the accuracy of the screening sub-model meets the requirement, determining that the output result of the screening sub-model, that is, the sixth target image is an alternative fifth target image, when the target loss value is greater than or equal to the first preset value, determining that the accuracy of the screening sub-model does not meet the requirement, training the screening sub-model according to the target loss value until the accuracy of the screening sub-model meets the requirement, and then processing the fourth target image through the screening sub-model again to obtain the sixth target image and determining the sixth target image as the fifth target image.
And the second determining module is used for calculating the confidence coefficient according to the alternative fifth target image and determining the alternative fifth target image with the confidence coefficient larger than a second preset value as the fifth target image.
Specifically, in order to further improve the precision of the drawing, the method and the device of the application are used for sequentially calculating the confidence coefficient according to the fifth target image candidate, and further rejecting the fifth target image candidate with the confidence coefficient which does not meet the requirement to obtain the fifth target image.
In order to screen out the fifth target image that meets the requirement, in an alternative embodiment, the second determining module includes:
the acquisition sub-module is used for acquiring a plurality of confidence probabilities and second preset weights, and calculating the confidence coefficient according to the confidence probabilities and the second preset weights, wherein the confidence probabilities correspond to the anchor frames one by one:
Wherein, P i * is the confidence coefficient, P is the candidate frame with the highest confidence coefficient, IOU (P, P i) is the intersection ratio of the anchor frame P i and the candidate frame, ω is the second preset weight;
Specifically, since at least two candidate frames with different confidence probabilities are selected, in order to reduce the interference of unnecessary anchor frames, a desired target candidate frame is obtained, and the present embodiment eliminates the interference frame according to the obtained confidence probabilities. In the prior art, a candidate frame with the maximum confidence probability is obtained through calculation, then the intersection ratio of any anchor frame and the candidate frame with the maximum confidence probability is calculated, and finally the anchor frame with the ratio exceeding a preset value is directly removed, wherein the corresponding expression is as follows: the expression of IOU (P, P i) is: /(I) Wherein J (P, P i) is the intersection area of the anchor frames P i and P, and B (P, P i) is the union area of the anchor frames P i and P. Because the feature map output by the feature extraction module has errors in the actual intercepting process, the phenomenon that an effective frame is proposed can be caused by directly eliminating an anchor frame with the ratio exceeding a preset value, and the embodiment optimizes the acquisition mode of the probability of correspondence of the defect to obtain the expression.
And the determining submodule is used for determining the fifth target image which corresponds to the anchor frame as the fifth target image when the confidence coefficient which corresponds to the anchor frame is larger than the second preset value, and the anchor frame corresponds to the fifth target image which corresponds to the anchor frame one by one.
Specifically, the fifth target image is determined as the fifth target image as the image corresponding to the anchor frame, when the confidence coefficient corresponding to the anchor frame is greater than the second preset value.
In order to ensure the accuracy of the second target image obtained according to the fifth target model process, in an alternative embodiment, the third input subunit includes:
The second processing module is used for performing convolution operation on the fifth target image to obtain a downsampled feature map;
Specifically, as shown in fig. 3, in order to improve the detection capability of the element recognition sub-model on a small target, the embodiment performs feature extraction on the element recognition sub-model from different scales, and performs data analysis by adopting lightweight convolution instead of traditional convolution. The method comprises Conv convolution, two GSconv convolutions, a connection layer and Conv convolution in sequence, wherein data of the connection layer is derived from the first data subjected to Conv convolution and GSConv processed data. In the data processing process of GSConv, as shown in fig. 4, conv convolution is performed on the received fifth target image to implement downsampling, so as to obtain a downsampled feature map.
The third processing module is used for carrying out depth convolution on the downsampled feature map to obtain a depth feature map;
specifically, further, a depth convolution operation is performed on the downsampled feature map to obtain a depth feature map.
And a fourth processing module, configured to splice the downsampled feature map and the depth feature map to obtain an alternative second target image, and perform a shuffle process on the downsampled feature map and the depth feature map to obtain the second target image, where the shuffle process is used to make the downsampled feature map and a corresponding channel of the depth feature map be in adjacent positions.
Specifically, the downsampled feature map and the depth feature map are spliced to obtain a fusion feature map, namely the alternative second target image. And finally, carrying out a shuffle process on the second target image to obtain the second target image, wherein the channel corresponding to the downsampling feature map and the depth feature map is positioned at the adjacent position.
In order to improve the accuracy of intelligent image recognition and remove the interference factor in the conversion process of the only value image and the electronic image, in an optional implementation manner, the first input unit includes:
the first processing subunit is used for carrying out graying processing on the alternative first target image to obtain a seventh target image;
specifically, drawing image data in an engineering drawing database is read to obtain the first target image, and graying processing is performed to obtain a gray scale image, namely the seventh target image.
A second processing subunit, configured to perform gray enhancement processing on the seventh target image through a gray transformation function to obtain an eighth target image;
Specifically, gray enhancement processing is performed on the seventh target image by using a gray conversion function, so as to obtain image data after gray enhancement, namely the eighth target data, so as to improve the contrast between the target object and the background, and facilitate the recognition of a subsequent model.
A third processing subunit, configured to median filter the eighth target image, and perform mean filtering on the eighth target image after the median filtering to obtain a ninth target image;
Specifically, the application executes the filtering operation on the drawing image data with enhanced gray scale, and in the process of executing the image filtering processing, the median filtering and the mean filtering are sequentially executed, and the defect of a single filtering mode in the denoising process is overcome by a mode of combining the median filtering and the mean filtering. Specifically, an average value of a current gray value is obtained by a sliding mode of a preset window template on drawing image data in the process of executing average value filtering. In the process of executing the median filtering, the reference pixel point and the field are selected first, then all gray values in the reference point field are ordered, and gray values corresponding to the intermediate serial numbers are output.
And the fourth processing subunit is used for sharpening the ninth target image through the Laplacian operator to obtain the first target image.
In particular, in order to reduce the blurring effect generated by filtering, the application sets the target object details of sharpening the image after filtering to be more prominent.
In order to sharpen the ninth target image, in an alternative embodiment, the fourth processing subunit includes:
A third determining module, configured to determine any one pixel point in the image as a target pixel point, and determine a preset laplace operator as the laplace operator corresponding to the target pixel point;
specifically, the laplacian is preset at any point in the ninth target image Wherein the method comprises the steps of
The fourth calculation module is used for solving the Laplacian corresponding to all pixel points in the image based on the target pixel points and the preset Laplacian to obtain a plurality of target Laplacian;
specifically, the ninth target image is represented by a dot, where f=f (x, y) is the ninth target image. Thereby obtaining the second partial derivative of F on the number axis AndAnd solving the Laplace operator corresponding to each point based on the property of the Laplace linear transformation.
And a fifth calculation module, configured to substitute each target laplace operator into a preset formula to obtain the first target image.
Specifically, based on the first target image g=g (x, y) after the obtained image sharpening enhancement, the corresponding formula is:
the intelligent recognition device of the power grid engineering drawing comprises a processor and a memory, wherein the acquisition unit, the first input unit, the second input unit and the like are all stored in the memory as program units, and the processor executes the program units stored in the memory to realize corresponding functions. The modules are all located in the same processor; or the above modules may be located in different processors in any combination.
The processor includes a kernel, and the kernel fetches the corresponding program unit from the memory. The kernel can be provided with one or more than one, and the efficiency of storing the power engineering drawing is improved by adjusting kernel parameters.
The memory may include volatile memory, random Access Memory (RAM), and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM), among other forms in computer readable media, the memory including at least one memory chip.
The embodiment of the invention provides a computer readable storage medium, which comprises a stored program, wherein the program is used for controlling equipment where the computer readable storage medium is located to execute an intelligent identification method of a power grid engineering drawing.
Specifically, the intelligent recognition method of the power grid engineering drawing comprises the following steps:
Step S201, acquiring an alternative first target image, wherein the alternative first target image is a power grid engineering drawing image stored in an engineering drawing database;
Specifically, the paper power grid engineering drawing is converted into an electronic image through an image scanning device and is stored in a target database, so that an engineering drawing database is obtained. And reading the electronic image data of the drawing from the engineering drawing database to obtain the first target image.
Step S202, preprocessing the first target image to obtain a first target image, inputting the first target image into a first target model to obtain a plurality of second target images, wherein the second target images are partial images of the first target image containing preset elements, the first target model is used for dividing and recognizing the first target image to obtain the second target image, and the preprocessing at least comprises graying, filtering and sharpening;
Specifically, because the electronic image has the influence of factors such as photoelectric elements in the data conversion process, the alternative first target image obtained by image scanning has the defects of noise interference, characteristic loss and the like, and in order to improve the accuracy of intelligent identification, the application sets the electronic image to be subjected to the processes such as graying, filtering, sharpening and the like before the image is input into a model, reduces the influence of interference factors, and highlights the detail characteristics of important information related to equipment and the like in the electronic image. And inputting the image into a first target model to perform feature extraction to determine the part comprising important information such as equipment and the like to obtain the second target image. Cutting an electronic image into an image in a unified format which accords with preset parameters of a model, and further carrying out convolution on the image data through the model to extract characteristic data, wherein the characteristic data are characteristic information of equipment in a pre-stored power grid engineering drawing; after the feature data extraction is completed, analyzing and determining a candidate area where the feature information is located according to the feature data, further carrying out further refinement identification on the candidate area, and determining a target area to obtain the second target image.
Step S203, inputting all the second target images into a second target model to obtain a third target image, where the third target image is the editable power grid engineering drawing image, and the second target model is used to splice the second target images to obtain the third target image.
Specifically, after the second target image is identified, the second target image is input into the second target model for integration, and the output result of the first target model is integrated and compiled to become an editable electronic drawing, so that the third target image is obtained.
The embodiment of the invention provides a processor which is used for running a program, wherein the intelligent identification method of the power grid engineering drawing is executed when the program runs.
Specifically, the intelligent recognition method of the power grid engineering drawing comprises the following steps:
Step S201, acquiring an alternative first target image, wherein the alternative first target image is a power grid engineering drawing image stored in an engineering drawing database;
Specifically, the paper power grid engineering drawing is converted into an electronic image through an image scanning device and is stored in a target database, so that an engineering drawing database is obtained. And reading the electronic image data of the drawing from the engineering drawing database to obtain the first target image.
Step S202, preprocessing the first target image to obtain a first target image, inputting the first target image into a first target model to obtain a plurality of second target images, wherein the second target images are partial images of the first target image containing preset elements, the first target model is used for dividing and recognizing the first target image to obtain the second target image, and the preprocessing at least comprises graying, filtering and sharpening;
Specifically, because the electronic image has the influence of factors such as photoelectric elements in the data conversion process, the alternative first target image obtained by image scanning has the defects of noise interference, characteristic loss and the like, and in order to improve the accuracy of intelligent identification, the application sets the electronic image to be subjected to the processes such as graying, filtering, sharpening and the like before the image is input into a model, reduces the influence of interference factors, and highlights the detail characteristics of important information related to equipment and the like in the electronic image. And inputting the image into a first target model to perform feature extraction to determine the part comprising important information such as equipment and the like to obtain the second target image. Cutting an electronic image into an image in a unified format which accords with preset parameters of a model, and further carrying out convolution on the image data through the model to extract characteristic data, wherein the characteristic data are characteristic information of equipment in a pre-stored power grid engineering drawing; after the feature data extraction is completed, analyzing and determining a candidate area where the feature information is located according to the feature data, further carrying out further refinement identification on the candidate area, and determining a target area to obtain the second target image.
Step S203, inputting all the second target images into a second target model to obtain a third target image, where the third target image is the editable power grid engineering drawing image, and the second target model is used to splice the second target images to obtain the third target image.
Specifically, after the second target image is identified, the second target image is input into the second target model for integration, and the output result of the first target model is integrated and compiled to become an editable electronic drawing, so that the third target image is obtained.
The embodiment of the invention provides a drawing recognition system, which comprises a processor, a memory and a program which is stored in the memory and can run on the processor, wherein the processor realizes at least the following steps when executing the program:
Step S201, acquiring an alternative first target image, wherein the alternative first target image is a power grid engineering drawing image stored in an engineering drawing database;
Step S202, preprocessing the first target image to obtain a first target image, inputting the first target image into a first target model to obtain a plurality of second target images, wherein the second target images are partial images of the first target image containing preset elements, the first target model is used for dividing and recognizing the first target image to obtain the second target image, and the preprocessing at least comprises graying, filtering and sharpening;
Step S203, inputting all the second target images into a second target model to obtain a third target image, where the third target image is the editable power grid engineering drawing image, and the second target model is used to splice the second target images to obtain the third target image.
The application also provides a computer program product adapted to perform, when executed on a data processing device, a program initialized with at least the following method steps:
Step S201, acquiring an alternative first target image, wherein the alternative first target image is a power grid engineering drawing image stored in an engineering drawing database;
Step S202, preprocessing the first target image to obtain a first target image, inputting the first target image into a first target model to obtain a plurality of second target images, wherein the second target images are partial images of the first target image containing preset elements, the first target model is used for dividing and recognizing the first target image to obtain the second target image, and the preprocessing at least comprises graying, filtering and sharpening;
Step S203, inputting all the second target images into a second target model to obtain a third target image, where the third target image is the editable power grid engineering drawing image, and the second target model is used to splice the second target images to obtain the third target image.
It will be appreciated by those skilled in the art that the modules or steps of the invention described above may be implemented in a general purpose computing device, they may be concentrated on a single computing device, or distributed across a network of computing devices, they may be implemented in program code executable by computing devices, so that they may be stored in a storage device for execution by computing devices, and in some cases, the steps shown or described may be performed in a different order than that shown or described herein, or they may be separately fabricated into individual integrated circuit modules, or multiple modules or steps of them may be fabricated into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In one typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include volatile memory in a computer-readable medium, random Access Memory (RAM) and/or nonvolatile memory, etc., such as Read Only Memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.
Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Disks (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (transmission media), such as modulated data signals and carrier waves.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises an element.
From the above description, it can be seen that the above embodiments of the present application achieve the following technical effects:
1) According to the intelligent recognition method of the power grid engineering drawing, firstly, an alternative first target image is obtained, wherein the alternative first target image is a power grid engineering drawing image stored in an engineering drawing database; then, preprocessing the first target image to obtain a first target image, inputting the first target image into a first target model to obtain a plurality of second target images, wherein the second target images are partial images of the first target image containing preset elements, the first target model is used for dividing and identifying the first target image to obtain the second target image, and the preprocessing at least comprises graying, filtering and sharpening; and inputting all the second target images into a second target model to obtain a third target image, wherein the third target image is the editable power grid engineering drawing image, and the second target model is used for splicing the second target images to obtain the third target image. According to the scheme, the acquired power grid engineering drawing image is identified through the neural network model, the characteristic elements in the acquired power grid engineering drawing image are extracted to obtain the identification result, and the identification result is integrated through the neural network model to obtain the editable power grid engineering drawing image.
2) According to the intelligent recognition device for the power grid engineering drawing, the acquisition unit acquires the first target image which is an alternative power grid engineering drawing image stored in the engineering drawing database; the first input unit is used for preprocessing the first target image to obtain a first target image, inputting the first target image into a first target model to obtain a plurality of second target images, wherein the second target images are partial images of the first target image containing preset elements, the first target model is used for dividing and identifying the first target image to obtain the second target image, and the preprocessing at least comprises graying, filtering and sharpening; and the second input unit inputs all the second target images into a second target model to obtain a third target image, wherein the third target image is the editable power grid engineering drawing image, and the second target model is used for splicing the second target images to obtain the third target image. According to the scheme, the acquired power grid engineering drawing image is identified through the neural network model, the characteristic elements in the acquired power grid engineering drawing image are extracted to obtain the identification result, and the identification result is integrated through the neural network model to obtain the editable power grid engineering drawing image.
The above description is only of the preferred embodiments of the present application and is not intended to limit the present application, but various modifications and variations can be made to the present application by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the protection scope of the present application.