Model training method, measurement method, device, equipment and program product
By generating initial labels using an edge detection model and adjusting them to target labels, and then training the model using sample images, the problem of low efficiency in manual labeling during AI model training in image measuring instruments is solved, thereby improving the efficiency and accuracy of label generation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHOTEST TECH INC
- Filing Date
- 2025-10-24
- Publication Date
- 2026-05-08
AI Technical Summary
Traditional image measuring instruments require a large amount of manual labeling for AI model training, which is inefficient.
Edge detection is performed on the image to be identified using an edge detection model to generate initial labels. The target labels are then adjusted based on the actual edge conditions. The candidate detection model is trained using sample images and target labels until the training conditions are met.
It enables automatic and rapid tag generation, improving tag generation efficiency and accuracy, and allows for rapid training to obtain an accurate target detection model.
Smart Images

Figure CN121999321A_ABST
Abstract
Description
[0001] This application is a divisional application of the patent application filed on October 24, 2025, with application number 202511527789.0 and invention titled "Intelligent Labeling Method, Model Training and Measurement Method, Apparatus, Device, and Medium". Technical Field
[0002] This application relates to the field of artificial intelligence technology, and in particular to a model training method and measurement method, apparatus, computer equipment and computer program product. Background Technology
[0003] Image measurement devices (such as image measuring instruments or quick-reading instruments) can achieve precise measurement of the surface dimensions, contours, angles, positions, and geometric tolerances of various complex parts. In practical applications, image measuring instruments can extract the geometric features (such as planes, lines, and points) of a workpiece, calculate the length or angle information of these geometric features, and thus determine whether the workpiece's machining accuracy meets the requirements. With the rapid development of artificial intelligence technology, image measurement can be performed based on artificial intelligence (AI) models. However, training the AI model in an image measuring instrument often requires a large number of sample images, and each sample image needs to be labeled.
[0004] In traditional techniques, labeling sample images is often done manually, drawing each label one by one. This requires a lot of repetitive work and results in low label generation efficiency. Summary of the Invention
[0005] Therefore, it is necessary to provide a model training method and measurement method, device, computer equipment, computer-readable storage medium and computer program product that can improve the efficiency of label generation, in order to address the above-mentioned technical problems.
[0006] Firstly, this application provides a model training method, including:
[0007] Edge detection is performed on the image to be identified based on an edge detection model to obtain the edge detection result; the image to be identified is a sample image to be labeled.
[0008] Initial labels are generated for the image to be identified based on the edge detection results;
[0009] The initial label is adjusted based on the actual edge condition of the image to be identified to obtain the target label of the image to be identified;
[0010] The candidate detection model is trained based on the sample image and the target label of the sample image until the training conditions are met, thus obtaining a target detection model for edge detection.
[0011] Secondly, this application also provides a model training apparatus, comprising:
[0012] An edge detection module is used to perform edge detection on the image to be identified based on an edge detection model, and obtain the edge detection result; the image to be identified is a sample image to be labeled.
[0013] A label generation module is used to generate initial labels for the image to be identified based on the edge detection results;
[0014] The label adjustment module is used to adjust the initial label according to the actual edge condition of the image to be identified, so as to obtain the target label of the image to be identified;
[0015] The model training module is used to train the candidate detection model based on the sample image and the target label of the sample image until the training conditions are met, so as to obtain the target detection model for edge detection.
[0016] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the model training method provided in the first aspect.
[0017] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the model training method provided in the first aspect.
[0018] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the model training method provided in the first aspect.
[0019] Sixthly, this application provides a measurement method, comprising:
[0020] Acquire the target image corresponding to the object to be measured;
[0021] The target image is edge-detected using the target detection model obtained based on the above model training method to obtain the target edge;
[0022] Determine the target size of the target edge, and determine the measurement result of the object to be measured based on the target size.
[0023] In a seventh aspect, this application also provides a measuring device, comprising:
[0024] The image acquisition module is used to acquire the target image corresponding to the object to be measured.
[0025] The edge detection module is used to perform edge detection on the target image using a target detection model obtained based on the above model training method, and to obtain the target edge;
[0026] The result determination module is used to determine the target size of the target edge and determine the measurement result of the object to be measured based on the target size.
[0027] Eighthly, this application also provides a computer device, including a memory and a processor, the memory storing a computer program, the processor executing the computer program to implement the steps of the measurement method provided in the eleventh aspect.
[0028] In a ninth aspect, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the measurement method provided in the eleventh aspect.
[0029] In a tenth aspect, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the measurement method provided in the eleventh aspect.
[0030] The aforementioned model training method, measurement method, apparatus, computer equipment, computer-readable storage medium, and computer program product perform edge detection on the image to be identified based on an edge detection model, obtain edge detection results, generate initial labels for the image to be identified based on the edge detection results, adjust the initial labels according to the actual edge conditions of the image to be identified, obtain target labels for the image to be identified, train the candidate detection model based on sample images and the target labels of the sample images until the training conditions are met, and obtain a target detection model for edge detection. It eliminates the need for manual labeling of sample images one by one, enabling automatic and rapid label generation, improving label generation efficiency, and training the target detection model based on a large number of accurate generated labels, quickly obtaining a model that can accurately generate labels. Attached Figure Description
[0031] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0032] Figure 1 This is an application environment diagram of the intelligent annotation method in one embodiment;
[0033] Figure 2 This is a flowchart illustrating the intelligent annotation method in one embodiment;
[0034] Figure 3 This is a schematic diagram of the initial label generation process in one embodiment;
[0035] Figure 4 This is a schematic diagram of different sample images of the same category in one embodiment;
[0036] Figure 5 This is a schematic diagram of the marker points and marker lines in one embodiment;
[0037] Figure 6 This is a schematic diagram of different label categories on the same sample image in one embodiment;
[0038] Figure 7 This is a schematic diagram of the process of generating tags by reverse engineering in one embodiment;
[0039] Figure 8 This is a schematic diagram of the adjusted label in one embodiment;
[0040] Figure 9 This is a structural block diagram of an intelligent annotation device in one embodiment;
[0041] Figure 10 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0042] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0043] It should be noted that the terms "first," "second," etc., used in this application can be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from the second element. The terms "comprising" and "having," and any variations thereof, used in this application, are intended to cover non-exclusive inclusion. The term "multiple" used in this application refers to two or more. The term "and / or" used in this application refers to one of the embodiments, or any combination of multiple embodiments.
[0044] The intelligent annotation method provided in this application embodiment can be applied to, for example, Figure 1In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated onto server 104 or placed in the cloud or on another network server. Server 104 acquires the image to be recognized sent by terminal 102, performs edge detection on the image based on an edge detection model, obtains the edge detection result, generates an initial label for the image to be recognized based on the edge detection result, adjusts the initial label according to the actual edge condition of the image to be recognized, and obtains the target label for the image to be recognized. Server 104 can return the target label of the image to be recognized to terminal 102. Terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, drones, low-altitude aircraft, image measuring instruments, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, smart vehicle devices, image measuring instruments, projection equipment, etc. Portable wearable devices can include smartwatches, smart bracelets, head-mounted devices, etc. The head-mounted device can be a virtual reality (VR) device, an augmented reality (AR) device, smart glasses, etc. Server 104 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. It should be noted that the intelligent annotation method provided in this application embodiment is not only applicable to the above-mentioned application scenarios involving interaction between the server and the terminal, but also to application scenarios with a single server or a single terminal.
[0045] In one exemplary embodiment, such as Figure 2 As shown, a label generation method (also known as an intelligent labeling method, automatic labeling method, etc.) is provided, which can reduce the number of operations in the labeling process and improve the labeling speed. This method is applied to... Figure 1 Taking the server in the example, the explanation includes the following steps 202 to 206. Wherein:
[0046] Step 202: Perform edge detection on the image to be identified based on the edge detection model to obtain the edge detection result.
[0047] The image to be identified refers to the image for which edge detection is to be performed. The image to be identified can be a sample image of the sample to be labeled, which can be obtained by capturing the sample using an image measuring device (such as an image measuring instrument or a flash meter). The sample image can be an image captured of the entire sample or an image captured of a portion of the sample. The sample image can be an image acquired from a target region of the sample, which can encompass the edge that the user wants to measure. In other words, the sample image can be an image acquired from a local region of the sample, which at least includes the target edge features in the local region of the sample, corresponding to the edge (also called the target edge) that the user needs to measure. In one embodiment, the number of target edges in the same sample image can be one or more. The same target edge, in theoretical drawings, refers to a continuous local edge containing only one shape (such as a straight line, arc, or circle).
[0048] An edge detection model is an artificial intelligence model capable of detecting edge features. Edge detection models can be trained models or existing models that can identify image edge features. Edge detection results refer to the edge feature detection results in the image to be identified.
[0049] In one example, the edge detection model is trained using labeled sample images. These sample images can be obtained by capturing images of the samples using an image measuring instrument or a flash meter. The sample images can be labeled manually or using a labeling algorithm to obtain labeled tags. Optionally, the region corresponding to the labeled tag includes the target edge, and the labeled tag is a closed contour, not a line or a point. In some embodiments, the same labeled tag includes one target edge, i.e., there is a one-to-one correspondence between the two. Optionally, the closed contour of the same labeled tag does not cover any edges other than the target edge, thereby reducing the influence of other edges on target edge recognition, especially when used to train the target detection model, effectively improving the accuracy of the trained target detection model in recognizing target edge features.
[0050] For example, the target edges of the sample image can be drawn manually in the drawing interface of the training software by selecting a suitable label drawing style (such as line, arc, circle, or curve) to form a marker line that fits the image edge. A region of preset width is formed centered on this marker line, and the border of this region is the label of the sample image. The preset width can be set according to the actual application scenario. Alternatively, the sample image can be labeled automatically. For example, target edges in the sample image are detected by an edge detection algorithm, and the detected target edges are labeled as marker points. The marker points are connected to form a marker line, and a region of preset width is formed centered on this marker line. The border of this region is the label of the sample image. The target edge can be a partial edge, i.e., a part of a complete edge. After obtaining the label of the sample image, the sample image including the label can be input into the initial detection model to obtain the predicted edge features. Based on the difference between the predicted edge features and the target edge features corresponding to the label, the parameters of the initial detection model are adjusted until the difference between the predicted edge features and the target edge features is less than the difference threshold, thus obtaining the edge detection model. The initial detection model is used to represent the untrained model. The image to be identified is input into the edge detection model to obtain the edge detection results, which are the potential target edges in the image to be identified. The potential target edges that can be identified are usually the same as or similar to the target edges labeled in the sample images used for training. The initial detection model can be, for example, a convolutional neural network architecture for edge detection, such as U-Net, FCN, Mask R-CNN, or generative adversarial networks (GANs).
[0051] In some practical applications, a small number of sample images can be labeled manually or using labeling algorithms to obtain labeled sample images. Then, an initial detection model can be trained using these few sample images to obtain an edge detection model. Here, "small number" refers to a number less than a threshold, which can be a threshold representing the number of samples typically required for model training. For example, 10 sample images can be labeled, and the initial detection model can be trained using these 10 labeled sample images to obtain an edge detection model. Based on this, an initial edge detection model that can identify target edges in sample images can be obtained. This model can quickly identify the images to be labeled to generate initial labels, and then adjust the labels based on the initial labels to obtain the target labels. Compared to labeling from scratch, this significantly improves labeling efficiency.
[0052] Step 204: Generate initial labels for the image to be identified based on the edge detection results.
[0053] The initial label refers to the label generated based on the edge detection results. The edge detection results can be marked as marker points, and a marker line is formed by fitting the marker points. The initial label is then generated based on the marker line.
[0054] It should be noted that the labels involved in this application embodiment are used to characterize target edge features in an image. A label is a closed contour, not just a line or a point, and the region corresponding to the label includes the target edge features. In other words, a label can be viewed as a closed contour that can select the region containing the target edge features of the image. The target edge corresponding to the target edge features is typically the edge that the user needs to measure. The target edge features can be local edge features.
[0055] Step 206: Adjust the initial label according to the actual edge condition of the image to be identified to obtain the target label of the image to be identified.
[0056] Here, "true edge condition" refers to the actual edge features. Adjusting the initial label based on the actual edge features of the image to be recognized can yield a target label that more closely matches the actual edge features. The initial label can be adjusted manually or by device according to the true edge condition of the image to be recognized to obtain the target label for the image.
[0057] For example, the marker points in the initial label can be adjusted according to the actual edge condition of the image to be identified, so that the similarity between the label and the actual edge condition of the image to be identified is greater than or equal to a threshold, thus obtaining the target label of the image to be identified.
[0058] In the aforementioned label generation method, edge detection is performed on the image to be identified using an edge detection model to obtain the edge detection result. An initial label for the image to be identified is then generated based on this result. The initial label is adjusted according to the actual edge characteristics of the image to obtain the target label. This eliminates the need for manual labeling of each sample image, enabling rapid label generation and improving efficiency. Furthermore, by further adjusting the initial label generated by the model based on the actual edge characteristics of the image, the accuracy of the labeling is improved.
[0059] In some embodiments, step 204, generating an initial label for the image to be identified based on the edge detection results, includes:
[0060] Target marker points are determined based on edge detection results; target marker lines are obtained by fitting the target marker points; and initial labels for the image to be recognized are generated based on the target marker lines and the preset label width.
[0061] The edge detection results obtained based on the edge detection model can be marked with target points. Target target points can be edge feature points corresponding to the edge detection results. The number of target target points is at least two, and can be four, eight, ten, or more, depending on the specific application scenario. The target label line is obtained by fitting the target target points; the target label line can be a straight line or a curve. The shape of the target label line is determined based on the edge features corresponding to the edge detection results. The preset label width can be set according to the specific application scenario.
[0062] In some application scenarios, the edge detection results obtained by the edge detection model can be presented in the form of contour lines. If the label generation function is enabled, marker points are generated based on these contour lines. That is, after the label generation function is enabled, the result can be several marker points generated along the contour line. Optionally, the marker points can be generated at a preset interval. These marker points can be used directly as target marker points; or a portion can be selected as target marker points, for example, marker points that fit the target edges in the sample image as closely as possible. It is understood that if the number of selected target marker points is large, the similarity between the generated initial labels and the real edge situation may be higher than the threshold, in which case there is no need to perform the label adjustment in step 206.
[0063] For example, target marker points can be determined based on edge detection results. Adjacent target marker points are connected by straight lines to obtain target marker lines. Based on these target marker lines, an initial label with a preset label width is generated. It is easy to understand that the overall shape trajectory of the initial label is the same as that of the target marker lines. That is, it is equivalent to generating a border of the preset label width around the target marker lines, following their trajectory, to obtain the initial label. The target marker lines can be located at the center or edge of the initial label, etc.
[0064] For example, target marker points can be determined based on edge detection results, and multiple target marker points can be fitted with curves using a curve fitting algorithm to obtain target marker lines. Then, an initial label with a preset label width can be generated based on the target marker lines.
[0065] In this embodiment, target marker points are determined based on edge detection results, and target marker lines are obtained by fitting the target marker points. Based on the target marker lines and a preset label width, an initial label for the image to be identified is generated. This can generate an initial label that matches the edge detection results better, thus improving the accuracy of the initial label.
[0066] In some embodiments, an initial label for the image to be identified is generated based on the target marker line and a preset label width, including:
[0067] Centered on the target marker line, a first boundary line and a second boundary line are generated on both sides of the target marker line, and the distance between the first boundary line and the second boundary line is the preset label width; the border of the area formed by the first boundary line and the second boundary line is used as the initial label of the image to be recognized.
[0068] The first and second boundary lines on either side of the target mark line are parallel to the target mark line. Assuming the preset label width is L, the distance between the first or second boundary line and the target mark line can be L / 2.
[0069] For example, such as Figure 3 As shown, multiple target marker points 302 are fitted to obtain a target marker line 304. With the target marker line 304 as the center, a first boundary line 306 and a second boundary line 308 are generated on both sides of the target marker line 304. The distance between the first boundary line 306 and the second boundary line 308 is a preset label width. The border of the region formed by the first boundary line 306 and the second boundary line 308 is the initial label. It should be noted that in this embodiment, each label is used to represent only one edge feature, which can be a complete edge or a part of a whole edge. That is, one label cannot represent multiple edge features. For example, Figure 3 The initial labels shown are only used to characterize the inner edge of the "U"-shaped component in the sample image, excluding the outer edge.
[0070] In this embodiment, by generating a first boundary line and a second boundary line on both sides of the target mark line as the center, and using the border of the area formed by the first boundary line and the second boundary line as the initial label of the image to be identified, the initial label of the image to be identified can be generated more accurately.
[0071] In some embodiments, step 206, adjusting the initial label based on the true edge condition of the image to be identified to obtain the target label of the image to be identified, includes:
[0072] Based on the actual edge conditions of the image to be identified, adjust the position and / or number of marker points corresponding to the initial label until the similarity between the initial label and the actual edge conditions of the image to be identified is higher than the threshold, thus obtaining the target label of the image to be identified.
[0073] It's easy to understand that the initial labels generated from the edge detection results obtained by the edge detection model may contain errors. If the initial labels do not match the true edge conditions of the image to be identified, the initial labels need to be adjusted so that they match the true edge conditions of the corresponding image. Specifically, if the similarity between the label and the true edge conditions in the image reaches a threshold, it means that the label matches the true edge features in the corresponding image.
[0074] For example, the number of initial label markers can be increased or decreased, or the positions of the markers can be moved, based on the actual edge characteristics of the image to be identified, so that the similarity between the label and the actual edge characteristics of the image to be identified is higher than a threshold, thus obtaining the target label for the image to be identified. The threshold can be set according to the actual application scenario, such as 85%, 90%, or 99%. It is easy to understand that after adjusting the position or number of markers, i.e., the markers change, the marking lines also change, and the label will change along with the marking lines according to predetermined rules, thereby achieving label adjustment based on marker points.
[0075] In practical applications, based on the true edge characteristics of the image to be identified, all the marker points of the initial label can be moved as a whole to cover the true edge features. Then, the number of marker points can be increased or decreased to make the similarity between the label and the true edge features higher than a threshold, thus obtaining the target label.
[0076] In this embodiment, by adjusting the position and / or number of marker points corresponding to the initial label based on the actual edge condition of the image to be identified, until the similarity between the initial label and the actual edge condition of the image to be identified is higher than a threshold, a target label that better matches the actual edge condition can be obtained, thereby further improving the accuracy of the generated image label.
[0077] Understandably, the edge detection model in step 202 can be iterative. Each time a preset number of sample images are selected for labeling, the edge detection model is further trained and optimized iteratively. As the edge detection model is progressively optimized, the accuracy of the generated labels in step 204 increases, and the label adjustment actions in step 206 are gradually reduced, thereby improving the efficiency of label drawing. In this case, iterative optimization can stop when the edge detection model meets the requirements of the object detection model described later.
[0078] In one exemplary embodiment, this application provides a model training method, including:
[0079] Obtain labeled sample images generated by the above intelligent annotation method; train the candidate detection model based on the sample images and their labels until the training conditions are met, and obtain the target detection model for edge detection.
[0080] The sample images may include multiple images, each acquired using an image measuring instrument or a flash imager. The acquired sample images are unlabeled; labels can be generated using the intelligent labeling method described above, resulting in labeled sample images. The candidate detection model can be, for example, a convolutional neural network architecture for edge detection, such as U-Net, FCN, Mask R-CNN, or Generative Adversarial Networks (GANs). The candidate detection model can be an untrained model or a trained model. For example, the candidate detection model can employ the edge detection model described in the above embodiments.
[0081] For example, a candidate detection model can be trained based on sample images and their labels until training conditions are met, resulting in a target detection model for edge detection. Training conditions include, for example, the difference between the label and the predicted edge being less than a preset difference threshold, or the training iterations reaching a preset number. The predicted edge is the edge predicted by the candidate detection model based on the sample image. During training, the sample image is input into the candidate detection model, which identifies edge features in the sample image to obtain predicted edges. The parameters of the candidate detection model are adjusted based on the difference between the predicted edge and the target edge represented by the label of the corresponding sample image, until the difference between the predicted edge and the target edge represented by the label of the sample image is less than the difference threshold, or until the training iterations reach a preset number, thus obtaining the target detection model for edge detection. It should be noted that the difference between the predicted edge and the target edge represented by the label of the sample image can be represented by their similarity or by the training loss.
[0082] In some examples, labels on sample images can be classified based on the edge features represented by the labels, resulting in at least one label category. For instance, labels corresponding to edge features with similarity higher than a threshold can be grouped into the same category. The candidate detection model can be trained sequentially using sample images corresponding to each label category until the model's predictions (i.e., predicted edges) for each label category meet preset conditions, thus obtaining the target detection model. This target detection model can accurately identify edge features across multiple categories. In practical applications, the candidate detection model can also be trained using sample images corresponding to the target category label to obtain the target detection model. This target detection model is more accurate in identifying edge features of the target category label. The target category can be any label category, such as a user-specified label category.
[0083] The above model training method generates labeled sample images through intelligent annotation, and trains the candidate detection model based on the sample images and their labels until the training conditions are met, thus obtaining the target detection model. This method can quickly and accurately obtain a large number of labeled sample images to train the model, improving the training efficiency and accuracy.
[0084] In one exemplary embodiment, this application provides a measurement method, including:
[0085] Obtain the target image corresponding to the object to be measured; perform edge detection on the target image using the target detection model obtained by the above model training method to obtain the target edge; determine the target size of the target edge, and determine the measurement result of the object to be measured based on the target size.
[0086] The target image can be a complete image or a partial image of the object to be measured. For example, the target image can be obtained by taking a picture of only the part of the object that needs to be measured.
[0087] For example, an image measuring instrument can be used to acquire a target image corresponding to the object to be measured. An embedded target detection model in the image measuring instrument can then be used to perform edge detection on the target image to obtain the target edges. The dimensions of the target edges can be measured according to the measurement requirements to obtain the target dimensions. The measurement result of the object to be measured can then be calculated based on the target dimensions. In practical applications, the trained target detection model can be loaded into the measurement software of the image measuring instrument. After the user selects the feature measurement region in the target image using a feature selection tool, the target detection model can identify the edge features in the selected feature measurement region to obtain the target edges. The image measuring instrument then measures the dimensions of the target edges to obtain the target dimensions. The measurement result of the object to be measured can then be obtained based on the target dimensions.
[0088] For example, the process of an object detection model identifying edge features in a target image may include acquiring the target image based on a feature measurement region, and using its trained knowledge to analyze the information in the target image to identify potential target edges, which are then displayed in the measurement software as contour lines or sets of points. The target image can be obtained by appropriately expanding the image within the feature measurement region. This appropriate expansion can refer to extending the feature measurement region outwards by a certain area, but the resulting target image will not excessively increase the edge features in the image. This ensures complete identification of the edge features of the feature measurement region (i.e., the target edges) while reducing the influence of other edges (edges other than the target edges) on the object detection model, thus improving recognition efficiency and accuracy.
[0089] In this embodiment, the target image corresponding to the object to be measured is edge-detected by the target detection model to obtain the target edge, and the measurement result is obtained based on the target size of the target edge. This enables accurate detection of edges in the target image based on the target detection model, thereby improving the accuracy of the measurement result.
[0090] In practical applications, labeling involves manually drawing the target edges of a sample image (i.e., a sample image) each time. This requires manually drawing the edges from scratch using tools such as lines or arcs, which is repetitive and significantly reduces labeling efficiency, increasing labor and production costs. Therefore, this application provides an intelligent labeling method. This method first selects a subset of sample images for labeling, then trains an initial AI model (i.e., an edge detection model) based on the labeled sample images. The initial AI model is then used to identify other sample images to obtain inference results (i.e., edge detection results). Based on these inference results, inferred labels (i.e., initial labels) are generated. Since the number of sample images used for training is relatively small, the obtained inferred labels may differ from the actual edge conditions. Therefore, the inferred labels are adjusted based on the actual edge conditions to obtain optimized labels (i.e., target labels). The initial AI model (i.e., the edge detection model) can be further trained on the labeled sample images to obtain a more complete AI model (object detection model). This method enables the generation of initial labels based on model inference results, improving label generation efficiency. Simultaneously, by adjusting the initial labels based on the actual edge conditions to obtain target labels, the accuracy of the generated labels is improved. The following describes a specific implementation process. The operations described in steps S1 to S4 below can also be applied to the aforementioned intelligent annotation method, model training method, and measurement method without excessive restrictions. Specifically, it includes:
[0091] S1: Prepare multiple sample images to be trained.
[0092] Multiple sample images can be obtained by an image measuring instrument capturing images of multiple samples with the same or similar testing requirements. Sample images do not reflect the entire sample; they can be images of areas of interest to the user on the sample (feature measurement areas), such as areas containing the edges the user wants to measure.
[0093] Multiple sample images to be labeled can be classified. For example, multiple sample images with the same or highly similar edge features can be grouped into the same category; that is, sample images of the same category can share the same or similar target edges for the labels to be drawn. Images of the same category are distinguished by using the same naming rules. Specifically, sample images belonging to the same category may be images of multiple samples located in roughly the same region, or images of the same sample with multiple highly similar edge features. Images of the regions containing these highly similar edge features can also be classified as the same category. For example, different sample images of the same category, such as... Figure 4 As shown.
[0094] S2: Select a portion of the sample images to draw labels, and train the initial AI model (edge detection model) based on the currently labeled images.
[0095] S2.1 Select several sample images and manually draw labels.
[0096] Import the sample images into the training software, and select several sample images to draw labels one by one. The selected sample images can contain multiple image classes, and the number of sample images for each image class must not be less than the minimum training threshold (e.g., 10 images) to avoid insufficient images for successful training.
[0097] When creating a label for a sample image, the drawing software selects a suitable label drawing style (such as line, arc, circle, or curve) to trace the target edge of the selected sample image, forming a marker line that fits the target edge. The generated label is then formed around this marker line as its center. The specific width can be set manually.
[0098] In this embodiment, the label is defined as a closed contour, and the area corresponding to the label includes the target edge features, rather than just an edge line. By defining a range through the label, even if there are some small errors in the drawing of the marker line at the boundary, it will not affect the judgment of the overall features of the target edge to a certain extent, effectively reducing the marking error. Of course, the closer the marker line is to the target edge, the more accurately the formed label area can cover the target edge, and the higher the edge recognition accuracy of the AI model trained subsequently.
[0099] The process of manually drawing labels is as follows: After importing multiple sample images into the training software, the image information will be displayed in a preset order in the corresponding image list interface. For example, the image list interface displays image information such as image number, sample image name, label type, label width, and whether it participates in training. By clicking on the image information in the image list interface, the corresponding sample image will be displayed on the screen. Furthermore, batch configuration of sample images is possible in the image list interface, such as batch selecting sample images to configure whether they participate in training, and batch setting label widths.
[0100] After selecting a sample image, you can choose a suitable label drawing style in the label settings interface to determine the desired target edge shape. The label settings interface includes options for label drawing style, label width, and label transparency (adjusting the label's transparency allows for easier observation of the drawn edge below the label, facilitating drawing and adjustment). For example, if you want a straight line, select "line" as the label drawing style in the interface; if you want a standard arc or circle, select "arc" or "circle" as the style. Then, on the display interface, click the target edge location with the mouse to create coarse marker points. If the label drawing style is set to "line," two coarse marker points will define a straight line; if the style is set to "arc" or "circle," three coarse marker points will define an arc or circle.
[0101] Due to software limitations, the lines connecting points are defaulted to straight lines. Therefore, to represent the corresponding drawn shapes, multiple fine-line markers are formed between adjacent coarse-line markers along the defined shape path. These coarse and fine-line markers are collectively referred to as marker points. Connecting these marker points sequentially forms a marker line with the corresponding shape. A schematic diagram of marker points and marker lines is shown below. Figure 5 As shown.
[0102] When drawing each target edge, it can be done in segments. Each segment of the marker line can better fit (match) the edge and adapt to complex edge shapes. That is, each segment can correspond to two or three coarse marker points. To ensure that adjacent segments are connected, the end of the previous segment and the beginning of the next segment can share a coarse marker point. The drawing is complete when the marker lines cover the selected target edge. Of course, if the edge shape is regular and clear, it can be drawn in one go without segments.
[0103] It should be noted that the aforementioned centerline, arc, or circle are suitable for relatively regular edge shapes in the sample image. We also provide a curve with stronger applicability, capable of handling more complex boundary conditions. If the label drawing style is selected as a curve, then every three coarse-drawn marker points can determine one end of the curve. Specifically, every three coarse-drawn marker points form a group, and the size and curvature of the curve segment can be determined by dragging the third coarse-drawn marker point to adjust its position. When drawing the next curve segment connected to it after drawing a curve segment, the first coarse-drawn marker point of the next curve segment can be the third coarse-drawn marker point of the previous curve segment. Even if the edge conditions are complex, the formed marker line can cover the target edge. Labels can be directly generated based on the drawn marker line and the set label width, and the labels (such as in the form of marker point coordinates and corresponding label width information) are saved to the corresponding training file. In this embodiment, the generated label only needs to cover the target edge. Compared with existing label drawing methods that at least cover the area of a closed loop boundary, the label drawing in this embodiment is relatively easy, and the formed label has a small coverage of the sample image, which is more conducive to the user's observation of the boundary conditions in the image and facilitates subsequent label adjustment.
[0104] Furthermore, the entire label can be moved to align the marker line with the target edge. The entire label can also be deleted. Each marker point in the label can be deleted or moved to adjust misaligned marker points. For example, additional marker points can be added at selected locations. Marker points can be added between existing marker points to enrich internal details and make the overall marker line better match the target edge; or marker points can be added outwards along the original shape trajectory (such as the original curvature) on both sides of the marker line, so that the marker line can completely cover the selected target edge.
[0105] In step S2.1, in addition to drawing labels entirely manually, a semi-automatic labeling method can also be used. That is, the training software can also use a method based on traditional algorithms to generate labels. For example, in the corresponding label selection interface, a suitable bounding box shape (such as a fan, rectangle, or circle) is selected and the target edge is selected in the display interface. Then, the software uses a pre-configured algorithm such as Canny edge detection to automatically detect the edges in the selected area, and marks them in the form of marker points. These marker points are then connected to form a marker line, thus forming the initial label. Due to the complexity of image edges, the accuracy of the edge detection algorithm may not meet the requirements. Therefore, after automatic labeling, the marker points are manually adjusted to make the marker line fit the target edge, and the optimized label is obtained to better meet the training requirements.
[0106] In this embodiment, labels can also be classified, where labels corresponding to identical or highly similar target edges in sample images can be grouped into one category. Determining whether two target edges are identical or highly similar can be achieved by comparing their edge characteristics, such as edge shape, texture, or intensity. Edges with similar characteristics belong to the same category, and labels corresponding to the same category belong to the same category. Labels belonging to the same category participate in the training of the subsequent AI model, enabling the trained AI model to recognize edges with similar characteristics. When training the same AI model, it is preferable to use sample images of the same graph class to ensure the accuracy of the AI model in recognizing edges with similar characteristics. However, this is not the only possibility. If sample images of different graph classes are used to train the same AI model, the AI model can recognize a wider range of edge types, but with the same number of images used for training, the recognition accuracy is lower than that of an AI model trained using a single graph class. The same AI model can be trained using multiple categories of labels, thereby improving the applicability of the AI model and enabling it to recognize various edges with different characteristics. The categories of multiple labels can be the label categories drawn corresponding to different target edges on the same sample image, such as... Figure 6 As shown, Label 1 and Label 2 belong to different label categories corresponding to different edges on the same sample image. The number of sample images used for training must meet the minimum training requirement, such as no less than 10 images. Different categories of labels can be distinguished by displaying different colors. For example, in the same sample image, it may be necessary to focus on two different edges; therefore, different colors can be used to depict the two edges when drawing labels, thus corresponding to different label categories. Labels on different sample images belonging to the same category can be displayed using the same color. The label drawing type of each sample image in the image list interface can be displayed in the corresponding color.
[0107] The training software can also include a label list interface, which can include label color, label name, label width, number of images, etc. The label list interface allows for batch management of labels, such as adjusting label width and label naming. Label color corresponds to the corresponding label category, and the number of images corresponds to the number of sample images with this type of label.
[0108] S2.2 Train the initial AI model (edge detection model) based on the currently labeled images.
[0109] In the image list interface, the sample images to be used for training are set. All selected sample images have pre-labeled labels. The prepared sample image data and corresponding label data are used as the initial training set and input into the selected model architecture (initial detection model) for training, thereby obtaining the initial AI model (edge detection model) for feature recognition. The model architecture (initial detection model) can be a convolutional neural network architecture for edge detection, such as U-Net, FCN, MaskR-CNN, etc., or some architectures based on generative adversarial networks (GANs) can also be selected. This embodiment does not impose too many restrictions.
[0110] S3: Use the initial AI model to draw inference labels (initial labels) on other sample images, and adjust the inference labels to obtain optimized labels (target labels).
[0111] S3.1 Based on the initial AI model (edge detection model), edge recognition is performed on other sample images to obtain inference results (edge detection results), and inference labels (initial labels) are generated based on the inference results.
[0112] After obtaining the initial AI model, it is directly loaded into the training software. The initial AI model is then used to perform recognition and inference on other unlabeled sample images to obtain inference results. Specifically, when the inference function is enabled on the corresponding interface, the unlabeled sample images are processed by the initial AI model. The initial AI model automatically extracts features from each input sample image. In this stage, the initial AI model uses its trained knowledge to analyze information in each sample image, such as color, texture, and brightness changes, thereby identifying potential target edges and displaying them as contour lines on the display interface (i.e., the inference result). Similarly, when the reverse labeling function is enabled, unlabeled sample images (images to be recognized) can generate labels based on the inference results (no need to select images; after checking the reverse labeling option, labels will be automatically derived for any unlabeled image). Of course, in addition to directly labeling all unlabeled images, the internal algorithm can be configured so that the AI model only recognizes one or more sample images selected in the image list interface to obtain the inference result for the selected sample image.
[0113] Here, the potential target edge refers to the edge features that the initial AI model can identify. That is, the initial AI model can only identify the edge categories trained in step S2. If the edge category does not exist in the sample image, it may not be identified. Of course, because the initial training set is small in step S2, even if the edge category exists in the sample image, the initial AI model may still fail to identify it. After obtaining the inference result (edge detection result) of the selected sample image (image to be identified), inference labels (initial labels) can be generated by reverse engineering. Specifically, multiple marker points can be generated along the contour line corresponding to the inference result. Multiple marker points are connected to form a marker line, and then the inference label (initial label) is generated with the marker line as the center line according to the default label width. A flowchart illustrating the reverse engineering label generation process is shown below. Figure 7 As shown.
[0114] S3.2 Adjust the inference label (initial label) based on the actual target edge situation in the sample image to obtain the optimized label (target label).
[0115] Because the initial training set is small, the inference results obtained by the initial AI model may differ from the actual target edges, leading to discrepancies between the generated inference labels (initial labels) and the actual target edges. Therefore, the generated inference labels (initial labels) are adaptively adjusted on the display interface based on the actual target edges. This includes moving / deleting labels (if an error occurs and a non-target edge is detected, the corresponding inference label is directly deleted), deleting marker points, and adjusting marker point positions. This allows the optimized labels (target labels) to better match the target edges on the current sample image. A schematic diagram of the adjusted labels (target labels) is shown below. Figure 8 As shown.
[0116] S4: Train the required AI model (object detection model) based on the newly added labeled sample images.
[0117] Select the sample images to be used for training from the image list interface. All selected sample images are pre-labeled (i.e., labeled sample images). Prioritize sample images that haven't been used in previous training, i.e., the labeled sample images added in step S3. Input the prepared sample image data and corresponding label data as a new training set into the previously trained initial AI model (edge detection model) for training, thereby obtaining a target AI model (object detection model) with higher recognition accuracy. This process optimizes the initial AI model using a new training set, significantly improving training speed compared to retraining an entire AI model. Alternatively, you can combine the previously obtained initial training set and output it as the training set to the defined model architecture (initial detection model) to retrain the AI model; this may require more training time and computational resources.
[0118] After the AI model is trained, it can be loaded into the training software. The AI model can then be used to perform recognition and inference on sample images to obtain inference results. The accuracy of the AI model can be evaluated based on these results. If the accuracy of the AI model is still low, it indicates that the number of training images used in the training set is still too small. In this case, new sample images can be added, or untrained sample images can be selected and step S3 can be repeated. The newly added sample image data and corresponding label data can be added to the training set to further train the AI model. This means training is performed on the basis of the original AI model to improve its accuracy until the desired AI model (object detection model) is obtained. In other words, the AI model's recognition accuracy meets the requirements and the evaluation is passed.
[0119] Understandably, the AI model can be iterative. In each step S3, a preset number of sample images are selected to draw labels, which are then used to further train the AI model and optimize it iteratively until the AI model meets the requirements. As the AI model is gradually optimized, the accuracy of the back-inference label generation in step S3 becomes higher and higher, and the manual adjustment of labels is gradually reduced, thereby reducing labor costs and improving the efficiency of label drawing. Of course, it is also possible to directly acquire a large number of labeled sample images in step S3, and train the required AI model in one go if possible.
[0120] After the AI model passes evaluation, it can be loaded into the measurement software of the image measuring instrument. Users can then select the feature measurement area using feature selection tools (such as circles, sectors, or rectangles). The AI model can then identify edges based on the selected feature measurement area and annotate the dimensions to be measured based on the identified features, thus completing the feature measurement. Compared to the edge recognition algorithm built into the measurement software, the AI model can achieve more accurate feature recognition and can identify edges that traditional edge recognition algorithms cannot recognize. For example, the edge recognition algorithm built into the measurement software is prone to errors, identifying edge features that deviate from the actual target edge, requiring manual adjustment. Furthermore, for some complex edges, it may fail to recognize them, requiring manual point selection. However, after loading the AI model (object detection model), even with complex edge conditions, it can accurately identify features within the feature measurement area.
[0121] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps. It is understood that the steps in different embodiments can be freely combined as needed, and all non-contradictory solutions formed by such combinations are within the scope of protection of this application.
[0122] Based on the same inventive concept, this application also provides an intelligent annotation device for implementing the intelligent annotation method described above. The solution provided by this device is similar to the implementation described in the above method; therefore, the specific limitations in one or more intelligent annotation device embodiments provided below can be found in the limitations of the intelligent annotation method described above, and will not be repeated here.
[0123] In one exemplary embodiment, such as Figure 9 As shown, an intelligent labeling device is provided, including: an edge detection module 902, a label generation module 904, and a label adjustment module 906, wherein:
[0124] Edge detection module 902 is used to perform edge detection on the image to be recognized based on the edge detection model and obtain the edge detection result;
[0125] The label generation module 904 is used to generate initial labels for the image to be recognized based on the edge detection results;
[0126] The label adjustment module 906 is used to adjust the initial label according to the actual edge condition of the image to be recognized, so as to obtain the target label of the image to be recognized.
[0127] In some embodiments, the label generation module 904 is further configured to: determine target marker points based on edge detection results; fit the target marker points to obtain target marker lines; and generate initial labels for the image to be recognized based on the target marker lines and a preset label width.
[0128] In some embodiments, the label generation module 904 is further configured to: generate a first boundary line and a second boundary line on both sides of the target mark line, with the target mark line as the center, the distance between the first boundary line and the second boundary line being a preset label width; and use the border of the area formed by the first boundary line and the second boundary line as the initial label of the image to be recognized.
[0129] In some embodiments, the label adjustment module 906 is further configured to: adjust the position and / or number of marker points corresponding to the initial label according to the actual edge condition of the image to be identified, until the similarity between the initial label and the actual edge condition of the image to be identified is higher than a threshold, thereby obtaining the target label of the image to be identified.
[0130] Based on the same inventive concept, this application also provides a model training apparatus for implementing the model training method described above. The solution provided by this apparatus is similar to the implementation scheme described in the above method; therefore, the specific limitations in one or more model training apparatus embodiments provided below can be found in the limitations of the model training method described above, and will not be repeated here.
[0131] In one exemplary embodiment, a model training apparatus is provided, comprising:
[0132] The sample image acquisition module is used to acquire labeled sample images generated according to the above-mentioned intelligent annotation method;
[0133] The model training module is used to train candidate detection models based on sample images and their labels until the training conditions are met, resulting in a target detection model for edge detection.
[0134] Based on the same inventive concept, this application also provides a measuring device for implementing the measurement method described above. The solution provided by this device is similar to the solution described in the above method; therefore, the specific limitations in one or more measuring device embodiments provided below can be found in the limitations of the measurement method described above, and will not be repeated here.
[0135] In one exemplary embodiment, a measuring device is provided, comprising:
[0136] The image acquisition module is used to acquire the target image corresponding to the object to be measured.
[0137] The edge detection module is used to perform edge detection on the target image using the target detection model obtained based on the above model training method, and to obtain the target edge;
[0138] The result determination module is used to determine the target size of the target edge and determine the measurement result of the object to be measured based on the target size.
[0139] Each module in the aforementioned intelligent annotation device, model training device, or measurement device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0140] In one exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 10 As shown, this computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operating system and computer programs stored in the non-volatile storage media. The database stores data related to the intelligent annotation method. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network. When the computer program is executed by the processor, it implements an intelligent annotation method.
[0141] Those skilled in the art will understand that Figure 10 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0142] In one exemplary embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.
[0143] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps in the above method embodiments.
[0144] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.
[0145] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.
[0146] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0147] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0148] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A model training method, characterized in that, The method includes: Edge detection is performed on the image to be identified based on an edge detection model to obtain the edge detection result; the image to be identified is a sample image to be labeled. Initial labels are generated for the image to be identified based on the edge detection results; The initial label is adjusted based on the actual edge condition of the image to be identified to obtain the target label of the image to be identified; The candidate detection model is trained based on the sample image and the target label of the sample image until the training conditions are met, thus obtaining a target detection model for edge detection.
2. The method according to claim 1, characterized in that, The candidate detection model is the edge detection model, which is iteratively optimized during training as the number of training sample images increases.
3. The method according to claim 1 or 2, characterized in that, The edge detection model is obtained through training, and the training methods for the edge detection model include: Sample images are obtained by capturing images of the samples using an image measuring instrument; The labeled images are obtained by labeling a small number of sample images; The edge detection model is obtained by training the initial detection model with a small number of sample images and labeled data.
4. The method according to claim 1, characterized in that, The step of generating initial labels for the image to be identified based on the edge detection results includes: The target marker point is determined based on the edge detection results; The target marking line is obtained by fitting the target marking points; Based on the target marker line and the preset label width, an initial label is generated for the image to be identified.
5. The method according to claim 4, characterized in that, The step of generating initial labels for the image to be recognized based on the target marker line and the preset label width includes: Centered on the target marking line, a first boundary line and a second boundary line are generated on both sides of the target marking line, and the distance between the first boundary line and the second boundary line is a preset label width; The border of the region formed by the first boundary line and the second boundary line is used as the initial label of the image to be identified.
6. The method according to claim 1, characterized in that, The step of adjusting the initial label based on the true edge condition of the image to be identified to obtain the target label of the image to be identified includes: Based on the actual edge condition of the image to be identified, the position and / or number of marker points corresponding to the initial label are adjusted until the similarity between the initial label and the actual edge condition of the image to be identified is higher than a threshold, thereby obtaining the target label of the image to be identified.
7. A measurement method, characterized in that, The method includes: Acquire the target image corresponding to the object to be measured; The target image is edge-detected using the target detection model obtained by the model training method according to any one of claims 1 to 6, thereby obtaining the target edge; Determine the target size of the target edge, and determine the measurement result of the object to be measured based on the target size.
8. A model training device, characterized in that, The device includes: An edge detection module is used to perform edge detection on the image to be identified based on an edge detection model, and obtain the edge detection result; the image to be identified is a sample image to be labeled. A label generation module is used to generate initial labels for the image to be identified based on the edge detection results; The label adjustment module is used to adjust the initial label according to the actual edge condition of the image to be identified, so as to obtain the target label of the image to be identified; The model training module is used to train the candidate detection model based on the sample image and the target label of the sample image until the training conditions are met, so as to obtain the target detection model for edge detection.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.