CN-121999298-A - Model training method, measuring method and device and computer equipment
Abstract
The application relates to a model training method, a model measuring device and computer equipment. The model training method comprises the steps of obtaining a scanning image by using an image measuring device, drawing a feature measuring area in the scanning image to conduct edge detection so as to obtain an edge detection result of a target edge in the feature measuring area, obtaining an image to be recognized based on the feature measuring area and the scanning image, obtaining an initial label of the image to be recognized based on the edge detection result, adjusting the initial label according to the real edge condition corresponding to the image to be recognized so as to obtain a target label of the image to be recognized, and training a candidate detection model based on the image to be recognized and the target label of the image to be recognized until training conditions are reached so as to obtain the target detection model. By adopting the method, the label generation efficiency and the label accuracy can be improved.
Inventors
- PENG MENG
- LI ZHAOSHUN
- HE JUNLI
- LIU MAOMAO
- LAI SHENGHUI
- WANG JIANQIANG
Assignees
- 深圳市中图仪器股份有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20251024
Claims (10)
- 1. A method of model training, the method comprising: acquiring a scanning image by using an image measuring device; Drawing a characteristic measurement region in the scanned image to perform edge detection so as to obtain an edge detection result of the target edge in the characteristic measurement region; Obtaining an image to be identified based on the characteristic measurement area and the scanning image, and obtaining an initial label of the image to be identified based on the edge detection result; Adjusting the initial label according to the real edge condition corresponding to 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 image to be identified and the target label of the image to be identified until the training condition is reached, so as to obtain the target detection model.
- 2. The method according to claim 1, wherein the training the candidate detection model based on the image to be identified and the target label of the image to be identified until the training condition is reached, to obtain the target detection model, includes: identifying edge features of the image to be identified based on a candidate detection model to obtain a predicted edge of the image to be identified; and adjusting parameters of the candidate detection model according to the difference between the predicted edge and the target edge of the target label of the image to be identified until the difference between the predicted edge and the target edge is smaller than a difference threshold value, so as to obtain the target detection model.
- 3. The method according to claim 1, wherein the training the candidate detection model based on the image to be identified and the target label of the image to be identified until the training condition is reached, to obtain the target detection model, includes: Classifying the target labels of the images to be identified to obtain at least one type of label; Training candidate detection models sequentially through the labels of each category and the corresponding images to be identified until the predicted edges obtained by carrying out edge feature identification on the images to be identified corresponding to the labels of each category by the candidate detection models meet preset conditions, and obtaining target detection models.
- 4. The method according to claim 1, wherein the training the candidate detection model based on the image to be identified and the target label of the image to be identified until the training condition is reached, to obtain the target detection model, includes: determining a target category label from the target labels of the images to be identified; And training the candidate detection model based on the target class label and the image to be identified corresponding to the target class label until a training condition is reached, so as to obtain the target detection model.
- 5. The method according to claim 1, wherein the candidate detection model is obtained through training, and the training manner of the candidate detection model comprises: shooting a sample through an image measuring instrument to obtain a partial sample image, and drawing a label of the partial sample image; A candidate detection model is trained based on the partial sample image and the labels of the partial sample image.
- 6. The method of claim 1, wherein the obtaining an image to be identified based on the feature measurement region and the scanned image comprises: And on the scanned image, the image to be identified is obtained after the characteristic measurement area is expanded to the periphery.
- 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. The method of claim 7, wherein the object detection model comprises a plurality of object detection models arranged in a predetermined order, wherein edge detection is performed on the object image by the object detection models to obtain an object edge, and wherein if edge detection is successfully performed on the object image by a first object detection model, the edge detected by the first object detection model is used as the object edge; And if the edge detection is not successfully performed on the target image through the first target detection model, performing edge detection on the target image through the second target detection model according to the preset sequence until the edge detection is successful, and taking the edge detected by the target detection model corresponding to the successful edge detection as a target edge.
- 9. A model training apparatus, the apparatus comprising: the image measuring device comprises an edge detecting module, a characteristic measuring area drawing module and a characteristic measuring module, wherein the edge detecting module is used for acquiring a scanning image by utilizing the image measuring device, drawing the characteristic measuring area in the scanning image and carrying out edge detection so as to acquire an edge detecting result of a target edge in the characteristic measuring area; The label acquisition module is used for acquiring an image to be identified based on the characteristic measurement area and the scanning image and acquiring an initial label of the image to be identified based on the edge detection result; the label adjusting module is used for adjusting the initial label according to the real edge condition corresponding to 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 image to be identified and the target label of the image to be identified until the training condition is reached, so as to obtain the target detection model.
- 10. 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 one of claims 1 to 8 when the computer program is executed.
Description
Model training method, measuring method and device and computer equipment The application relates to a method for generating labels, a method for training models and measuring models, a device, equipment and media, which are classified application of patent application with the application date of 2025, 10, 24 and the application number of 202511528434.3. Technical Field The present application relates to the field of artificial intelligence technology, and in particular, to a model training method, a model measuring device, and a computer device. 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: acquiring a scanning image by using an image measuring device; Drawing a characteristic measurement region in the scanned image to perform edge detection so as to obtain an edge detection result of the target edge in the characteristic measurement region; Obtaining an image to be identified based on the characteristic measurement area and the scanning image, and obtaining an initial label of the image to be identified based on the edge detection result; Adjusting the initial label according to the real edge condition corresponding to 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 image to be identified and the target label of the image to be identified until the training condition is reached, so as to obtain the target detection model. In a second aspect, the present application further provides a model training apparatus, including: the image measuring device comprises an edge detecting module, a characteristic measuring area drawing module and a characteristic measuring module, wherein the edge detecting module is used for acquiring a scanning image by utilizing the image measuring device, drawing the characteristic measuring area in the scanning image and carrying out edge detection so as to acquire an edge detecting result of a target edge in the characteristic measuring area; The label acquisition module is used for acquiring an image to be identified based on the characteristic measurement area and the scanning image and acquiring an initial label of the image to be identified based on the edge detection result; the label adjusting module is used for adjusting the initial label according to the real edge condition corresponding to 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 image to be identified and the target label of the image to be identified until the training condition is reached, so as to obtain the target detection model. 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 ta