Centipede quality identification method, system and device and storage medium

By obtaining the characteristic parts and color samples of centipedes, combining component content and length information, using convolutional neural networks to identify centipedes’ quality, solving the problem of time-consuming and inconvenient centipedes’ quality recognition in the existing technology, and achieving fast and accurate centipedes’ quality recognition.

CN120220140AActive Publication Date: 2025-06-27CHANGSHA UNIVERSITY OF SCIENCE AND TECHNOLOGY
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202510297557.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-13
Publication Date
2025-06-27
Estimated Expiration
2045-03-13

AI Technical Summary

Technical Problem

The prior art is difficult to quickly and conveniently identify the quality of centipedes, especially for inexperienced buyers and merchants, traditional sampling and detection methods are time-consuming and inconvenient for real-time judgment.

Method used

By obtaining the sample pictures and color sample pictures of the characteristic parts of the thorny giant centipede, extracting the color matrix and screening it, combining the component content and length information, using a convolutional neural network for training, establishing a centipede quality level comparison table to quickly identify the quality of the centipede.

Benefits of technology

It realizes rapid and accurate identification of centipede quality without cumbersome component testing, and can easily provide the quality level of centipede, improving the judgment efficiency of buyers and merchants.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120220140A_ABST
    Figure CN120220140A_ABST
Patent Text Reader

Abstract

The invention discloses a centipede quality identification method, system and equipment and a storage medium, and the method comprises the steps: obtaining a feature part sample picture and a color sample picture of a Scolopendra subspinipes giganteus, calculating a color score and a length score according to the color sample picture, measuring the content of components, obtaining a component score, combining the length score and the color score to obtain a final score, and carrying out the recognition of the quality of the Scolopendra subspinipes giganteus. And establishing a centipede quality grade comparison table. Preprocessing the feature part sample pictures, performing deformable convolution to obtain extracted features, inputting the extracted features into a convolutional neural network for training to obtain a centipede category training network, training a centipede quality grade training network by using color sample pictures, and inputting actual pictures into the category training network to obtain a centipede quality grade training network; and inputting the pictures corresponding to the centipedes with the centipede categories being the scolopendra subspinipes giganteus into the centipede quality grade training network to obtain the centipede quality grade corresponding to the actual pictures. When the method is actually used, the component content does not need to be tested, and the centipede quality grade can be obtained only through the picture.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of centipede quality identification, and specifically discloses a centipede quality identification method, system, device and storage medium. Background Art

[0002] In recent years, with the increasing recognition of traditional Chinese medicine by people, the demand for centipedes has been increasing year by year. Scolopendra subspinipes mutilans is the specified centipede that can be used as medicine. However, there are certain requirements for the color, length and chemical composition content of centipedes used as medicine. Experienced merchants and buyers can judge the quality of centipedes by their color, length and smell. It is very difficult for inexperienced buyers and merchants to judge the quality of centipedes, which has certain limitations for purchasing centipedes.

[0003] In related technologies, the quality detection of centipedes is mainly through sampling detection. In a batch of centipede samples, a part of centipedes are randomly selected, and then the quality of centipedes is detected by using high performance liquid chromatography technology and the analysis method of one standard multi-detection.

[0004] Aiming at the above related technologies, it is difficult for both merchants and buyers to conveniently detect the chemical components of centipede samples, and it is impossible to conveniently obtain the centipede quality grade through this method, and it takes a long time. Summary of the Invention

[0005] The technical problem to be solved by the present invention is to provide a centipede quality identification method, system, device and storage medium, which can quickly identify the quality of centipedes.

[0006] A centipede quality identification method includes:

[0007] Obtaining sample pictures of characteristic parts and color sample pictures of Scolopendra subspinipes mutilans;

[0008] According to the color sample pictures, extracting a color matrix, where the color matrix includes a head color matrix, a back color matrix and an abdomen color matrix;

[0009] Selecting two quantiles, and forming an acceptance region according to the two quantiles. Screening the elements in the color matrix according to the acceptance region to obtain screened elements, and calculating a mean vector according to the screened elements;

[0010] Converting the mean vector through the HIS model to obtain a conversion vector;

[0011] Screening centipedes according to the conversion vector and color constraint conditions to obtain screened centipedes, and obtaining the color score of centipedes according to the conversion vectors and color formulas of the screened centipedes;

[0012] Obtaining the test component content of the screened centipedes;

[0013] Generate a component matrix based on the content of the test components, and screen the centipedes according to the component matrix and component constraint conditions to obtain the remaining centipedes. Number the remaining centipedes to obtain a number matrix, and perform a scaling process on the number matrix to obtain a filling matrix;

[0014] Obtain a penalty coefficient;

[0015] Obtain component scores according to the filling matrix, the penalty coefficient, and weight constraint conditions;

[0016] Calculate a length score according to the length of the centipede;

[0017] Obtain a final score according to the length score, the component score, and the color score, perform a normal distribution on the final score, and establish a centipede quality grade comparison table;

[0018] Perform grayscale processing on the feature image to obtain a processed centipede image;

[0019] Preprocess the processed centipede image to obtain a preprocessed image;

[0020] Obtain extracted features by passing the preprocessed image through deformable convolution;

[0021] Input the extracted features into a category convolutional neural network for training to obtain a centipede category training network;

[0022] Obtain the color sample images corresponding to the remaining centipedes as category training set images;

[0023] Normalize the category training set images to obtain normalized images, and crop the normalized images to obtain a set of cropped images;

[0024] Input the set of cropped images and the centipede quality grade comparison table into a grade convolutional neural network for training to obtain a centipede quality grade training network;

[0025] Input the actual feature image into the category training network, and input the actual color image corresponding to the centipede category of Scolopendra subspinipes mutilans into the centipede quality grade training network to obtain the centipede quality grade corresponding to the actual image.

[0026] Optionally, the steps of selecting two quantiles, forming an acceptance region according to the two quantiles, screening the elements in the color matrix according to the acceptance region to obtain screened elements, and calculating a mean vector according to the screened elements include:

[0027] Analyze each column of the head color matrix, back color matrix, and abdominal color matrix respectively, select the elements within the acceptance region to obtain the head screening elements, back screening elements, and abdominal screening elements;

[0028] Calculate the mean values of the head screening elements, back screening elements, and abdominal screening elements respectively to obtain the head mean vector, abdominal mean vector, and back mean vector, and form the mean vector of the color values of different parts according to the head mean vector, abdominal mean vector, and back mean vector.

[0029] Optionally, generate a component matrix according to the test component content, and screen the screened centipedes according to the component matrix and component constraint conditions to obtain the remaining centipedes, number the remaining centipedes to obtain a number matrix, and perform a scaling process on the number matrix to obtain a weight matrix, including:

[0030] The test component content includes moisture content, total ash content, aflatoxin content, and extract content, and the aflatoxin content includes aflatoxin B1, aflatoxin G2, aflatoxin G1, and aflatoxin B2;

[0031] Construct a component matrix with the moisture content as the first column, total ash content as the second column, aflatoxin B1 content as the third column, total content of aflatoxin G2, aflatoxin G1, aflatoxin B2, and aflatoxin B1 as the fourth column, and extract content as the fifth column;

[0032] Screen the screened centipedes according to the component matrix and component constraint conditions to obtain the remaining centipedes, and number the remaining centipedes to obtain a number matrix;

[0033] Represent each element in the number matrix in scientific notation, find the maximum element in each column of the number matrix and sort them;

[0034] Perform numerical scaling on all elements in each column in column order to obtain new elements, and form a filling matrix.

[0035] Optionally, the obtaining of the component score according to the filling matrix, the penalty coefficient, and the weight constraint conditions includes:

[0036] Obtain the influence weights of different component contents on the content scores of the pharmacodynamic chemical components of centipedes;

[0037] According to the filling matrix, the influence weights, the penalty coefficient, and the component score formula, obtain the component score;

[0038] The component score formula is expressed as:

[0039] S = C·WT -A * ·σ T ;

[0040] Wherein, S is the component fraction, W is the weight matrix composed of influence weights, σ is the penalty coefficient, A * is the test component content matrix corresponding to the filling matrix extracted from the component matrix, C is the filling matrix, and T is the transpose matrix.

[0041] Optionally, calculating the length fraction according to the length of the centipede includes:

[0042] Obtain the prices of Scolopendra subspinipes mutilans with different lengths and widths, and calculate the average unit price;

[0043] Draw a three-dimensional image with length as the x-axis, width as the y-axis, and average unit price as the z-axis, and perform interpolation processing to obtain an interpolated image;

[0044] Scale the Z-axis of the interpolated image to obtain the scaled Z-axis length;

[0045] Use the fitting algorithm of the least squares method to fit the correlation function of the scaled Z-axis length with respect to length x and width y;

[0046] Obtain the length fraction according to the correlation function and the length of Scolopendra subspinipes mutilans.

[0047] Optionally, obtaining the extracted features by performing deformable convolution on the preprocessed image includes:

[0048] Set the offset;

[0049] Select a number of sampling points on the preprocessed image;

[0050] Obtain the actual offset according to the sampling points and the offset;

[0051] Obtain the extracted features according to the actual offset and the deformable convolution formula.

[0052] Optionally, the deformable convolution formula is:

[0053]

[0054] Wherein, is the offset, is the actual offset, is the convolution kernel coefficient.

[0055] A centipede quality identification system, comprising:

[0056] A first acquisition module for acquiring sample pictures of the characteristic parts of Scolopendra subspinipes mutilans;

[0057] The first extraction module is used to extract a color matrix according to the color sample picture, and the color matrix includes a head color matrix, a back color matrix, and an abdominal color matrix;

[0058] The first calculation module is used to select two quantiles, form an acceptance region according to the two quantiles, screen the elements in the color matrix according to the acceptance region to obtain screened elements, and calculate a mean vector according to the screened elements;

[0059] The conversion module is used to convert the mean vector through the HIS model to obtain a conversion vector;

[0060] The second calculation module is used to screen centipedes according to the conversion vector and color constraints to obtain screened centipedes, and obtain the color score of the centipedes according to the conversion vectors and color formulas of the screened centipedes;

[0061] The second acquisition module is used to acquire the test component content of the screened centipedes;

[0062] The screening module is used to generate a component matrix according to the test component content, screen the screened centipedes according to the component matrix and component constraints to obtain remaining centipedes, number the remaining centipedes to obtain a number matrix, and perform a scaling process on the number matrix to obtain a filling matrix;

[0063] The third acquisition module is used to acquire a penalty coefficient;

[0064] The third calculation module is used to obtain a component score according to the filling matrix, the penalty coefficient, and weight constraints;

[0065] The fourth calculation module is used to calculate a length score according to the length of the centipede;

[0066] The establishment module is used to obtain a final score according to the length score, the component score, and the color score, perform a normal distribution on the final score, and establish a centipede quality grade comparison table;

[0067] The grayscale processing module is used to perform grayscale processing on the feature picture to obtain a processed centipede image;

[0068] The second extraction module is used to obtain extraction features by performing deformable convolution on the preprocessed image;

[0069] The first training module is used to input the extraction features into a category convolutional neural network for training to obtain a centipede category training network;

[0070] The fourth acquisition module is used to acquire the color sample pictures corresponding to the remaining centipedes as category training set pictures;

[0071] A preprocessing module, configured to normalize the pictures in the category training set to obtain normalized pictures, and crop the normalized pictures to obtain a set of cropped pictures;

[0072] A second training module, configured to input the set of cropped pictures and the centipede quality grade comparison table into a grade convolutional neural network for training to obtain a centipede quality grade training network;

[0073] An identification module, configured to input an actual feature picture into the category training network, and input an actual color picture corresponding to the centipede category of Scolopendra subspinipes mutilans into the centipede quality grade training network to obtain the centipede quality grade corresponding to the actual picture.

[0074] A terminal device includes a memory and a processor. The memory stores a computer program that can run on the processor. When the processor loads and executes the computer program, a centipede quality identification method is adopted.

[0075] A computer-readable storage medium stores a computer program. When the computer program is loaded and executed by a processor, a centipede quality identification method is adopted.

[0076] The beneficial effects of the present invention are as follows:

[0077] Select Scolopendra subspinipes mutilans samples, take pictures to obtain characteristic part sample pictures and color sample pictures. According to the color sample pictures, calculate the color score and the length score. By measuring the component content, obtain the component score. Obtain the final score according to the color score, the length score and the component score, and establish a centipede quality grade comparison table. Then use the characteristic part sample pictures, after preprocessing, obtain the extracted features through deformable convolution, and then input them into a convolutional neural network for training to obtain a category training network. Preprocess the color sample pictures and input them into the convolutional neural network for training to obtain a centipede quality grade training network. Input the actual pictures into the category training network, and input the pictures corresponding to the centipede category of Scolopendra subspinipes mutilans into the centipede quality grade training network to obtain the centipede quality grade corresponding to the actual pictures. When the present application is actually used, there is no need to test the component content, and only by taking pictures, the quality grade of the centipede can be obtained. Description of the Drawings

[0078] Figure 1 It is the centipede quality grade comparison table of the present invention. Detailed Embodiments

[0079] A centipede quality identification method, the present invention includes:

[0080] S1. Obtain sample pictures of the characteristic parts and color and luster sample pictures of Scolopendra subspinipes mutilans.

[0081] Specifically, Scolopendra subspinipes mutilans is the specified centipede that can be used as medicine.

[0082] Place the sample centipede in the center of a 20 cm × 20 cm white background, and take pictures of the front and back sides of the centipede with a length-width ratio of 1:1 to obtain the color and luster photos of the front and back sides of each sample. At the same time, according to the pixel value L of the length of the taken picture, the length per pixel (LPP) of the picture can be calculated. The calculation formula is:

[0083]

[0084] Place the sample centipede in the center of a 1 cm × 1 cm white background, and take pictures of the characteristic parts of the centipede (the rear end of the basal lateral plate, the outer and inner sides of the ventral surface of the anterior femur of the last pair of walking legs, and the inner side of the dorsal surface of the anterior femur of the last pair of walking legs) with a length-width ratio of 1:1 to obtain the characteristic part pictures of each centipede.

[0085] S2. According to the color and luster sample pictures, extract the color and luster matrix, and the color and luster matrix includes the head color and luster matrix, the back color and luster matrix, and the abdominal color and luster matrix.

[0086] Determine the area for extracting the color and luster matrix in all the color and luster photos. There are various interferences such as mouthparts and antennae on the head of the centipede. Then select the position of the centipede's head to obtain an area without interference. Divide a rectangular area of 20 × 20 pixels in this area, and take equally spaced points. A total of 100 points are taken to obtain the head color and luster matrix. Its head color and luster matrix is:

[0087]

[0088] Compared with the head of the centipede, there is less interference on the back. Avoid the connection parts of the dorsal plates, select five dorsal plates in the middle, select an area for each dorsal plate, divide a rectangular area of 10 × 10 pixels in each area, take equally spaced points, select 20 points for each rectangular area, and a total of 100 points are taken to obtain the back color and luster matrix. Its back color and luster matrix is:

[0089]

[0090] The centipede is composed of a series of repeating body segments called somites. Therefore, the abdominal structure is similar to the dorsal plate structure. Just avoid the connection parts of the abdomen for area selection. The five dorsal plates in the middle correspond to five abdominal parts. Select an area for each abdominal part, divide a rectangular area of 10 × 10 pixels in each area, take equally spaced points, select 20 points for each rectangular area, and a total of 100 points are taken to obtain the abdominal color and luster matrix. Its abdominal color and luster matrix is:

[0091]

[0092] The value of R represents the value of the centipede on the red channel, while G and B respectively represent the values on the green and blue channels. The value range of all values is an integer from 0 to 255.

[0093] S3. Select two quantiles, form an acceptance region according to the two quantiles, screen the elements in the color matrix according to the acceptance region to obtain the screened elements, and calculate the mean vector according to the screened elements.

[0094] Selecting two quantiles, forming an acceptance region according to the two quantiles, screening the elements in the color matrix according to the acceptance region to obtain the screened elements, and calculating the mean vector according to the screened elements includes:

[0095] Analyze each column of the head color matrix, the back color matrix, and the abdominal color matrix respectively, select the elements within the acceptance region to obtain the head screened elements, the back screened elements, and the abdominal screened elements.

[0096] Calculate the mean of the head screened elements, the back screened elements, and the abdominal screened elements respectively to obtain the head mean vector, the abdominal mean vector, and the back mean vector, and form the mean vector of the color values of different parts according to the head mean vector, the abdominal mean vector, and the back mean vector.

[0097] Taking the head color matrix HC as an example, analyze each column of the head color matrix. Taking the first column as an example, arrange all the elements of the first column in ascending order, select the data falling between the 0.025 quantile and the 0.925 quantile, and record the two quantiles as:

[0098]

[0099] Take these two points as the acceptance region for the head red channel value, and the acceptance region is denoted as:

[0100]

[0101] The processing methods of the remaining two columns are the same as that of the first column, and the other two acceptance regions can be obtained. The acceptance regions are:

[0102]

[0103] Perform the same processing on the back color matrix BC and the abdominal color matrix AC, and obtain the following acceptance regions in a similar naming method. The acceptance regions are:

[0104]

[0105] The number of centipedes remaining within the acceptance region is denoted as n. The mean value of all elements within the acceptance region is calculated to obtain the mean vector of the color values for different body parts. The mean vector is as follows:

[0106]

[0107] Among them, is the mean vector of the head, is the mean vector of the back, is the mean vector of the abdomen, is the pigment value of the head color matrix, is the pigment value of the back color matrix, is the pigment value of the abdomen color matrix.

[0108] S4. The mean vector is transformed through the HIS model to obtain the transformed vector.

[0109] Specifically, compared with RGB images, HIS images can better compare the saturation differences of similar colors, and thus better reflect the color differences. Therefore, the above all data are transformed into the HIS (hue, saturation, intensity) model using the formula. Among them, the hue represents the color type, the saturation reflects the purity of the color, and the intensity represents the brightness of the color. The transformation formula is:

[0110]

[0111] The transformed acceptance region is denoted as:

[0112]

[0113] The transformed mean vector is denoted as:

[0114]

[0115] S5. According to the transformed vector and the color constraint conditions, the centipedes are screened to obtain the screened centipedes. According to the transformed vector of the screened centipedes and the color formula, the color score of the centipedes is obtained.

[0116] Specifically, the color constraint conditions are:

[0117]

[0118] For centipedes that do not meet the color constraint conditions, the color score is 0 points. For centipedes that meet the color constraint conditions, the specific color score is calculated using the color formula. The color formula is:

[0119]

[0120] Among them, τ g (g = 1, 2, 3, 4, 5, 6) is obtained by the expert evaluation method, which is used to reflect the influence coefficients of the colors and color saturations of different parts on the centipede color score, and the score value range is restricted by weighted calculation. The restriction conditions are as follows:

[0121] 0 < cs ≤ 100

[0122] S6. Obtain the test component contents of the screened centipedes.

[0123] S7. Generate a component matrix according to the test component contents, and screen the screened centipedes according to the component matrix and component constraint conditions to obtain the remaining centipedes. Number the remaining centipedes to obtain a number matrix, and perform a scaling process on the number matrix to obtain a filling matrix.

[0124] Generate a component matrix according to the test component contents, and screen the screened centipedes according to the component matrix and component constraint conditions to obtain the remaining centipedes. Number the remaining centipedes to obtain a number matrix, and perform a scaling process on the number matrix to obtain a weight matrix including:

[0125] The test component contents include moisture content, total ash content, aflatoxin content and extract content. The aflatoxin content includes aflatoxin B1, aflatoxin G2, aflatoxin G1 and aflatoxin B2.

[0126] Take the moisture content as the first column, the total ash content as the second column, the aflatoxin B1 content as the third column, the total content of aflatoxin G2, aflatoxin G1, aflatoxin B2 and aflatoxin B1 as the fourth column, and the extract content as the fifth column to construct a component matrix.

[0127] Specifically, use all n samples within the above acceptance range to measure the contents of moisture, total ash and aflatoxin.

[0128] Establish an n×5 order matrix A, and fill matrix A with the detection results, where the moisture content is the first column, the total ash content is the second column, the aflatoxin B1 content is the third column, the total content of aflatoxin G2, aflatoxin G1, aflatoxin B2 and aflatoxin B1 is the fourth column, and the extract content is the fifth column. Matrix A is:

[0129]

[0130] The extract is determined by the hot extraction method under the alcohol-soluble extract determination method (General Rule 2201), and dilute ethanol is used as the solvent, not less than 20.0%.

[0131] According to the ingredient matrix and ingredient constraint conditions, screen the screened centipedes to obtain the remaining centipedes, number the remaining centipedes, and obtain the number matrix.

[0132] Specifically, according to the requirements for moisture, total ash, and aflatoxin when centipedes are used as medicine, five constraint conditions are established for the elements in the above matrix A. The constraint conditions are:

[0133]

[0134] Among them, a i,1 is the moisture content, a i,2 is the total ash content, a i,3 is the aflatoxin B1 content, a i,4 is the total content of aflatoxin G2, aflatoxin G1, aflatoxin B2, and aflatoxin B1, and a i,5 is the extract content.

[0135] All centipedes that meet the above conditions are obtained, the number of remaining centipedes is denoted as n', and they are renumbered 1, 2, …, n'. To reduce the detection cost, only the centipedes with the above new numbers are detected for the content of pharmacodynamic chemical components (assuming there are j kinds of pharmacodynamic chemical components). Record the detected results to obtain the matrix of the content of pharmacodynamic chemical components of centipedes, denoted as the number matrix B. The B matrix is:

[0136]

[0137] Represent each element in the number matrix in scientific notation, find the maximum element in each column of the number matrix and sort them.

[0138] Specifically, represent each element in the B matrix in scientific notation. The representation method is:

[0139]

[0140] Scale the values of all elements in each column in column order and obtain new elements to form a filling matrix.

[0141] Specifically, find the maximum element in each column of the B matrix. The representation method is:

[0142]

[0143] Scale the values of all elements in each column in column order and obtain a new element c x,y . The scaling formula is:

[0144]

[0145] Use the filling matrix C with element c x,y . The C matrix is:

[0146]

[0147] S8. Obtain the penalty coefficient.

[0148] Specifically, since moisture, total ash, and aflatoxin have a direct impact on the quality of centipedes, when calculating the content fraction of the pharmacodynamic chemical components of centipedes with all three contents being qualified, consider these three as penalty factors and determine the penalty coefficients of these three (moisture, total ash, aflatoxin) through the expert evaluation method. The penalty coefficients are as follows:

[0149] σ = (σ1, σ2, σ3, σ4)

[0150] S9. Obtain the component fraction according to the filling matrix, penalty coefficient, and weight constraint conditions.

[0151] Obtaining the component fraction according to the filling matrix, penalty coefficient, and weight constraint conditions includes:

[0152] Obtain the influence weight of different component contents on the content fraction of the pharmacodynamic chemical components of centipedes.

[0153] Specifically, to simplify the calculation of the pharmacodynamic chemical content fraction and ensure that the selected weights are of reference value, the weights can be set to meet the following constraint conditions. The weight constraint conditions are:

[0154]

[0155] Obtain the component fraction according to the filling matrix, influence weight, penalty coefficient, and component fraction formula.

[0156] The component fraction formula is expressed as:

[0157] S = C · W T - A * · σ T .

[0158] Among them, S is the component fraction, W is the weight matrix composed of influence weights, σ is the penalty coefficient, A * is the test component content matrix corresponding to the filling matrix extracted from the component matrix, C is the filling matrix, and T is the transpose matrix.

[0159] When any one of the moisture, total ash, aflatoxin content, and extract content of the centipede is unqualified, the content fraction of its pharmacodynamic chemical components is recorded as 0 points. The formula is:

[0160] S = 0

[0161] S10. Calculate the length fraction according to the length of the centipede.

[0162] Calculating the length fraction according to the length of the centipede includes:

[0163] Obtain the prices of Scolopendra subspinipes mutilans with different lengths and widths, and calculate the average unit price.

[0164] Draw a three-dimensional image with length as the x-axis, width as the y-axis, and average unit price as the z-axis, and perform interpolation processing to obtain an interpolated image.

[0165] Scale the z-axis of the interpolated image to obtain the scaled z-axis length.

[0166] Use the fitting algorithm of the least squares method to fit the correlation function of the scaled z-axis length with respect to length x and width y.

[0167] According to the correlation function and the length of Scolopendra subspinipes mutilans, obtain the length fraction.

[0168] Specifically, collect the prices of centipedes with different lengths and widths on the market and record them. Input these data into an Excel table in the order of length, width, and unit price for storage.

[0169] For the situation where there are multiple different unit prices corresponding to the same length and width in the stored data, the following processing should be carried out: calculate the average value of these unit prices, and use this average unit price to replace the unit price of the centipede under this specific length and width.

[0170] Based on the above data, use MATLAB to draw a three-dimensional image with length as the x-axis, width as the y-axis, and average unit price as the z-axis.

[0171] Analyze the drawn image, and use the interp3 function to perform interpolation processing on the image to obtain a new image.

[0172] Scale the z-axis of the image, denoted as Z' (scaled z-axis length). The calculation formula is:

[0173]

[0174] Use the fitting algorithm of the least squares method to fit the function of Z' with respect to length x and width y. Its function expression is:

[0175] Z′ = g(x,y)

[0176] According to the records in the Chinese Pharmacopoeia, the length range of centipedes is 9 - 15 cm. When calculating the centipede length fraction, when the length is greater than 9 cm, use the formula to calculate the length fraction value. The formula is:

[0177] L = Z′ = g(x,y)

[0178] If the length is less than 9 cm, the length fraction is recorded as 0 points. The formula is:

[0179] L = 0

[0180] Calculate the final score S end . Include:

[0181] Determine the influence weights of the above three aspects on the overall quality of centipedes through the expert evaluation method. Denote them as and satisfy the equation. The equation is:

[0182]

[0183] Define the function:

[0184]

[0185] The formula for calculating the final score is:

[0186]

[0187] S11. Obtain the final score based on the length score, component score, and color score, perform a normal distribution on the final score, and establish a centipede quality grade comparison table.

[0188] Specifically, centipedes with a final score of 0 are unqualified centipedes in terms of quality. Extract all scores greater than 0 from the final scores and perform a normal test on these scores.

[0189] If it conforms to the normal distribution, no box-cox transformation is performed. If it does not conform to the normal distribution, the data is subjected to box-cox transformation to obtain new score values that satisfy the normal distribution.

[0190] Denote the mean and standard deviation in both cases as μ and σ. Determine the centipede quality grade comparison table according to the 3σ principle. The comparison table is as Figure 1 shown.

[0191] S12. Grayscale the feature image to obtain a processed centipede image.

[0192] Specifically, in the above steps, photos of the characteristic parts of Scolopendra subspinipes mutilans (the rear end of the basal lateral plate, the outer and inner sides of the ventral surface of the anterior femur of the last pair of walking legs, and the inner side of the dorsal surface of the anterior femur of the last pair of walking legs), photos of the color of the front and back sides of the centipede, and the corresponding centipede quality grades are obtained, and the qualified samples are numbered.

[0193] Input the sample pictures of the characteristic parts, the sample pictures of the color of the front and back sides, and the quality grade information in sequence according to the numbering order.

[0194] Since only the information of Scolopendra subspinipes mutilans has been input at present, it is necessary to input the information of other types of centipedes.

[0195] Number other types of centipedes, take photos of the characteristic parts (the method of taking photos of the characteristic parts is the same as that of Scolopendra subspinipes mutilans), and input the images of the characteristic parts of other types of centipedes in sequence according to the numbering order to establish a visual database.

[0196] Impose constraints such as security and integrity on the visual database, and construct an indexing mechanism.

[0197] The completed visual database can provide data for training the convolutional neural network

[0198] S13. Preprocess the processed centipede images to obtain preprocessed images.

[0199] Specifically, extract the photos of the characteristic parts of all centipedes in the visual database.

[0200] Perform grayscale processing on all the extracted images. Adopt the average value algorithm. At this time, the R, G, and B of the image satisfy the following formula. The formula is:

[0201]

[0202] Perform operations such as rotation and scaling on the grayscale processed images to better reflect the characteristic parts, and determine the pixels of the images to be 400×400.

[0203] Use the closing operation in morphological preprocessing to process the images, that is, perform dilation and erosion on the images to highlight the characteristic parts of the images and obtain preprocessed images.

[0204] S14. Pass the preprocessed images through deformable convolution to obtain the extracted features.

[0205] To improve the accuracy of feature part extraction, use deformable convolution (Deformable Conv) instead of ordinary convolution. Deformable convolution can better capture the complex and variable features in the images by introducing learnable offsets. The calculation method of the deformable convolution kernel does not change the convolution kernel. Taking a 3×3 ordinary convolution kernel as an example, denote the input feature map as X and the output feature map as Y, R=

[0206] {(1,1),(1,0),…,(-1,0),(-1,-1)} represents the position of the sampling point relative to the sampling center point, ω is the weight at the corresponding position in the convolution kernel, and Y p represents the value at position p in the output feature map. For each output of Y p 9 positions on X need to be sampled. These 9 positions fall within the square area centered on the corresponding X p in the feature map X. (1,1) represents the upper right corner of X p and (-1,-1) represents the lower left corner of X pAt the lower left corner, and the same for others. The calculation of ordinary convolution can be obtained, and its formula is:

[0207]

[0208] (A certain position in the output feature map Y corresponds to a point in the input feature map X By different p n Select to traverse in order to 9 points within the square centered on After multiplying each point by the coefficient in its corresponding convolution kernel )

[0209] For deformable convolution, by adding learnable offsets Allows the sampling points to spread into a non-square shape, represents the horizontal offset on the input feature map X, represents the vertical offset on the input feature map X, ρ1, ρ2 are learning factors, used to learn the most suitable offset and control the points after offset still in the input feature map X. Its formula is:

[0210]

[0211] Through the above, the calculation formula of deformable convolution can be obtained, and its formula is:

[0212]

[0213] To ensure is the actual pixel point that can be found on the input feature map, for perform bilinear interpolation, and its formula is:

[0214]

[0215] (q traverses all pixel points in the input feature map X)

[0216] Pass the preprocessed image through deformable convolution, and the extracted features include:

[0217] Set the offset.

[0218] Select several sampling points on the preprocessed image.

[0219] According to the sampling points and the offset, obtain the actual offset.

[0220] According to the actual offset and the deformable convolution formula, obtain the extracted features.

[0221] The deformable convolution formula is:

[0222]

[0223] Among them, is the offset, is the actual offset, is the convolution kernel coefficient.

[0224] S15. Input the extracted features into the category convolution neural network for training to obtain a centipede category training network.

[0225] Specifically, calculate the recognition accuracy of the convolution neural network through the last 20% of the image set. It is found from the reference materials that the recognition accuracy of the convolution neural network for classifying and recognizing different species of animals is about 90%. Referring to the recognition accuracy of classifying and recognizing different species of animals and combining with this problem, when the recognition accuracy is higher than 80%, the remaining 10% of the data is also used to judge the recognition accuracy of the algorithm. If the recognition rate is lower than 80%, it is used for further optimization of the algorithm.

[0226] S16. Obtain the color sample pictures corresponding to the remaining centipedes as the category training set pictures.

[0227] S17. Normalize the category training set pictures to obtain normalized pictures, and crop the normalized pictures to obtain a cropped picture set.

[0228] S18. Input the cropped picture set and the centipede quality grade comparison table into the grade convolution neural network for training to obtain a centipede quality grade training network.

[0229] S19. Input the actual feature pictures into the category training network, and input the actual color pictures corresponding to the centipede category of Scolopendra subspinipes mutilans into the centipede quality grade training network to obtain the centipede quality grade corresponding to the actual pictures.

[0230] Extract the color photos of the front and back sides of Scolopendra subspinipes mutilans in the visual database and the corresponding quality grades of the photos.

[0231] Normalize the pictures in the database. The normalized pictures can eliminate the influence of light on pixels. The normalization formula is:

[0232]

[0233] Nowadays, the pixel count of the rear cameras of mainstream mobile phones generally reaches over 13 million, and they can capture images with a length-width ratio of 1:1. Under these conditions, when shooting a background of 20 cm * 20 cm, the pixel size of the resulting picture is approximately 3600 * 3600. Use the Smart Image Cropping API to crop the normalized picture, intercept the entire centipede in the picture, and set the pixel size of the cropped picture, which is 3600 * 1200, to obtain the preprocessed color image.

[0234] Input the preprocessed color image in the form of an image in the RGB space into the convolutional layer, and select a 3×3 size for all convolutional kernels.

[0235] Select the ReLu function as the activation function between the convolutional layer and the pooling layer.

[0236] The size of the max pooling layer in the pooling layer is 5×5, effectively reducing the computational amount and ensuring the extraction of features.

[0237] Figure 1 The quality grade of the centipede has been given, and the final output layer is set to the quality grade of the centipede.

[0238] Select 80% of the preprocessed pictures as the training set and the remaining 20% as the validation set to train the convolutional neural network, obtaining a convolutional neural network algorithm for judging the quality grade of centipedes.

[0239] Add a conditional statement after the convolutional neural network algorithm for judging whether a centipede is Scolopendra subspinipes mutilans: If it is judged to be Scolopendra subspinipes mutilans, then proceed to judge the quality grade of Scolopendra subspinipes mutilans, call the convolutional neural network algorithm for judging the quality grade of centipedes, and finally output the quality grade of Scolopendra subspinipes mutilans. If it is judged to be a non-Scolopendra subspinipes mutilans centipede, directly output: This centipede is not Scolopendra subspinipes mutilans, so the quality is unqualified, thus constructing a complete convolutional neural network.

[0240] Specifically, the actual picture is a picture taken of the centipede whose quality needs to be known.

[0241] A centipede quality identification system, including:

[0242] A first acquisition module, used to acquire sample pictures of the characteristic parts of Scolopendra subspinipes mutilans;

[0243] A first extraction module, used to extract a color matrix according to the color sample picture, and the color matrix includes a head color matrix, a back color matrix, and an abdomen color matrix;

[0244] The first calculation module is used to select two quantiles, form an acceptance region according to the two quantiles, screen the elements in the color matrix according to the acceptance region to obtain screened elements, and calculate a mean vector according to the screened elements;

[0245] The conversion module is used to convert the mean vector through the HIS model to obtain a conversion vector;

[0246] The second calculation module is used to screen centipedes according to the conversion vector and the color constraint conditions to obtain screened centipedes, and obtain the color score of the centipedes according to the conversion vectors and color formulas of the screened centipedes;

[0247] The second acquisition module is used to acquire the test component content of the screened centipedes;

[0248] The screening module is used to generate a component matrix according to the test component content, screen the screened centipedes according to the component matrix and the component constraint conditions to obtain remaining centipedes, number the remaining centipedes to obtain a numbered matrix, and perform a scaling process on the numbered matrix to obtain a filled matrix;

[0249] The third acquisition module is used to acquire a penalty coefficient;

[0250] The third calculation module is used to obtain a component score according to the filled matrix, the penalty coefficient, and the weight constraint conditions;

[0251] The fourth calculation module is used to calculate a length score according to the length of the centipede;

[0252] The establishment module is used to obtain a final score according to the length score, the component score, and the color score, perform a normal distribution on the final score, and establish a centipede quality grade comparison table;

[0253] The grayscale processing module is used to perform grayscale processing on the feature picture to obtain a processed centipede image;

[0254] The second extraction module is used to obtain extraction features by performing deformable convolution on the preprocessed image;

[0255] The first training module is used to input the extraction features into a category convolutional neural network for training to obtain a centipede category training network;

[0256] The fourth acquisition module is used to acquire the color sample pictures corresponding to the remaining centipedes as category training set pictures;

[0257] The preprocessing module is used to normalize the category training set pictures to obtain normalized pictures, and crop the normalized pictures to obtain a set of cropped pictures;

[0258] A second training module, configured to input the cropped picture set and the centipede quality grade comparison table into a grade convolutional neural network for training to obtain a centipede quality grade training network;

[0259] An identification module, configured to input an actual feature picture into a category training network, and input an actual color picture corresponding to the centipede category of Scolopendra subspinipes mutilans into the centipede quality grade training network to obtain the centipede quality grade corresponding to the actual picture.

[0260] An embodiment of the present application also discloses a terminal device, including a memory and a processor. The memory stores a computer program that can run on the processor. When the processor loads and executes the computer program, a centipede quality identification method is adopted.

[0261] Among them, the terminal device can be a computer device such as a desktop computer, a notebook computer or a cloud server. And the terminal device includes, but is not limited to, a processor and a memory. For example, the terminal device may further include an input / output device, a network access device, and a bus, etc.

[0262] Among them, the processor may adopt a central processing unit (CPU). Of course, according to actual usage, other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. may also be adopted. The general-purpose processor may adopt a microprocessor or any conventional processor, etc. The present application does not make any restrictions on this.

[0263] Among them, the memory may be an internal storage unit of the terminal device. For example, the hard disk or memory of the terminal device, or it may also be an external storage device of the terminal device. For example, a plug-in hard disk, a smart media card (SMC), a secure digital card (SD) or a flash card (FC) etc. equipped on the terminal device. And the memory may also be a combination of the internal storage unit and the external storage device of the terminal device. The memory is used to store the computer program and other programs and data required by the terminal device. The memory may also be used to temporarily store the data that has been output or will be output. The present application does not make any restrictions on this.

[0264] Among them, through this terminal device, a centipede quality identification method in the above embodiment is stored in the memory of the terminal device, and is loaded and executed on the processor of the terminal device, which is convenient for use.

[0265] An embodiment of the present application also discloses a computer-readable storage medium. And the computer-readable storage medium stores a computer program. Among them, when the computer program is executed by the processor, a centipede quality identification method in the above embodiment is adopted.

[0266] Among them, the computer program can be stored in a computer-readable medium. The computer program includes computer program code, which can be in the form of source code, object code, executable file, or some middleware form, etc. The computer-readable medium includes any entity or device, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disc, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal, and software distribution medium, etc. It should be noted that the computer-readable medium includes but is not limited to the above components.

[0267] Among them, through this computer-readable storage medium, a centipede quality identification method in the above embodiment is stored in the computer-readable storage medium, and is loaded and executed on a processor to facilitate the storage and application of the above method.

[0268] Those of ordinary skill in the art should understand that: The discussion of any of the above embodiments is only exemplary and is not intended to imply that the protection scope of the present application is limited to these examples. Under the idea of the present application, the technical features in the above embodiments or different embodiments can also be combined, and the steps can be implemented in any order, and there are many other variations in different aspects of one or more embodiments of the present application as described above, and they are not provided in detail for the sake of brevity.

[0269] One or more embodiments of the present application are intended to cover all such substitutions, modifications, and variations that fall within the broad scope of the present application. Therefore, any omission, modification, equivalent substitution, improvement, etc. made within the spirit and principle of one or more embodiments of the present application shall be included in the protection scope of the present application.

Claims

1. A centipede quality identification method, characterized in that: include: Obtain sample images of characteristic parts and color of the Giant Centipede; Extracting a color matrix according to the color sample image, wherein the color matrix includes a head color matrix, a back color matrix, and an abdomen color matrix; Select two quantiles, and form a receptive domain according to the two quantiles, screen the elements in the color matrix according to the receptive domain to obtain screened elements, and calculate a mean vector according to the screened elements; The mean vector is transformed by the HIS model to obtain a transformation vector; According to the transformation vector and the color constraint condition, centipedes are screened to obtain screened centipedes, and according to the transformation vector and the color formula of the screened centipedes, a color score of the centipedes is obtained; Obtain the test ingredient content of the screening centipede; Generate a component matrix according to the content of the test components, and screen the screening centipedes according to the component matrix and the component constraint conditions to obtain the remaining centipedes, number the remaining centipedes to obtain a numbering matrix, and scale the numbering matrix to obtain a filling matrix; Get the penalty coefficient; Obtaining component scores according to the filling matrix, the penalty coefficient and the weight constraint; Based on the length of the centipede, calculate the length score; According to the length score, the component score and the color score, a final score is obtained, the final score is normally distributed, and a centipede quality grade comparison table is established; Gray-scale the characteristic image to obtain a processed centipede image; Preprocessing the centipede image to obtain a preprocessed image; The preprocessed image is subjected to deformable convolution to obtain extracted features; Inputting the extracted features into a category convolutional neural network for training to obtain a centipede category training network; Obtain the color sample images corresponding to the remaining centipedes as the category training set images; Normalizing the category training set images to obtain normalized images, and cropping the normalized images to obtain a cropped image set; Inputting the cropped picture set and the centipede quality grade comparison table into a hierarchical convolutional neural network for training to obtain a centipede quality grade training network; The actual feature image is input into the category training network, and the actual color image corresponding to the centipede category of Giant Scolopendra subspinata is input into the centipede quality grade training network to obtain the centipede quality grade corresponding to the actual image.

2. centipede quality identification method as claimed in claim 1, is characterized in that, The selecting two quantiles, forming a receptive domain according to the two quantiles, screening the elements in the color matrix according to the receptive domain to obtain screening elements, and calculating the mean vector according to the screening elements includes: Analyze each column of the head color matrix, the back color matrix, and the abdomen color matrix respectively, select the elements in the receptive field, and obtain the head screening element, the back screening element, and the abdomen screening element; The head screening elements, back screening elements and abdomen screening elements are averaged respectively to obtain the head mean vector, abdomen mean vector and back mean vector, and the mean vector of the color values ​​of different parts is formed according to the head mean vector, abdomen mean vector and back mean vector.

3. The centipede quality identification method as claimed in claim 1, characterized in that, The method of generating a component matrix according to the content of the tested components, screening the screened centipedes according to the component matrix and the component constraint conditions to obtain the remaining centipedes, numbering the remaining centipedes to obtain a numbering matrix, and scaling the numbering matrix to obtain a filling matrix includes: The test component content includes moisture content, total ash content, aflatoxin content and extract content, and the aflatoxin content includes aflatoxin B1, aflatoxin G2, aflatoxin G1 and aflatoxin B2; Construct a component matrix with the moisture content as the first column, the total ash content as the second column, the aflatoxin B1 content as the third column, the total content of aflatoxin G2, aflatoxin G1, aflatoxin B2 and aflatoxin B1 as the fourth column, and the extract content as the fifth column; According to the component matrix and the component constraint conditions, the screening centipedes are screened to obtain the remaining centipedes, and the remaining centipedes are numbered to obtain a numbering matrix; For each element in the number matrix, the scientific notation is used to express it, and the maximum element in each column of the number matrix is ​​found and sorted; All elements in each column are numerically scaled in column order to obtain new elements to form a filling matrix.

4. The centipede quality identification method as claimed in claim 1, wherein: The obtaining of component scores according to the filling matrix, the penalty coefficient and the weight constraint condition comprises: Obtain the influence weight of different component contents on the content score of centipede medicinal chemical components; Obtaining a component score according to the filling matrix, the influence weight, the penalty coefficient and a component score formula; The component score formula is expressed as: S=C·W T -A * ·s T ; Among them, S is the component score, W is the weight matrix of the influence weight composition, σ is the penalty coefficient, and A * is the test component content matrix corresponding to the filling matrix extracted from the component matrix, C is the filling matrix, and T is the transposed matrix.

5. The centipede quality identification method as claimed in claim 1, characterized in that, The calculating of the length score according to the length of the centipede comprises: Get the prices of Scolopendra subspinipes of different lengths and widths, and calculate the average unit price; Draw a three-dimensional image with length as the x-axis, width as the y-axis, and average unit price as the z-axis, and perform interpolation processing to obtain an interpolated image; Scaling the Z axis of the interpolated image to obtain a scaled Z axis length; The least squares fitting algorithm is used to fit the correlation function of the scaled Z-axis length with respect to the length x and the width y; A length score is obtained according to the correlation function and the length of the Giant Scolopendra subspinipes.

6. The centipede quality identification method as claimed in claim 1, characterized in that, The extracting features by subjecting the preprocessed image to deformable convolution comprises: Set the offset; Selecting a number of sampling points on the preprocessed image; According to the sampling point and the offset, an actual offset is obtained; According to the actual offset and the deformable convolution formula, the extracted features are obtained.

7. The centipede quality identification method as claimed in claim 6, characterized in that: The deformable convolution formula is: in, is the offset, is the actual offset, is the convolution kernel coefficient.

8. A centipede quality identification system, characterized in that: include: The first acquisition module is used to obtain sample images of characteristic parts of the Giant Scolopendra subspinipes; A first extraction module is used to extract a color matrix according to the color sample picture, wherein the color matrix includes a head color matrix, a back color matrix and an abdomen color matrix; A first calculation module is used to select two quantiles, form a receptive domain according to the two quantiles, screen the elements in the color matrix according to the receptive domain to obtain screened elements, and calculate a mean vector according to the screened elements; A transformation module, used for transforming the mean vector through a HIS model to obtain a transformation vector; A second calculation module is used to screen centipedes according to the transformation vector and the color constraint condition to obtain screened centipedes, and obtain a color score of the centipede according to the transformation vector and the color formula of the screened centipede; The second acquisition module is used to obtain the test component content of the screening centipede; A screening module is used to generate a component matrix according to the content of the test component, and to screen the screening centipedes according to the component matrix and the component constraint conditions to obtain the remaining centipedes, to number the remaining centipedes to obtain a numbering matrix, and to scale the numbering matrix to obtain a filling matrix; A third acquisition module is used to obtain a penalty coefficient; A third calculation module, used for obtaining a component score according to the filling matrix, the penalty coefficient and the weight constraint condition; A fourth calculation module is used to calculate a length score according to the length of the centipede; Establishing a module, for obtaining a final score according to the length score, the component score and the color score, performing a normal distribution on the final score, and establishing a centipede quality grade comparison table; A grayscale processing module is used to grayscale the feature image to obtain a processed centipede image; A second extraction module, used for subjecting the preprocessed image to deformable convolution to obtain extracted features; A first training module is used to input the extracted features into a category convolutional neural network for training to obtain a centipede category training network; The fourth acquisition module is used to obtain color sample images corresponding to the remaining centipedes as category training set images; A preprocessing module, used for normalizing the category training set pictures to obtain normalized pictures, and cropping the normalized pictures to obtain a cropped picture set; The second training module is used to input the cropped picture set and the centipede quality grade comparison table into a graded convolutional neural network for training to obtain a centipede quality grade training network; The recognition module is used to input the actual feature image into the category training network, and input the actual color image corresponding to the centipede category of Giant Scolopendra subspinipes into the centipede quality grade training network to obtain the centipede quality grade corresponding to the actual image.

9. A terminal device, comprising a memory and a processor, characterized in that: The memory stores a computer program that can be run on the processor, and when the processor loads and executes the computer program, the identification method according to any one of claims 1 to 7 is adopted.

10. A computer-readable storage medium having a computer program stored therein, characterized in that: When the computer program is loaded and executed by a processor, the identification method according to any one of claims 1 to 7 is adopted.

Citation Information

Patent Citations

  • Pinellia ternate quality grading method based on neural network

    CN110796639A

  • Crayfish quality nondestructive testing method and device

    CN114972895A

  • Strawberry growth state pest identification and growth vigor evaluation method based on PP-YOLOv2 improved model

    CN118736564A

  • Sick juvenile fish identification method based on improved YOLOv10 model

    CN119479010A

  • Method and Apparatus for Detecting Target Object, Electronic Device and Storage Medium

    US20210319231A1