A system and method for identifying quality of antler slices based on image recognition

By combining image recognition and multi-layer perceptron model, combined with the image characteristics and odor characteristics of deer antler sheets, the problems of low efficiency and poor accuracy of deer antler sheets in the prior art are solved, and more accurate and efficient quality identification is achieved.

CN118861783BActive Publication Date: 2024-11-22JILIN AGRICULTURAL UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411315751.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-20
Publication Date
2024-11-22
Estimated Expiration
2044-09-20

AI Technical Summary

Technical Problem

The existing deer antler sheet quality identification methods rely on human sensory judgment, are inefficient and have large subjectivity and human errors, which are difficult to meet the needs of large-scale production and have low accuracy.

Method used

Using an image recognition method, by collecting image data and gas component content data of deer antler sheets, building a multi-layer perceptron model, combining image features and odor characteristics for quality identification, and using marine predator optimization algorithm to optimize feature center data to improve Identification accuracy.

Benefits of technology

Two-face identification (type and freshness) of the quality of deer antler sheets is realized, the accuracy and efficiency of identification are improved, the classification process is simplified, and the identification and classification ability of the multi-layer perceptron model is enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118861783B_ABST
    Figure CN118861783B_ABST
Patent Text Reader

Abstract

The invention discloses a velvet antler slice quality identification system and method based on image recognition, and relates to the field of image data processing. The invention obtains a final identification result by performing dual-aspect identification on the quality of velvet antler slices from aspects of the type and freshness of the velvet antler slices; the final identification result is made more accurate and comprehensive; characteristic data of different types of velvet antler slice samples are extracted to provide a data basis for subsequent determination of the category of the velvet antler slices to be identified; the process of classifying the characteristic data of the velvet antler slices to be identified is simplified by performing an optimization operation on category center data of each category of characteristic data of the velvet antler slices; and the quality grade of the velvet antler slices is judged from the perspective of smell by collecting gas component content data of multiple types of velvet antler slices and corresponding category label data, thereby further improving the accuracy of the determination and providing data support for subsequent training and testing of a multi-layer perceptron model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of image data processing, and in particular, relates to a system and method for identifying the quality of antler slices based on image recognition. Background Art

[0002] The existing quality identification method of antler slices mainly relies on human sensory judgment, such as color and smell. This identification method is not only cumbersome and inefficient, but also difficult to meet the needs of large-scale production. In addition, everyone's perception of the quality of antler slices is different. Therefore, there is a large degree of subjectivity and human errors, which makes the accuracy of antler slice quality identification low. Summary of the invention

[0003] In view of the problems in the related art, the present invention proposes a system and method for identifying the quality of antler slices based on image recognition to overcome the above-mentioned technical problems existing in the existing related art.

[0004] In order to solve the above technical problems, the present invention is achieved through the following technical solutions:

[0005] The present invention provides a method for identifying the quality of antler slices based on image recognition, comprising the following steps:

[0006] S1. Collect image data of multiple types of antler slices to obtain an antler slice image data matrix; extract feature data of each antler slice image data in the antler slice image data matrix to obtain an antler slice feature data set matrix; construct category label data of each antler slice feature data set in the antler slice feature data set matrix to obtain a first category label data matrix;

[0007] S2, iteratively optimizing the central data of each type of antler slice feature data in the antler slice feature data set matrix to obtain a feature central data matrix;

[0008] S3, collecting gas component content data of multiple types of antler slices to obtain a final gas component content data set matrix;

[0009] Constructing the category label data of each gas component content data set in the final gas component content data set matrix to obtain a second category label data matrix; using the second category label data matrix and the final gas component content data set matrix to construct a final multi-layer perceptron model;

[0010] S4, classifying and identifying the first velvet antler slices according to the characteristic center data matrix and the characteristic data of the velvet antler slices to be identified, and obtaining the quality grade data of the first velvet antler slices;

[0011] S5, using the final multi-layer perceptron model to classify and identify the gas component content data of the velvet antler slices to be identified, to obtain the second velvet antler slice quality grade data;

[0012] S6, comparing the first pilose antler slice quality grade data with the second pilose antler slice quality grade data to obtain final quality grade data of the pilose antler slice to be identified;

[0013] The quality of different types of antler slices is different. For example, the quality of sika deer antler is usually better than that of red deer antler. Based on this, this solution first identifies the quality of antler slices from the type of antler slices. By collecting image data of multiple types of antler slices, data support is provided for the subsequent extraction of feature data of different types of antler slices. Then, by extracting the feature data of different types of antler slice samples, data basis is provided for the subsequent determination of the category of antler slices to be identified. By setting corresponding category label data for each antler slice feature data set, a basis for determination is provided for the subsequent determination of the category of antler slices to be identified, and also for the subsequent search for the category center data of each type of antler slice feature data. It provides a basis for searching; by optimizing the category center data of each type of antler slice feature data, it provides a classification basis for the subsequent classification of the feature data of antler slices to be identified; secondly, the quality of antler slices is not only related to the type, but also to the smell emitted by the antler slices. Fresh antler slices should have an animal fishy smell. If there is no or a strange smell, it may be an inferior or spoiled product; based on this, in this scheme, by collecting gas component content data of multiple types of antler slices and the corresponding category label data, the quality grade of antler slices is judged from the perspective of smell, which further improves the accuracy of the judgment. At the same time, it also provides data support for the subsequent training and testing of the multi-layer perceptron model.

[0014] Preferably, the S1 comprises the following steps:

[0015] S11. Set the type set of antler slices , Indicates the set i-th antler slice type, Indicates the total number of the set antler slice types;

[0016] According to the type of deer antler slices Collect the corresponding antler slice samples to obtain the antler slice sample matrix ;as follows,

[0017] ;

[0018] in, Indicates the type set of collected antler slices The jth antler slice sample corresponding to the i-th antler slice type in, Indicates the type set of collected antler slices The total number of antler slice samples corresponding to the i-th antler slice type;

[0019] S12, collecting the pilose antler slice sample matrix The image data of each antler slice sample in is obtained to obtain the antler slice image data matrix b; as follows,

[0020] ;

[0021] in, Represents the type set of deer antler slices Image data of the jth antler slice sample corresponding to the i-th antler slice type;

[0022] Set the category label corresponding to each antler slice image data in the antler slice image data matrix b to obtain the first category label data matrix ;as follows,

[0023] ;

[0024] in, Represents the type set of deer antler slices Category label data of the image data of the j-th deer antler slice sample corresponding to the i-th deer antler slice type;

[0025] S13, setting multiple feature types that can distinguish the types of antler slices, and obtaining a antler slice feature type set , Indicates the set i-th antler slice feature type, Indicates the total number of set antler slice feature types;

[0026] According to the deer antler slice feature type set Obtain the feature data of each antler slice image data in the antler slice image data matrix b to obtain the antler slice feature data set matrix c; as follows,

[0027] ;

[0028] in, Represents the type set of deer antler slices The feature data set of the image data of the j-th deer antler slice sample corresponding to the i-th deer antler slice type; , express Corresponding to the deer antler slice feature type set The feature data of the kth antler slice feature type;

[0029] The types of antler slices include sika deer antler slices, New Zealand deer antler slices, and red deer antler slices; the characteristic types of antler slices include shape characteristics, thickness characteristics, velvet color characteristics, velvet length characteristics, velvet coarseness characteristics, cross-section color characteristics, cross-section ring pattern characteristics, etc.; different antler slices may differ in the above characteristics, so by collecting these characteristic data of antler slices, the category of antler slices can be determined.

[0030] Preferably, S2 comprises the following steps:

[0031] S21, setting a discreteness threshold for the velvet antler slice feature data set matrix c ;

[0032] S22, according to the discreteness threshold Calculate and obtain the central data of the characteristic data of each type of antler slice sample in the antler slice characteristic data set matrix c to obtain the characteristic central data matrix ;as follows,

[0033] ;

[0034] in, Represents the type set of deer antler slices The i-th antler slice type corresponds to the j-th feature center data of the antler slice sample;

[0035] By setting the discreteness threshold, an optimization target is provided for the subsequent optimization of the central data of the characteristic data of each type of antler slice samples, thereby making the optimization process more convenient and improving the optimization efficiency.

[0036] Preferably, the S22 comprises the following steps:

[0037] S221. Constructing an elite predator population and prey populations ; , They represent the ith elite predator in the elite predator population and the ith prey in the prey population respectively; d represents the total number of elite predators in the elite predator population and the total number of prey in the prey population; the maximum number of iterations is set to , the current number of iterations is And the search space dimension is ;

[0038] S222, randomly select 2 from the feature data corresponding to each type of antler slice in the antler slice feature data set matrix c. d feature datasets are used as elite predator populations and prey populations The initial positions of each elite predator and prey in the elite predator are obtained as the initial position matrix set of the elite predator. and the prey initial position matrix set ; , They represent the initial position matrix of the i-th elite predator in the elite predator population and the initial position matrix of the i-th prey in the prey population respectively; they are as follows,

[0039] ; ;

[0040] in, for , represents the kth feature center data corresponding to the jth deer antler slice type in the deer antler slice feature data set matrix c; for Represents the kth feature center data corresponding to the jth deer antler slice type in the deer antler slice feature data set matrix c;

[0041] S223, according to the discreteness threshold Setting the Elite Predator Population and prey populations The fitness function ;as follows,

[0042] ;

[0043] In the formula, represents the sum of the Euclidean distances from each feature data set of the ith antler slice type in the antler slice feature data set matrix c to the corresponding feature center data set; β is a positive number, representing a correction parameter;

[0044] S224, start iteration; before iteration, set the current iteration number Set to 1; in each iteration,

[0045] when The exploration phase is the time when the elite predator population and the movement formula of the ith elite predator and the ith prey in the prey population in the exploration phase are as follows:

[0046] ;

[0047] in, represents the moving step length of the i-th elite predator and the i-th prey in the elite predator population and the prey population; represents a random vector; , Respectively represent the positions of the i-th elite predator and the i-th prey in the elite predator population and the prey population in the current round of iteration; represents a term-by-term multiplication operation; δ represents a constant, δ=0.5; represents a random vector of [0,1];

[0048] when It is the transition stage between exploration and development. The movement formula of the ith elite predator and the ith prey in the elite predator population and the prey population in the transition stage between exploration and development is as follows:

[0049] ;

[0050] Where f represents a random variable generated by Levy distribution; Represents the adaptive parameter, and the calculation formula is as follows:

[0051] ;

[0052] when The development stage is the development stage. The movement formula of the ith elite predator and the ith prey in the elite predator population and the prey population in the development stage is as follows:

[0053] ;

[0054] After the location update is completed, the current number of iterations Add 1 and enter the next iteration;

[0055] S225, when When , the iteration operation is stopped and the final global optimal position is output; the final global optimal position is used as the feature center data matrix ;

[0056] The marine predator optimization algorithm can effectively explore and develop in the solution space by simulating the foraging behavior of marine predators, which helps to find the global optimal solution or the area close to the optimal solution. Different speed ratios are considered in the algorithm design, which enables the marine predator optimization algorithm to balance exploration and development in the optimization process, thereby accelerating the convergence speed; therefore, by adopting the marine predator optimization algorithm to perform multiple iterative optimizations on the classification center data of each type of antler slice feature data set, and using the overall discreteness of the antler slice feature data set matrix as the corresponding fitness function, the optimal classification center data corresponding to each type of antler slice feature data set can be searched more efficiently.

[0057] Preferably, S3 comprises the following steps:

[0058] S31, setting a storage time threshold and storing the pilose antler slice sample matrix Each antler slice sample in the above embodiment is placed in a sealed can for sealed storage; when the sealed storage time is greater than or equal to the storage time threshold, a certain amount of gas is uniformly extracted from each sealed can using a diaphragm air pump to obtain a gas sample matrix. ;as follows,

[0059] ;

[0060] in, Represents the type set of deer antler slices The gas sample corresponding to the jth antler slice sample corresponding to the i-th antler slice type;

[0061] Set the gas sample matrix The category label corresponding to each gas sample in the second category label data matrix is ​​obtained ;as follows,

[0062] ;

[0063] in, Represents the type set of deer antler slices The category label data of the gas sample corresponding to the j-th deer antler slice sample corresponding to the i-th deer antler slice type;

[0064] S32, using a gas sensor to collect the gas sample matrix The content of each component gas of each gas sample in the initial gas component content data set matrix is ​​obtained; various gas component types in the initial gas component content data set matrix are combined to obtain a gas component type combination set. , represents the type of the i-th gas component obtained by combination, Indicates the total number of gas component types obtained by combination;

[0065] According to the gas component type combination set Reconstruct the initial gas component content data set matrix to obtain the final gas component content data set matrix ;as follows,

[0066] ;

[0067] in, Represents the type set of deer antler slices The gas component content data set of the gas sample corresponding to the j-th deer antler slice sample corresponding to the i-th deer antler slice type; , express The k-th gas component content data in ;

[0068] S33, constructing an initial multi-layer perceptron model; using the final gas component content data set matrix And the second category label data matrix The initial multi-layer perceptron model is trained and tested; after the training and testing are completed, the final multi-layer perceptron model is obtained;

[0069] Since it takes a certain amount of time for the odor gas of the antler slice samples to dissipate, a storage time threshold is set to limit the dissipation time of the odor gas of the antler slice samples; the antler slice samples are sealed and stored to facilitate the collection of the odor gas of the antler slice samples; the initial multi-layer perceptron model is then trained and tested through the final gas component content data set matrix and the second category label data matrix, so that the final multi-layer perceptron model has good mapping and classification capabilities for the gas component content data of the antler slice samples to the category label data of the antler slice samples, which provides a classification tool for the subsequent classification of the gas component content data of the antler slices to be identified.

[0070] Preferably, the S33 comprises the following steps:

[0071] S331, setting the training data ratio; and calculating the final gas component content data set matrix according to the training data ratio. And the second category label data matrix Perform data division to obtain a final gas component content training data set matrix, a final gas component content test data set matrix, a second category label training data matrix, and a second category label test data matrix;

[0072] S332, setting a training error threshold; inputting the final gas component content training data set matrix and the second category label training data matrix into the initial multi-layer perceptron model for training operation; during the training process, when the training error is less than the training error threshold, stopping the training operation to obtain a trained multi-layer perceptron model; otherwise, continuing the training;

[0073] S333, setting a test accuracy threshold; inputting the final gas component content test data set matrix and the second category label test data matrix into the trained multi-layer perceptron model for testing; after the test is completed, obtaining the test accuracy; when the test accuracy is greater than or equal to the test accuracy threshold, using the trained multi-layer perceptron model as the final multi-layer perceptron model; otherwise, returning to S332 to continue training the trained multi-layer perceptron model until the test accuracy is greater than or equal to the test accuracy threshold, and obtaining the final multi-layer perceptron model;

[0074] The initial multilayer perceptron model is trained by using the final gas component content training data set matrix and the second category label training data matrix, and then the trained multilayer perceptron model is tested by using the final gas component content test data set matrix and the second category label test data matrix, so that the final multilayer perceptron model has better recognition and classification capabilities for gas component content data.

[0075] Preferably, S4 comprises the following steps:

[0076] S41, setting a pilose antler slice to be identified; collecting image data of the pilose antler slice to be identified, and obtaining image data to be identified;

[0077] S42, according to the velvet antler slice feature type set Obtain the feature data of the image data to be identified, and obtain the feature data set to be identified , Represents the corresponding antler slice feature type set of the image data to be identified Feature data of the i-th antler slice feature type in ;

[0078] S43, calculating the feature data set to be identified With the feature center data matrix The Euclidean distance data between each row of data in the , and the Euclidean distance data set is obtained , Represents the feature data set to be identified With the feature center data matrix The Euclidean distance data between the i-th row of data in;

[0079] Match the first category label data matrix , the Euclidean distance dataset The feature center data matrix corresponding to the maximum Euclidean distance data The category label data of the Bank of China data is used as the feature data set to be identified The category label data to be identified is obtained;

[0080] S44, set the quality level of antler slices , Indicates the set quality level of the ith antler slices, Indicates the total number of set velvet antler slice quality grades;

[0081] According to the quality grade of velvet antler slices Set of deer antler slice types The quality grade of each type of antler slices in the antler slices is obtained to obtain the antler slice quality grade dataset , Represents the type set of deer antler slices The quality grade data of the i-th type of antler slices;

[0082] S45, matching the velvet antler slice quality grade data set And Deer Antler Slice Type Set Acquire the antler slice quality grade data corresponding to the first category label data to be identified, and obtain the first antler slice quality grade data;

[0083] When the feature center data matrix for classifying the feature data of the antler slices is prepared, the feature data of the antler slices to be identified can be classified; by classifying the feature data of the antler slices to be identified, the first antler slice quality grade data is obtained, and the quality identification of the antler slices to be identified is completed from the type of the antler slices.

[0084] Preferably, the S5 comprises the following steps:

[0085] S51, placing the velvet antler slices to be identified into a sealed can for sealed storage; when the sealed storage time is greater than or equal to the storage time threshold, using a diaphragm air pump to uniformly extract a certain amount of gas from the sealed can to obtain a gas sample to be identified;

[0086] S52, according to the gas component type combination set The gas sensor is used to collect the content of each component gas of the gas sample to be identified, and a data set of the content of the gas component to be identified is obtained. ,

[0087] Indicates the content data of the i-th gas component in the gas sample to be identified;

[0088] S53, the gas component content data set to be identified Input into the final multi-layer perceptron model for classification to obtain the second category label data to be identified;

[0089] S54, according to the quality grade of the velvet antler slices Set the second category label data matrix The quality grade data of each category label data in the , and the quality grade data matrix of velvet antler slices is obtained ;as follows,

[0090] ;

[0091] in, Represents the type set of deer antler slices The quality grade data of the category label data of the gas sample corresponding to the j-th deer antler slice sample corresponding to the i-th deer antler slice type;

[0092] Matching the quality grade data matrix of the velvet antler slices And the second category label data matrix Acquire the quality grade data of the second category label data to be identified, and obtain the second quality grade data of the antler slices;

[0093] When the final multi-layer perceptron model for classifying the gas component content data of the antler slices is prepared, the gas component content data of the antler slices to be identified can be classified; by classifying the gas component content data of the antler slices to be identified, the second antler slice quality grade data is obtained; and the quality identification of the antler slices to be identified is completed from the aspect of the freshness of the antler slices.

[0094] Preferably, the S6 includes the following process:

[0095] When the second antler slice quality grade data is greater than or equal to the first antler slice quality grade data, the first antler slice quality grade data is used as the final quality grade data of the antler slice to be identified; otherwise, the second antler slice quality grade data is used as the final quality grade data of the antler slice to be identified;

[0096] Finally, the results of the two aspects of quality identification of the antler slices, namely the type and freshness, are comprehensively analyzed to obtain the final identification result, making the final identification result more accurate and comprehensive.

[0097] A velvet antler slice quality identification system based on image recognition, comprising a first velvet antler slice image data acquisition module, a feature extraction module, a first label construction module, a feature center data optimization module, a gas component content data acquisition module, a second label construction module, a classification model construction module, a first quality grade identification module, a second quality grade identification module and a final judgment module;

[0098] The first antler slice image data acquisition module is used to acquire image data of multiple types of antler slices to obtain an antler slice image data matrix;

[0099] The feature extraction module is used to extract feature data of each antler slice image data in the antler slice image data matrix to obtain a antler slice feature data set matrix;

[0100] The first label construction module is used to construct the category label data of each velvet antler slice feature data set in the velvet antler slice feature data set matrix to obtain a first category label data matrix;

[0101] The feature center data optimization module is used to iteratively optimize the center data of each type of antler slice feature data in the antler slice feature data set matrix to obtain a feature center data matrix;

[0102] The gas component content data acquisition module is used to collect gas component content data of multiple types of pilose antler slices to obtain a final gas component content data set matrix;

[0103] The second label construction module is used to construct the category label data of each gas component content data set in the final gas component content data set matrix to obtain a second category label data matrix;

[0104] The classification model is used to construct a module to construct a final multi-layer perceptron model using the second category label data matrix and the final gas component content data set matrix;

[0105] The first quality grade identification module is used to classify and identify the first antler slice quality grade data according to the characteristic center data matrix and the characteristic data of the antler slice to be identified;

[0106] The second quality grade identification module is used to classify and identify the gas component content data of the antler slices to be identified by using the final multi-layer perceptron model to obtain the second antler slice quality grade data;

[0107] The final determination module is used to compare the first antler slice quality grade data with the second antler slice quality grade data to obtain the final quality grade data of the antler slice to be identified.

[0108] The present invention has the following beneficial effects:

[0109] 1. In the present invention, the quality of the antler slices is identified from both the type and freshness of the antler slices to obtain the final identification result; the final identification result is made more accurate and comprehensive; the characteristic data of different types of antler slice samples are extracted to provide a data basis for subsequent determination of the category of the antler slices to be identified; the process of classifying the characteristic data of the antler slices to be identified is simplified by performing an optimization operation on the category center data of each type of antler slice characteristic data; and the quality grade of the antler slices is judged from the perspective of smell by collecting gas component content data of multiple types of antler slices and corresponding category label data, thereby further improving the accuracy of the determination and providing data support for subsequent training and testing of the multi-layer perceptron model.

[0110] 2. In the present invention, the classification center data of each type of antler slice feature data set is iteratively optimized multiple times by adopting the marine predator optimization algorithm, and the overall discreteness of the antler slice feature data set matrix is ​​used as the corresponding fitness function, so that the optimal classification center data corresponding to each type of antler slice feature data set can be searched more efficiently.

[0111] 3. In the present invention, the initial multilayer perceptron model is trained by using the final gas component content training data set matrix and the second category label training data matrix, and then the trained multilayer perceptron model is tested by using the final gas component content test data set matrix and the second category label test data matrix, so that the final multilayer perceptron model has better recognition and classification capabilities for gas component content data.

[0112] Of course, any product implementing the present invention does not necessarily need to achieve all of the advantages described above at the same time. BRIEF DESCRIPTION OF THE DRAWINGS

[0113] In order to more clearly illustrate the technical solutions of the embodiments of the invention, the drawings required for describing the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the invention. For ordinary technicians in this field, they can also obtain drawings based on these drawings without paying creative work.

[0114] Figure 1 The present invention is a flow chart of a velvet antler slice quality identification system based on image recognition for identifying the quality of velvet antler slices. DETAILED DESCRIPTION

[0115] The following will be combined with the drawings in the embodiments of the invention to clearly and completely describe the technical solutions in the embodiments of the invention. Obviously, the described embodiments are only part of the embodiments of the invention, not all of the embodiments. Based on the embodiments in the invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the invention.

[0116] In the description of the present invention, it is necessary to understand that the terms "opening", "upper", "lower", "top", "middle", "inside" and the like indicating orientation or positional relationship are only for the convenience of describing the invention and simplifying the description, and do not indicate or imply that the components or elements referred to must have a specific orientation, be constructed and operate in a specific orientation, and therefore cannot be understood as limiting the invention.

[0117] Embodiment 1

[0118] This embodiment is a method for identifying the quality of antler slices based on image recognition, comprising the following steps:

[0119] S1. Collect image data of multiple types of antler slices to obtain an antler slice image data matrix; extract feature data of each antler slice image data in the antler slice image data matrix to obtain an antler slice feature data set matrix; construct category label data of each antler slice feature data set in the antler slice feature data set matrix to obtain a first category label data matrix;

[0120] The S1 comprises the following steps:

[0121] S11. Set the type set of antler slices , Indicates the set i-th antler slice type, Indicates the total number of the set antler slice types;

[0122] According to the type of deer antler slices Collect the corresponding antler slice samples to obtain the antler slice sample matrix ;as follows,

[0123] ;

[0124] in, Indicates the type set of collected antler slices The jth antler slice sample corresponding to the i-th antler slice type in, Indicates the type set of collected antler slices The total number of antler slice samples corresponding to the i-th antler slice type;

[0125] S12, collecting the pilose antler slice sample matrix The image data of each antler slice sample in is obtained to obtain the antler slice image data matrix b; as follows,

[0126] ;

[0127] in, Represents the type set of deer antler slices Image data of the jth antler slice sample corresponding to the i-th antler slice type;

[0128] Set the category label corresponding to each antler slice image data in the antler slice image data matrix b to obtain the first category label data matrix ;as follows,

[0129] ;

[0130] in, Represents the type set of deer antler slices Category label data of the image data of the j-th deer antler slice sample corresponding to the i-th deer antler slice type;

[0131] S13, setting multiple feature types that can distinguish the types of antler slices, and obtaining a antler slice feature type set , Indicates the set i-th antler slice feature type, Indicates the total number of set antler slice feature types;

[0132] According to the deer antler slice feature type set Obtain the feature data of each antler slice image data in the antler slice image data matrix b to obtain the antler slice feature data set matrix c; as follows,

[0133] ;

[0134] in, Represents the type set of deer antler slices The feature data set of the image data of the j-th deer antler slice sample corresponding to the i-th deer antler slice type; , express Corresponding to the deer antler slice feature type set The feature data of the kth antler slice feature type;

[0135] S2, iteratively optimizing the central data of each type of antler slice feature data in the antler slice feature data set matrix to obtain a feature central data matrix;

[0136] The S2 comprises the following steps:

[0137] S21, setting a discreteness threshold for the velvet antler slice feature data set matrix c ;

[0138] S22, according to the discreteness threshold Calculate and obtain the central data of the characteristic data of each type of antler slice sample in the antler slice characteristic data set matrix c to obtain the characteristic central data matrix ;as follows,

[0139] ;

[0140] in, Represents the type set of deer antler slices The i-th antler slice type corresponds to the j-th feature center data of the antler slice sample;

[0141] The S22 comprises the following steps:

[0142] S221. Constructing an elite predator population and prey populations ; , They represent the ith elite predator in the elite predator population and the ith prey in the prey population respectively; d represents the total number of elite predators in the elite predator population and the total number of prey in the prey population; the maximum number of iterations is set to , the current number of iterations is And the search space dimension is ;

[0143] S222, randomly select 2 from the feature data corresponding to each type of antler slice in the antler slice feature data set matrix c. d feature datasets are used as elite predator populations and prey populations The initial positions of each elite predator and prey in the elite predator are obtained as the initial position matrix set of the elite predator. and the prey initial position matrix set ; , They represent the initial position matrix of the i-th elite predator in the elite predator population and the initial position matrix of the i-th prey in the prey population respectively; they are as follows,

[0144] ; ;

[0145] in, for , represents the kth feature center data corresponding to the jth deer antler slice type in the deer antler slice feature data set matrix c; for Represents the kth feature center data corresponding to the jth deer antler slice type in the deer antler slice feature data set matrix c;

[0146] S223, according to the discreteness threshold Setting the Elite Predator Population and prey populations The fitness function ;as follows,

[0147] ;

[0148] In the formula, represents the sum of the Euclidean distances from each feature data set of the ith antler slice type in the antler slice feature data set matrix c to the corresponding feature center data set; β is a positive number, representing a correction parameter;

[0149] S224, start iteration; before iteration, set the current iteration number Set to 1; in each iteration,

[0150] when The exploration phase is the time when the elite predator population and the movement formula of the ith elite predator and the ith prey in the prey population in the exploration phase are as follows:

[0151] ;

[0152] in, represents the moving step length of the i-th elite predator and the i-th prey in the elite predator population and the prey population; represents a random vector; , Respectively represent the positions of the i-th elite predator and the i-th prey in the elite predator population and the prey population in the current round of iteration; represents a term-by-term multiplication operation; δ represents a constant, δ=0.5; represents a random vector of [0,1];

[0153] when It is the transition stage between exploration and development. The movement formula of the ith elite predator and the ith prey in the elite predator population and the prey population in the transition stage between exploration and development is as follows:

[0154] ;

[0155] Where f represents a random variable generated by Levy distribution; Represents the adaptive parameter, and the calculation formula is as follows:

[0156] ;

[0157] when The development stage is the development stage. The movement formula of the ith elite predator and the ith prey in the elite predator population and the prey population in the development stage is as follows:

[0158] ;

[0159] After the location update is completed, the current number of iterations Add 1 and enter the next iteration;

[0160] S225, when When , the iteration operation is stopped and the final global optimal position is output; the final global optimal position is used as the feature center data matrix ;

[0161] S3, collecting gas component content data of multiple types of antler slices to obtain a final gas component content data set matrix;

[0162] Constructing the category label data of each gas component content data set in the final gas component content data set matrix to obtain a second category label data matrix; using the second category label data matrix and the final gas component content data set matrix to construct a final multi-layer perceptron model;

[0163] The S3 comprises the following steps:

[0164] S31, setting a storage time threshold and storing the pilose antler slice sample matrix Each antler slice sample in the above embodiment is placed in a sealed can for sealed storage; when the sealed storage time is greater than or equal to the storage time threshold, a certain amount of gas is uniformly extracted from each sealed can using a diaphragm air pump to obtain a gas sample matrix. ;as follows,

[0165] ;

[0166] in, Represents the type set of deer antler slices The gas sample corresponding to the jth antler slice sample corresponding to the i-th antler slice type;

[0167] Set the gas sample matrix The category label corresponding to each gas sample in the second category label data matrix is ​​obtained ;as follows,

[0168] ;

[0169] in, Represents the type set of deer antler slices The category label data of the gas sample corresponding to the j-th deer antler slice sample corresponding to the i-th deer antler slice type;

[0170] S32, using a gas sensor to collect the gas sample matrix The content of each component gas of each gas sample in the initial gas component content data set matrix is ​​obtained; various gas component types in the initial gas component content data set matrix are combined to obtain a gas component type combination set. , represents the type of the i-th gas component obtained by combination, Indicates the total number of gas component types obtained by combination;

[0171] According to the gas component type combination set Reconstruct the initial gas component content data set matrix to obtain the final gas component content data set matrix ;as follows,

[0172] ;

[0173] in, Represents the type set of deer antler slices The gas component content data set of the gas sample corresponding to the j-th deer antler slice sample corresponding to the i-th deer antler slice type; , express The k-th gas component content data in ;

[0174] S33, constructing an initial multi-layer perceptron model; using the final gas component content data set matrix And the second category label data matrix The initial multi-layer perceptron model is trained and tested; after the training and testing are completed, the final multi-layer perceptron model is obtained;

[0175] The S33 comprises the following steps:

[0176] S331, setting the training data ratio; and calculating the final gas component content data set matrix according to the training data ratio. And the second category label data matrix Perform data division to obtain a final gas component content training data set matrix, a final gas component content test data set matrix, a second category label training data matrix, and a second category label test data matrix;

[0177] S332, setting a training error threshold; inputting the final gas component content training data set matrix and the second category label training data matrix into the initial multi-layer perceptron model for training operation; during the training process, when the training error is less than the training error threshold, stopping the training operation to obtain a trained multi-layer perceptron model; otherwise, continuing the training;

[0178] S333, setting a test accuracy threshold; inputting the final gas component content test data set matrix and the second category label test data matrix into the trained multi-layer perceptron model for testing; after the test is completed, obtaining the test accuracy; when the test accuracy is greater than or equal to the test accuracy threshold, using the trained multi-layer perceptron model as the final multi-layer perceptron model; otherwise, returning to S332 to continue training the trained multi-layer perceptron model until the test accuracy is greater than or equal to the test accuracy threshold, and obtaining the final multi-layer perceptron model;

[0179] S4, classifying and identifying the first velvet antler slices according to the characteristic center data matrix and the characteristic data of the velvet antler slices to be identified, and obtaining the quality grade data of the first velvet antler slices;

[0180] The S4 comprises the following steps:

[0181] S41, setting a pilose antler slice to be identified; collecting image data of the pilose antler slice to be identified, and obtaining image data to be identified;

[0182] S42, according to the velvet antler slice feature type set Obtain the feature data of the image data to be identified, and obtain the feature data set to be identified , Represents the corresponding antler slice feature type set of the image data to be identified Feature data of the i-th antler slice feature type in ;

[0183] S43, calculating the feature data set to be identified With the feature center data matrix The Euclidean distance data between each row of data in the , and the Euclidean distance data set is obtained , Represents the feature data set to be identified With the feature center data matrix The Euclidean distance data between the i-th row of data in;

[0184] Match the first category label data matrix , the Euclidean distance dataset The feature center data matrix corresponding to the maximum Euclidean distance data The category label data of the Bank of China data is used as the feature data set to be identified The category label data to be identified is obtained;

[0185] S44, set the quality level of antler slices , Indicates the set quality level of the ith antler slices, Indicates the total number of set velvet antler slice quality grades;

[0186] According to the quality grade of velvet antler slices Set of deer antler slice types The quality grade of each type of antler slices in the antler slices is obtained to obtain the antler slice quality grade dataset , Represents the type set of deer antler slices The quality grade data of the i-th type of antler slices;

[0187] S45, matching the velvet antler slice quality grade data set And Deer Antler Slice Type Set Acquire the antler slice quality grade data corresponding to the first category label data to be identified, and obtain the first antler slice quality grade data;

[0188] S5, using the final multi-layer perceptron model to classify and identify the gas component content data of the velvet antler slices to be identified, to obtain the second velvet antler slice quality grade data;

[0189] The S5 comprises the following steps:

[0190] S51, placing the velvet antler slices to be identified into a sealed can for sealed storage; when the sealed storage time is greater than or equal to the storage time threshold, using a diaphragm air pump to uniformly extract a certain amount of gas from the sealed can to obtain a gas sample to be identified;

[0191] S52, according to the gas component type combination set The gas sensor is used to collect the content of each component gas of the gas sample to be identified, and a data set of the content of the gas component to be identified is obtained. ,

[0192] Indicates the content data of the i-th gas component in the gas sample to be identified;

[0193] S53, the gas component content data set to be identified Input into the final multi-layer perceptron model for classification to obtain the second category label data to be identified;

[0194] S54, according to the quality grade of the velvet antler slices Set the second category label data matrix The quality grade data of each category label data in the , and the quality grade data matrix of velvet antler slices is obtained ;as follows,

[0195] ;

[0196] in, Represents the type set of deer antler slices The quality grade data of the category label data of the gas sample corresponding to the j-th deer antler slice sample corresponding to the i-th deer antler slice type;

[0197] Matching the quality grade data matrix of the velvet antler slices And the second category label data matrix Acquire the quality grade data of the second category label data to be identified, and obtain the second quality grade data of the antler slices;

[0198] S6, comparing the first pilose antler slice quality grade data with the second pilose antler slice quality grade data to obtain final quality grade data of the pilose antler slice to be identified;

[0199] The S6 includes the following process:

[0200] When the second antler slice quality grade data is greater than or equal to the first antler slice quality grade data, the first antler slice quality grade data is used as the final quality grade data of the antler slice to be identified; otherwise, the second antler slice quality grade data is used as the final quality grade data of the antler slice to be identified.

[0201] Embodiment 2

[0202] This embodiment discloses a velvet antler slice quality identification system based on image recognition, the system can implement the method of the above embodiment, including a first velvet antler slice image data acquisition module, a feature extraction module, a first label construction module, a feature center data optimization module, a gas component content data acquisition module, a second label construction module, a classification model construction module, a first quality grade identification module, a second quality grade identification module and a final judgment module;

[0203] The first antler slice image data acquisition module is used to acquire image data of multiple types of antler slices to obtain an antler slice image data matrix;

[0204] The feature extraction module is used to extract feature data of each antler slice image data in the antler slice image data matrix to obtain a antler slice feature data set matrix;

[0205] The first label construction module is used to construct the category label data of each velvet antler slice feature data set in the velvet antler slice feature data set matrix to obtain a first category label data matrix;

[0206] The feature center data optimization module is used to iteratively optimize the center data of each type of antler slice feature data in the antler slice feature data set matrix to obtain a feature center data matrix;

[0207] The gas component content data acquisition module is used to collect gas component content data of multiple types of pilose antler slices to obtain a final gas component content data set matrix;

[0208] The second label construction module is used to construct the category label data of each gas component content data set in the final gas component content data set matrix to obtain a second category label data matrix;

[0209] The classification model is used to construct a module to construct a final multi-layer perceptron model using the second category label data matrix and the final gas component content data set matrix;

[0210] The first quality grade identification module is used to classify and identify the first antler slice quality grade data according to the characteristic center data matrix and the characteristic data of the antler slice to be identified;

[0211] The second quality grade identification module is used to classify and identify the gas component content data of the antler slices to be identified by using the final multi-layer perceptron model to obtain the second antler slice quality grade data;

[0212] The final determination module is used to compare the first antler slice quality grade data with the second antler slice quality grade data to obtain the final quality grade data of the antler slice to be identified.

[0213] In the description of this specification, the description with reference to the terms "one embodiment", "example", "specific example", etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.

[0214] The preferred embodiments of the invention disclosed above are only used to help explain the invention. The preferred embodiments do not describe all the details in detail, nor do they limit the invention to the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the invention, so that those skilled in the art can understand and use the invention well.

Claims

1. A method for identifying the quality of velvet antler slices based on image recognition, characterized in that: The following steps are involved: S1, collecting image data of multiple types of antler slices to obtain an antler slice image data matrix; extracting feature data of each antler slice image data in the antler slice image data matrix to obtain an antler slice feature data set matrix; Constructing category label data of each velvet antler slice feature data set in the velvet antler slice feature data set matrix to obtain a first category label data matrix; S2, iteratively optimizing the central data of each type of antler slice feature data in the antler slice feature data set matrix to obtain a feature central data matrix; S3, collecting gas component content data of multiple types of antler slices to obtain a final gas component content data set matrix; Constructing category label data of each gas component content data set in the final gas component content data set matrix to obtain a second category label data matrix; Using the second category label data matrix and the final gas component content data set matrix to construct a final multi-layer perceptron model; S4, classifying and identifying the first velvet antler slices according to the characteristic center data matrix and the characteristic data of the velvet antler slices to be identified, and obtaining the quality grade data of the first velvet antler slices; S5, using the final multi-layer perceptron model to classify and identify the gas component content data of the velvet antler slices to be identified, to obtain the second velvet antler slice quality grade data; S6. Compare the first pilose antler slice quality grade data with the second pilose antler slice quality grade data to obtain final quality grade data of the pilose antler slice to be identified.

2. The method for identifying the quality of velvet antler slices based on image recognition according to claim 1, characterized in that: The S1 comprises the following steps: S11, setting a velvet antler slice type set; collecting corresponding velvet antler slice samples according to the velvet antler slice type set to obtain a velvet antler slice sample matrix; S12, collecting image data of each antler slice sample in the antler slice sample matrix to obtain a antler slice image data matrix; setting a category label corresponding to each antler slice image data in the antler slice image data matrix to obtain a first category label data matrix; S13, setting a plurality of feature types that can distinguish the types of antler slices to obtain a antler slice feature type set; acquiring feature data of each antler slice image data in the antler slice image data matrix according to the antler slice feature type set to obtain a antler slice feature data set matrix.

3. The method for quality identification of velvet antler slices based on image recognition according to claim 2, characterized in that: The S2 comprises the following steps: S21, setting a discreteness threshold for the velvet antler slice feature data set matrix; S22, obtaining the central data of the characteristic data of each type of velvet antler slice sample in the velvet antler slice characteristic data set matrix according to the discreteness threshold value, and obtaining a characteristic central data matrix.

4. The method for quality identification of velvet antler slices based on image recognition according to claim 3, characterized in that: The S22 comprises the following steps: S221, construct elite predator population and prey population; set the maximum number of iterations to , the current number of iterations is ; S222, randomly selecting a number of feature data sets from the feature data corresponding to each type of antler slice in the antler slice feature data set matrix as the initial positions of each elite predator and prey in the elite predator population and the prey population, respectively, to obtain an elite predator initial position matrix set and a prey initial position matrix set; S223, setting the fitness function of the elite predator population and the prey population according to the discreteness threshold; S224, start iteration; in each round of iteration, when It is the exploration stage; It is the transition stage between exploration and development; This is the development stage; after the location update is completed, it enters the next round of iteration; S225, when When , the iteration operation is stopped and the final global optimal position is output; the final global optimal position is used as the feature center data matrix.

5. The method for identifying the quality of velvet antler slices based on image recognition according to claim 4, characterized in that: The S3 comprises the following steps: S31, setting a storage time threshold and placing each antler slice sample in the antler slice sample matrix into a sealed can for sealed storage; when the sealed storage time is greater than or equal to the storage time threshold, using a diaphragm air pump to extract a certain amount of gas at a uniform speed from each sealed can to obtain a gas sample matrix; setting a category label corresponding to each gas sample in the gas sample matrix to obtain a second category label data matrix; S32, using a gas sensor to collect the content of each component gas of each gas sample in the gas sample matrix to obtain an initial gas component content data set matrix; combining various gas component types in the initial gas component content data set matrix to obtain a gas component type combination set; reconstructing the initial gas component content data set matrix according to the gas component type combination set to obtain a final gas component content data set matrix; S33, constructing an initial multi-layer perceptron model; using the final gas component content data set matrix and the second category label data matrix to train and test the initial multi-layer perceptron model; after the training and testing are completed, the final multi-layer perceptron model is obtained.

6. The method for quality identification of velvet antler slices based on image recognition according to claim 5, characterized in that: The S33 comprises the following steps: S331, performing data partitioning on the final gas component content data set matrix and the second category label data matrix to obtain a final gas component content training data set matrix, a final gas component content test data set matrix, a second category label training data matrix, and a second category label test data matrix; S332, setting a training error threshold; inputting the final gas component content training data set matrix and the second category label training data matrix into the initial multi-layer perceptron model for training operation; during the training process, when the training error is less than the training error threshold, stopping the training operation to obtain a trained multi-layer perceptron model; otherwise, continuing the training; S333, setting a test accuracy threshold; inputting the final gas component content test data set matrix and the second category label test data matrix into the trained multi-layer perceptron model for testing; after the test is completed, obtaining the test accuracy; when the test accuracy is greater than or equal to the test accuracy threshold, using the trained multi-layer perceptron model as the final multi-layer perceptron model; otherwise, returning to S332 to continue training the trained multi-layer perceptron model until the test accuracy is greater than or equal to the test accuracy threshold, to obtain the final multi-layer perceptron model.

7. The method for identifying the quality of velvet antler slices based on image recognition according to claim 6, characterized in that: The S4 comprises the following steps: S41, setting a pilose antler slice to be identified; collecting image data of the pilose antler slice to be identified, and obtaining image data to be identified; S42, acquiring feature data of the image data to be identified according to the velvet antler slice feature type set, to obtain a feature data set to be identified; S43, calculating the Euclidean distance data between the feature data set to be identified and each row of data in the feature center data matrix to obtain a Euclidean distance data set; using the category label data of the row data in the feature center data matrix corresponding to the maximum Euclidean distance data in the Euclidean distance data set as the category label data of the feature data set to be identified, and obtaining the first category label data to be identified; S44, setting a velvet antler slice quality grade set; setting a quality grade of each velvet antler slice type in a velvet antler slice type set according to the velvet antler slice quality grade set, to obtain a velvet antler slice quality grade data set; S45. Acquire the antler slice quality grade data corresponding to the first category label data to be identified by cooperating with the antler slice quality grade data set and the antler slice type set to obtain the first antler slice quality grade data.

8. The method for identifying the quality of velvet antler slices based on image recognition according to claim 7, characterized in that: The S5 comprises the following steps: S51, placing the velvet antler slices to be identified into a sealed can for sealed storage; when the sealed storage time is greater than or equal to the storage time threshold, using a diaphragm air pump to uniformly extract a certain amount of gas from the sealed can to obtain a gas sample to be identified; S52, using a gas sensor to collect the content of each component gas of the gas sample to be identified according to the gas component type combination set, to obtain a data set of gas component content to be identified; S53, inputting the gas component content data set to be identified into the final multi-layer perceptron model for classification to obtain second category label data to be identified; S54. Set the quality grade data of each category label data in the second category label data matrix according to the antler antler slice quality grade set to obtain the antler antler slice quality grade data matrix; obtain the quality grade data of the second category label data to be identified by combining the antler antler slice quality grade data matrix and the second category label data matrix to obtain the second antler antler slice quality grade data.

9. The method for identifying the quality of velvet antler slices based on image recognition according to claim 8, characterized in that: The S6 includes the following process: When the second antler slice quality grade data is greater than or equal to the first antler slice quality grade data, the first antler slice quality grade data is used as the final quality grade data of the antler slice to be identified; otherwise, the second antler slice quality grade data is used as the final quality grade data of the antler slice to be identified.

10. A system for implementing the method for identifying the quality of velvet antler slices based on image recognition as described in any one of claims 1 to 9.