Salmon meat quality analysis method
By using heterogeneous feature fusion technology of texture density characteristics and color characteristics in salmon meat quality assessment, the problems of strong subjectivity and neglected texture characteristics in the existing technology are solved, and accurate and automated evaluation of salmon meat quality and freshness are achieved.
Patent Information
- Application Number
- CN202411738098.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-03-28
AI Technical Summary
The prior art has problems such as strong subjectivity, low efficiency and difficulty in standardization in salmon meat quality assessment, and ignores the texture characteristics of the meat quality, affecting the accuracy and automation level of the assessment.
Salmon meat quality analysis method is used to analyze the texture and color characteristics of salmon through heterogeneous feature fusion technology of texture density characteristics and color characteristics, combined with image processing and artificial intelligence algorithms, to achieve accurate assessment of meat quality and freshness.
It improves the automation level of meat quality assessment, reduces errors in human judgment, provides a reliable quality control basis, and ensures the quality consistency of salmon products.
Smart Images

Figure CN119723561A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of meat freshness detection, and in particular to a salmon meat quality analysis method. Background Art
[0002] Salmon is a seafood with great nutritional and economic value, and is widely used in raw and cooked food. As consumers' requirements for food quality continue to increase, how to quickly and accurately evaluate the meat quality and freshness of salmon has become an important research topic. Traditional salmon meat quality evaluation mainly relies on experienced professionals to judge by vision and touch, but this method has problems such as strong subjectivity, low efficiency, and difficulty in standardization. In addition, with the development of large-scale industrial production and processing, an automated and accurate meat quality evaluation method is urgently needed to improve production efficiency and ensure product quality consistency.
[0003] In recent years, the development of computer vision and image processing technology has provided new solutions for food quality testing. Through image acquisition equipment, high-precision meat images can be obtained, and combined with artificial intelligence algorithms, quantitative analysis of meat texture, color and other characteristics can be performed to achieve automated quality testing. However, the image processing technology currently used in the market mostly focuses on the analysis of surface color, ignoring the texture characteristics of meat. Texture is an important factor in judging meat quality and is directly related to the taste, fat content and freshness of the meat. Summary of the invention
[0004] In view of the shortcomings of the prior art, the present invention proposes a salmon meat quality analysis method, which uses the heterogeneous feature fusion technology of texture density features and color features to comprehensively analyze the texture and color of salmon and accurately evaluate the quality and freshness of the meat. Through this method, the automation level of meat quality evaluation can be effectively improved, the error of human judgment can be reduced, and a reliable quality control basis can be provided for the production and processing of salmon.
[0005] To solve the above problems, the present invention provides the following technical solutions:
[0006] A salmon meat quality analysis method comprises the following steps:
[0007] Step S1, extracting the red channel of the original salmon image, converting the single-channel image into a grayscale image, and normalizing it to a uniform size, and then dividing the grayscale image into a plurality of small grids;
[0008] Step S2, taking the image of each small grid for texture analysis, obtaining a rotationally invariant texture density matrix representation corresponding to each small grid and performing probability analysis on it, and constructing a texture density feature vector according to the probability analysis result;
[0009] Step S3, based on the rotationally invariant texture density matrix representation and probability analysis described in step S2, meat quality area division is performed, and the face value proportions of the different divided areas are counted;
[0010] Step S4: performing statistical analysis on the color of the salmon meat according to the result of the meat quality area division in step S3, and constructing a color feature vector;
[0011] S5. A heterogeneous feature map network is established based on the constructed texture density feature vector and color feature vector. Feature fusion and calculation are performed through the heterogeneous feature map network to obtain a texture comprehensive judgment vector p1 and a color comprehensive judgment vector p2, and then the final meat quality grade and freshness grade analysis results of the whole piece of salmon meat are output.
[0012] Compared with the prior art, the present invention has at least the following beneficial effects:
[0013] 1. Through the fast meat segmentation method based on texture density feature representation, the meat is divided into different areas according to the texture density feature. For different areas, the texture is different, and the size of the image block is also different. Using the texture density histogram and color heterogeneous feature fusion technology, the texture and color characteristics of salmon are comprehensively analyzed, and the quality and freshness of the meat are evaluated more accurately;
[0014] 2. Traditional methods usually directly add or cascade different types of features. Such a rough fusion method will fuse useful features and introduce a lot of noise. Too much information will not be selected and filtered, which will not only fail to improve the recognition rate, but will damage the classification accuracy. The present invention uses a heterogeneous feature fusion method for the final identification of meat color and texture, which can naturally fuse information from different sources (here it is color and texture, but not only this information, for the future, other types of information such as pH value and moisture information can also be integrated). Therefore, a variety of information features can be comprehensively considered, which is more accurate than the results of single processing or simple combination evaluation only in the post-processing stage;
[0015] 3. Preserve the complementarity between features through the method of heterogeneous feature fusion: Color and texture may have different contributions in judging meat quality and freshness. Through heterogeneous graphs, not only can each feature be processed separately, but also their mutual relationships can be considered to better capture their complementarity;
[0016] 4. Enhance the model's expressiveness through heterogeneous feature fusion: Heterogeneous feature fusion can process different types of node features and edge relationships, thereby capturing richer patterns and improving the accuracy of meat quality judgment;
[0017] In general, the method of the present invention can effectively improve the automation level of meat quality evaluation, reduce errors in human judgment, and provide a reliable quality control basis for the production and processing of salmon. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The drawings described herein are used to provide a further understanding of the embodiments of the present invention, constitute a part of this application, and do not constitute a limitation of the embodiments of the present invention. In the drawings:
[0019] Figure 1 This is a diagram of the texture of real and fake salmon;
[0020] Figure 2 This is a diagram of the different qualities of salmon;
[0021] Figure 3 This is a texture image of a whole salmon fillet;
[0022] Figure 4 Divide the texture map for salmon;
[0023] Figure 5 This is the salmon texture division map after shrinking the window;
[0024] Figure 6 This is a relationship diagram between texture nodes and color nodes. DETAILED DESCRIPTION
[0025] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with embodiments and drawings. The exemplary embodiments of the present invention and their description are only used to explain the present invention and are not intended to limit the present invention.
[0026] Generally, the quality of salmon can be classified in the following ways:
[0027] 1. Classification by fat content:
[0028] High-quality salmon usually has obvious white fat stripes and soft and delicate meat. Such salmon has a higher fat content, which brings a richer taste. It is often used in sashimi or sushi because its rich fat enhances the taste and flavor;
[0029] Ideal fat ratio: Generally speaking, the white fat texture and red muscle texture of high-quality salmon should be evenly distributed, with neither too much nor too little fat; salmon with a fat content of about 10% to 25% usually tastes the best, ensuring that the fish meat is tender and juicy without being too greasy;
[0030] Too much fat: Too much fat can make salmon taste too greasy and affect the taste balance, especially when it is heated, too much fat will be lost. Too much fat in salmon is common in some farmed varieties;
[0031] Too little fat: Salmon with too little fat tastes dry, especially during cooking, and is prone to becoming dry and hard, lacking in lubricity and freshness. This type of fish is more suitable for heat processing or baking;
[0032] 2. Classification by fat distribution:
[0033] Evenly distributed fat: The fat of high-quality salmon is usually evenly distributed between the muscles, forming delicate "marble patterns" or "fish patterns"; this evenly distributed fat makes the salmon meat more tender and especially suitable for raw consumption, such as sashimi;
[0034] Unevenly distributed fat: If fat is concentrated in certain parts, it may affect the eating experience, such as inconsistent taste, with some parts being too greasy and others being dry;
[0035] 3. Classification by color:
[0036] Dark orange-red: Dark salmon rich in natural astaxanthin is generally considered to be of higher quality. Astaxanthin not only gives salmon a bright orange-red color, but also has strong antioxidant properties. The fat on the surface of this type of salmon is evenly distributed and tastes excellent;
[0037] Light pink or pale: Light-colored salmon usually means it is lower in fat or has a lighter color due to its breeding environment and diet. The flavor and taste of this type of salmon is often not as rich as dark-colored salmon;
[0038] 4. Classification by meat texture:
[0039] Delicate and smooth: The meat of high-quality salmon is delicate and smooth, with evenly arranged muscle fibers and reasonable fat distribution. This kind of meat is suitable for raw consumption and is often used in high-end cuisine such as sashimi and sushi;
[0040] Rough and fibrous: Salmon with rough and fibrous texture is usually of lower quality and is suitable for eating after being cooked because it can still maintain a good taste at high temperatures;
[0041] 5. Classification by freshness:
[0042] Fresh fish: Fresh salmon has bright color, firm and elastic texture, no slime or odor on the surface, and smooth cut surface. This type of fish is of high quality and suitable for raw consumption and high-quality cooking;
[0043] Stale fish: Stale salmon is dull or grey in colour, has loose texture, feels sticky, may have an off-odour, and may have an uneven or damaged surface texture, such as Figure 1 and Figure 2 shown.
[0044] In terms of meat texture classification, each piece of salmon meat has a unique texture, and the texture distribution is also uneven (see Figure 3 ). Since texture information can reflect the quality level of the entire salmon meat, if the texture characteristics of the salmon meat surface can be extracted and analyzed and graded, it will be of great help in the subsequent grading of the salmon meat quality. Based on this, the present invention proposes a salmon meat quality analysis method, which realizes the texture analysis of the whole piece of salmon meat through the image (original image) of salmon meat, and the method steps are as follows:
[0045] Step S1: extract the red channel of the image, convert the single-channel image into a grayscale image, normalize it to a uniform size, and divide the grayscale image into H*W small grids, such as Figure 4 As shown, H represents the number of rows, W represents the number of columns, and preferably, the small grids are square grids.
[0046] Step S2: Take the image of each small grid for texture analysis, obtain a rotationally invariant texture density matrix representation for each small grid and perform probability analysis on it; specifically, the calculation process of texture analysis for a small grid at the current scale is as follows:
[0047] a) Select distance and direction: Select a specific distance (d) and direction (θ), for example, d = 1 and θ = 0° (indicates horizontal direction);
[0048] b) Grayscale adjustment: Reduce the grayscale of the image to N levels as needed. For example, quantize an 8-bit image (0-255 grayscale) to 16 grayscales, N=16.
[0049] c) Initialize an N×N matrix to zero, denoted as the initial texture matrix, where N is the number of gray levels of the image;
[0050] d) Traverse every pixel in the image, and for each pixel (i, j) in the image, find its neighboring pixels at the selected distance and direction;
[0051] e) Constructing the texture matrix: Let the gray level of the current pixel be g1, and the gray level of its neighboring pixel be g2, then add 1 to the g1th row and g2th column of the initial texture matrix;
[0052] f) Boundary processing: When approaching the boundary of the image, some pixels may have no neighbors depending on the distance and direction chosen, in which case we choose to skip these pixels;
[0053] g) Complete the traversal: Continue the above steps d) to f) until all pixels in the image of the current small grid are processed;
[0054] h) Normalization: Although the texture matrix is constructed, it records the frequency of grayscale differences of neighboring pixels, and the frequency does not represent the probability. Therefore, in order to obtain a probability representation, each element of the texture matrix is divided by the sum of all elements in the matrix, thereby obtaining the texture density matrix in the corresponding direction;
[0055] i) redefine multiple specific distances (d) and directions (θ) for calculation, repeat the above steps b) to h), and obtain the texture density matrix from different directions; when calculating, use a different direction each time;
[0056] j) Synthesis direction: For multiple texture density matrices obtained from different directions, average them to obtain a rotationally invariant texture density matrix representation, calculated as follows:
[0057] The most direct method is to simply take the arithmetic average of the GLCM (gray level co-occurrence matrix) in each direction. Assuming that the GLCMs (P 0° , P 45° , P 90° , P 135° ), for each element ij in GLCM, its rotationally invariant geometric mean is:
[0058]
[0059] k) performing probability analysis on the rotationally invariant texture density matrix, including contrast, energy, entropy, homogeneity, correlation and difference, and the specific calculation formula is as follows:
[0060] 1. Contrast:
[0061] The calculation formula is: Contrast = Σ_i,j(ij) 2 ×P(i,j);
[0062] This parameter describes the size of the elements outside the diagonal elements of the GLCM. A large contrast value usually means that the image has higher frequency changes or stronger textures.
[0063] 2. Energy or Angular Second Moment (ASM):
[0064] The calculation formula is: Energy = ∑_i,jP(i,j) 2 ;
[0065] This parameter represents the quadratic sum of the GLCM, which captures the uniformity or texture consistency of the image;
[0066] 3. Entropy:
[0067] The calculation formula is: Entropy = -∑_i,jP(i,j)×log(P(i,j));
[0068] This parameter represents the complexity or randomness of the texture. A high entropy value means more complex texture information.
[0069] 4. Homogeneity or Inverse Difference Moment (IDM):
[0070] The calculation formula is:
[0071] This parameter represents the similarity or consistency of local responses in the image;
[0072] 5. Correlation:
[0073] This parameter describes the linear correlation between two gray levels i and j, which can be quantified by calculating the Pearson correlation coefficient. The Pearson correlation coefficient is a statistical indicator that measures the strength and direction of the linear relationship between two variables. Its calculation involves the mean, standard deviation and the product of the deviations of each gray level;
[0074] 6.Dissimilarity:
[0075] The calculation formula is: Dissimilarity = ∑_i,j|ij|×P(i,j); this parameter represents the difference in the grayscale values of two pixels;
[0076] For each small grid, a texture density feature vector is constructed after probability analysis, denoted as R n , n represents the nth grid.
[0077] Step S3: Based on the rotationally invariant texture density matrix representation and probability analysis described in step S2, meat quality regions are divided, and the face value proportions of the divided different regions are counted. For meat quality evaluation, the meat quality of each piece of meat is not uniform. Some parts have good meat quality and high quality, while some parts have poor meat quality. In order to evaluate the meat quality of each piece of meat, the present invention uses the following method to achieve meat quality region division:
[0078] S31, according to the texture density matrix probability analysis performed on each small grid in step k), the meat texture degree of each small grid is calculated, and the specific calculation formula is:
[0079] T = f(V, Contrast), where
[0080]
[0081] Where T is the meat texture, V is the grid texture variance, u is the mean of the texture density matrix, and x i is the texture density matrix of the i-th small grid, p i Represents the probability of meat texture density; where the local grid texture variance V is calculated using the original grayscale pixels. A higher variance may indicate that this area has rich textures, and a large meat texture means that the image has a higher frequency change and texture; h and Nl are the subscript range and total number involved in contrast normalization; Nl is the total number of grids at the current scale, indicating the range of the number of grids at a certain scale used to calculate the texture density probability, and h represents the current traversal value when traversing Nl;
[0082] S32, setting a threshold: setting a meat texture threshold, such as M. When the meat texture T is lower than M, it is considered that this area needs further exploration and continues to be segmented downward. When the meat texture T is higher than M, it is considered that this area has good meat quality and rich texture.
[0083] S33, calculating the next step of texture segmentation direction: calculating the gradient direction within the window and determining the main direction of the texture; this can be done using a Sobel or Prewitt filter;
[0084] S34, window expansion rule: If the meat texture is less than M and the texture direction is clear, the window is shrunk along the main texture direction, for example, multiple square areas are divided along the main texture direction, and the division method is as follows: Figure 5 ;
[0085] S35. If the newly divided square area exceeds the original grid range, the newly divided grid is used as the main one, because the final segmentation is based on pixel statistics, and the grid that exceeds the limit is equivalent to one more calculation, which does not affect the final segmentation;
[0086] S36, performing texture density matrix analysis on each newly divided small grid, recalculating the meat texture degree T, and when the meat texture degree T is lower than M, it is considered that this area needs further exploration and continues to be segmented downward. During the process of continuing segmentation, when the area pixel of the small grid is lower than G pixels, no further segmentation is performed;
[0087] S37, traversing the image to perform meat quality division: traversing the entire image, obtaining the meat texture T of all grids (including the newly divided small grids) and performing meat quality area division, specifically, when the meat texture T is higher than M, it is considered to be a high-level meat quality area; when the meat texture T is lower than M but higher than P, it is considered to be a medium-level meat quality area; when the meat texture T is lower than P but higher than U, it is considered to be an ordinary meat quality area; when the meat texture T is lower than U, it is considered to be an edge or blank; wherein M, P, and U are hyperparameters, which are set manually;
[0088] S38. According to the result of the meat quality area division, the area ratios of the high-quality meat area, the intermediate-quality meat area, and the ordinary meat area are counted. The statistical method is that if the pixel position belongs to the grid division of the high-quality meat area, then the pixel point is the high-quality meat area; the intermediate and ordinary meat areas are counted in the same way; the larger the area of the high-quality meat area, the higher the level and the higher the meat quality.
[0089] In addition, we know that the color of the meat will change from dark red at the beginning to bright red and then to brown as the exposure time increases. This is because the surface color of salmon meat is mainly determined by the content of myoglobin. After the salmon meat is left in the air for a long time, myoglobin will be strongly oxidized into oxidized myoglobin (when the degree of oxidation exceeds 50%, the meat color appears brown), making the meat color appear dark brown. Therefore, it is of great significance to use computer vision to obtain color feature parameter values from the original image of the meat product to evaluate the freshness of the salmon meat. Based on this, the analysis method of the present invention further includes step S4, that is, according to the result of the meat area division in step S3, the color of the salmon meat is analyzed, the color of the salmon meat is statistically analyzed and a color feature vector is constructed, specifically including the following steps:
[0090] S41, determining the analysis area: according to the result of the meat area division in step S37, selecting the square area with meat quality for analysis (this step is mainly to exclude the analysis of the edge or blank area with a meat texture lower than U);
[0091] S42, using computer vision methods to calculate the color histogram of each square area, and calculating the RGB histogram for each grid to evaluate the color distribution of the area;
[0092] S43, perform color statistical analysis on each grid:
[0093] For each grid, calculate the color mean, median, mode and other statistics of the pixels in the entire grid image; then, integrate the above color histogram and color mean, median, and mode information into a new color feature vector, denoted as C n , n represents the nth grid;
[0094] In order to better achieve the purpose of the present invention, step S5 is further included after step S4, that is, a heterogeneous feature map network is established based on the constructed texture density feature vector and color feature vector, feature fusion and calculation are performed through the heterogeneous feature map network to obtain the texture comprehensive judgment vector p1 and the color comprehensive judgment vector p2, and then the final meat quality grade and freshness grade analysis results of the whole piece of salmon meat are output.
[0095] Specifically, the heterogeneous feature graph network is established by the following method:
[0096] A. Node establishment: For each grid, extract its color feature vector C n , treat each color feature vector as an independent node and mark it as color node C i , whose characteristic is expressed as v(C i );For each grid, extract the texture density feature vector R n , treat each texture density feature vector as an independent node and mark it as texture node R i , whose characteristic is expressed as v(R i );
[0097] B. Establishment of edge:
[0098] Establish a color-color edge (C-CEdge). Specifically, for each pair of color nodes C i and C j , calculate their feature similarity. If the similarity exceeds a predefined threshold or is located in the top k most similar nodes (the k value is pre-set as needed), an edge is added. The weight of the edge is calculated by the color feature similarity. The calculation formula is:
[0099]
[0100] Among them, W C i ,Cj represents the weight of the color-color edge, sim is the similarity function of color features (such as cosine similarity), and λ is an adjustable parameter used to control the saturation of the weight;
[0101] Establish a texture-texture edge (R-REdge). Specifically, for each pair of texture node features v(R i ), calculate its feature similarity, if the similarity exceeds a predefined threshold or is located in the top k most similar nodes, then add an edge, the weight of the edge is calculated by the texture feature similarity, and its calculation formula is:
[0102]
[0103] Among them, W Ri,Rj represents the weight of the texture-texture edge, som is the similarity function of texture features (such as cosine similarity), and λ is an adjustable parameter used to control the saturation of the weight;
[0104] C. Constructing a heterogeneous feature graph network:
[0105] Two graph neural networks are constructed, denoted as GNN1 and GNN2. GNN1 is a texture heterogeneous graph network used to judge meat quality, and GNN2 is a color heterogeneous graph network used to judge freshness. Each node of the GNN1 texture heterogeneous graph network is a texture node, and each node of the GNN2 color heterogeneous graph network is a color node. In addition, the texture nodes in GNN1 are mapped and connected with the corresponding color nodes; the color nodes in GNN2 are mapped and connected with the corresponding texture nodes. The main network architectures of GNN1 and GNN2 are similar. The two are interconnected and have different emphases. GNN1 focuses on the nodes and edges of texture features, while GNN2 focuses on the nodes and edges of color features.
[0106] Taking the GNN1 texture heterogeneous graph network as an example (similar to GNN2), it is connected to the corresponding color nodes through the following method:
[0107] like Figure 6 As shown in FIG. 1 , each grid contains texture features and color features. For the texture features of each grid, a texture node is first established and a texture-texture edge is constructed to establish a graph neural network of the texture node and its associated texture nodes (e.g., a network formed between texture node 1 and texture nodes 2 and 3); then, a color node corresponding to the established texture node is found in the same grid (e.g., Figure 6 The color node 1 shown in the figure is constructed to construct a color-color edge, thereby establishing a graph neural network of the color node and the color nodes associated with it (for example, the network formed between color node 1 and color nodes 5 and color node 6); finally, through the mapping conversion method, the color node association relationship in the same grid is uniformly converted into the connection of texture nodes, that is, all neighboring color nodes connected to the color node will be connected to the texture node corresponding to the color node (see Figure 6 , forming a network connecting texture node 1 with color node 5 and color node 6). In this way, the connection edge between texture node and color node is established, thereby forming a texture heterogeneous graph network. The establishment method of GNN2 color heterogeneous graph network is similar to that of GNN1 texture heterogeneous graph network, which will not be repeated here. Furthermore, in order to realize the conversion of color node features to texture node features and realize the connection between texture nodes and color nodes, a mapping network of color node features to texture node features is also provided here as an example, and the formula is as follows:
[0108]
[0109] Among them, W C The trainable network parameters representing the mapping network from color node features to texture node features, Represents the features after mapping.
[0110] Furthermore, the feature fusion and calculation are performed through the heterogeneous feature map network to obtain the texture comprehensive determination vector p1 and the color comprehensive determination vector p2, including the following steps:
[0111] D1. Obtain updated node features of each texture node and color node through feature fusion and calculation;
[0112] D2. According to the result of the meat quality area division in step S3, the updated node features in different meat quality areas are averaged to obtain the global texture information vector and the global color information vector in different meat quality areas, and the global texture information vector and the global color information vector are cascaded with the area value of the corresponding meat quality area to obtain the corresponding texture comprehensive judgment vector p1 and color comprehensive judgment vector p2.
[0113] Through the above steps, for each node, the node features are updated by the feature aggregation operation of its neighboring nodes to capture the complex relationship between nodes, especially the complementarity between texture and color features.
[0114] More specifically, in step D1, feature fusion and calculation include three steps: message passing, feature aggregation and node updating, specifically (here only the texture node is used as an example for explanation, the color node is similar and will not be repeated):
[0115] Message Passing:
[0116] First, for each texture node R i , it is necessary to receive feature information from its neighboring nodes (i.e. other texture nodes and color nodes connected to it). For each node R i , the received message m i By neighboring node N(R i ) The information transmitted consists of:
[0117]
[0118] Among them, N(R i ) represents node R i The set of neighbor nodes, w ij is node R i With neighboring node R j The edge weight between them (as defined in step B above), h j is the feature representation of neighbor node j;
[0119] Feature Aggregation:
[0120] During the message passing process, the features of all neighbor nodes are aggregated through weighted summation. In order to consider the different effects of different neighbor nodes on the current node, a nonlinear activation function (such as ReLU or LeakyReLU) can be introduced to transform the aggregated information:
[0121] h' i =σ(W·m i ),
[0122] Where W is the learnable weight matrix, σ is the nonlinear activation function, and h' i It is the feature representation after node aggregation;
[0123] Node Update:
[0124] The node update process is completed by combining its own features with the feature information received from neighboring nodes. The final feature update of the node can use a trainable network parameter θ to control the contribution of its own features and neighbor features:
[0125]
[0126] in, is node R i The feature representation at the tth iteration is: is the updated feature, θ is a trainable parameter that controls the fusion ratio of the node’s own features and neighbor information;
[0127] In step D2, the different regions of the meat quality area are recorded as G1, G2 and G3 (representing high-quality, medium-quality and ordinary meat quality areas, respectively). For each region, the average value of all updated node features hi in the region is taken to obtain the global texture information vector g of the group of regions. Gq and the global color information vector s Gq , q = 1, 2, 3; then, the global texture information vector g Gq and the global color information vector s Gq Cascade with the area value of the corresponding meat area to obtain the corresponding texture comprehensive determination vector p1 and color comprehensive determination vector p2. Taking the acquisition method of texture comprehensive determination vector p1 as an example, the global texture information vector g Gq The calculation is performed using the following formula:
[0128]
[0129] Then the texture comprehensive decision vector p1 can be expressed as:
[0130]
[0131] Wherein, AG1, AG2, AG3 represent the areas of high-grade, medium-grade, and common meat quality regions, respectively. It should be noted that the acquisition method of the color comprehensive determination vector p2 is similar to the acquisition method of the texture comprehensive determination vector p1, and will not be further described here.
[0132] Furthermore, in order to output the final analysis results of the meat quality grade and freshness grade of the whole salmon meat, the obtained texture comprehensive determination vector p1 and color comprehensive determination vector p2 need to be input into the fully connected network to classify or regress each node. There are many fully connected networks in the prior art, which will not be described in detail here.
[0133] In order to better achieve the purpose of the present invention, multiple rounds of message transmission and feature aggregation are performed during feature fusion and calculation. Through this multi-round propagation method, the features of each node will gradually capture more global texture and color information.
[0134] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A salmon meat quality analysis method, characterized in that: The following steps are involved: Step S1, extracting the red channel of the original image of salmon meat, converting the single-channel image into a grayscale image, and normalizing it to a uniform size, and then dividing the grayscale image into a plurality of small grids; Step S2, taking the image of each small grid for texture analysis, obtaining a rotationally invariant texture density matrix representation for each small grid and performing probability analysis, and constructing a texture density feature vector according to the probability analysis result; Step S3, based on the rotationally invariant texture density matrix representation and probability analysis described in step S2, meat quality area division is performed, and the proportion of face value of different divided areas is counted; Step S4: performing statistical analysis on the color of the salmon meat according to the result of the meat quality area division in step S3, and constructing a color feature vector; Step S5, establishing a heterogeneous feature map network based on the constructed texture density feature vector and color feature vector, performing feature fusion and calculation through the heterogeneous feature map network, obtaining a texture comprehensive judgment vector p1 and a color comprehensive judgment vector p2, and then outputting the analysis results of the final meat quality grade and freshness grade of the whole piece of salmon meat.
2. A salmon meat quality analysis method according to claim 1, characterized in that: In step S2, the rotation-invariant texture density matrix representation is obtained by the following method: a) Select distance and direction: Select a specific distance and direction; b) Grayscale adjustment: quantize the grayscale of the image into N levels as needed; c) Initialize an N×N matrix to zero, denoted as the initial texture matrix, where N is the number of gray levels of the image; d) Traverse each pixel in the image, and for each pixel in the image, find its neighboring pixels at the selected distance and direction; e) constructing a texture matrix: assuming that the gray level of the current pixel is g1 and the gray level of the neighboring pixel is g2, then adding 1 to the g1th row and g2th column of the initial texture matrix; f) Boundary processing: When approaching the boundary of the image, pixels without neighboring pixels are skipped according to the selected distance and direction; g) Complete the traversal: Continue the above steps d) to f) until all pixels in the image of the current small grid are processed; h) Normalization: dividing each element of the texture matrix by the sum of all elements in the matrix, thereby obtaining a texture density matrix in the corresponding direction; i) redefine multiple specific distances and directions for calculation, repeat the above steps b) to h), and obtain the texture density matrix from different directions; when calculating, use a different direction each time; j) Synthesis direction: For multiple texture density matrices obtained from different directions, they are coupled to obtain a rotationally invariant texture density matrix representation.
3. A salmon meat quality analysis method according to claim 2, characterized in that: In step j), multiple texture density matrices are coupled by taking the arithmetic average of GLCM.
4. A salmon meat quality analysis method according to claim 2 or 3, characterized in that: In step S2, after obtaining the rotationally invariant texture density matrix representation, it also includes performing probability analysis on the rotationally invariant texture density matrix and constructing a texture density feature vector R n , n represents the nth grid, and the probability analysis includes the calculation of contrast, energy, entropy, homogeneity, correlation and difference.
5. The salmon meat quality analysis method according to claim 1, characterized in that: In step S5, the heterogeneous feature map network is established by the following method: A. Node establishment: For each grid, extract its color feature vector C n , treat each color feature vector as an independent node and mark it as color node C i , whose characteristic is expressed as v(C i );For each grid, extract the texture density feature vector R n , treat each texture density feature vector as an independent node and mark it as texture node R i , whose characteristic is expressed as v(R i ); B. Establishment of edge: The edges created include color-color edges and texture-texture edges. When creating color-color edges, for each pair of color nodes C i and C j , calculate their feature similarity, if the similarity exceeds a predefined threshold or is in the top k most similar nodes, then add an edge; when establishing texture-texture edges, for each pair of texture node features v(R i ), calculate their feature similarity, and add an edge if the similarity exceeds a predefined threshold or is located in the top k most similar nodes; C. Constructing a heterogeneous feature graph network: GNN1 and GNN2 graph neural networks are constructed respectively. GNN1 is a texture heterogeneous graph network used to judge the meat quality, and GNN2 is a color heterogeneous graph network used to judge the freshness. Each node of the GNN1 texture heterogeneous graph network is a texture node, and each node of the GNN2 color heterogeneous graph network is a color node. In addition, the texture nodes in GNN1 are mapped and connected to the corresponding color nodes; the color nodes in GNN2 are mapped and connected to the corresponding texture nodes.
6. A salmon meat quality analysis method according to claim 5, characterized in that: In step B, while constructing the corresponding edges, the weights of the corresponding edges are also calculated, and the weights are used for feature fusion and calculation.
7. A salmon meat quality analysis method according to claim 5, characterized in that: In step S5, the feature fusion and calculation are performed through the heterogeneous feature map network to obtain the texture comprehensive determination vector p1 and the color comprehensive determination vector p2, including the following steps: D1. Obtain updated node features of each texture node and color node through feature fusion and calculation; D2. According to the result of the meat quality area division in step S3, the updated node features in different meat quality areas are averaged to obtain the global texture information vector and the global color information vector in different meat quality areas, and the global texture information vector and the global color information vector are cascaded with the area value of the corresponding meat quality area to obtain the corresponding texture comprehensive judgment vector p1 and color comprehensive judgment vector p2.
8. A salmon meat quality analysis method according to claim 7, characterized in that: In step D1, feature fusion and calculation include three steps: message passing, feature aggregation and node update. Message passing means that each texture node and color node needs to receive feature information from its neighbor nodes; feature aggregation means that during the message passing process, the features of all neighbor nodes are aggregated by weighted summation; node update is completed by combining its own features with the feature information received from neighbor nodes.
9. A salmon meat quality analysis method according to claim 8, characterized in that: In the final feature update process of the node, a trainable network parameter θ is used to control the contribution of its own features and neighbor features: in, is the feature representation of the node at the tth iteration, is the updated feature, and θ is a trainable parameter that controls the fusion ratio of the node’s own features and neighbor information.