CN110728663A - Intelligent detection method for diamond content - Google Patents

Intelligent detection method for diamond content Download PDF

Info

Publication number
CN110728663A
CN110728663A CN201910923863.9A CN201910923863A CN110728663A CN 110728663 A CN110728663 A CN 110728663A CN 201910923863 A CN201910923863 A CN 201910923863A CN 110728663 A CN110728663 A CN 110728663A
Authority
CN
China
Prior art keywords
detection
diamond
picture
detected
slices
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Withdrawn
Application number
CN201910923863.9A
Other languages
Chinese (zh)
Inventor
宋艳枝
邱安东
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Mdt Infotech Ltd Hefei Hefei
Original Assignee
Mdt Infotech Ltd Hefei Hefei
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Mdt Infotech Ltd Hefei Hefei filed Critical Mdt Infotech Ltd Hefei Hefei
Priority to CN201910923863.9A priority Critical patent/CN110728663A/en
Publication of CN110728663A publication Critical patent/CN110728663A/en
Withdrawn legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/60Rotation of whole images or parts thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20016Hierarchical, coarse-to-fine, multiscale or multiresolution image processing; Pyramid transform
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30168Image quality inspection

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Data Mining & Analysis (AREA)
  • Quality & Reliability (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • General Engineering & Computer Science (AREA)
  • Image Analysis (AREA)

Abstract

The invention discloses an intelligent detection method for diamond inclusions, and relates to the technical field of diamond detection. Preprocessing a diamond picture to be detected to prepare four slices to be detected, detecting the slices to be detected by adopting a trained FPN detection network model to obtain a detection result set corresponding to the slices to be detected; directly integrating the detection result in the non-overlapping area on a diamond picture to be detected; and integrating the detection results in the overlapping region onto the picture of the diamond to be detected according to an integration strategy. The isomorphic shot diamond picture is subjected to image preprocessing, vgg16 or resnet50 or resnet101 is used as a bottom network of a bottom network, an inclusion detection model is trained, a test set is predicted, and the detection results of four slices are integrated and output, so that the picture detection effect is improved; the detection results of the four slices are integrated according to the original diamond image to obtain the final detection result, so that the position and the category of the diamond content can be accurately detected.

Description

Intelligent detection method for diamond content
Technical Field
The invention belongs to the technical field of diamond detection, and particularly relates to an intelligent detection method for diamond inclusions.
Background
Target detection is a process of obtaining category information and position information of a target object.
The grade of diamond clarity directly determines the value of the diamond, and the type, location and amount of diamond inclusions are the basis for grading the diamond clarity. The diamond inclusion classes are mainly feather cracks, crystallines, clouds, needles, spikes, twins and other unusual inclusion types. The quality of diamond picture, the environment, illumination variation, and light reflection and refraction are all the major problems for detecting the diamond content. In addition to the wide variety of inclusion classes and the extremely small size of some inclusions, the detection of diamond inclusions is a difficult problem. The deep learning technology is excellent in performance in the field of computer vision, and the characteristic pyramid network model achieves good effect in the aspect of small target detection.
The invention provides an intelligent detection method for diamond inclusion.
Disclosure of Invention
The invention aims to provide an intelligent detection method for diamond content, which comprises the steps of carrying out image preprocessing on a shot diamond picture, using resnet101 as a bottom layer network of a characteristic pyramid network, training a content detection model, predicting a test set, integrating detection results of four slices and outputting, and improving the picture detection effect.
In order to solve the technical problems, the invention is realized by the following technical scheme:
the invention relates to an intelligent detection method of diamond inclusion, which comprises the following steps:
the method comprises the following steps: shooting a plurality of diamond sample pictures, and preprocessing the diamond sample pictures to prepare a training set;
the pretreatment comprises background removal of a diamond sample picture and slice pretreatment to obtain four sample slices; the training set comprises a plurality of sample slices formed through pretreatment;
step two: selecting an underlying network model and training an FPN detection network model by adopting a training set;
the FPN detection network model adopts vgg16 or resnet50 or resnet101 as an underlying network;
step three: preprocessing a diamond picture to be detected to prepare four slices to be detected, and detecting the slices to be detected by adopting a trained FPN detection network model to obtain a detection result set corresponding to the slices to be detected;
wherein the detection result set comprises a plurality of detection results; the detection result comprises a detection frame and an inclusion category; the detection frame is a rectangular coordinate area containing inclusions;
step four: directly integrating the detection result in the non-overlapping area on a diamond picture to be detected; wherein, the overlapped area of the four diamond pictures to be detected is an overlapped area; the regions other than the overlapping region are non-overlapping regions;
step five: and integrating the detection results in the overlapping region onto the picture of the diamond to be detected according to an integration strategy.
Preferably, the removing the background in the first step includes: detecting the edge of a diamond sample picture through an edge detection algorithm and outwards expanding 10 pixels along the edge of the diamond sample picture to obtain an expanded diamond picture;
the slice pretreatment in the step one comprises the following steps:
expanding the expanded diamond picture again to form a circumscribed square picture of the expanded diamond picture and setting the re-expanded part to be black;
taking the lower left corner of the circumscribed square picture as an origin O and taking the side length of the circumscribed square picture as a unit length 1; cutting a first sample slice with a vertical line x being 3/5 and a horizontal line y being 2/5; a second specimen slice is cut at line x-2/5 and line y-2/5; a third specimen slice is cut at line x-3/5 and line y-3/5; a fourth sample slice was cut at line x-2/5 and line y-3/5;
the second, third and fourth sample slices are rotated 90 °, 270 ° and 180 ° counterclockwise, respectively.
Preferably, the integration strategy in step five comprises the following:
traversing the detection result of the overlapping area and judging whether the current detection result is the same as the inclusion types of other detection results in the overlapping area;
if the inclusion types of the two detection results are the same and IoU is larger than 0.4; then retaining the detection result with high probability of the detection category; if the class probability is detected, the detection result with the large detection frame is reserved;
if the inclusion types of the two detection results are the same and 80% of the area of one detection frame is contained in the other detection frame; reserving a detection result corresponding to the next detection frame;
if the two detection results are different and IoU is greater than 0.7; then retaining the detection result with high probability of the detection category; if the class probability is detected, the detection result with the large detection frame is reserved;
wherein IoU is the intersection area/union area of two detection boxes.
The invention has the following beneficial effects:
according to the invention, image preprocessing is carried out on shot diamond pictures, a resnet101 is used as a bottom layer network of a characteristic pyramid network, an inclusion detection model is trained, a test set is predicted, and the picture detection effect is improved by integrating and outputting detection results of four slices; the detection results of the four slices are integrated by contrasting the original diamond image to obtain the final detection result, so that the positions and the types of the diamond inclusions can be accurately detected, and a certain basis and guarantee are provided for grading the diamond cleanliness.
Of course, it is not necessary for any product in which the invention is practiced to achieve all of the above-described advantages at the same time.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a flow chart of a method of intelligent detection of diamond inclusions in accordance with the present invention;
FIG. 2 is a schematic diagram of the present invention illustrating the pretreatment of a diamond picture to be detected to form four slices to be detected;
fig. 3 is a schematic diagram of the FPN model in the invention with resnet101 as the underlying network.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, the present invention is a method for intelligently detecting diamond inclusions, comprising the following steps:
the method comprises the following steps: shooting a plurality of diamond sample pictures, and preprocessing the diamond sample pictures to prepare a training set;
the method comprises the following steps of preprocessing, wherein preprocessing comprises removing a background of a diamond sample picture and preprocessing slices to obtain four sample slices; the training set comprises a plurality of sample slices formed through pretreatment;
wherein removing the background comprises: detecting the edge of a diamond sample picture through an edge detection algorithm and outwards expanding 10 pixels along the edge of the diamond sample picture to obtain an expanded diamond picture;
the slice pretreatment comprises the following steps:
expanding the expanded diamond picture again to form a circumscribed square picture of the expanded diamond picture and setting the re-expanded part to be black;
taking the left lower corner of the circumscribed square picture as an origin O and taking the side length of the circumscribed square picture as a unit length 1; cutting a first sample slice with a vertical line x being 3/5 and a horizontal line y being 2/5, wherein the obtained first sample slice area is 0< x <3/5, 1> y > 2/5; a second specimen slice is cut at the vertical line x-2/5 and the horizontal line y-2/5, at which time the second specimen slice region is obtained as 2/5< x <1 and 2/5< y < 1; a third specimen slice is cut at 3/5 vertical line x and 3/5 horizontal line y, and the area of the third specimen slice is 0< x <3/5 and 0< y < 3/5; a fourth sample slice was taken at a vertical line x 2/5 and a horizontal line y 3/5, where the fourth sample slice was taken at a region of 2/5< x <1, 0< y < 3/5; rotating the second sample slice, the third sample slice and the fourth sample slice by 90 degrees, 270 degrees and 180 degrees counterclockwise respectively; referring to FIG. 2: the resulting final fig. 2 top left: first sample section, upper right in fig. 2: second sample section, bottom left in fig. 2: third sample section and bottom left in fig. 2: and a fourth sample section.
Step two: selecting an underlying network model and training an FPN detection network model by adopting a training set;
the FPN detection network model adopts vgg16 or resnet50 or resnet101 as an underlying network; the FPN network simultaneously utilizes low-level features and high-level features to respectively predict at different feature levels simultaneously, integrates information of different semantic features and different resolutions, and has more advantages in small target detection. Referring to fig. 3, the FPN model uses resnet101 as a schematic diagram under the underlying network;
step three: preprocessing a diamond picture to be detected to prepare four slices to be detected, and detecting the slices to be detected by adopting a trained FPN detection network model to obtain a detection result set corresponding to the slices to be detected;
wherein the detection result set comprises a plurality of detection results; the detection result comprises a detection frame and an inclusion category; the detection frame is a rectangular coordinate area containing the content;
step four: directly integrating the detection result in the non-overlapping area on a diamond picture to be detected; wherein, the overlapped area of the four diamond pictures to be detected is an overlapped area; the regions other than the overlapping region are non-overlapping regions; the diamond sample picture pretreatment in the step one is the same as the diamond sample picture pretreatment in the step one, and the four slices to be detected are respectively a first slice to be detected, a second slice to be detected, a third slice to be detected and a fourth slice to be detected; before the fourth step, the second to-be-detected slice, the third to-be-detected slice and the fourth to-be-detected slice are correspondingly rotated clockwise by 90 degrees, 270 degrees and 180 degrees;
step five: and integrating the detection results in the overlapping region onto the picture of the diamond to be detected according to an integration strategy. Wherein, the integration strategy comprises the following steps:
traversing the detection result of the overlapping area and judging whether the current detection result is the same as the inclusion types of other detection results in the overlapping area;
if the inclusion types of the two detection results are the same and IoU is larger than 0.4; then retaining the detection result with high probability of the detection category; if the class probability is detected, the detection result with the large detection frame is reserved;
if the inclusion types of the two detection results are the same and 80% of the area of one detection frame is contained in the other detection frame; reserving a detection result corresponding to the next detection frame;
if the two detection results are different and IoU is greater than 0.7; then retaining the detection result with high probability of the detection category; if the class probability is detected, the detection result with the large detection frame is reserved;
wherein IoU is the intersection area/union area of two detection boxes.
It should be noted that, in the above system embodiment, each included unit is only divided according to functional logic, but is not limited to the above division as long as the corresponding function can be implemented; in addition, specific names of the functional units are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present invention.
In addition, it is understood by those skilled in the art that all or part of the steps in the method for implementing the embodiments described above may be implemented by a program instructing associated hardware, and the corresponding program may be stored in a computer-readable storage medium.
The preferred embodiments of the invention disclosed above are intended to be illustrative only. The preferred embodiments are not intended to be exhaustive or to limit the invention to the precise embodiments disclosed. Obviously, many modifications and variations are possible in light of the above teaching. The embodiments were chosen and described in order to best explain the principles of the invention and the practical application, to thereby enable others skilled in the art to best utilize the invention. The invention is limited only by the claims and their full scope and equivalents.

Claims (3)

1. An intelligent detection method for diamond content is characterized by comprising the following steps:
the method comprises the following steps: shooting a plurality of diamond sample pictures, and preprocessing the diamond sample pictures to prepare a training set;
the pretreatment comprises background removal of a diamond sample picture and slice pretreatment to obtain four sample slices; the training set comprises a plurality of sample slices formed through pretreatment;
step two: selecting an underlying network model and training an FPN detection network model by adopting a training set;
the FPN detection network model adopts vgg16 or resnet50 or resnet101 as an underlying network;
step three: preprocessing a diamond picture to be detected to prepare four slices to be detected, and detecting the slices to be detected by adopting a trained FPN detection network model to obtain a detection result set corresponding to the slices to be detected;
wherein the detection result set comprises a plurality of detection results; the detection result comprises a detection frame and an inclusion category; the detection frame is a rectangular coordinate area containing inclusions;
step four: directly integrating the detection result in the non-overlapping area on a diamond picture to be detected; wherein, the overlapped area of the four diamond pictures to be detected is an overlapped area; the regions other than the overlapping region are non-overlapping regions;
step five: and integrating the detection results in the overlapping region onto the picture of the diamond to be detected according to an integration strategy.
2. The method of claim 1, wherein said background removal step comprises: detecting the edge of a diamond sample picture through an edge detection algorithm and outwards expanding 10 pixels along the edge of the diamond sample picture to obtain an expanded diamond picture;
the slice pretreatment in the step one comprises the following steps:
expanding the expanded diamond picture again to form a circumscribed square picture of the expanded diamond picture and setting the re-expanded part to be black;
taking the lower left corner of the circumscribed square picture as an origin O and taking the side length of the circumscribed square picture as a unit length 1; cutting a first sample slice with a vertical line x being 3/5 and a horizontal line y being 2/5; a second specimen slice is cut at line x-2/5 and line y-2/5; a third specimen slice is cut at line x-3/5 and line y-3/5; a fourth sample slice was cut at line x-2/5 and line y-3/5;
the second, third and fourth sample slices are rotated 90 °, 270 ° and 180 ° counterclockwise, respectively.
3. The method of claim 1, wherein the integration strategy in step five comprises the following steps:
traversing the detection result of the overlapping area and judging whether the current detection result is the same as the inclusion types of other detection results in the overlapping area;
if the inclusion types of the two detection results are the same and IoU is larger than 0.4; then retaining the detection result with high probability of the detection category; if the class probability is detected, the detection result with the large detection frame is reserved;
if the inclusion types of the two detection results are the same and 80% of the area of one detection frame is contained in the other detection frame; reserving a detection result corresponding to the next detection frame;
if the two detection results are different and IoU is greater than 0.7; then retaining the detection result with high probability of the detection category; if the class probability is detected, the detection result with the large detection frame is reserved;
wherein IoU is the intersection area/union area of two detection boxes.
CN201910923863.9A 2019-09-27 2019-09-27 Intelligent detection method for diamond content Withdrawn CN110728663A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910923863.9A CN110728663A (en) 2019-09-27 2019-09-27 Intelligent detection method for diamond content

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910923863.9A CN110728663A (en) 2019-09-27 2019-09-27 Intelligent detection method for diamond content

Publications (1)

Publication Number Publication Date
CN110728663A true CN110728663A (en) 2020-01-24

Family

ID=69218464

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910923863.9A Withdrawn CN110728663A (en) 2019-09-27 2019-09-27 Intelligent detection method for diamond content

Country Status (1)

Country Link
CN (1) CN110728663A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113344084A (en) * 2021-06-16 2021-09-03 国家珠宝检测中心(广东)有限责任公司 Jewelry quality identification method and device based on image recognition

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113344084A (en) * 2021-06-16 2021-09-03 国家珠宝检测中心(广东)有限责任公司 Jewelry quality identification method and device based on image recognition

Similar Documents

Publication Publication Date Title
CN111784685B (en) Power transmission line defect image identification method based on cloud edge cooperative detection
CN110310264B (en) DCNN-based large-scale target detection method and device
CN111640125B (en) Aerial photography graph building detection and segmentation method and device based on Mask R-CNN
CN109448001B (en) Automatic picture clipping method
CN111191570B (en) Image recognition method and device
CN109671058B (en) Defect detection method and system for large-resolution image
CN112070135B (en) Power equipment image detection method and device, power equipment and storage medium
CN105260749B (en) Real-time target detection method based on direction gradient binary pattern and soft cascade SVM
CN116485709A (en) Bridge concrete crack detection method based on YOLOv5 improved algorithm
CN112560675B (en) Bird visual target detection method combining YOLO and rotation-fusion strategy
CN111259878A (en) Method and equipment for detecting text
CN106599025B (en) Vector data slicing method and system based on data exchange format
CN111027538A (en) Container detection method based on instance segmentation model
CN110599453A (en) Panel defect detection method and device based on image fusion and equipment terminal
WO2022237135A1 (en) Target object recognition method and apparatus
CN116071651B (en) Voltage equalizing field identification method and device, storage medium and terminal
CN111652140A (en) Method, device, equipment and medium for accurately segmenting questions based on deep learning
CN111242066A (en) Large-size image target detection method and device and computer readable storage medium
CN114998337A (en) Scratch detection method, device, equipment and storage medium
CN110728663A (en) Intelligent detection method for diamond content
CN113870196A (en) Image processing method, device, equipment and medium based on anchor point cutting graph
CN113988222A (en) Forest fire detection and identification method based on fast-RCNN
CN110298838A (en) A kind of method, apparatus, equipment and the storage medium of determining sample image
CN116091784A (en) Target tracking method, device and storage medium
CN114862642A (en) Method for removing short video visible watermark and computer readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB03 Change of inventor or designer information
CB03 Change of inventor or designer information

Inventor after: Song Yanzhi

Inventor after: Zhang Jiajun

Inventor before: Song Yanzhi

Inventor before: Qiu Andong

WW01 Invention patent application withdrawn after publication
WW01 Invention patent application withdrawn after publication

Application publication date: 20200124