CN-121998964-A - Glass defect detection method, device, computer equipment and storage medium
Abstract
The application relates to a glass defect detection method, a device, computer equipment and a storage medium, wherein the method comprises the steps of obtaining training image data corresponding to a first glass to be detected; the method comprises the steps of training a preset defect detection model by using training image data to obtain a target defect detection model, training the target defect detection model in a multi-mode based on text prompt information, material model information and defect labeling information, obtaining to-be-detected image data corresponding to second to-be-detected glass, enabling the second to-be-detected glass to be different from the first to-be-detected glass in model, and carrying out defect detection on the to-be-detected image data by using the target defect detection model to obtain a defect detection result corresponding to the second to-be-detected glass. By adopting the method and the device, the detection efficiency of the glass defects can be improved.
Inventors
- ZHOU ZHENDONG
- CHEN PENGGUANG
- Kuang Hongfa
- LIU SHU
Assignees
- 深圳思谋信息科技有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20260206
Claims (10)
- 1. A method for detecting glass defects, comprising: acquiring training image data corresponding to a first glass to be detected; training a preset defect detection model by using the training image data to obtain a target defect detection model, wherein the target defect detection model is obtained by training in a multi-mode based on text prompt information, material model information and defect labeling information; Acquiring to-be-detected image data corresponding to second to-be-detected glass, wherein the types of the second to-be-detected glass and the first to-be-detected glass are different; And performing defect detection on the image data to be detected by using the target defect detection model to obtain a defect detection result corresponding to the second glass to be detected.
- 2. The method of claim 1, wherein the training image data comprises first glass model feature map data and defect labeling image data, the first glass model being a model of the first glass to be detected; training a preset defect detection model by using the training image data to obtain a target defect detection model, wherein the training image data comprises the following steps: determining prompt word data corresponding to the first glass model feature map data; Training a preset defect detection model by using the first glass model feature map data, the defect labeling image data and the prompt word data to obtain a target defect detection model.
- 3. The method according to claim 2, wherein training the preset defect detection model by using the first glass model feature map data, the defect labeling image data and the cue word data to obtain a target defect detection model comprises: processing the prompt word data through a first feature extraction model to obtain first feature data; Processing the first glass model feature map data through a second feature extraction model to obtain second feature data; Fusing the first characteristic data and the second characteristic data to obtain first fused characteristic data; Fusing the first fusion characteristic data and the defect labeling image data to obtain second fusion characteristic data; Training a preset defect detection model by using the first fusion characteristic data and the second fusion characteristic data to obtain a target defect detection model.
- 4. The method of claim 3, wherein training a preset defect detection model using the first fused feature data and the second fused feature data to obtain a target defect detection model comprises: processing the first fusion characteristic data and the second fusion characteristic data through a defect detection model to obtain a predicted defect detection result; Obtaining a real defect detection result corresponding to the first glass to be detected; determining model loss according to a preset loss function, the predicted defect detection result and the real defect detection result; And updating parameters of the defect detection model according to the model loss to obtain a target defect detection model.
- 5. The method according to claim 3 or 4, wherein the fusing the first feature data and the second feature data to obtain first fused feature data includes: And fusing the first characteristic data and the second characteristic data based on a cross self-attention mechanism to obtain first fused characteristic data.
- 6. The method according to any one of claims 1 to 4, wherein the acquiring the image data to be detected corresponding to the second glass to be detected includes: determining a reference image corresponding to the second glass to be detected; determining a reference feature map corresponding to the reference image; and determining image data to be detected according to the reference feature map.
- 7. The method of claim 3, wherein the first feature extraction model comprises a contrasted language-image pre-training model and the second feature extraction model comprises a visual transformation feature extraction model.
- 8. A glass defect detection apparatus, comprising: the first acquisition module is used for acquiring training image data corresponding to the first glass to be detected; the model training module is used for training a preset defect detection model by utilizing the training image data to obtain a target defect detection model, wherein the target defect detection model is obtained by training in a multi-mode based on text prompt information, material model information and defect labeling information; The system comprises a first acquisition module, a second acquisition module and a detection module, wherein the first acquisition module is used for acquiring to-be-detected image data corresponding to a first to-be-detected glass; And the defect detection module is used for carrying out defect detection on the image data to be detected by utilizing the target defect detection model to obtain a defect detection result corresponding to the second glass to be detected.
- 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 readable storage medium, on which a computer program is stored, 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
Glass defect detection method, device, computer equipment and storage medium Technical Field The present application relates to the field of defect detection technologies, and in particular, to a method and apparatus for detecting glass defects, a computer device, and a storage medium. Background Glass is used as a core component of a display device of equipment, and the surface quality of the glass directly determines the display effect. In the production process, the surface of the glass is easy to generate defects such as scratches, stains and the like, the display quality of the defects can be reduced, and the whole display device can be scrapped when the defects are serious, so that the accurate detection of the defects of the glass is very important. At present, a glass defect detection method generally aims at marking defects of a single type of glass, a defect detection model is trained by marking data, and the trained defect detection model is used for detecting the type of glass. The method is simple to operate and can process a large amount of detection data, but when the type of the glass to be detected changes, the original model cannot identify the structural characteristics of the glass with the new type due to the structural difference of the glass with the new type and the old type, and the structural difference is easily misjudged as a defect, so that the over-killing phenomenon is caused. In order to solve the problem, new model needs to be acquired again, marked manually and trained, and therefore detection efficiency is low. Therefore, how to improve the detection efficiency of glass defects is a problem to be solved. Disclosure of Invention In view of the foregoing, it is desirable to provide a method, an apparatus, a computer device, and a storage medium for detecting glass defects, which can improve the efficiency of detecting glass defects. In a first aspect, the present application provides a glass defect detection method, comprising: acquiring training image data corresponding to a first glass to be detected; Training a preset defect detection model by using training image data to obtain a target defect detection model, wherein the target defect detection model is obtained by training in a multi-mode based on text prompt information, material model information and defect labeling information; acquiring to-be-detected image data corresponding to a second to-be-detected glass, wherein the types of the second to-be-detected glass and the first to-be-detected glass are different; And performing defect detection on the image data to be detected by using the target defect detection model to obtain a defect detection result corresponding to the second glass to be detected. In a second aspect, the present application provides a glass defect detection apparatus comprising: the first acquisition module is used for acquiring training image data corresponding to the first glass to be detected; The model training module is used for training a preset defect detection model by utilizing training image data to obtain a target defect detection model, wherein the target defect detection model is obtained by training in a multi-mode based on text prompt information, material model information and defect labeling information; The second acquisition module is used for acquiring to-be-detected image data corresponding to the second to-be-detected glass, wherein the types of the second to-be-detected glass and the first to-be-detected glass are different; And the defect detection module is used for carrying out defect detection on the image data to be detected by utilizing the target defect detection model to obtain a defect detection result corresponding to the second glass to be detected. In a third aspect, the application provides a computer device comprising a memory storing a computer program and a processor implementing the steps of the method described above when the processor executes the computer program. In a fourth aspect, the present application provides a computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of the method described above. In a fifth aspect, the application provides a computer program product comprising a computer program which, when executed by a processor, implements the steps of the method described above. According to the glass defect detection method, the device, the computer equipment and the storage medium, the training image data of the first glass to be detected is obtained, and the defect detection model is trained, so that the target defect detection model capable of being used for multiplexing in a cross-model mode is obtained, the model can directly detect the defects of the image data to be detected of the second glass to be detected of different models, the defect data do not need to be acquired again and marked during the model changing, a new model is trained, the time consumption of m