CN110542659B - Pearl luster detection method based on visible light spectrum - Google Patents

Pearl luster detection method based on visible light spectrum Download PDF

Info

Publication number
CN110542659B
CN110542659B CN201910842953.5A CN201910842953A CN110542659B CN 110542659 B CN110542659 B CN 110542659B CN 201910842953 A CN201910842953 A CN 201910842953A CN 110542659 B CN110542659 B CN 110542659B
Authority
CN
China
Prior art keywords
spectrum
pearl
vector
abnormal
training
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.)
Expired - Fee Related
Application number
CN201910842953.5A
Other languages
Chinese (zh)
Other versions
CN110542659A (en
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.)
Sichuan University
Original Assignee
Sichuan University
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 Sichuan University filed Critical Sichuan University
Priority to CN201910842953.5A priority Critical patent/CN110542659B/en
Publication of CN110542659A publication Critical patent/CN110542659A/en
Application granted granted Critical
Publication of CN110542659B publication Critical patent/CN110542659B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/17Systems in which incident light is modified in accordance with the properties of the material investigated
    • G01N21/25Colour; Spectral properties, i.e. comparison of effect of material on the light at two or more different wavelengths or wavelength bands
    • G01N21/31Investigating relative effect of material at wavelengths characteristic of specific elements or molecules, e.g. atomic absorption spectrometry
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/23Clustering techniques
    • G06F18/232Non-hierarchical techniques
    • G06F18/2321Non-hierarchical techniques using statistics or function optimisation, e.g. modelling of probability density functions
    • G06F18/23213Non-hierarchical techniques using statistics or function optimisation, e.g. modelling of probability density functions with fixed number of clusters, e.g. K-means clustering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • G06F18/2411Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on the proximity to a decision surface, e.g. support vector machines

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Evolutionary Computation (AREA)
  • Evolutionary Biology (AREA)
  • Artificial Intelligence (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • General Engineering & Computer Science (AREA)
  • Spectroscopy & Molecular Physics (AREA)
  • Analytical Chemistry (AREA)
  • Probability & Statistics with Applications (AREA)
  • Pathology (AREA)
  • Immunology (AREA)
  • General Health & Medical Sciences (AREA)
  • Biochemistry (AREA)
  • Chemical & Material Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Investigating Or Analysing Materials By Optical Means (AREA)

Abstract

The invention discloses a pearl luster detection method based on visible light spectrum, which comprises the steps of obtaining a pearl sample set; randomly measuring h groups of visible light spectrum data on the surface of each pearl in the pearl sample set to obtain visible light spectrum data groups of all pearls in the pearl sample set; preprocessing the obtained visible light spectrum data; performing spectrum exception processing on h groups of spectral data of each pearl in the training sample set and the test sample set respectively to obtain a training spectrum vector set and a test spectrum vector set; respectively extracting the features of the training spectrum vector set and the test spectrum vector set to obtain a training feature vector set and a test feature vector set; training the classification model according to the training feature vector set to obtain a pearl grade recognition model; and testing the test feature vector set by adopting a pearl grade identification model to obtain the gloss grade of the pearl sample corresponding to the test feature vector set. The accuracy and the stability of the identification are obviously improved.

Description

Pearl luster detection method based on visible light spectrum
Technical Field
The invention relates to the technical field of pearl detection, in particular to a visible light spectrum-based pearl luster detection method.
Background
As a large country for culturing fresh water pearls in China, in order to ensure the economic benefit of pearl farmers, the good quality evaluation of pearls is very important, and the existing pearl quality identification technology mainly comprises the following steps:
(1) manual detection, which is also the most common pearl quality identification technology at present in China; however, the identification and recognition of the pearl quality by the detection equipment and the detection method mainly depend on manual completion, so that the identification equipment and the detection method not only need an operator to have higher identification capability, but also have the identification result greatly influenced by external factors such as the eyesight and fatigue of the operator, and have poor detection reliability and efficiency.
(2) Machine vision, several organizations in China at present propose to process pearl images by using an image detection method, and further realize the identification and classification of pearls; however, the method is greatly influenced by image quality, and the processing process does not consider the surface gloss non-uniformity characteristic of the pearl, so that the method cannot be well suitable for pearl gloss detection; in addition, the prior art is difficult to realize large-scale detection, requires higher professional techniques for operators, and fails to obtain good detection precision.
(3) Spectrum detection, few foreign institutions and papers propose to detect pearls by using a spectrum pattern recognition method, however, the methods are not specially designed for gloss quality detection, and a single group of ultraviolet or infrared spectrum data is used as a recognition basis, so that good gloss quality detection precision cannot be obtained.
Disclosure of Invention
In order to overcome the technical problems of poor detection precision and the like of the existing pearls, the invention provides a visible light spectrum-based pearl gloss detection method for solving the problems. The method is based on multiple groups of visible light spectrum data (compound sampling spectrum data) on the surface of the pearl, and combines spectrum exception processing, classification model training and the like to realize high-stability and high-reliability detection of the pearl.
The invention is realized by the following technical scheme:
the pearl luster detection method based on the visible light spectrum comprises the following steps:
step S1, obtaining a pearl sample set, and dividing the pearl sample set into a training sample set and a testing sample set;
step S2, randomly measuring h groups of visible light spectrum data on the surface of each pearl in the pearl sample set to obtain visible light spectrum data sets of all pearls in the pearl sample set; wherein h is an integer and h is not less than 5;
step S3, preprocessing the visible light spectrum data obtained in step S2;
step S4, performing spectrum exception processing on the h groups of spectral data of each pearl in the training sample set and the test sample set respectively to obtain a training spectrum vector set and a test spectrum vector set;
step S5, respectively extracting the features of the training spectrum vector set and the testing spectrum vector set to obtain a training feature vector set and a testing feature vector set;
step S6, training the classification model according to the training feature vector set and the gloss grade label of the corresponding pearl sample to obtain a pearl grade recognition model;
and step S7, testing the test feature vector set by adopting the pearl grade recognition model obtained by training to obtain the gloss grade of the pearl sample corresponding to the test feature vector set.
Preferably, the step S4 of performing spectrum exception processing on the h groups of spectrum data of each pearl in the pearl sample set specifically includes
Step S41, a sliding window coarse shift detection method is adopted to obtain a reference spectrum set and an abnormal spectrum vector through screening;
and step S42, merging the abnormal spectrum vector and the reference spectrum set, and performing type detection and correction on the abnormal spectrum vector by adopting a sliding window coarse shift detection method.
Preferably, the step S41 specifically includes:
step S411, in h sets of spectrum data randomly collected by each pearl, each set of spectrum includes n data points, and the kth set of spectrum vector of the pearl is represented as:
Figure BDA0002194290760000021
wherein k is 1 … h;
step S412, defining the spectrum set of the same pearl as:
Figure BDA0002194290760000022
wherein u represents the same pearl spectrum set
Figure BDA0002194290760000023
The number of the contained spectral vector groups, and initial u is h; calculating the spectrum set of the same pearl
Figure BDA0002194290760000024
Mean spectrum of (a):
Figure BDA0002194290760000025
step S413, calculating the spectrum set of the same pearl
Figure BDA0002194290760000026
Residual error of the s-th set of spectra at each data point:
Figure BDA0002194290760000027
wherein the content of the first and second substances,
Figure BDA0002194290760000028
residual errors at the ith data point;
step S414, calculating the spectrum set of the same pearl
Figure BDA0002194290760000029
Middle and s group spectrum relative mean spectrum
Figure BDA00021942907600000210
The window residual of (d) is:
Figure BDA00021942907600000211
Figure BDA00021942907600000212
wherein t is a window serial number, y is a window width coefficient, and g is a window sliding coefficient; t is the maximum window sequence number;
step S415, window interval abnormality determination: if it is satisfied with
Figure BDA00021942907600000213
The window interval is called as an abnormal window interval; wherein, Delta represents the window interval abnormity discrimination coefficient;
step S416, rejecting the spectral vector with the largest number of abnormal window intervals;
and step S417, iteratively executing the steps S412-S416 until convergence, wherein the residual spectrum vector set during convergence is a reference spectrum set, and the rejected spectrum vector is an abnormal spectrum vector.
Preferably, the step S42 specifically includes:
step S421, abnormal spectral vector is calculated
Figure BDA0002194290760000031
And the reference spectrum set, executing the steps S412-S416 to obtain the number of the window sections judged to be abnormal
Figure BDA0002194290760000032
Step S422, the number of abnormal window sections is judged according to the abnormal spectral vector
Figure BDA0002194290760000033
Determining the type of the abnormal spectral vector; if the local abnormal type spectral vector is determined, go to step S423; if the entire abnormal type spectrum vector is determined, go to step S424;
step S423, correcting the local abnormal type spectrum vector, and iteratively executing the step S421 to the step S423 on the corrected local abnormal spectrum vector until convergence, and obtaining the spectrum vector after the local abnormal type correction when the convergence is achieved;
in step S424, the overall abnormal type spectrum vector is subjected to abnormal type discrimination to obtain an external overall abnormal type spectrum vector and an internal overall abnormal type spectrum vector.
Preferably, the step S4 further includes a step S43, where the spectral vectors of the reference spectral set of all pearls in the training sample set and the spectral vectors after local anomaly correction are combined to form a training spectral vector set; and combining the spectral vectors of the reference spectral set of all pearls in the test sample set, the spectral vectors after local anomaly type correction and the spectral vectors of the external integral anomaly type to form a test spectral vector set.
Preferably, the step S7 specifically includes:
step S71, obtaining the predicted value of each group of feature vectors in the test feature vector set by using the pearl grade recognition model obtained by training;
step S72, a predicted value is supplemented for the spectrum vectors of the internal integral abnormal types which are not reserved in the test sample set;
step S73, calculating the mean value of the predicted values of h groups of characteristic vectors of the pearl samples to be tested in the test sample set;
and step S74, judging the gloss grade of the pearl to be measured according to the mean value of the predicted values.
Preferably, the specific process of extracting the features of the training spectrum vector set in step S5 is as follows:
step S51, carrying out compression mapping on the training spectrum vector set to obtain a mapped reconstruction feature set E;
step S52, determining the dimension D of the reconstruction feature set E;
step S53, calculating the mean value of each dimension characteristic to obtain a gradient diffusion center;
step S54, calculating Euclidean distances from each group of feature vectors to a diffusion center;
step S55, obtaining a gradient step length according to the Euclidean distance of each group of feature vectors and the gradient diffusion coefficient;
step S56, calculating the inclusion rate of the feature vectors of each step, and determining the dense step interval of the feature vectors;
and step S57, taking the feature vector set in the dense step interval as a new reconstruction feature set E, and iteratively executing the steps S52-S57 until convergence, wherein the feature vector set in the dense step interval obtained in convergence is the extracted training feature vector set. The invention adopts a ladder step screening method to screen the feature vector set, and aims to optimize the feature vectors used for modeling so as to improve the detection precision.
Preferably, the specific process of extracting the features of the test spectrum vector set in step S5 is as follows: carrying out compression mapping on the test spectrum vector set to obtain a mapped reconstruction feature set E; and then extracting the front D-dimensional features to form a test feature vector set.
Preferably, the classification model adopted in step S6 is an SVM classifier, a PLS model or an ANN.
The invention has the following advantages and beneficial effects:
the invention is based on the visible light spectrum data of the pearl surface according to the biological characteristics of the manually sorted pearl luster. And the accuracy and the stability of the identification are obviously improved by combining random complex sampling, sliding window coarse offset detection, a feature set screening method for model training based on gradient diffusion, a multi-result judgment mechanism and the like.
Drawings
The accompanying drawings, which are included to provide a further understanding of the embodiments of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the principles of the invention. In the drawings:
FIG. 1 is a flow chart of the method of the present invention.
Detailed Description
Hereinafter, the term "comprising" or "may include" used in various embodiments of the present invention indicates the presence of the invented function, operation or element, and does not limit the addition of one or more functions, operations or elements. Furthermore, as used in various embodiments of the present invention, the terms "comprises," "comprising," "includes," "including," "has," "having" and their derivatives are intended to mean that the specified features, numbers, steps, operations, elements, components, or combinations of the foregoing, are only meant to indicate that a particular feature, number, step, operation, element, component, or combination of the foregoing, and should not be construed as first excluding the existence of, or adding to the possibility of, one or more other features, numbers, steps, operations, elements, components, or combinations of the foregoing.
In various embodiments of the invention, the expression "or" at least one of a or/and B "includes any or all combinations of the words listed simultaneously. For example, the expression "a or B" or "at least one of a or/and B" may include a, may include B, or may include both a and B.
Expressions (such as "first", "second", and the like) used in various embodiments of the present invention may modify various constituent elements in various embodiments, but may not limit the respective constituent elements. For example, the above description does not limit the order and/or importance of the elements described. The foregoing description is for the purpose of distinguishing one element from another. For example, the first user device and the second user device indicate different user devices, although both are user devices. For example, a first element could be termed a second element, and, similarly, a second element could be termed a first element, without departing from the scope of various embodiments of the present invention.
It should be noted that: if it is described that one constituent element is "connected" to another constituent element, the first constituent element may be directly connected to the second constituent element, and a third constituent element may be "connected" between the first constituent element and the second constituent element. In contrast, when one constituent element is "directly connected" to another constituent element, it is understood that there is no third constituent element between the first constituent element and the second constituent element.
The terminology used in the various embodiments of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the various embodiments of the invention. As used herein, the singular forms are intended to include the plural forms as well, unless the context clearly indicates otherwise. Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which various embodiments of the present invention belong. The terms (such as those defined in commonly used dictionaries) should be interpreted as having a meaning that is consistent with their contextual meaning in the relevant art and will not be interpreted in an idealized or overly formal sense unless expressly so defined herein in various embodiments of the present invention.
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is further described in detail below with reference to examples and accompanying drawings, and the exemplary embodiments and descriptions thereof are only used for explaining the present invention and are not meant to limit the present invention.
Example 1
The embodiment proposes a pearl luster detection method based on visible light spectrum, as shown in fig. 1, the detection method comprises the following steps:
and step S1, obtaining a pearl sample set, and dividing the pearl sample set into a training sample set and a testing sample set.
In this embodiment, the selected pearl sample set has the following characteristics: (1) the number of pearl samples with each gloss grade under each color system is not less than 10; (2) the pearl surface characteristics of the training sample set are as uniform as possible. The pearl surface has different structural characteristics at different positions, so that different gloss characteristics are always presented, and in order to ensure that the collected spectrum presents the characteristic of the gloss grade as much as possible, the surface of the pearl to be measured presents the gloss characteristic of the gloss grade as much as possible. For example, the surface of a high gloss pearl exhibits high gloss characteristics throughout the entire surface, but contains regions of medium/low gloss characteristics, and uniformity is desirable to minimize the number of medium/low gloss regions on the surface of the bright pearl.
Step S2, randomly measuring h groups of visible light spectrum data on the surface of each pearl in the pearl sample set to obtain visible light spectrum data sets of all pearls in the pearl sample set; wherein h is an integer and h is not less than 5.
In this embodiment, for spectrum detection, the better the randomness of the spectrum measurement position, and the more reliable the detection result. The stability of the detection result is improved along with the increase of the number of the spectrum complex sampling groups, and then gradually becomes stable, and the stability improvement rate gradually decreases until the stability is close to zero. In this embodiment, at least 5 sets of spectral data are measured randomly.
Step S3, preprocessing the visible light spectrum data obtained in step S2.
In this embodiment, in consideration of noise interference of the collected visible light spectrum raw data, preprocessing operations such as band interception and filtering need to be performed on the visible light spectrum data to eliminate interference of irrelevant bands or non-target factors, so as to improve the signal-to-noise ratio and further improve the detection effect.
And step S4, performing spectrum exception processing on the h groups of spectral data of each pearl in the training sample set and the test sample set respectively to obtain a training spectrum vector set and a test spectrum vector set.
In this embodiment, step S4 adopts a sliding window coarse offset detection method to improve the reliability of data, and the specific process is as follows:
step S41, a sliding window coarse shift detection method is adopted to obtain a reference spectrum set and an abnormal spectrum vector through screening; the specific process is as follows:
step S411, in h sets of spectrum data randomly collected by each pearl, each set of spectrum includes n data points, and the kth set of spectrum vector of the pearl is represented as:
Figure BDA0002194290760000061
wherein k is 1 … h;
step S412, defining the spectrum set of the same pearl as:
Figure BDA0002194290760000062
wherein u represents the same pearl spectrum set
Figure BDA0002194290760000063
The number of the contained spectral vector groups, and initial u is h; calculating the spectrum set of the same pearl
Figure BDA0002194290760000064
Mean spectrum of (a):
Figure BDA0002194290760000065
step S413, calculating the spectrum set of the same pearl
Figure BDA0002194290760000066
Residual error of the s-th set of spectra at each data point:
Figure BDA0002194290760000067
wherein the content of the first and second substances,
Figure BDA0002194290760000068
residual errors at the ith data point;
step S414, calculating the spectrum set of the same pearl
Figure BDA0002194290760000069
Middle and s group spectrum relative mean spectrum
Figure BDA00021942907600000610
The window residual of (d) is:
Figure BDA00021942907600000611
Figure BDA00021942907600000612
wherein t is a window serial number, y is a window width coefficient, and g is a window sliding coefficient; t is the maximum window sequence number;
step S415, window interval abnormality determination: if it is satisfied with
Figure BDA00021942907600000613
The window interval is called as an abnormal window interval; wherein, Delta represents the window interval abnormity discrimination coefficient;
step S416, rejecting the spectral vector with the largest number of abnormal window intervals;
in step S417, steps S412 to S416 are iteratively executed until convergence (i.e., no abnormal window interval exists in the remaining spectral vectors) occurs, the remaining spectral vector set during convergence is the reference spectral set, and the rejected spectral vectors are abnormal spectral vectors.
Step S42, the abnormal spectrum vector and the reference spectrum set are combined, and the type of the abnormal spectrum vector is detected and corrected by adopting a sliding window coarse shift detection method, which comprises the following specific processes:
step S421, abnormal spectral vector is calculated
Figure BDA0002194290760000071
And the reference spectrum set, executing the steps S412-S416 to obtain the number of the window sections judged to be abnormal
Figure BDA0002194290760000072
Step S422, the number of abnormal window sections is judged according to the abnormal spectral vector
Figure BDA0002194290760000073
Determining the type of the abnormal spectral vector; if the local abnormal type spectral vector is determined, go to step S423; if the entire abnormal type spectrum vector is determined, go to step S424;
in this embodiment, the type determination method is as follows: if it is
Figure BDA0002194290760000074
Then call
Figure BDA0002194290760000075
Is an integral abnormal type spectrum vector; if it is
Figure BDA0002194290760000076
Then call
Figure BDA0002194290760000077
Is a local anomaly type spectral vector.
Step S423 of correcting the local anomaly type spectral vector, and iteratively executing steps S421 to S423 on the corrected local anomaly spectral vector until convergence (i.e. convergence )
Figure BDA0002194290760000078
) Obtaining a spectrum vector after local abnormal type correction during convergence;
in this embodiment, the correction process is: order to
Figure BDA0002194290760000079
Spectral vectors of local anomaly type
Figure BDA00021942907600000710
Data points in the abnormal window interval, the 'reference spectrum set' comprises hΔSet spectral vectors, and
Figure BDA00021942907600000711
the data point of the corresponding position is
Figure BDA00021942907600000712
Then there are:
Figure BDA00021942907600000713
wherein the content of the first and second substances,
Figure BDA00021942907600000714
are weight coefficients.
In step S424, the overall abnormal type spectrum vector is subjected to abnormal type discrimination to obtain an external overall abnormal type spectrum vector and an internal overall abnormal type spectrum vector.
In this embodiment, the overall abnormality type determination specifically includes: let the integral abnormal type spectral vector be
Figure BDA00021942907600000715
y is n; g is 0; and modifies step S414 to
Figure BDA00021942907600000716
Then step S412-step S416 are executed; and (3) judging the type of the abnormality: if it is
Figure BDA00021942907600000717
Then call
Figure BDA00021942907600000718
An exterior type among the overall exception types;
Figure BDA00021942907600000719
then call
Figure BDA00021942907600000720
An internal type among the overall abnormality types.
Step S43, combining the spectrum vectors of the reference spectrum set of all pearls in the training sample set and the spectrum vectors after local anomaly correction to form a training spectrum vector set; and combining the spectral vectors of the reference spectral set of all pearls in the test sample set, the spectral vectors after local anomaly type correction and the spectral vectors of the external integral anomaly type to form a test spectral vector set.
In this embodiment, a total of N pearl samples are provided, and the jth pearl remains after the steps S41-S42
Figure BDA00021942907600000721
And (4) grouping the spectra. The set of spectral vectors can be represented as
Figure BDA00021942907600000722
Wherein
Figure BDA00021942907600000723
The kth set of spectral vectors retained in the jth pearl. The h groups of spectra are provided with a spectral vector h delta group of a reference spectrum set, a spectral vector q group of a local variation type, a spectral vector pw group of an external integral abnormal type and a spectral vector pn group of an internal integral abnormal type. Then the dimension of T is (h)Δ+q+pw)n,E(T)Has a dimension of (h)Δ+q+pw)D。
And step S5, respectively extracting the features of the training spectrum vector set and the testing spectrum vector set to obtain a training feature vector set and a testing feature vector set.
In this embodiment, a plurality of unsupervised clustering methods such as PCA, K-means, EM, and the like may be adopted to reconstruct the feature space through mapping transformation, so that the main distinguishing information is concentrated on the previous several-dimensional reconstruction features.
The specific process of extracting the features of the training spectrum vector set in the embodiment is as follows:
step S51, performing compression mapping on the training spectrum vector set to obtain a mapped reconstruction feature set E, which is specifically as follows:
(1)
Figure BDA0002194290760000081
wherein E is the set of the mapped reconstructed sample characteristics and the dimensionality is
Figure BDA0002194290760000082
The reconstructed characteristic vector of the jth pearl in the X and the kth group of spectra is
Figure BDA0002194290760000083
(2) E can be divided into E according to the gloss grade of the pearl sample to which the feature vector belongs(L),E(M),E(H),E(S)And the like. Wherein the content of the first and second substances,
Figure BDA0002194290760000084
dimension of
Figure BDA0002194290760000085
(3) And due to the following pair E(L),E(M),E(H),E(S)The subsets are processed in the same way, so for ease of explanation, E will remain(M)Write as E, write N(M)Wait for writing as N.
Step S52, determining the dimension D of the reconstruction feature set E, which is as follows:
(1) the retention rate of accumulated information is required to be more than 90%;
(2) typically D ∈ {3, 4, …, 8 }. When the dimensionality is too low, the information is seriously lost, and the distinguishing effect is insufficient; when the dimensionality is too high, information is redundant, and the detection speed is reduced.
(3) A plurality of models can be trained by different dimensions, the accuracy is selected to meet the detection requirement, and when the dimensions are continuously increased, the accuracy is not obviously improved.
(4) The dimension of E after compression is:
Figure BDA0002194290760000086
step S53, calculating the mean value of the features of each dimension to obtain a gradient diffusion center, which is as follows:
(1) calculating the mean value of each dimension of features:
Figure BDA0002194290760000087
(2) the gradient diffusion center is:
Figure BDA0002194290760000088
step S54, calculating the euclidean distance between each group of feature vectors and the diffusion center, which is as follows:
the distance from the reconstructed feature vector of the kth group of the spectrums to the gradient diffusion center of the jth pearl is as follows:
Figure BDA0002194290760000091
Figure BDA0002194290760000092
and define
Figure BDA0002194290760000093
Step S55, obtaining a gradient step length according to the euclidean distance and the gradient diffusion coefficient of each group of feature vectors, which is as follows:
(1) let the gradient diffusion coefficient be α (1 ≦ α ∈ N+) Dividing the maximum distance from each group of feature vectors to the gradient diffusion center into α steps, positively correlating the analysis fineness with α values, negatively correlating the calculation complexity with α values, and determining the dispersion degree of the reconstruction feature space, wherein the value-taking interval is [5, 50 ]]The optimal value period is [5, 20 ]]The item takes the value 10.
(2) Gradient step size:
Figure BDA0002194290760000094
wherein
Figure BDA0002194290760000095
Is the maximum distance.
Step S56, calculating the inclusion rate of the feature vectors of each step, and determining the dense step interval of the feature vectors, which is as follows:
(1)ncis composed of
Figure BDA0002194290760000096
c≠1;
Figure BDA0002194290760000097
c is 1; the number of sets of eigenvectors in the step interval. Accordingly, the method can be used for solving the problems that,
Figure BDA0002194290760000098
the eigenvector inclusion rate for the step interval. And defines:
Figure BDA0002194290760000099
(2) and judging the dense step interval of the feature vector. Setting as [0, (cs) B ], wherein cs is the maximum diffusion step of the dense interval, and a human engineering method and a threshold value method can be adopted for value taking, and the method specifically comprises the following steps:
the method comprises the following steps: provided is a human engineering method. First, drawing G(α)Line drawings of (d). Then, an appropriate cs is selected based on the line graph so as to satisfy: to pair
Figure BDA00021942907600000910
All have gc<<max(G(α)) (i.e., the inclusion rate is significantly less than the maximum inclusion rate max (G) after cs(α)) And is
Figure BDA00021942907600000911
The method 2 comprises the following steps: a thresholding method. Define cs as: satisfy pair
Figure BDA00021942907600000912
All have gc<θmax(G(α)) And is
Figure BDA00021942907600000913
Is measured. When the value of θ is too large, the convergence requirement is high, and the step with a high feature vector inclusion rate may also be includedExcluding the interval of dense ladder steps; when the value of theta is too small, the convergence requirement is low, and the ladder step with the low feature vector inclusion rate can be included in the dense ladder step interval.
Figure BDA00021942907600000914
Can obtain better effect, in the embodiment
Figure BDA00021942907600000915
And step S57, taking the feature vector set in the dense step interval as a new reconstruction feature set E, and iteratively executing the steps S52-S57 until convergence (i.e., the dense step interval includes all steps) is achieved, wherein the feature vector set in the dense step interval obtained during convergence is the extracted training feature vector set.
And step S6, training the classification model according to the training feature vector set and the gloss grade label of the corresponding pearl sample to obtain the pearl grade recognition model.
The specific process of extracting the features of the test spectrum vector set in the embodiment is as follows:
compressing and mapping the test spectrum vector set according to the method in the step S51 to obtain a mapped reconstruction feature set E; then extracting the former D-dimensional characteristics to form a test characteristic vector set (E)(T))。
In this embodiment, the training model may adopt a plurality of types, such as PLS, SVM, ANN, and the like, and the embodiment adopts an SVM classifier. The SVM can be well adapted to the problems of small sample sets and nonlinear regression, and has strong generalization capability. This example sets digital labels 1, 2, 3 in order for low, medium and high gloss grade pearls. The optimal model parameters can be obtained by iteration of heuristic algorithms such as a grid search method, a gradient descent method, particle swarm and the like.
Step S7, testing the test feature vector set by adopting the pearl grade recognition model obtained by training to obtain the gloss grade of the pearl sample corresponding to the test feature vector set; the specific process is as follows:
step S71, recognizing the model by using the pearl grade obtained by trainingTo test feature vector set (E)(T)) The predicted value of each group of feature vectors
Figure BDA0002194290760000101
Step S72, a predicted value is added for the spectrum vector of the internal type overall abnormal type not reserved in the test sample set
Figure BDA0002194290760000102
Order to
Figure BDA0002194290760000103
Namely, the mean value of the predicted values corresponding to the reference spectrum set and the corrected local variation type spectrum vector is set.
Step S73, calculating the predicted value mean value of h groups of feature vectors of the pearl samples to be tested in the test sample set:
Figure BDA0002194290760000104
Figure BDA0002194290760000105
wherein
Figure BDA0002194290760000106
Step S74, judging the gloss grade of the pearl to be measured according to the mean value of the predicted values: if it is
Figure BDA0002194290760000107
The pearl is a low gloss grade pearl; if it is
Figure BDA0002194290760000108
The pearl is a middle-gloss grade pearl; if it is
Figure BDA0002194290760000109
The pearl is a high gloss grade pearl.
Example 2
This example 2 applies the pearl detection method proposed in the above example 1 to specific detection of pearl samples.
In this embodiment, a total of 250 pearl sample sets are selected, wherein 200 pearls are randomly extracted as a training sample set, and the remaining 50 pearls are used as a testing sample set. Performing visible light spectrum complex sampling measurement and pretreatment based on a training sample set by adopting the detection method provided by the embodiment 1, and then training a detection model; performing visible light spectrum complex sampling measurement, processing, model prediction and grade judgment on a test sample set by adopting the detection method provided by the embodiment 1 to obtain a detection result shown in the following table 1; the method comprises the steps of carrying out single-group visible light spectrum measurement on the basis of a training sample set by adopting a traditional detection method, training a classification detection model after carrying out conventional pretreatment, carrying out single-group visible light spectrum measurement on a test sample set by adopting the traditional detection method, carrying out conventional pretreatment, and predicting a grade result by using the classification detection model to obtain a detection result shown in the following table 2.
TABLE 1 test results obtained by the test method of the present invention
Figure BDA00021942907600001010
Figure BDA0002194290760000111
TABLE 2 test results obtained by conventional test methods
Figure BDA0002194290760000112
The detection results shown in the above table 1 and table 2 can be obviously obtained, and the prediction accuracy and recall accuracy of the detection method provided by the invention are far higher than those of the detection results of the traditional detection method, namely, the detection method provided by the invention greatly improves the detection precision of the pearls.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The above-mentioned embodiments are intended to illustrate the objects, technical solutions and advantages of the present invention in further detail, and it should be understood that the above-mentioned embodiments are merely exemplary embodiments of the present invention, and are not intended to limit the scope of the present invention, and any modifications, equivalent substitutions, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.

Claims (7)

1. The pearl luster detection method based on the visible light spectrum is characterized by comprising the following steps:
step S1, obtaining a pearl sample set, and dividing the pearl sample set into a training sample set and a testing sample set;
step S2, randomly measuring h groups of visible light spectrum data on the surface of each pearl in the pearl sample set to obtain visible light spectrum data sets of all pearls in the pearl sample set; wherein h is an integer and h is not less than 5;
step S3, preprocessing the visible light spectrum data obtained in step S2;
step S4, performing spectrum exception processing on the h groups of spectral data of each pearl in the training sample set and the test sample set respectively to obtain a training spectrum vector set and a test spectrum vector set;
step S5, respectively extracting the features of the training spectrum vector set and the testing spectrum vector set to obtain a training feature vector set and a testing feature vector set;
step S6, training the classification model according to the training feature vector set and the gloss grade label of the corresponding pearl sample to obtain a pearl grade recognition model;
step S7, testing the test feature vector set by adopting the pearl grade recognition model obtained by training to obtain the gloss grade of the pearl sample corresponding to the test feature vector set;
the performing of the spectrum abnormality processing on the h groups of spectrum data of each pearl in the pearl sample set in the step S4 specifically includes:
step S41, a sliding window coarse shift detection method is adopted to obtain a reference spectrum set and an abnormal spectrum vector through screening;
step S42, merging the abnormal spectrum vector and the reference spectrum set, and performing type detection and correction on the abnormal spectrum vector by adopting a sliding window coarse shift detection method;
the step S41 specifically includes:
step S411, in h sets of spectrum data randomly collected by each pearl, each set of spectrum includes n data points, and the kth set of spectrum vector of the pearl is represented as:
Figure FDA0002374008040000011
wherein k is 1 … h;
step S412, defining the spectrum set of the same pearl as:
Figure FDA0002374008040000012
wherein u represents the same pearl spectrum set
Figure FDA0002374008040000013
The number of the contained spectral vector groups, and initial u is h; calculating the spectrum set of the same pearl
Figure FDA0002374008040000014
Mean spectrum of (a):
Figure FDA0002374008040000015
step S413, calculating the spectrum set of the same pearl
Figure FDA0002374008040000016
Residual error of the s-th set of spectra at each data point:
Figure FDA0002374008040000017
wherein the content of the first and second substances,
Figure FDA0002374008040000018
residual errors at the ith data point;
step S414, calculating the spectrum set of the same pearl
Figure FDA0002374008040000019
Group S ofRelative mean spectrum of spectrum
Figure FDA00023740080400000110
The window residual of (d) is:
Figure FDA0002374008040000021
Figure FDA0002374008040000022
wherein t is a window serial number, y is a window width coefficient, and g is a window sliding coefficient; t is the maximum window sequence number;
step S415, window interval abnormality determination: if it is satisfied with
Figure FDA0002374008040000023
The window interval is called as an abnormal window interval; wherein, Delta represents the window interval abnormity discrimination coefficient;
step S416, rejecting the spectral vector with the largest number of abnormal window intervals;
and step S417, iteratively executing the steps S412-S416 until convergence, wherein the residual spectrum vector set during convergence is a reference spectrum set, and the rejected spectrum vector is an abnormal spectrum vector.
2. The method for detecting pearl luster based on visible light spectrum of claim 1, wherein the step S42 specifically comprises:
step S421, abnormal spectral vector is calculated
Figure FDA0002374008040000024
And the reference spectrum set, executing the steps S412-S416 to obtain the number of the window sections judged to be abnormal
Figure FDA0002374008040000025
Step S422, the number of abnormal window sections is judged according to the abnormal spectral vector
Figure FDA0002374008040000026
Determining the type of the abnormal spectral vector; if the local abnormal type spectral vector is determined, go to step S423; if the entire abnormal type spectrum vector is determined, go to step S424;
step S423, correcting the local abnormal type spectrum vector, and iteratively executing the step S421 to the step S423 on the corrected local abnormal spectrum vector until convergence, and obtaining the spectrum vector after the local abnormal type correction when the convergence is achieved;
in step S424, the overall abnormal type spectrum vector is subjected to abnormal type discrimination to obtain an external overall abnormal type spectrum vector and an internal overall abnormal type spectrum vector.
3. The method for detecting pearl luster based on visible light spectrum according to claim 2, wherein the step S4 further comprises a step S43 of combining the spectrum vectors of the reference spectrum set of all pearls in the training sample set and the spectrum vectors corrected by the local anomaly class to form a training spectrum vector set; and combining the spectral vectors of the reference spectral set of all pearls in the test sample set, the spectral vectors after local anomaly type correction and the spectral vectors of the external integral anomaly type to form a test spectral vector set.
4. The method for detecting pearl luster based on visible light spectrum of claim 3, wherein the step S7 specifically comprises:
step S71, obtaining the predicted value of each group of feature vectors in the test feature vector set by using the pearl grade recognition model obtained by training;
step S72, a predicted value is supplemented for the spectrum vectors of the internal integral abnormal types which are not reserved in the test sample set;
step S73, calculating the mean value of the predicted values of h groups of characteristic vectors of the pearl samples to be tested in the test sample set;
and step S74, judging the gloss grade of the pearl to be measured according to the mean value of the predicted values.
5. The method for detecting pearl luster based on visible light spectrum according to any one of claims 1 to 4, wherein the specific process of extracting the features of the training spectrum vector set in the step S5 is as follows:
step S51, carrying out compression mapping on the training spectrum vector set to obtain a mapped reconstruction feature set E;
step S52, determining the dimension D of the reconstruction feature set E;
step S53, calculating the mean value of each dimension characteristic to obtain a gradient diffusion center;
step S54, calculating Euclidean distances from each group of feature vectors to a diffusion center;
step S55, obtaining a gradient step length according to the Euclidean distance of each group of feature vectors and the gradient diffusion coefficient;
step S56, calculating the inclusion rate of the feature vectors of each step, and determining the dense step interval of the feature vectors;
and step S57, taking the feature vector set in the dense step interval as a new reconstruction feature set E, and iteratively executing the steps S52-S57 until convergence, wherein the feature vector set in the dense step interval obtained in convergence is the extracted training feature vector set.
6. The method for detecting pearl luster based on visible light spectrum of claim 5, wherein the step S5 of extracting the features of the vector set of test spectrum is as follows: carrying out compression mapping on the test spectrum vector set to obtain a mapped reconstruction feature set E; and then extracting the front D-dimensional features to form a test feature vector set.
7. The method for detecting pearl luster based on visible light spectrum according to claim 6, wherein the classification model adopted in the step S6 is SVM classifier, PLS model or ANN.
CN201910842953.5A 2019-09-06 2019-09-06 Pearl luster detection method based on visible light spectrum Expired - Fee Related CN110542659B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910842953.5A CN110542659B (en) 2019-09-06 2019-09-06 Pearl luster detection method based on visible light spectrum

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910842953.5A CN110542659B (en) 2019-09-06 2019-09-06 Pearl luster detection method based on visible light spectrum

Publications (2)

Publication Number Publication Date
CN110542659A CN110542659A (en) 2019-12-06
CN110542659B true CN110542659B (en) 2020-04-07

Family

ID=68712969

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910842953.5A Expired - Fee Related CN110542659B (en) 2019-09-06 2019-09-06 Pearl luster detection method based on visible light spectrum

Country Status (1)

Country Link
CN (1) CN110542659B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111257263A (en) * 2020-03-04 2020-06-09 浙江方圆检测集团股份有限公司 Method for identifying chemical composition and structural morphology consistency of pearl surface layer by using ultraviolet-visible diffuse reflection spectrum
CN115905881B (en) * 2022-09-30 2023-10-20 国家珠宝玉石首饰检验集团有限公司 Yellow pearl classification method and device, electronic equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN85204813U (en) * 1985-11-26 1986-07-23 北京毛纺织科学研究所 Fabric glossiness tester
CN101144860A (en) * 2007-10-16 2008-03-19 哈尔滨工业大学 Hyperspectral image abnormal point detection method based on selective kernel principal component analysis
CN106714220A (en) * 2017-01-06 2017-05-24 江南大学 WSN (Wireless Sensor Network) anomaly detection method based on MEA-BP neural network
CN108801950A (en) * 2018-05-21 2018-11-13 东南大学 A kind of ultraviolet spectra abnormal water detection method based on sliding window Multiscale Principal Component Analysis
CN110102507A (en) * 2019-05-24 2019-08-09 浙江科技学院 Pearl stage division

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6903813B2 (en) * 2002-02-21 2005-06-07 Jjl Technologies Llc Miniaturized system and method for measuring optical characteristics

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN85204813U (en) * 1985-11-26 1986-07-23 北京毛纺织科学研究所 Fabric glossiness tester
CN101144860A (en) * 2007-10-16 2008-03-19 哈尔滨工业大学 Hyperspectral image abnormal point detection method based on selective kernel principal component analysis
CN106714220A (en) * 2017-01-06 2017-05-24 江南大学 WSN (Wireless Sensor Network) anomaly detection method based on MEA-BP neural network
CN108801950A (en) * 2018-05-21 2018-11-13 东南大学 A kind of ultraviolet spectra abnormal water detection method based on sliding window Multiscale Principal Component Analysis
CN110102507A (en) * 2019-05-24 2019-08-09 浙江科技学院 Pearl stage division

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Gaël Mondonneix 等.Tahitian Pearls’ Luster Assessment Automation.《2017 IEEE Applied Imagery Pattern Recognition Workshop》.2017,第1-9页. *
The Use of UV-Visible Reflectance Spectroscopy as an Objective Tool to Evaluate Pearl Quality;Snezana Agatonovic-Kustrin 等;《Marine Drugs》;20120710;第10卷;第1459-1475页 *

Also Published As

Publication number Publication date
CN110542659A (en) 2019-12-06

Similar Documents

Publication Publication Date Title
US10671833B2 (en) Analyzing digital holographic microscopy data for hematology applications
Brancati et al. A deep learning approach for breast invasive ductal carcinoma detection and lymphoma multi-classification in histological images
US10474874B2 (en) Applying pixelwise descriptors to a target image that are generated by segmenting objects in other images
CN114549522A (en) Textile quality detection method based on target detection
CN110717368A (en) Qualitative classification method for textiles
CN114846507A (en) Method and system for non-invasive gene detection using Artificial Intelligence (AI) models
CN106815819B (en) More strategy grain worm visible detection methods
CN110542659B (en) Pearl luster detection method based on visible light spectrum
Şengür et al. White blood cell classification based on shape and deep features
CN115170572A (en) BOPP composite film surface gluing quality monitoring method
CN103048273A (en) Fruit near infrared spectrum sorting method based on fuzzy clustering
CN115994907B (en) Intelligent processing system and method for comprehensive information of food detection mechanism
CN108446613A (en) A kind of pedestrian's recognition methods again based on distance centerization and projection vector study
CN110414587A (en) Depth convolutional neural networks training method and system based on progressive learning
Mohammadpoor et al. An intelligent technique for grape fanleaf virus detection
CN110874576B (en) Pedestrian re-identification method based on typical correlation analysis fusion characteristics
CN116559111A (en) Sorghum variety identification method based on hyperspectral imaging technology
CN110533083B (en) Casting defect recognition method based on Adaboost model of SVM
Khan et al. Plant disease detection techniques: A review
CN112633301A (en) Traditional Chinese medicine tongue image greasy feature classification method based on depth metric learning
CN116071592A (en) Corn seed variety identification method and system based on hyperspectral incremental updating
CN111353443B (en) Pedestrian re-identification method based on cross-view kernel collaborative representation
Möller et al. Analysis of Arabidopsis Root Images--Studies on CNNs and Skeleton-Based Root Topology
CN112132212B (en) Abnormal raw material tolerant wood raw material color selection method
CN110555342A (en) image identification method and device and image equipment

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
GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20200407

Termination date: 20210906