An Abnormal Detection Method for Polytetrafluoroethylene Tubes Used in Cyanide Sampling
By conducting DTW and PCA analysis of the spectral curve of the PTFE tube, the degree of abnormality of the data points was determined, and the detection inaccurate problem caused by different batches of materials was solved, and efficient and accurate abnormal detection of PTFE tubes was achieved.
Patent Information
- Application Number
- CN202510346433.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-24
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2045-03-24
AI Technical Summary
The existing polytetrafluoroethylene tube abnormality detection methods lead to inaccurate detection results and low efficiency due to the differences in materials in different batches.
By obtaining the spectral curves of different morphologies of polytetrafluoroethylene tubes, using DTW algorithm and PCA analysis, we determine the first and second intervals of the spectral curve, calculate the slope, vector modulus value and vector direction of the data point, combine the absorbance, determine the scaling weight of the data point, correct the spectral curve, and judge whether there is an abnormality in the polytetrafluoroethylene tube.
It improves the accuracy and efficiency of abnormal detection of PTFE tubes, and can detect multiple different forms of PTFE tubes at the same time, enhancing the reliability of the detection results.
Smart Images

Figure CN119880835B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of material testing, and particularly to a method for detecting abnormalities in polytetrafluoroethylene tubes for cyanide sampling. Background Art
[0002] Due to its excellent chemical stability and corrosion resistance, polytetrafluoroethylene tubes are commonly used in the chemical industry to transport or contain various chemicals, including cyanide. All the pipe fittings of polytetrafluoroethylene tubes are formed by rotational molding without any plastic welds, making the products more reliable. At the same time, it provides a reliable guarantee for splash-free transportation. Here, the pipe fittings include elbows, tees, crosses, reducers, etc. The quality inspection of polytetrafluoroethylene tubes is to determine whether the polytetrafluoroethylene tubes meet the standard requirements and whether there are any abnormalities. If the quality inspection of polytetrafluoroethylene tubes is not carried out, it will lead to safety problems during the construction and application process. Therefore, realizing the quality inspection of polytetrafluoroethylene tubes is an extremely important step.
[0003] The existing method realizes the quality inspection of polytetrafluoroethylene tubes by collecting the spectral curve data of polytetrafluoroethylene tubes of the same type and shape and determining the abnormal data points in the spectral curve data. However, when the existing method compares and analyzes polytetrafluoroethylene tubes of the same form, there are certain differences in polytetrafluoroethylene tubes made of materials from different batches, that is, the standard products and the products to be detected are not made of the same batch of materials, resulting in inaccurate quality inspection results. Moreover, each polytetrafluoroethylene tube to be detected is compared and analyzed with the standard polytetrafluoroethylene tube, which will reduce the efficiency of detecting abnormalities in polytetrafluoroethylene tubes. Summary of the Invention
[0004] In order to solve the above technical problem of low accuracy of the existing abnormal detection results of polytetrafluoroethylene tubes, the purpose of the present invention is to provide a method for detecting abnormalities in polytetrafluoroethylene tubes for cyanide sampling.
[0005] The present invention provides a method for detecting abnormalities in polytetrafluoroethylene tubes for cyanide sampling, including the following steps:
[0006] Obtain each spectral curve corresponding to polytetrafluoroethylene tubes of different forms to be detected;
[0007] Evenly divide each spectral curve into a preset number of sub-spectral curves, and use the sub-spectral curves as the first intervals in the spectral curve. According to the absorbance of each data point in each first interval of each spectral curve, determine the initial matching degree of the target spectral curve corresponding to each first interval;
[0008] According to the slope of each data point in each first interval, determine each second interval in each first interval. According to the principal component direction value, the vector modulus value and the vector direction of each data point in each second interval, determine the data difference value corresponding to each second interval;
[0009] Determine the data abnormality degree of each first interval according to the initial matching degree of the target spectral curve corresponding to each first interval and the data difference value corresponding to each second interval. Determine the scaling weight of each data point according to the data abnormality degree of each first interval and the absorbance of each data point in it.
[0010] Correct each spectral curve according to the scaling weight and absorbance of each data point in each spectral curve, and obtain the corrected spectral curves. Determine the matching degree of the target spectral curve corresponding to each first interval according to the absorbance of each data point in each first interval of the corrected spectral curves.
[0011] Determine the abnormality degree of each data point according to the slope value and absorbance of each data point in each spectral curve. Determine whether there is an abnormality in polytetrafluoroethylene tubes of different shapes according to the matching degree of the target spectral curve corresponding to each first interval and the abnormality degree of each data point.
[0012] Further, determine the data difference value corresponding to each second interval according to the principal component direction value, the vector modulus value and the vector direction of each data point in each second interval, including:
[0013] Obtain the first spectral curve and the second spectral curve in each spectral curve. According to the principal component direction values of each second interval in the first spectral curve and the second spectral curve, calculate the absolute value of the difference between the principal component direction values of each second interval between the two spectral curves, and use the absolute value of the difference as the first difference index of each second interval between the two spectral curves. The first spectral curve and the second spectral curve are both any one spectral curve in each spectral curve, and the first spectral curve is different from the second spectral curve.
[0014] Perform an addition process on the vector modulus value of each data point in each second interval of the first spectral curve and the vector modulus value of each data point in each second interval of the second spectral curve, and use the value after the addition process as the denominator of the ratio. When using the vector modulus value of each data point in each second interval of the first spectral curve as the numerator of the ratio, use the ratio as the first difference degree of each data point in each second interval of the first spectral curve. When using the vector modulus value of each data point in each second interval of the second spectral curve as the numerator of the ratio, use the ratio as the first difference degree of each data point in each second interval of the second spectral curve.
[0015] Add the vector directions of each data point in each second interval of the first spectral curve and the vector directions of each data point in each second interval of the second spectral curve, and use the value after the addition process as the denominator of the ratio. When using the vector direction of each data point in each second interval of the first spectral curve as the numerator of the ratio, use the ratio as the second difference degree of each data point in each second interval of the first spectral curve. When using the vector direction of each data point in each second interval of the second spectral curve as the numerator of the ratio, use the ratio as the second difference degree of each data point in each second interval of the second spectral curve;
[0016] Calculate the cumulative value of the sum of the first difference degree and the second difference degree of each data point in each second interval of the first spectral curve and the second spectral curve, use the cumulative value as the second difference index of each second interval, perform an addition process on the first difference index and the second difference index, and use the value after the addition process after negative correlation mapping as the data difference value of each second interval.
[0017] Further, determine the data abnormality degree of each first interval according to the initial matching degree of the target spectral curve corresponding to each first interval and the data difference value corresponding to each second interval, including:
[0018] Perform negative correlation mapping on the initial matching degree of the target spectral curve corresponding to each first interval in the first spectral curve and the second spectral curve, and use the initial matching degree of the target spectral curve after negative correlation mapping as the first data abnormality degree of each first interval;
[0019] Select the maximum data difference value in each first interval of the first spectral curve and the maximum data difference value in each first interval of the second spectral curve, calculate the cumulative value of the data difference values corresponding to each second interval in each first interval of each spectral curve, use the cumulative value as the denominator of the ratio. When using the maximum data difference value corresponding to each first interval in the first spectral curve as the numerator of the ratio, use the ratio as the second data abnormality degree of each first interval in the first spectral curve. When using the maximum data difference value corresponding to each first interval in the second spectral curve as the numerator of the ratio, use the ratio as the second data abnormality degree of each first interval in the second spectral curve;
[0020] Calculate the product of the first data abnormality degree and the second data abnormality degree of each first interval, and use the product as the data abnormality degree of each first interval.
[0021] Further, determine the scaling weight of each data point according to the data abnormality degree of each first interval and the absorbance of each data point, including:
[0022] Calculate the difference in absorbance of each data point in each first interval between the first spectral curve and the second spectral curve, and determine the degree of data anomaly after negative correlation mapping corresponding to the first interval where each data point in the first spectral curve and the second spectral curve is located; calculate the product of the difference in absorbance of each data point in each first interval and the degree of data anomaly after negative correlation mapping corresponding to the first interval where each data point in the first spectral curve is located, and use the product as the scaling weight of each data point in each first interval in the first spectral curve; calculate the product of the difference in absorbance of each data point in each first interval and the degree of data anomaly after negative correlation mapping corresponding to the first interval where each data point in the second spectral curve is located, and use the product as the scaling weight of each data point in each first interval in the second spectral curve.
[0023] Further, correct each spectral curve according to the scaling weight and absorbance of each data point in each spectral curve to obtain each corrected spectral curve, including:
[0024] Determine the corrected absorbance corresponding to each data point in the first spectral curve according to the scaling weight and absorbance of each data point in the first spectral curve and the absorbance of each data point in the second spectral curve, and its calculation formula is:
[0025]
[0026] Wherein, is the corrected absorbance of each data point in the j-th first interval in the first spectral curve, is the first spectral curve, is the serial number of each first interval in the first spectral curve, is the absorbance of each data point in the j-th first interval in the first spectral curve, is the absorbance of each data point in the j-th first interval in the second spectral curve, is the second spectral curve, is the scaling weight of each data point in the j-th first interval in the first spectral curve;
[0027] Update the absorbance of each data point in the first spectral curve to the corrected absorbance to obtain each corrected spectral curve.
[0028] Further, determine the degree of anomaly of each data point according to the slope value and absorbance of each data point in each spectral curve, including:
[0029] Determine the neighborhood data points of each data point in each spectral curve, calculate the difference between the absorbance of each data point in the first spectral curve and the absorbance of its neighborhood data points, and calculate the difference between the absorbance of each data point in the second spectral curve and the absorbance of its neighborhood data points;
[0030] When the product of the absorbance difference corresponding to each data point in the first spectral curve and the slope value is used as the numerator of the ratio, the product of the absorbance difference corresponding to each data point in the second spectral curve and the slope value is used as the denominator of the ratio, and the ratio is used as the degree of abnormality of each data point in the first spectral curve; when the product of the absorbance difference corresponding to each data point in the second spectral curve and the slope value is used as the numerator of the ratio, the product of the absorbance difference corresponding to each data point in the first spectral curve and the slope value is used as the denominator of the ratio, and the ratio is used as the degree of abnormality of each data point in the second spectral curve.
[0031] Further, according to the matching degree of the target spectral curve corresponding to each first interval and the degree of abnormality of each data point, it is judged whether there is an abnormality in polytetrafluoroethylene tubes of different shapes, including:
[0032] If the matching degree of the target spectral curve corresponding to any one of the first intervals is not greater than the preset matching degree threshold, it is determined that there is an abnormality in the polytetrafluoroethylene tubes of different shapes to be detected, and the polytetrafluoroethylene tubes corresponding to the spectral curves of the first intervals not greater than the preset matching degree threshold are used as abnormal polytetrafluoroethylene tubes;
[0033] If the degree of abnormality of any one data point is greater than the preset degree of abnormality threshold, it is determined that there is an abnormality in the polytetrafluoroethylene tubes of different shapes to be detected, and the polytetrafluoroethylene tubes corresponding to the spectral curves of the data points greater than the preset degree of abnormality threshold are used as abnormal polytetrafluoroethylene tubes;
[0034] If the matching degree of the target spectral curve corresponding to any one of the first intervals is greater than the preset matching degree threshold and the degree of abnormality of any one data point is not greater than the preset degree of abnormality threshold, it is determined that there is no abnormality in the polytetrafluoroethylene tubes of different shapes to be detected.
[0035] Further, according to the slope of each data point in each first interval, each second interval in each first interval is determined, including:
[0036] According to the slope of each data point in each first interval, the change trend of the slope of the data points in each first interval is determined, and the change trend is decreasing and increasing. The spectral curve segments corresponding to continuous decrease or continuous increase are used as the second intervals in the first interval.
[0037] Further, according to the absorbance of each data point in each first interval in each spectral curve, the initial matching degree of the target spectral curve corresponding to each first interval is determined, including:
[0038] According to the absorbance of each data point in each first interval of any two spectral curves, using the DTW algorithm, perform matching processing on any two spectral curves to obtain multiple initial matching degrees of the spectral curves corresponding to each first interval, select the maximum value from the multiple initial matching degrees of the spectral curves corresponding to each first interval, and use the initial matching degree of the spectral curve corresponding to the maximum value as the initial matching degree of the target spectral curve.
[0039] The present invention has the following beneficial effects:
[0040] The present invention provides a method for detecting abnormalities in a polytetrafluoroethylene tube for cyanide sampling. This method analyzes the degree of abnormality of the polytetrafluoroethylene tube by means of the physical properties of the polytetrafluoroethylene tube. Here, the physical properties refer to the spectral data of the polytetrafluoroethylene tube, which helps to improve the accuracy of detecting abnormalities in the polytetrafluoroethylene tube. By the data characteristics of the spectral curves corresponding to different forms of the polytetrafluoroethylene tube to be detected, determine the scaling weight of each data point in the spectral curve, and use the scaling weight to correct the absorbance of each data point in the spectral curve to obtain the corrected spectral curves, and then obtain the target spectral curve matching degree corresponding to each first interval in each spectral curve, which can overcome the defect of inaccurate matching degree caused by too large changes in data amplitude; when comparing and analyzing the spectral curves corresponding to different forms of the polytetrafluoroethylene tube to be detected, based on the slope value and absorbance of each data point in each spectral curve, the degree of abnormality of each data point can be obtained, which helps to detect multiple different forms of polytetrafluoroethylene tubes simultaneously and greatly improves the detection efficiency; analyzing whether there are abnormalities in the polytetrafluoroethylene tube from two perspectives, that is, the target spectral curve matching degree corresponding to each first interval and the degree of abnormality of the data point, helps to improve the integrity of detecting abnormalities in the polytetrafluoroethylene tube and enhance the reliability of the detection results of abnormalities in the polytetrafluoroethylene tube. Brief Description of the Drawings
[0041] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0042] Figure 1 It is a flowchart of a method for detecting abnormalities in a polytetrafluoroethylene tube for cyanide sampling according to the present invention. Detailed Embodiments
[0043] To further elaborate on the technical means and effects adopted by the present invention to achieve the intended invention purpose, the specific implementation manners, structures, features and effects of the technical solutions proposed according to the present invention will be described in detail below in conjunction with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. In addition, the specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.
[0044] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the technical field to which this invention belongs.
[0045] Application scenario of this embodiment: When a spectrometer measures polytetrafluoroethylene tube products in different forms of the same material, the frequency range of the absorption wavelengths of the obtained spectral data is the same, but the degree of the absorption wavelengths is different. Based on the nature characteristics of the above spectral data, using the spectral curves corresponding to polytetrafluoroethylene tubes in different forms, it is possible to judge whether there are abnormal data points in the spectral data of polytetrafluoroethylene tubes in different forms. Based on the judgment result, abnormal detection of polytetrafluoroethylene tubes can be realized. Specifically, an abnormal detection method for polytetrafluoroethylene tubes for cyanide sampling is provided, as Figure 1 shown, including the following steps:
[0046] S1, obtain each spectral curve corresponding to polytetrafluoroethylene tubes in different forms to be detected.
[0047] It should be noted that each form of polytetrafluoroethylene tube has its corresponding spectral curve. The change rules of the spectral curves of polytetrafluoroethylene tube products in different forms of the same material are similar. When any one of the multiple spectral curves is abnormal, the change rule of this spectral curve will change, and there are significant differences between its change rule and those of other spectral curves. Based on the data characteristics of the multiple spectral curves, by comparing the multiple spectral curves, the abnormal degree of each data point in the multiple spectral curves can be obtained. By analyzing the abnormal degree of each data point, the spectral curve with abnormalities can be determined, and thus the abnormal detection of polytetrafluoroethylene tubes can be realized. Therefore, the prerequisite for realizing the abnormal detection of polytetrafluoroethylene tubes is to obtain each spectral curve corresponding to polytetrafluoroethylene tubes in different forms to be detected.
[0048] In this embodiment, the spectral data of polytetrafluoroethylene tubes in different forms to be detected are the basic data for anomaly detection. The spectral data of polytetrafluoroethylene tubes in different forms are collected using a Fourier transform infrared spectrometer. Here, the spectral data are spectral curves, and the spectral curves corresponding to polytetrafluoroethylene tubes in different forms to be detected are obtained. The polytetrafluoroethylene tubes in different forms can be the original plastic samples, products prepared into plastic film type, and polytetrafluoroethylene tubular products. The abscissa of the spectral curve is the wavelength value, and the ordinate is the absorbance, and the absorbance is the wavelength amplitude value. In addition, in order to improve the accuracy of the spectral curve, data preprocessing is performed on each spectral curve. Specifically, tensor decomposition is used to denoise the spectral curves of the three plastic products, and each spectral curve after denoising is obtained. The implementation process of tensor decomposition denoising is prior art and not within the scope of protection of the present invention, so it will not be elaborated in detail here.
[0049] S2. Divide each spectral curve into a preset number of sub-spectral curves, and use the sub-spectral curves as the first intervals in the spectral curve. Determine the initial matching degree of the spectral curve corresponding to each first interval according to the absorbance of each data point in each first interval of each spectral curve. The steps include:
[0050] S21. Divide each spectral curve into a preset number of sub-spectral curves, and use the sub-spectral curves as the first intervals in the spectral curve.
[0051] In this embodiment, the wavelength ranges of the spectral curves of polytetrafluoroethylene tubes in different forms are the same, but the variation amplitudes and variation rules of the spectral curves are different. In order to facilitate the subsequent accurate analysis of the anomaly degree of each data point of the spectral curve, each spectral curve is divided into a preset number of sub-spectral curves, and the sub-spectral curves are used as the first intervals. The number of first intervals in each spectral curve is at least 2. Each spectral curve corresponds to multiple first intervals. Here, the preset number of the sub-spectral curves can be determined by the implementer according to the actual data characteristics of each spectral curve, and no specific limitation is made.
[0052] S22. Determine the initial matching degree of the target spectral curve corresponding to each first interval according to the absorbance of each data point in each first interval of each spectral curve.
[0053] According to the absorbance of each data point in each first interval of any two spectral curves, use the DTW algorithm to perform matching processing on any two spectral curves, obtain multiple initial matching degrees of the spectral curve corresponding to each first interval, select the maximum value from the multiple initial matching degrees of the spectral curve corresponding to each first interval, and use the spectral curve initial matching degree corresponding to the maximum value as the initial matching degree of the target spectral curve.
[0054] It should be noted that the number of data points in the first interval of each spectral curve is the same, but the variation amplitude and variation law of the data points in the first interval of different spectral curves are different. Therefore, after obtaining the data information of each first interval in each spectral curve, based on the variation degree of the data points in each first interval of each spectral curve, the first intervals between any two spectral curves are initially matched to facilitate the subsequent screening of abnormal data points.
[0055] In this embodiment, there are data fluctuations in the data points in the first interval of each spectral curve, and the data variation degree is relatively large. To improve the accuracy of anomaly detection, the DTW (Dynamic Time Warping) algorithm is used to initially match the first intervals between any two spectral curves in each spectral curve, and the initial matching degree of the spectral curves between each spectral curve and other spectral curves other than itself is obtained. For the convenience of description, in this embodiment, any two spectral curves in each spectral curve will be taken as an example. Any two spectral curves can be the first spectral curve and the second spectral curve. When the first spectral curve is the data to be processed, the second spectral curve is the comparison data. When the second spectral curve is the data to be processed, the first spectral curve is the comparison data. When performing the matching process on the first spectral curve and the second spectral curve, the initial matching degree of the spectral curves of the first spectral curve and the second spectral curve is the same. Calculate the initial matching degree of the spectral curves corresponding to each first interval in the two spectral curves. The calculation formula can be:
[0056]
[0057] Where, is the initial matching degree of the spectral curves corresponding to the j-th first interval in the first spectral curve and the second spectral curve, is the minimum value of, that is, the shortest path in the distance matrix, which is also the maximum similarity degree between any two spectral curves. N is the number of data points in the j-th first interval in the first spectral curve and the second spectral curve. The number of data points in the j-th first interval in the first spectral curve is equal to the number of data points in the j-th first interval in the second spectral curve. k is the serial number of the data points in the j-th first interval in the first spectral curve and the second spectral curve. is the distance of the k-th data point in the distance matrix generated by the DTW algorithm corresponding to the first spectral curve and the second spectral curve.
[0058] In the calculation formula for the initial matching degree of spectral curves, due to the different lengths of different paths, there will be more "point pairs" in the longer path, and more distances need to be accumulated for calculation. To improve the accuracy of the initial matching degree of spectral curves, the total distance is divided by the number N of data points in the first interval. That is, the denominator N of the ratio can be used to compensate for the regular paths of different lengths. The calculation formula for the initial matching degree of spectral curves is prior art and not within the protection scope of the present invention, so it will not be elaborated in detail here.
[0059] It should be noted that when the matching degree of a pair of data points in the first interval of any two spectral curves is large, it indicates that the similarity of the data point change degree of the spectral curves corresponding to this pair of first intervals is large. When the matching degree of a pair of data points in the first interval of any two spectral curves is small, it indicates that the similarity of the data point change degree of the spectral curves corresponding to this pair of first intervals is small.
[0060] So far, this embodiment has obtained the initial matching degrees of multiple spectral curves corresponding to each first interval in each spectral curve. When there is an abnormality in the first interval corresponding to the maximum initial matching degree of the spectral curve, it indicates that there is an abnormality in the data to be processed corresponding to the maximum initial matching degree of the spectral curve. Therefore, the maximum initial matching degree of the spectral curve corresponding to the first interval is selected as the target initial matching degree of the spectral curve. It should be noted that each spectral curve can be matched with other spectral curves other than itself. Each first interval can correspond to multiple different initial matching degrees of the spectral curve, and the number of multiple different initial matching degrees of the spectral curve corresponding to each first interval is equal to the number of all spectral curves minus one.
[0061] S3. According to the slopes of each data point in each first interval, determine each second interval in each first interval. According to the principal component direction values, the vector modulus values and vector directions of each data point in each second interval, determine the data difference values corresponding to each second interval.
[0062] It should be noted that the data change intervals of the spectral curves of the same material are the same, but the light absorption degrees of polytetrafluoroethylene tubes in different forms are different. That is, the peak values (absorbance) in each spectral curve corresponding to polytetrafluoroethylene tubes in different forms are different. Therefore, it is necessary to scale the absorbance of the data points with the same change trend but large peak differences according to the data point change degree in each first interval of each spectral curve to improve the accuracy of the matching degree of the target spectral curve. First, determine the data difference values corresponding to each second interval, and its steps include:
[0063] S31. According to the slopes of each data point in each first interval, determine each second interval in each first interval.
[0064] According to the slopes of each data point in each first interval, determine the changing trend of the slopes of the data points in each first interval. The changing trend includes decreasing and increasing. Take the spectral curve segments corresponding to continuous decrease or continuous increase as the second intervals in the first intervals.
[0065] In this embodiment, after calculating the initial matching degree of the spectral curves corresponding to any two forms of polytetrafluoroethylene tubes by using the DTW algorithm, there will be a phenomenon of low matching degree caused by the same changing trend but different peak values of data points. For example, in the spectral curves corresponding to any two forms of polytetrafluoroethylene tubes, the changing trend of a pair of sub-spectral curves in a certain first interval is an increasing trend. However, the peak value of the data points of one sub-spectral curve in this pair of first intervals is 80, while the peak value of the data points of the other sub-spectral curve in this first interval is 10. At this time, the matching degree of this pair of first intervals will be relatively low. In order to improve the accuracy of the matching degree of the target spectral curve and facilitate the subsequent calculation of the data difference values corresponding to each second interval, by calculating the slopes of each data point in each first interval, obtain the changing trend of the slopes of the data points in each first interval. The changing trend of the slopes of the data points can include an increasing trend and a decreasing trend. Take the spectral curve segments corresponding to continuous decrease or continuous increase as the second intervals in the first intervals, and obtain the second intervals in each first interval of each spectral curve.
[0066] S32. According to the principal component direction values, the vector modulus values and vector directions of each data point in each second interval, determine the data difference values corresponding to each second interval.
[0067] It should be noted that the data difference manifested on the two-dimensional plane refers to the change differences of the abscissas and ordinates of the data points between different spectral curves. The abscissa is the wavelength value, and the ordinate is the absorbance. In order to facilitate the analysis of the data characteristics of the spectral curve segments corresponding to the second intervals with the same changing trend in different spectral curves, based on the abscissas and ordinates of each data point in each second interval of each spectral curve, calculate the data difference values corresponding to each second interval. The steps include:
[0068] S321. Obtain the first spectral curve and the second spectral curve in each spectral curve. According to the principal component direction values of each second interval in the first spectral curve and the second spectral curve, calculate the absolute value of the difference between the principal component direction values of each second interval between the two spectral curves, and take the absolute value of the difference as the first difference index of each second interval between the two spectral curves.
[0069] In this embodiment, for the convenience of subsequent description, two spectral curves are arbitrarily selected from each spectral curve. These two spectral curves can be the first spectral curve and the second spectral curve, and the first spectral curve is different from the second spectral curve, that is, the morphology of the polytetrafluoroethylene tube corresponding to the first spectral curve is different from the morphology of the polytetrafluoroethylene tube corresponding to the second spectral curve. Since the vector directions of each data point in each second interval of each spectral curve change continuously, using the PCA (Principal Component Analysis) principal component analysis algorithm, based on the vector directions of each data point in each second interval, the second intervals in the first spectral curve and the second spectral curve are analyzed to obtain the principal component direction values of each second interval. The PCA principal component analysis algorithm is a prior art, and its implementation process will not be elaborated in detail here.
[0070] After obtaining the principal component direction values of each second interval, from the perspective of the principal component direction, the principal component direction values of each second interval in the first spectral curve and the second spectral curve are compared and analyzed to obtain the data difference degree of each second interval in the first spectral curve and the second spectral curve. Specifically, calculate the absolute value of the difference between the principal component direction values of each second interval between the first spectral curve and the second spectral curve, and use the absolute value of the difference as the first difference index of each second interval in these two spectral curves.
[0071] It should be noted that the first difference index of a certain second interval in the first spectral curve is equal to the first difference index of the second interval corresponding to the first spectral curve in the second spectral curve. Each second interval in the first spectral curve and the second spectral curve has a one-to-one correspondence. The larger the first difference index of the second interval, the greater the data difference between the two spectral curve segments corresponding to the second interval.
[0072] S322. Add the vector modulus values of each data point in each second interval of the first spectral curve and the vector modulus values of each data point in each second interval of the second spectral curve, and use the added value as the denominator of the ratio. When using the vector modulus value of each data point in each second interval of the first spectral curve as the numerator of the ratio, use the ratio as the first difference degree of each data point in each second interval of the first spectral curve. When using the vector modulus value of each data point in each second interval of the second spectral curve as the numerator of the ratio, use the ratio as the first difference degree of each data point in each second interval of the second spectral curve.
[0073] In this embodiment, each data point in the first spectral curve and each data point in the second spectral curve have a one-to-one correspondence. The two-dimensional data points in the spectral curve can be characterized as plane vectors, and the modulus value of the plane vector can be obtained by calculating the abscissa and ordinate of the data point. The calculation formula can be: , where is the two-dimensional data point in the spectral curve of the vector modulus value, is the binary function for partial derivative of, is the binary function of the spectral curve, is the binary function for partial derivative of. The process of calculating the vector modulus value of the data point is the prior art and will not be elaborated here in detail.
[0074] S323. Add the vector directions of each data point in each second interval of the first spectral curve and the vector directions of each data point in each second interval of the second spectral curve, and use the value after the addition process as the denominator of the ratio. When using the vector direction of each data point in each second interval of the first spectral curve as the numerator of the ratio, use the ratio as the second difference degree of each data point in each second interval of the first spectral curve. When using the vector direction of each data point in each second interval of the second spectral curve as the numerator of the ratio, use the ratio as the second difference degree of each data point in each second interval of the second spectral curve.
[0075] In this embodiment, the direction of the planar vector can also be obtained by calculating the abscissa and ordinate of the data point, and the calculation formula can be , is the data point of the vector direction, is the binary function for partial derivative of, is the binary function for partial derivative of, is for arctangent function operation. The process of calculating the vector direction of the data point is the prior art and will not be elaborated here in detail.
[0076] S324. Calculate the cumulative value of the sum of the first difference degree and the second difference degree of each data point in each second interval of the first spectral curve and the second spectral curve, use the cumulative value as the second difference index of each second interval, add the first difference index and the second difference index, and use the value after the addition process after negative correlation mapping as the data difference value of each second interval.
[0077] Based on steps S321 to S324, the data difference values corresponding to each second interval in the first spectral curve and the second spectral curve can be obtained. The calculation processes of the data difference values corresponding to each second interval in the first spectral curve and the data difference values corresponding to each second interval in the second spectral curve are similar. Taking the first spectral curve as an example, to calculate the data difference values corresponding to each second interval in the first spectral curve, its calculation formula can be:
[0078]
[0079] Wherein, is the data difference value corresponding to the j-th second interval in the first spectral curve, is the first spectral curve, is the second spectral curve, j is the serial number of the second interval in the spectral curve, is the principal component direction value of the j-th second interval in the first spectral curve, is the principal component direction value of the j-th second interval in the second spectral curve, is the first difference index of the i-th data point in the j-th second interval of the first spectral curve, is the exponential function with the natural constant e as the base of n is the number of data points in the j-th second interval of the first spectral curve, i is the serial number of the data point in the j-th second interval of the first spectral curve, is the vector modulus value of the i-th data point in the j-th second interval of the first spectral curve, is the vector modulus value of the i-th data point in the j-th second interval of the second spectral curve, is the first difference degree of the i-th data point in the j-th second interval of the first spectral curve, is the vector direction of the i-th data point in the j-th second interval of the first spectral curve, is the vector direction of the i-th data point in the j-th second interval of the second spectral curve, is the second difference degree of the i-th data point in the j-th second interval of the first spectral curve, is the second difference index of the j-th second interval of the first spectral curve.
[0080] In the above calculation formula of the data difference value, can represent the difference degree of the j-th pair of spectral curve segments corresponding to the first spectral curve and the second spectral curve in the principal component direction. The greater this difference degree, the greater the difference in the change of data points between the two spectral curve segments. and It can represent the degree of difference between the i-th data point in the j-th pair of spectral curve segments corresponding to the first spectral curve and the second spectral curve in terms of vector modulus and vector direction. The greater the difference between the vector moduli of the data points, the greater the difference in the ordinates of the data points; the greater the difference between the vector directions of the data points, the greater the difference in the slopes of the data points.
[0081] It should be noted that when analyzing the differences between two sets of data corresponding to two spectral curves, the original values of the two sets of data are relatively large. To facilitate the comparison of the data change trends of the two sets of data, the two-dimensional data points are converted into two-dimensional plane vectors, which can better represent the change differences between the data points of different spectral curves and improve the accuracy of the data difference values corresponding to the second interval. If the data difference value of a certain second interval is large, it indicates that the difference in the data change trends between the data to be processed and the comparison data corresponding to this second interval is large, and the data similarity degree is small. The possibility that the data to be processed corresponding to this second interval is abnormal is relatively large.
[0082] S4. Determine the data abnormality degree of each first interval according to the initial matching degree of the target spectral curve corresponding to each first interval and the data difference value corresponding to each second interval. According to the data abnormality degree of each first interval and the absorbance of each data point, determine the scaling weight of each data point. The steps include:
[0083] S41. Determine the data abnormality degree of each first interval according to the initial matching degree of the target spectral curve corresponding to each first interval and the data difference value corresponding to each second interval.
[0084] It should be noted that to improve the calculation efficiency of the data abnormality degree and facilitate the comparison of pairwise spectral curves, the maximum data difference value in each first interval is used to characterize the data difference degree of the first interval where it is located, and this maximum data difference value is used as the best data difference value corresponding to the first interval. By analyzing the initial matching degree of the target spectral curve corresponding to each first interval and the best data difference value in pairwise spectral curves, determine the data abnormality degree of each first interval in each spectral curve. Taking the first spectral curve and the second spectral curve as an example, calculate the second data abnormality degree of each first interval in the first spectral curve and the second spectral curve. The specific steps include:
[0085] S411. Perform a negative correlation mapping on the initial matching degree of the target spectral curve corresponding to each first interval in the first spectral curve and the second spectral curve, and use the negatively correlated mapped initial matching degree of the target spectral curve as the first data abnormality degree of each first interval.
[0086] It should be noted that each spectral curve has its corresponding initial matching degree of the target spectral curve. Performing a negative correlation mapping on the initial matching degree of the target spectral curve is to reasonably describe the relationship between the initial matching degree of the target spectral curve and the degree of abnormality of the first data, that is, the greater the initial matching degree of the target spectral curve, the smaller the degree of abnormality of the first data.
[0087] S412. Screen out the maximum data difference value in each first interval of the first spectral curve and the maximum data difference value in each first interval of the second spectral curve, calculate the cumulative value of the data difference values corresponding to each second interval in each first interval of each spectral curve, and use the cumulative value as the denominator of the ratio. When using the maximum data difference value corresponding to each first interval in the first spectral curve as the numerator of the ratio, use the ratio as the degree of abnormality of the second data in each first interval of the first spectral curve. When using the maximum data difference value corresponding to each first interval in the second spectral curve as the numerator of the ratio, use the ratio as the degree of abnormality of the second data in each first interval of the second spectral curve.
[0088] S413. Calculate the product of the degree of abnormality of the first data and the degree of abnormality of the second data in each first interval, and use the product as the degree of abnormality of the data in each first interval.
[0089] In this embodiment, the calculation formula for the degree of abnormality of the data in the first interval of the first spectral curve can be:
[0090]
[0091] Where, is the degree of abnormality of the data in the j-th first interval of the first spectral curve, is the first spectral curve, j is the serial number of the first interval in the first spectral curve, e is the natural constant, is the initial matching degree of the target spectral curve corresponding to the j-th first interval in the first spectral curve, is the degree of abnormality of the first data in the j-th first interval of the first spectral curve, The data difference values corresponding to each second interval in the j-th first interval of the first spectral curve, is the maximum data difference value corresponding to the j-th first interval in the first spectral curve, r is the serial number of each spectral curve, 3 is the number of spectral curves, and in this embodiment, the number of spectral curves is set to 3, is the data difference value corresponding to each second interval in the j-th first interval of the r-th spectral curve, is the degree of abnormality of the second data in the j-th first interval of the first spectral curve.
[0092] In the calculation formula for the degree of abnormality of the data, the initial matching degree of the target spectral curve The smaller it is, the greater the degree of data difference. Therefore, an exponential function is used to change the monotonicity of the function. The greater the possibility of anomalies in the spectral curve with the largest data difference, so when comparing each pair of first intervals in the two spectral curves, the maximum data difference value in the first interval is used to characterize the degree of data anomalies in the first interval; represents the cumulative sum of the data difference values corresponding to each second interval in each first interval among the three spectral curves. Since this embodiment performs anomaly detection on polytetrafluoroethylene pipe products in three different forms, the data difference values corresponding to each second interval are also in three groups, so the upper limit of the number r of spectral curves is 3.
[0093] It should be noted that the degree of data anomalies in each first interval helps to determine the scaling weights of each data point subsequently. Analyzing from two perspectives can effectively improve the reference value of the degree of data anomalies in the first interval, thereby improving the accuracy of polytetrafluoroethylene pipe anomaly detection.
[0094] S42. Determine the scaling weight of each data point according to the degree of data anomalies in each first interval and the absorbance of each data point.
[0095] It should be noted that for the spectral curve with a larger degree of data anomalies, the curve amplitude change and trend change are larger. Therefore, based on the degree of data anomalies, the absorbance of each data point can be scaled. The larger the degree of data anomalies, the smaller the matching degree of the data points in this first interval, and the larger the scaling weight during the scaling process; the smaller the degree of data anomalies, the larger the matching degree of the data points in this first interval, and the smaller the scaling weight during the scaling process.
[0096] In this embodiment, scaling the absorbance of each data point based on the degree of data anomalies in each first interval can reduce the matching differences between the spectral curves corresponding to polytetrafluoroethylene pipes in different forms. Taking the first spectral curve and the second spectral curve as an example, specifically:
[0097] S421. Calculate the difference in the absorbance of each data point in each first interval between the first spectral curve and the second spectral curve, and determine the degree of data anomalies after the negative correlation mapping corresponding to each first interval where each data point in the first spectral curve and the second spectral curve is located.
[0098] S422. Calculate the product of the difference in the absorbance of each data point in each first interval and the degree of data anomalies after the negative correlation mapping corresponding to each first interval where each data point in the first spectral curve is located, and use the product as the scaling weight of each data point in each first interval in the first spectral curve.
[0099] Among them, the calculation formula for the scaling weight of each data point in each first interval in the first spectral curve can be:
[0100]
[0101] Among them, is the scaling weight of each data point in the j-th first interval of the first spectral curve, is the first spectral curve, is the serial number of each first interval in the first spectral curve, is the absorbance of each data point in the j-th first interval of the first spectral curve, is the absorbance of each data point in the j-th first interval of the second spectral curve, is the second spectral curve, is the data abnormality degree of the j-th first interval in the first spectral curve, is the exponential function with the natural constant e as the base and as the exponent, that is, the data abnormality degree after negative correlation mapping, is for to perform normalization processing.
[0102] In the calculation formula of the scaling weight of the data point, can represent the amplitude difference between the two spectral curves, can represent the abnormality degree of the data points within the first interval. The greater the amplitude difference and the smaller the abnormality degree, the greater the scaling weight required for the data points. By calculating the scaling weights between each pair of spectral curves, the absorbance of each data point in each spectral curve is scaled, so as to reduce the difference between the data points with the same change trend, facilitating the subsequent acquisition of accurate data change relationships.
[0103] S423. Calculate the product of the difference in the absorbance of each data point in each first interval and the data abnormality degree after negative correlation mapping corresponding to the first interval where each data point in the second spectral curve is located, and use the product as the scaling weight of each data point in each first interval of the second spectral curve.
[0104] S5. According to the scaling weight and absorbance of each data point in each spectral curve, correct each spectral curve to obtain the corrected spectral curves. According to the absorbance of each data point in each first interval in the corrected spectral curves, determine the matching degree of the target spectral curve corresponding to each first interval.
[0105] In this embodiment, taking the first spectral curve as an example, based on the scaling weight of each data point in the first spectral curve, the absorbance of each data point can be corrected to obtain the corrected absorbance of each data point in the first spectral curve, and its calculation formula can be:
[0106]
[0107] Wherein, is the corrected absorbance of each data point in the j-th first interval of the first spectral curve, is the first spectral curve, is the serial number of each first interval in the first spectral curve, is the absorbance of each data point in the j-th first interval of the first spectral curve, is the absorbance of each data point in the j-th first interval of the second spectral curve, is the second spectral curve, is the scaling weight of each data point in the j-th first interval of the first spectral curve.
[0108] The scaling weight in the calculation formula of the corrected absorbance is the weight value of the difference in absorbance of the data points in the two spectral curves, which helps to obtain a more accurate corrected absorbance. It should be noted that, for the convenience of description, in this embodiment when performing data calculation, the first spectral curve is used as the data to be processed, and the second spectral curve is used as the comparison data. is the scaling weight of each data point in the j-th first interval of the first spectral curve, so here the absorbance of each data point in the first spectral curve is corrected.
[0109] After obtaining the corrected absorbance of each data point in each spectral curve, based on the corrected absorbance of each data point, the absorbance of each data point in each spectral curve is updated, that is, the absorbance of each data point in each spectral curve is updated to the corrected absorbance, and the corrected spectral curves can be obtained. Furthermore, based on the absorbance of each data point in each first interval of the corrected spectral curves, referring to the implementation process of the initial matching degree of the target spectral curve in step S22, a higher-precision spectral curve matching degree corresponding to each first interval can be obtained. At this time, each first interval can correspond to multiple spectral curve matching degrees. To improve the calculation efficiency, determine the maximum value among the multiple spectral curve matching degrees corresponding to each first interval, and use the spectral curve matching degree corresponding to the maximum value as the target spectral curve matching degree of the first interval.
[0110] S6. According to the slope value and absorbance of each data point in each spectral curve, determine the abnormality degree of each data point. According to the target spectral curve matching degree corresponding to each first interval and the abnormality degree of each data point, determine whether there is an abnormality in PTFE tubes of different shapes. The steps include:
[0111] S61. According to the slope value and absorbance of each data point in each spectral curve, determine the abnormality degree of each data point.
[0112] Among the spectral curves of polytetrafluoroethylene tubes in different forms, if there are data points in a certain spectral curve that are significantly different from those of other spectral curves, it is determined that the degree of influence of these data points by the quality problems of the polytetrafluoroethylene tubes is relatively large. Here, the significant difference means that compared with the data points at the same wavelength position in other spectral curves, the absorbance of the data points with significant differences will have large data changes. Therefore, in order to improve the accuracy of abnormal detection of polytetrafluoroethylene tubes, based on the slope values and absorbances of each data point in each spectral curve, the degree of abnormality of each data point is calculated to facilitate subsequent judgment of whether there are abnormalities in polytetrafluoroethylene tubes in different forms. The specific steps are as follows:
[0113] To facilitate determining the data value changes within the neighborhood range of the data points, it is necessary to artificially determine the neighborhood data points of each data point in each spectral curve. Here, the neighborhood data points refer to the data points adjacent to the data point, and the distance between the neighborhood data points and the data point can be 10 data points. Furthermore, the difference between the absorbance of each data point in the first spectral curve and the absorbance of its neighborhood data points is calculated. When taking the product of the absorbance difference corresponding to each data point in the first spectral curve and the slope value as the numerator of the ratio, and taking the product of the absorbance difference corresponding to each data point in the second spectral curve and the slope value as the denominator of the ratio, the ratio is taken as the degree of abnormality of each data point in the first spectral curve; when taking the product of the absorbance difference corresponding to each data point in the second spectral curve and the slope value as the numerator of the ratio, and taking the product of the absorbance difference corresponding to each data point in the first spectral curve and the slope value as the denominator of the ratio, the ratio is taken as the degree of abnormality of each data point in the second spectral curve.
[0114] In this embodiment, taking the first spectral curve as an example, the degree of abnormality of each data point in the first spectral curve is calculated, and its calculation formula can be:
[0115]
[0116] Among them, is the degree of abnormality of the i-th data point in the first spectral curve, where i is the serial number of each data point in the spectral curve, is the first spectral curve, is the slope value of the i-th data point in the first spectral curve, is the absorbance of the i-th data point in the first spectral curve, is the absorbance of the (i + t)-th data point in the first spectral curve, and the (i + t)-th data point is the neighborhood data point of the i-th data point, is the slope value of the i-th data point in the second spectral curve, is the second spectral curve, is the absorbance of the i-th data point in the second spectral curve, is the absorbance of the (i + t)-th data point in the second spectral curve.
[0117] In the calculation formula of the anomaly degree, and can characterize the change degree of the absorbance of the data points of the spectral curve within the neighborhood range of the data point. t can be set to 10 by the implementer. To obtain obvious data anomaly points, by comparing the slope values of the data points in the two spectral curves, the anomaly degree at the data point position can be characterized. If there is an anomaly in the i-th data point of the first spectral curve, there is a large difference in the slope change between the i-th data point of the first spectral curve and the i-th data point of the second spectral curve, and the absorbance of the data points within the neighborhood range also changes greatly. Therefore, using the slope value and absorbance can effectively improve the accuracy of the anomaly degree value of the data point. If there are curve changes in the first spectral curve and the second spectral curve, the slope value and absorbance at the position of the data point with curve changes will also change, that is, the ratio decreases, so as to distinguish the data points with data changes at the same position.
[0118] It should be noted that when judging whether a certain spectral curve has an anomaly, the data characteristic information of the spectral curve needs to be placed in the numerator position of the ratio for calculation, which helps to obtain the anomaly degree of each data point in each spectral curve. Compare the data points in the spectral curves of different forms. Determining the anomaly degree of the data points helps to obtain the data points with a larger anomaly degree, but cannot screen out the data points with the same data change trend but a larger anomaly degree. Therefore, when subsequently judging whether the polytetrafluoroethylene tube has an anomaly, two judgment indicators, namely the target spectral curve matching degree and the anomaly degree, are used to realize the anomaly judgment, which helps to improve the integrity of the anomaly judgment of the polytetrafluoroethylene tube.
[0119] S62, according to the target spectral curve matching degree corresponding to each first interval and the anomaly degree of each data point, judge whether the polytetrafluoroethylene tubes of different forms have anomalies.
[0120] In this embodiment, through the target spectral curve matching degree corresponding to each first interval in each spectral curve and the anomaly degree of each data point, it is reflected whether the spectral curves corresponding to the polytetrafluoroethylene tubes of different forms have anomalies. If there are anomalies, the anomaly degree of the data points is larger or the target spectral curve matching degree corresponding to the first interval is smaller. The specific content includes:
[0121] If the matching degree of the target spectral curve corresponding to any one of the first intervals is not greater than the preset matching degree threshold, it is determined that the polytetrafluoroethylene tubes of different shapes to be detected are abnormal, and the polytetrafluoroethylene tubes corresponding to the spectral curves of the first intervals with a matching degree not greater than the preset matching degree threshold are taken as abnormal polytetrafluoroethylene tubes; if the abnormality degree of any one data point is greater than the preset abnormality degree threshold, it is determined that the polytetrafluoroethylene tubes of different shapes to be detected are abnormal, and the polytetrafluoroethylene tubes corresponding to the spectral curves of the data points with an abnormality degree greater than the preset abnormality degree threshold are taken as abnormal polytetrafluoroethylene tubes; if the matching degree of the target spectral curve corresponding to any one of the first intervals is greater than the preset matching degree threshold and the abnormality degree of any one data point is not greater than the preset abnormality degree threshold, it is determined that the polytetrafluoroethylene tubes of different shapes to be detected are not abnormal.
[0122] It should be noted that the preset matching degree threshold can be set to 0.87, and the preset abnormality degree threshold can be set to 2.4. The set thresholds are all empirical thresholds, and the implementer can set them according to different real-time situations. To improve the accuracy of anomaly detection, when the abnormality degree of any one data point is greater than the preset abnormality degree threshold, the data point is marked, and then based on the comparison and analysis of this data point with the data points in other spectral curves, it is verified whether there is an abnormality in the data point here, which helps to improve the accuracy of the anomaly detection result of the polytetrafluoroethylene tube. If the polytetrafluoroethylene tubes of different shapes to be detected are abnormal, selecting the abnormal polytetrafluoroethylene tubes can effectively improve the reliability of the quality detection of the abnormal polytetrafluoroethylene tubes.
[0123] The present invention provides a method for detecting anomalies in polytetrafluoroethylene tubes for cyanide sampling. This method analyzes the abnormality degree and matching degree of each data point in different spectral curves according to the data change characteristics of the spectral curves corresponding to polytetrafluoroethylene tubes of different shapes, so as to judge whether there are anomalies in polytetrafluoroethylene tubes of different shapes, which effectively improves the accuracy and efficiency of anomaly detection of polytetrafluoroethylene tubes.
[0124] The above-described embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A method for detecting abnormalities in a polytetrafluoroethylene tube for cyanide sampling, characterized in that, Including the following steps: Obtain respective spectral curves corresponding to polytetrafluoroethylene tubes of different forms to be detected; Evenly divide each spectral curve into a preset number of sub-spectral curves, and use the sub-spectral curves as the first intervals in the spectral curve. According to the absorbance of each data point in each first interval of each spectral curve, determine the initial matching degree of the target spectral curve corresponding to each first interval; According to the slope of each data point in each first interval, determine each second interval in each first interval. According to the principal component direction value, the vector modulus value and the vector direction of each data point in each second interval, determine the data difference value corresponding to each second interval; According to the initial matching degree of the target spectral curve corresponding to each first interval and the data difference value corresponding to each second interval, determine the data abnormality degree of each first interval. According to the data abnormality degree of each first interval and the absorbance of each data point thereof, determine the scaling weight of each data point; According to the scaling weight and the absorbance of each data point in each spectral curve, correct each spectral curve to obtain the corrected spectral curves. According to the absorbance of each data point in each first interval of the corrected spectral curves, determine the matching degree of the target spectral curve corresponding to each first interval; According to the slope value and the absorbance of each data point in each spectral curve, determine the abnormality degree of each data point. According to the matching degree of the target spectral curve corresponding to each first interval and the abnormality degree of each data point, determine whether there are abnormalities in polytetrafluoroethylene tubes of different forms; Determine the initial matching degree of the target spectral curve corresponding to each first interval according to the absorbance of each data point in each first interval of each spectral curve, including: According to the absorbance of each data point in each first interval of any two spectral curves, use the DTW algorithm to perform matching processing on any two spectral curves to obtain multiple initial matching degrees of the spectral curves corresponding to each first interval. Select the maximum value from the multiple initial matching degrees of the spectral curves corresponding to each first interval, and use the initial matching degree of the spectral curve corresponding to the maximum value as the initial matching degree of the target spectral curve; According to the slope of each data point in each first interval, determine each second interval in each first interval, including: According to the slope of each data point in each first interval, determine the change trend of the slope of the data points in each first interval. The change trend is decreasing and increasing. Use the spectral curve segment corresponding to continuous decrease or continuous increase as the second interval in the first interval; According to the slope value and the absorbance of each data point in each spectral curve, determine the abnormality degree of each data point, including: Determine the neighborhood data points of each data point in each spectral curve, calculate the difference between the absorbance of each data point in the first spectral curve and the absorbance of its neighborhood data points, and calculate the difference between the absorbance of each data point in the second spectral curve and the absorbance of its neighborhood data points; When taking the product of the absorbance difference corresponding to each data point in the first spectral curve and the slope value as the numerator of the ratio, taking the product of the absorbance difference corresponding to each data point in the second spectral curve and the slope value as the denominator of the ratio, and taking the ratio as the degree of abnormality of each data point in the first spectral curve; when taking the product of the absorbance difference corresponding to each data point in the second spectral curve and the slope value as the numerator of the ratio, taking the product of the absorbance difference corresponding to each data point in the first spectral curve and the slope value as the denominator of the ratio, and taking the ratio as the degree of abnormality of each data point in the second spectral curve.
2. The abnormal detection method of a polytetrafluoroethylene tube for cyanide sampling according to claim 1, characterized in that, Determine the data difference values corresponding to each second interval according to the principal component direction values of each second interval, the vector modulus values of each data point, and the vector directions, including: Obtain the first spectral curve and the second spectral curve in each spectral curve. According to the principal component direction values of each second interval in the first spectral curve and the second spectral curve, calculate the absolute value of the difference between the principal component direction values of each second interval between the two spectral curves, and take the absolute value of the difference as the first difference index of each second interval between the two spectral curves. The first spectral curve and the second spectral curve are both any one spectral curve in each spectral curve, and the first spectral curve is different from the second spectral curve; Perform an addition process on the vector modulus values of each data point in each second interval of the first spectral curve and the vector modulus values of each data point in each second interval of the second spectral curve, and take the value after the addition process as the denominator of the ratio. When taking the vector modulus value of each data point in each second interval of the first spectral curve as the numerator of the ratio, take the ratio as the first difference degree of each data point in each second interval of the first spectral curve. When taking the vector modulus value of each data point in each second interval of the second spectral curve as the numerator of the ratio, take the ratio as the first difference degree of each data point in each second interval of the second spectral curve; Perform an addition process on the vector directions of each data point in each second interval of the first spectral curve and the vector directions of each data point in each second interval of the second spectral curve, and take the value after the addition process as the denominator of the ratio. When taking the vector direction of each data point in each second interval of the first spectral curve as the numerator of the ratio, take the ratio as the second difference degree of each data point in each second interval of the first spectral curve. When taking the vector direction of each data point in each second interval of the second spectral curve as the numerator of the ratio, take the ratio as the second difference degree of each data point in each second interval of the second spectral curve; Calculate the cumulative value of the sum of the first difference degree and the second difference degree of each data point in each second interval of the first spectral curve and the second spectral curve, take the cumulative value as the second difference index of each second interval, perform an addition process on the first difference index and the second difference index, and take the value after the addition process after negative correlation mapping as the data difference value of each second interval.
3. The abnormal detection method of the polytetrafluoroethylene tube for cyanide sampling according to claim 2, characterized in that, Determine the data abnormality degree of each first interval according to the initial matching degree of the target spectral curve corresponding to each first interval and the data difference value corresponding to each second interval, including: Perform a negative correlation mapping on the initial matching degree of the target spectral curve corresponding to each first interval in the first spectral curve and the second spectral curve, and use the initial matching degree of the target spectral curve after the negative correlation mapping as the first data anomaly degree of each first interval; Screen out the maximum data difference value in each first interval of the first spectral curve and the maximum data difference value in each first interval of the second spectral curve, calculate the cumulative value of the data difference values corresponding to each second interval in each first interval of each spectral curve, and use the cumulative value as the denominator of the ratio. When using the maximum data difference value corresponding to each first interval in the first spectral curve as the numerator of the ratio, use the ratio as the second data anomaly degree of each first interval in the first spectral curve. When using the maximum data difference value corresponding to each first interval in the second spectral curve as the numerator of the ratio, use the ratio as the second data anomaly degree of each first interval in the second spectral curve; Calculate the product of the first data anomaly degree and the second data anomaly degree of each first interval, and use the product as the data anomaly degree of each first interval.
4. The abnormal detection method of the polytetrafluoroethylene tube for cyanide sampling according to claim 3, characterized in that, Determine the scaling weight of each data point according to the data anomaly degree of each first interval and the absorbance of each data point, including: Calculate the difference in absorbance of each data point in each first interval between the first spectral curve and the second spectral curve, and determine the data anomaly degree after negative correlation mapping corresponding to the first interval where each data point in the first spectral curve and the second spectral curve is located; calculate the product of the difference in absorbance of each data point in each first interval and the data anomaly degree after negative correlation mapping corresponding to the first interval where each data point in the first spectral curve is located, and use the product as the scaling weight of each data point in each first interval of the first spectral curve; calculate the product of the difference in absorbance of each data point in each first interval and the data anomaly degree after negative correlation mapping corresponding to the first interval where each data point in the second spectral curve is located, and use the product as the scaling weight of each data point in each first interval of the second spectral curve.
5. The abnormal detection method of the polytetrafluoroethylene tube for cyanide sampling according to claim 4, characterized in that, Correct each spectral curve according to the scaling weight and absorbance of each data point in each spectral curve to obtain the corrected spectral curves of each, including: Determine the corrected absorbance corresponding to each data point in the first spectral curve according to the scaling weight and absorbance of each data point in the first spectral curve and the absorbance of each data point in the second spectral curve. The calculation formula is: Wherein, is the corrected absorbance of each data point in the j-th first interval of the first spectral curve, is the first spectral curve, is the serial number of each first interval in the first spectral curve, is the absorbance of each data point in the j-th first interval of the first spectral curve, is the absorbance of each data point in the j-th first interval of the second spectral curve, is the second spectral curve, is the scaling weight of each data point in the j-th first interval of the first spectral curve; Update the absorbance of each data point in the first spectral curve to the corrected absorbance to obtain the corrected spectral curves of each.
6. The abnormal detection method of a polytetrafluoroethylene tube for cyanide sampling according to claim 1, characterized in that Judge whether there is an anomaly in polytetrafluoroethylene tubes of different forms according to the matching degree of the target spectral curve corresponding to each first interval and the anomaly degree of each data point, including: If the matching degree of the target spectral curve corresponding to any one first interval is not greater than the preset matching degree threshold, it is determined that there is an anomaly in the polytetrafluoroethylene tubes of different forms to be detected, and the polytetrafluoroethylene tubes of the spectral curve corresponding to the first interval with a matching degree not greater than the preset matching degree threshold are used as abnormal polytetrafluoroethylene tubes; If the abnormality degree of any data point is greater than the preset abnormality degree threshold, it is determined that there is an abnormality in the polytetrafluoroethylene tubes of different shapes to be detected, and the polytetrafluoroethylene tube corresponding to the spectral curve of the data point greater than the preset abnormality degree threshold is used as the abnormal polytetrafluoroethylene tube; If the matching degree of the target spectral curve corresponding to any first interval is greater than the preset matching degree threshold and the abnormality degree of any data point is not greater than the preset abnormality degree threshold, it is determined that there is no abnormality in the polytetrafluoroethylene tubes of different shapes to be detected.
Citation Information
Patent Citations
Flow injection colorimetry cyanogen measuring instrument for measuring cyanide content
CN101441178A
Automobile part coating color difference abnormity detection system based on spectral data
CN117349683A