CN-121999321-A - Model training method, measuring method, device, equipment and program product
Abstract
The application relates to a model training method, a measuring device, equipment and a program product. The model training method comprises the steps of carrying out edge detection on an image to be identified based on an edge detection model to obtain an edge detection result, enabling the image to be identified to be a sample image of a label to be marked, generating an initial label of the image to be identified according to the edge detection result, adjusting the initial label according to the real edge condition of the image to be identified to obtain a target label of the image to be identified, and training a candidate detection model based on the sample image and the target label of the sample image until training conditions are met to obtain the target detection model for edge detection. By adopting the method, the label generation efficiency and accuracy can be improved.
Inventors
- LIU MAOMAO
- PENG MENG
- HE JUNLI
- LI ZHAOSHUN
- WANG JIANQIANG
- LAI SHENGHUI
Assignees
- 深圳市中图仪器股份有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20251024
Claims (10)
- 1. A method of model training, the method comprising: performing edge detection on an image to be identified based on an edge detection model to obtain an edge detection result, wherein the image to be identified is a sample image of a label to be marked; Generating an initial label of the image to be identified according to the edge detection result; adjusting the initial label according to the real edge condition of the image to be identified to obtain a target label of the image to be identified; And training the candidate detection model based on the sample image and the target label of the sample image until the training condition is reached, so as to obtain the target detection model for edge detection.
- 2. The method of claim 1, wherein the candidate detection model is the edge detection model that is iteratively optimized as the number of trained sample images increases during training.
- 3. The method according to claim 1 or 2, wherein the edge detection model is obtained by training, and the training method of the edge detection model comprises: Shooting a sample through an image measuring instrument to obtain a sample image; labeling a small amount of sample images to obtain labeling labels of the sample images; training an initial detection model through a small number of sample images and labeling labels to obtain the edge detection model.
- 4. The method according to claim 1, wherein generating the initial label of the image to be identified according to the edge detection result comprises: determining a target mark point according to the edge detection result; Fitting the target mark points to obtain a target mark line; And generating an initial label of the image to be identified based on the target mark line and a preset label width.
- 5. The method of claim 4, wherein generating the initial label of the image to be identified based on the target mark line and a preset label width comprises: Generating a first boundary line and a second boundary line on two sides of the target mark line by taking the target mark line as a center, wherein the distance between the first boundary line and the second boundary line is a preset label width; And taking a border of an area formed by the first boundary line and the second boundary line as an initial label of the image to be identified.
- 6. The method according to claim 1, wherein the adjusting the initial tag according to the real edge condition of the image to be identified to obtain the target tag of the image to be identified includes: And adjusting the positions of the marking points and/or the number of the marking points corresponding to the initial label according to the real edge condition of the image to be identified until the similarity between the initial label and the real edge condition of the image to be identified is higher than a threshold value, so as to obtain the target label of the image to be identified.
- 7. A method of measurement, the method comprising: acquiring a target image corresponding to an object to be measured; performing edge detection on the target image by using a target detection model obtained based on the model training method according to any one of claims 1 to 6 to obtain a target edge; And determining a target size of the target edge, and determining a measurement result of the object to be measured based on the target size.
- 8. A model training apparatus, the apparatus comprising: The edge detection module is used for carrying out edge detection on the image to be identified based on the edge detection model to obtain an edge detection result, wherein the image to be identified is a sample image of the label to be marked; The label generating module is used for generating an initial label of the image to be identified according to the edge detection result; The label adjusting module is used for adjusting the initial label according to the real edge condition of the image to be identified to obtain a target label of the image to be identified; and the model training module is used for training the candidate detection model based on the sample image and the target label of the sample image until the training condition is reached, so as to obtain the target detection model for edge detection.
- 9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any of claims 1 to 7 when the computer program is executed.
- 10. A computer program product comprising a computer program, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 7.
Description
Model training method, measuring method, device, equipment and program product The application relates to a patent application division application of 2025, 10 and 24 days, 202511527789.0, an intelligent labeling method, a model training and measuring method, a device, equipment and a medium. Technical Field The present application relates to the field of artificial intelligence technology, and in particular, to a model training method, a model measurement device, a computer device, and a computer program product. Background The image measuring device (such as an image measuring instrument or a flash measuring instrument) can realize precise measurement of the surface size, the outline, the angle, the position, the form and position tolerance and the like of various complex parts. In practical application, geometric features (such as planes, lines and points) of the workpiece can be extracted through the image measuring instrument, and length or angle information of the geometric features is calculated, so that whether machining precision of the workpiece meets requirements can be judged. With the rapid development of artificial intelligence technology, image measurements may be made based on an artificial intelligence (ARTIFICIAL INTELLIGENCE, AI) model. However, when training the AI model in the image measuring instrument, a large number of sample images are often required, and each sample image needs to be labeled. In the traditional technology, when labeling of the sample image is carried out, the sample image is often drawn one by manual work, which requires a great deal of repeated labor, and the label generation efficiency is low. Disclosure of Invention In view of the foregoing, it is desirable to provide a model training method and a measuring method, an apparatus, a computer device, a computer-readable storage medium, and a computer program product that can improve label generation efficiency. In a first aspect, the present application provides a model training method, including: performing edge detection on an image to be identified based on an edge detection model to obtain an edge detection result, wherein the image to be identified is a sample image of a label to be marked; Generating an initial label of the image to be identified according to the edge detection result; adjusting the initial label according to the real edge condition of the image to be identified to obtain a target label of the image to be identified; And training the candidate detection model based on the sample image and the target label of the sample image until the training condition is reached, so as to obtain the target detection model for edge detection. In a second aspect, the present application further provides a model training apparatus, including: The edge detection module is used for carrying out edge detection on the image to be identified based on the edge detection model to obtain an edge detection result, wherein the image to be identified is a sample image of the label to be marked; The label generating module is used for generating an initial label of the image to be identified according to the edge detection result; The label adjusting module is used for adjusting the initial label according to the real edge condition of the image to be identified to obtain a target label of the image to be identified; and the model training module is used for training the candidate detection model based on the sample image and the target label of the sample image until the training condition is reached, so as to obtain the target detection model for edge detection. In a third aspect, the present application also provides a computer device comprising a memory storing a computer program and a processor implementing the steps of the model training method provided in the first aspect when the computer program is executed by the processor. In a fourth aspect, the present application also provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the model training method provided in the first aspect. In a fifth aspect, the application also provides a computer program product comprising a computer program which, when executed by a processor, implements the steps of the model training method provided in the first aspect. In a sixth aspect, the present application provides a measurement method comprising: acquiring a target image corresponding to an object to be measured; Performing edge detection on the target image through a target detection model based on the model training method to obtain a target edge; And determining a target size of the target edge, and determining a measurement result of the object to be measured based on the target size. In a seventh aspect, the present application also provides a measurement device, including: The image acquisition module is used for acquiring a target image corresponding to the object to be measured;