Edge detection model training method, edge detection method and device
By using modeling simulation technology and pre-training of virtual synthetic scenes in edge detection, combined with the homography adaptive algorithm and the Canny edge detection algorithm, pixel-level and object-level edge annotations are generated, which solves the problem of edge detection annotation efficiency in the existing technology. It solves the problem of low and high cost and achieves efficient and accurate edge detection.
Patent Information
- Application Number
- CN202410866004.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-01
- Publication Date
- 2024-10-01
AI Technical Summary
Manual annotation of edge detection in the existing technology is inefficient, costly and contains large errors, resulting in inconsistent annotation data.
Modeling and simulation technology is used to obtain the detection data of the object to be detected, model pre-training is performed through virtual synthetic scenes, and the homography adaptive algorithm and Canny edge detection algorithm are combined to generate pixel-level and object-level edge annotations, and finally based on real scene annotation The data is used to train the edge detection model.
It reduces the cost and error of manual annotation, improves the accuracy and efficiency of edge detection, and achieves effective annotation of target edges in real scenes.
Smart Images

Figure CN118736239A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to an edge detection model training method, an edge detection method and a device. Background Art
[0002] As the urbanization process continues to accelerate, the number of motor vehicles continues to increase, and many problems such as urban traffic congestion and parking conflicts have also arisen. To this end, relying on artificial intelligence algorithms, cloud service platforms, smart hardware devices, and edge computing devices, an intelligent urban traffic management system has been realized, which is an intelligent management system that can collect, process, and feedback traffic information in real time and accurately.
[0003] At present, the main method is to install high-position video surveillance equipment on the roadside of urban roads, important traffic light intersections, etc., collect video image data of the monitoring scene, use visual algorithms to process and analyze the data, and use manual annotation methods to achieve the analysis of the monitoring scene. However, manual annotation of edge detection is very expensive, requiring a lot of manpower and cost, and different annotators have different understandings of the edge boundaries in the same image, and the annotation results are also different. Therefore, there may be a large deviation in the annotation data set. Summary of the invention
[0004] In view of this, the embodiments of the present invention provide an edge detection model training method, an edge detection method and a device, which solve the problems of low efficiency, high cost and large error of manual labeling in the prior art.
[0005] According to a first aspect, an embodiment of the present invention provides an edge detection model training method, comprising:
[0006] Use modeling and simulation technology to obtain the detection data of the object to be detected;
[0007] Performing data processing on the detection data to determine a target data set;
[0008] The target data set is used to train the edge detection model to generate a target edge detection model.
[0009] In combination with the first aspect, in a first implementation of the first aspect, the detection data includes image information, pixel points, and corresponding pixel-level edge detection labels of the object to be detected.
[0010] Using an encoder to extract features from the pixels of different sizes to determine first feature data;
[0011] Processing the first feature data using a pixel-level edge decoder to determine a probability that the pixel point is an edge point;
[0012] A target data set is determined according to the probability and the pixel-level edge detection label.
[0013] In combination with the first implementation manner of the first aspect, in the second implementation manner of the first aspect, the using a pixel-level edge decoder to process the first feature data to determine the probability that the pixel point is an edge point includes:
[0014] Input the first feature data into a convolutional layer and output second feature data;
[0015] The second feature data is classified using a classification function to determine the probability that the pixel point is an edge point.
[0016] In combination with the second implementation of the first aspect, in the third implementation of the first aspect, determining the target data set according to the probability and the pixel-level edge detection label includes:
[0017] Determine edge point information according to the probability;
[0018] Calculating the information of each edge point to determine the pixel-level edge annotation;
[0019] The pixel-level edge annotation is expressed using the following formula:
[0020]
[0021] Where I represents the input image, f() represents the pre-trained edge detection model, and N h represents the number of homography transformations, H i represents the homography transformation, represents the inverse homography transform;
[0022] The pixel-level edge detection labels and the pixel-level edge annotations are compared, and the pixel-level edge annotations that meet preset requirements are determined as the target data set.
[0023] In combination with the first implementation manner of the first aspect, in a fourth implementation manner of the first aspect, the using the target data set to train the edge detection model to generate the target edge detection model includes:
[0024] Construct loss function;
[0025] The edge detection model is trained using the loss function and the target data set to generate a target edge detection model.
[0026] In combination with the fourth implementation manner of the first aspect, in the fifth implementation manner of the first aspect, the constructing the loss function includes:
[0027] L=L pix +Lobj
[0028] Among them, L pix represents the pixel-level edge detection loss function, L obj represents the target level loss function;
[0029]
[0030] in, H and W represent the length and width of the image information; if y hw =65, Y + and Y - They represent the number of edge pixels and non-edge pixels respectively, and δ is a hyperparameter used to balance the number of positive and negative samples.
[0031] The edge detection model training method provided by the embodiment of the present invention performs model pre-training based on a virtual synthetic scene with known edge labels, and then performs edge detection and annotation on the real scene based on the pre-trained model. In combination with a homography adaptive algorithm, a Canny edge detection algorithm, etc., label generation for the real scene is achieved, and pixel-level and object-level edge annotations are effectively generated for the target edges in the real scene. Finally, the edge detection model is trained based on the annotated data of the real scene.
[0032] According to a second aspect, an edge detection method provided by an embodiment of the present invention includes:
[0033] Determine a target edge detection model using the edge detection model training method described in any one of the embodiments of the first aspect of the present invention;
[0034] Acquire a monitoring scene image of an object to be detected;
[0035] The target edge detection model is used to perform edge detection on the monitoring scene image to determine an edge detection result.
[0036] The edge detection method provided by the embodiment of the present invention is based on a virtual synthetic scene with a known edge label to perform model pre-training, and then edge detection and annotation of the real scene are performed based on the pre-trained model. The label generation of the real scene is realized by combining the homography adaptive algorithm, the Canny edge detection algorithm, etc., and pixel-level and object-level edge annotations are effectively generated for the target edges in the real scene. Finally, the edge detection model is trained based on the labeled data of the real scene.
[0037] According to a third aspect, an edge detection model training device provided by an embodiment of the present invention includes:
[0038] An acquisition module is used to acquire detection data of the object to be detected by using modeling and simulation technology;
[0039] A data processing module, used to process the detection data and determine a target data set;
[0040] The training module is used to train the edge detection model using the target data set to generate a target edge detection model.
[0041] According to a fourth aspect, an edge detection device provided by an embodiment of the present invention includes:
[0042] A first processing module, configured to determine a target edge detection model using the edge detection model training device as described in the third aspect of the present invention;
[0043] The second processing module is used to obtain a monitoring scene image of the object to be detected;
[0044] The third processing module is used to perform edge detection on the monitoring scene image using the target edge detection model to determine an edge detection result.
[0045] According to the fifth aspect, an embodiment of the present invention provides an electronic device, comprising: a memory and a processor, the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the edge detection model training method described in the first aspect or any one of the embodiments of the first aspect, or executes the edge detection method described in the second aspect or any one of the embodiments of the second aspect by executing the computer instructions.
[0046] According to a sixth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute the edge detection model training method described in the first aspect or any one of the embodiments of the first aspect, or to execute the edge detection method described in the second aspect or any one of the embodiments of the second aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0048] Figure 1 is a flow chart of an edge detection model training method according to an embodiment of the present invention;
[0049] Figure 2 is a flow chart of an edge detection method according to an embodiment of the present invention;
[0050] Figure 3 is a schematic diagram of an edge detection model training device according to an embodiment of the present invention;
[0051] Figure 4 is a schematic diagram of an edge detection device according to an embodiment of the present invention;
[0052] Figure 5 It is a schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0053] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0054] In recent years, with the continuous acceleration of urbanization, the number of motor vehicles has continued to increase, and many problems such as urban traffic congestion and parking conflicts have also arisen. To this end, relying on artificial intelligence algorithms, cloud service platforms, intelligent hardware devices, and edge computing devices, an intelligent urban traffic management system has been realized, which can collect, process, and feedback traffic information in real time and accurately.
[0055] At present, the main method is to install high-position video surveillance equipment on the roadside of urban roads, important traffic light intersections, etc., collect video image data of the monitoring scene, and use visual algorithms to process and analyze the data to achieve the analysis of the monitoring scene. Vision includes vehicle detection, license plate detection, pedestrian detection, traversable area segmentation, roadside green plant segmentation and other tasks, so as to achieve a full range of traffic scene analysis functions for the entire area monitored by the high-position camera, which is conducive to more refined and accurate management of roadside parking. In addition, it can provide more evidence about vehicle violations, irregular driving, etc. for the traffic management department, and realize more intelligent application and management of the entire traffic flow, which has a positive role in promoting various aspects of urban traffic management and driving safety. Among them, edge detection, as a basic task of computer vision, plays an important role. Edge detection can identify and extract discontinuities in images. These discontinuities are usually consistent with changes in object features, such as shape, color, material and other attributes. It can provide important feature information in the above-mentioned complex visual tasks such as vehicle and license plate detection and semantic segmentation, and improve the accuracy of these visual tasks;
[0056] Traditional edge detection methods mainly predict edges based on local features of gradients and filters, such as Canny and Sobel edge detection algorithms. At present, learning-based edge detection methods have also made certain progress, such as HED, BCDN and other algorithms. These algorithms are based on model training on manually annotated data sets and combined with multi-layer supervision to enhance the generalization ability of the model. However, manual annotation of edge detection is very expensive and requires a lot of manpower and cost. Different annotators have different understandings of edge boundaries in the same image, and the annotation results are also different. Therefore, there may be many inconsistencies in the annotated data sets.
[0057] In this embodiment, an edge detection model training method is provided, which can be used in electronic devices such as computers, mobile phones, tablet computers, etc. Figure 1 is a flow chart of an edge detection model training method according to an embodiment of the present invention. Figure 1 As shown, the process includes the following steps:
[0058] S11, using modeling and simulation technology to obtain detection data of the object to be detected.
[0059] Among them, the detection data of the object to be detected is obtained by using modeling and simulation technology (some existing technical means), and the specific acquisition means can use any existing means, and this embodiment does not impose any restrictions on the acquisition means. For example, in this embodiment, a large number of geometric figures, including circles, cubes, polygons, etc., are first obtained by modeling and simulation technology, and the background is random Gaussian noise. Based on the modeling technology, the pixel-level edge detection labels of the geometric figures can be directly obtained; specifically, the modeling and simulation technology includes but is not limited to the generation of geometric figures of various shapes based on game engines such as Unity and Unreal, and using simulation software such as Carla and Arisim.
[0060] S12, processing the detection data to determine the target data set.
[0061] In this embodiment, corresponding data processing is performed on the acquired detection data to ensure the validity of the features of each data, and finally a target data set is determined to implement the training of the edge detection model and ensure the accuracy of the edge detection model.
[0062] S13, using the target data set to train the edge detection model to generate a target edge detection model.
[0063] In practical applications, the edge detection model is constructed using existing technologies, which can be an existing recognizer or other deep learning network model, as long as it can achieve edge detection, and this embodiment is not limited thereto. The edge detection model is then trained using the target data set to generate a target edge detection model to achieve accurate edge detection.
[0064] The edge detection model training method provided in this embodiment is based on a virtual synthetic scene with known edge labels to perform model pre-training, and then edge detection and annotation of the real scene is performed based on the pre-trained model. The label generation of the real scene is realized by combining the homography adaptive algorithm, the Canny edge detection algorithm, etc., and pixel-level and object-level edge annotations are effectively generated for the target edges in the real scene. Finally, the edge detection model is trained based on the labeled data of the real scene.
[0065] In another embodiment, an edge detection model training method is also provided, comprising the following steps:
[0066] S21, using modeling and simulation technology to obtain detection data of the object to be detected.
[0067] Please refer to step S11 for details, which will not be described in detail in this embodiment.
[0068] S22, processing the detection data to determine the target data set.
[0069] In this embodiment, the detection data includes image information, pixel points and corresponding pixel-level edge detection labels of the object to be detected, and the above step S22 specifically includes:
[0070] S221, using an encoder to extract features from pixels of different sizes to determine first feature data.
[0071] In this embodiment, the role of the encoder is to perform feature extraction. The input image size is the resolution size of the original image, which is defined as H*W*C, which respectively represent the height, width and number of channels of the image. The encoder adopts a fully convolutional neural network, including but not limited to ResNet-50, VGG and other convolutional neural networks as encoders. The encoder output feature size is H / 8*W / 8*C1, and C1 can be set to 128 or 256 channels.
[0072] S222, using a pixel-level edge decoder to process the first feature data to determine the probability that the pixel is an edge point. The pixel-level edge decoder is used to output the probability that each pixel is an edge point. The decoder includes multiple convolution modules, and then a softmax classifier layer is connected to perform a softmax operation in the channel dimension, and finally a reshape layer is connected to restore the image size.
[0073] Specifically, the following steps are also included:
[0074] 1. Input the first feature data into the convolution layer and output the second feature data; the convolution layer is a plurality of convolution modules, each of which is composed of a plurality of convolution layers-normalization layers-activation function layers, and the output feature map size is H / 8*W / 8*C2, where C2 can be set to the number of channel dimensions such as 256 or 512;
[0075] 2. Classify the second feature data using the classification function to determine the probability that the pixel is an edge point; the classification function is a softmax classifier layer, first use the convolution layer to transform the feature dimension, and the output is H / 8*W / 8*C3, then use the softmax classification function to obtain the probability of each channel, C3 is set to 65, indicating (8*8+1)=64+1=65, wherein 8*8=64 indicates that the feature vector has 64 feature response values in the channel dimension, corresponding to the pixel area block with a width and height of 8 mapped on the original image size, the larger the feature response value, the greater the probability that the original image area corresponds to the camera as an edge point, the 65th channel represents the category of non-edge pixels, and the larger the feature response value of the channel, the less likely it is that there is an edge point in the area; finally, remove the 65th channel, transform the feature vector to H / 8*W / 8*C4, C4 is 64, and then use the reshape function to transform the feature vector to the original image size H*W, obtain the probability of whether each pixel is an edge point, and determine the pixel corresponding to the value with the largest probability as the edge point.
[0076] S223, determining a target data set based on the probability and the pixel-level edge detection label.
[0077] Specifically, the edge point information is determined according to the probability; the pixel point corresponding to the value with the largest probability is determined as the edge point. Then, the information of each edge point is calculated to determine the pixel-level edge annotation; by introducing multiple homography transformations, the unlabeled real image is arbitrarily transformed, and then the pre-trained model is used for edge detection, and then the corresponding inverse homography transformation is used to obtain the edge detection results of multiple original images, and finally the multiple edge detection results are added and averaged to obtain the pixel-level edge annotation of the pre-trained edge detection model.
[0078] The pixel-level edge annotation is expressed using the following formula:
[0079]
[0080] Where I represents the input image, f() represents the pre-trained edge detection model, and N h represents the number of homography transformations, H i represents the homography transformation, represents the inverse homography transform;
[0081] Specifically, in order to improve the accuracy of edge detection annotation, target-level edge detection annotation is added. First, Gaussian blur and L0 smoothing are used to reduce the noise in the image and enhance the smoothness of the image. Then, the Canny edge detection algorithm is used to generate the object-level edge detection annotation of the image. Finally, the two parts of the annotation are added together to obtain the final edge detection annotation of the real scene image, which is specifically expressed as:
[0082] x=F(I,f)+G(I)
[0083] Among them, I represents the original real scene image, F() represents the annotation process based on the pre-trained model, and G() represents the annotation process based on Canny edge detection;
[0084] The pixel-level edge detection labels and the pixel-level edge annotations are compared, and the pixel-level edge annotations that meet the preset requirements are determined as the target data set. The preset requirements are pre-determined data, and the consistency between the pixel-level edge detection labels and the pixel-level edge annotations can reach a certain requirement, which can be 85% in this embodiment.
[0085] S23, using the target data set to train the edge detection model to generate a target edge detection model.
[0086] In this embodiment, the above step S23 specifically further includes:
[0087] S231, constructing a loss function; including:
[0088] L=L pix +L obj
[0089] Among them, L pix represents the pixel-level edge detection loss function, L obj represents the target level loss function;
[0090]
[0091] in, H and W represent the length and width of the image information;
[0092]
[0093] Y + and Y - They represent the number of edge pixels and the number of non-edge pixels respectively, and δ is a hyperparameter used to balance the number of positive and negative samples. Among them, the number of edge pixels and the number of non-edge pixels are known data in the image information and can be determined using existing technology.
[0094] S232, using the loss function and the target data set to train the edge detection model to generate a target edge detection model.
[0095] In this embodiment, the target edge detection model of real scene data includes two parts, namely an encoder and a decoder; wherein, the network structure of the encoder part is the same as the encoder network structure of the above-mentioned pre-trained model; for the decoder, it is divided into two branches, namely a pixel-level edge detection branch and a target-level edge detection branch; wherein, the network structure of the pixel-level edge detection branch is the same as the decoder network structure of the pre-trained model in the above steps; specifically, for the target-level edge detection branch, it includes multiple convolution modules, and then a self-attention layer is connected to extract more global feature information, so as to better understand the semantics and structure of the entire image, and then a softmax classifier layer is connected to perform softmax operation in the channel dimension, and finally a reshape layer is connected to restore the image size.
[0096] An edge detection model training method provided in this embodiment first performs model pre-training based on a virtual synthetic scene with known edge labels, then performs edge detection and annotation on the real scene based on the pre-trained model, combines the homography adaptive algorithm, the Canny edge detection algorithm, etc., to achieve label generation for the real scene, and effectively generates pixel-level and object-level edge annotations for the target edges in the real scene. Finally, the edge detection model is trained based on the labeled data of the real scene.
[0097] In this embodiment, an edge detection method is also provided. Figure 2 The steps shown include:
[0098] Step S31: Determine the target edge detection model using the edge detection model training method in the above embodiment; see steps S11-S13 for details, which will not be described in detail in this embodiment.
[0099] Step S32: Acquire the monitoring scene image of the object to be detected. In this embodiment, the monitoring scene image of the object to be detected is acquired by using the existing monitoring equipment scene.
[0100] Step S33: Use the target edge detection model to perform edge detection on the monitored scene image and determine the edge detection result.
[0101] In this embodiment, an edge detection model training device is also provided. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0102] The present invention discloses an edge detection model training device, such as Figure 3 As shown, including:
[0103] The acquisition module 1 is used to acquire the detection data of the object to be detected by using the modeling and simulation technology; the detailed operation process is detailed in the corresponding steps in the above method embodiment.
[0104] The data processing module 2 is used to process the detection data and determine the target data set; the detailed operation process is detailed in the corresponding steps in the above method embodiment.
[0105] The training module 3 is used to train the edge detection model using the target data set to generate a target edge detection model; the detailed operation process is detailed in the corresponding steps in the above method embodiment.
[0106] The present invention discloses an edge detection device, such as Figure 4 As shown, including:
[0107] The first processing module 01 is used to determine the target edge detection model using the edge detection model training device as described above; the detailed operation process is detailed in the corresponding steps in the above method embodiment.
[0108] The second processing module 02 is used to obtain a monitoring scene image of the object to be detected; the detailed operation process is detailed in the corresponding steps in the above method embodiment.
[0109] The third processing module 03 is used to perform edge detection on the monitoring scene image using the target edge detection model to determine the edge detection result; the detailed operation process is detailed in the corresponding steps in the above method embodiment.
[0110] The present invention also provides an electronic device. Figure 5 , Figure 5 is a schematic diagram of the structure of an electronic device provided by an optional embodiment of the present invention, such as Figure 5As shown, the electronic device may include: at least one processor 601, such as a CPU (Central Processing Unit), at least one communication interface 603, a memory 604, and at least one communication bus 602. The communication bus 602 is used to realize the connection and communication between these components. The communication interface 603 may include a display screen (Display), a keyboard (Keyboard), and the optional communication interface 603 may also include a standard wired interface and a wireless interface. The memory 604 may be a high-speed RAM memory (Random Access Memory, volatile random access memory) or a non-volatile memory (non-volatile memory), such as at least one disk storage. The memory 604 may optionally be at least one storage device located away from the aforementioned processor 601. The processor 601 may be the device described, the memory 604 stores the application program, and the processor 601 calls the program code stored in the memory 604 to perform any of the above method steps.
[0111] The communication bus 602 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The communication bus 602 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 5 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0112] Among them, the memory 604 may include a volatile memory (English: volatile memory), such as a random access memory (English: random-access memory, abbreviated: RAM); the memory may also include a non-volatile memory (English: non-volatile memory), such as a flash memory (English: flash memory), a hard disk drive (English: hard disk drive, abbreviated: HDD) or a solid-state drive (English: solid-state drive, abbreviated: SSD); the memory 604 may also include a combination of the above types of memory.
[0113] The processor 601 may be a central processing unit (CPU), a network processor (NP), or a combination of a CPU and a NP.
[0114] The processor 601 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.
[0115] Optionally, the memory 604 is also used to store program instructions. The processor 601 can call the program instructions to implement the method shown in the embodiment of the present application.
[0116] The embodiment of the present invention further provides a non-transitory computer storage medium, which stores computer executable instructions, and the computer executable instructions can execute the method in any of the above method embodiments. Among them, the storage medium can be a disk, an optical disk, a read-only memory (ROM), a random access memory (RAM), a flash memory (Flash Memory), a hard disk (HDD) or a solid-state drive (SSD), etc.; the storage medium can also include a combination of the above types of memory.
[0117] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A method for training an edge detection model, characterized in that: include: Use modeling and simulation technology to obtain the detection data of the object to be detected; Performing data processing on the detection data to determine a target data set; The target data set is used to train the edge detection model to generate a target edge detection model.
2. The method according to claim 1, characterized in that The processing of the detection data to determine the target data set includes: the detection data includes image information, pixel points and corresponding pixel-level edge detection labels of the object to be detected, Using an encoder to extract features from the pixels of different sizes to determine first feature data; Processing the first feature data using a pixel-level edge decoder to determine a probability that the pixel point is an edge point; A target data set is determined according to the probability and the pixel-level edge detection label.
3. The method according to claim 2, characterized in that The using a pixel-level edge decoder to process the first feature data to determine the probability that the pixel point is an edge point includes: Input the first feature data into a convolutional layer and output second feature data; The second feature data is classified using a classification function to determine the probability that the pixel point is an edge point.
4. The method according to claim 3, characterized in that Determining a target data set according to the probability and the pixel-level edge detection label includes: Determine edge point information according to the probability; Calculating the information of each edge point to determine the pixel-level edge annotation; The pixel-level edge annotation is expressed using the following formula: Where I represents the input image, f() represents the pre-trained edge detection model, and N h represents the number of homography transformations, H i represents the homography transformation, represents the inverse homography transform; The pixel-level edge detection labels and the pixel-level edge annotations are compared, and the pixel-level edge annotations that meet preset requirements are determined as the target data set.
5. The method according to claim 2, characterized in that: The step of training the edge detection model using the target data set to generate the target edge detection model includes: Construct loss function; The edge detection model is trained using the loss function and the target data set to generate a target edge detection model.
6. The method according to claim 5, characterized in that The constructing of the loss function comprises: L=L pix +L obj Among them, L pix represents the pixel-level edge detection loss function, L obj represents the target level loss function; in, H and W represent the length and width of the image information; Y + and Y - They represent the number of edge pixels and non-edge pixels respectively, and δ is a hyperparameter used to balance the number of positive and negative samples.
7. An edge detection method, characterized in that: include: Determine a target edge detection model by using the edge detection model training method according to any one of claims 1 to 6; Acquire a monitoring scene image of an object to be detected; The target edge detection model is used to perform edge detection on the monitoring scene image to determine an edge detection result.
8. An edge detection model training device, characterized in that: include: An acquisition module is used to acquire detection data of the object to be detected by using modeling and simulation technology; A data processing module, used to process the detection data and determine a target data set; The training module is used to train the edge detection model using the target data set to generate a target edge detection model.
9. An edge detection device, characterized in that: include: A first processing module, configured to determine a target edge detection model using the edge detection model training device as claimed in claim 8; The second processing module is used to obtain a monitoring scene image of the object to be detected; The third processing module is used to perform edge detection on the monitoring scene image using the target edge detection model to determine an edge detection result.
