Meat quality intelligent detection method and system based on graph neural network

By constructing a graph structure in meat quality detection and using graph neural networks for graph convolution and structure updating, the problem of insufficient image structure modeling capabilities in existing technologies is solved, and automatic meat quality classification with higher accuracy and efficiency is achieved.

CN120672698AInactive Publication Date: 2025-09-19SHANDONG RUICHENG DATA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510768454.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-10
Publication Date
2025-09-19
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing technologies in meat quality detection have problems such as insufficient image structure modeling capabilities, insufficient dynamic image structure updates, and poor adaptability, resulting in low detection accuracy and efficiency.

Method used

An intelligent detection method based on graph neural network is adopted to construct graph structure through image segmentation. Combined with graph convolution and graph structure update operations, the graph edge connection relationship is dynamically adjusted to achieve adaptive evolution of graph structure and full propagation of features.

Benefits of technology

It improves the modeling ability of complex texture and structural differences in meat images, enhances the accuracy and efficiency of detection, and realizes intelligent and controllable automatic classification of meat quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120672698A_ABST
    Figure CN120672698A_ABST
Patent Text Reader

Abstract

The invention discloses a discrete pattern spot traversal survey path planning method under the influence of multiple factors, and the method comprises the following steps: S1, collecting a meat sample image, carrying out the image segmentation, and constructing an initial image structure; s2, extracting image features of each graph node, and generating node representation; s3, inputting the initial graph structure and the node representation into a graph topology evolution network, and executing a structure propagation period; s4, executing graph convolution operation in each period to generate a semantic tag prediction result; s5, adjusting a graph edge connection relation in the graph structure according to a prediction result; s6, inputting the updated graph structure and node representation into the next period, and repeating propagation and updating operations; and S7, aggregating node representation after propagation is completed, generating a graph structure global representation vector, inputting the graph structure global representation vector into a quality detection network, and outputting a quality detection result of the meat sample. According to the invention, combination of structure evolution and quality intelligent identification is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing technology, and in particular to a method and system for intelligent meat quality detection based on graph neural networks. Background Art

[0002] With the continuous improvement of food safety standards and the rapid development of intelligent manufacturing systems, meat product quality testing is gradually shifting from traditional manual subjective evaluation to automated systems that rely on image perception and intelligent algorithms. Processing and analyzing image information of meat samples to determine visual indicators such as color, texture, and fat distribution, thereby inferring freshness, meat quality grade, and potential defects, has become a key technical direction for improving inspection efficiency and standardization in the food industry.

[0003] Traditional meat quality detection methods mostly rely on manual experience, machine vision, or specific spectral imaging equipment. The former is highly subjective and has inconsistent standards. Although the latter has a certain degree of objectivity, it is highly dependent on equipment, has a complex detection process, and is difficult to adapt to the diverse appearance of meat. Against the backdrop of rapid developments in image processing and machine learning, convolutional neural networks (CNNs), as the mainstream model for image classification tasks, have been widely used in the automatic identification of meat quality. For example, some studies have used pre-trained deep convolutional networks such as ResNet and VGG to extract image features and implement meat grade classification through fully connected classifiers; there are also methods that divide meat images into several sub-regions, extract their respective features, and then perform multi-channel feature fusion to train supervised recognition models. These methods have improved detection accuracy to a certain extent, but they generally have the following shortcomings: First, the CNN model essentially processes images with a regular grid structure, and has natural limitations in modeling spatial feature relationships; second, the convolution operation has strong local perception and weak global semantics, and has limited ability to express the complex structural relationships between regions in meat images (such as fascia, fat stripes, texture direction, etc.); third, traditional classification models often use static feature extraction and fixed structure judgment processes, and cannot dynamically optimize the graph structure or propagation path according to the image content, and lack flexibility and adaptive modeling capabilities.

[0004] In recent years, graph neural networks (GNNs), as an important tool for processing non-Euclidean data structures, have achieved excellent performance in scenarios such as molecular property prediction, social network analysis, and remote sensing image segmentation due to their flexible ability to model dependencies between nodes in graph structures. In image understanding tasks, some studies have incorporated graph structures into the image region modeling process. For example, they divide the image into several patches and model them as graph nodes. Graph edges are connected based on pixel adjacency or semantic similarity, and then regional feature propagation and aggregation are performed using models such as GCN or GAT. While these methods have, to some extent, overcome the local perception limitations of traditional CNNs and possess certain structural expression capabilities, their direct application to meat quality inspection tasks still faces significant limitations. First, most current graph modeling methods use static graph structures. Once constructed, graph edges are fixed and cannot dynamically adapt to structural differences between samples or the evolving semantics during the recognition process. This can lead to edge connections that may deviate from the actual semantics. Second, most graph neural network models still rely on a fixed number of propagation layers or manually set propagation depth, lacking precise control over information propagation sufficiency and convergence, which can easily lead to problems such as overfitting or insufficient information propagation. Third, existing methods mostly focus on node feature enhancement or aggregation mechanisms, with insufficient attention to the active evolution and feedback adjustment mechanisms of the graph structure itself, making it difficult to achieve simultaneous optimization of structural expression and semantic discrimination.

[0005] Furthermore, existing approaches often use simple distance metrics for edge or node features, such as Euclidean distance and cosine similarity, to update graph structures. These metrics lack a deep understanding of the differences between predicted distributions at the semantic level, and fail to consider inverting label predictions back into the design space of structural connections. This results in a lack of interpretable updates to the graph's topology during training, hindering targeted structural optimization for the recognition target and impacting the model's accuracy in recognizing complex meat textures.

[0006] Therefore, how to provide an intelligent meat quality detection method and system based on graph neural networks is an urgent problem that needs to be solved by technical personnel in this field. Summary of the Invention

[0007] One objective of the present invention is to propose an intelligent meat quality detection method based on graph neural networks. This method fully integrates image region partitioning, graph structure modeling, node feature extraction, and graph topology evolution mechanisms. It utilizes graph convolution and semantic label prediction results to jointly drive iterative optimization of the graph structure. It describes in detail the feature evolution process of graph nodes over multiple propagation cycles and the feedback update method for the graph structure. It constructs a quality prediction model consisting of a dual-pooling graph aggregation module and a linear classification network. This method boasts strong structural expression capabilities, high detection accuracy, and strong model interpretability. It can more accurately identify complex texture and structural differences in meat images, enabling intelligent and controllable automatic classification and identification of meat quality.

[0008] The meat quality intelligent detection method based on graph neural network according to an embodiment of the present invention includes the following steps:

[0009] S1. Collect a meat sample image and perform image segmentation to divide the image into image regions of equal size and construct an initial graph structure.

[0010] S2. Extract image features for each graph node and generate node representation;

[0011] S3. Inputting the initial graph structure and node representation into a graph topology evolution network, wherein the graph topology evolution network sequentially executes a preset number of structure propagation cycles, each structure propagation cycle including a graph convolution operation and a graph structure update operation;

[0012] S4. In each structure propagation cycle, a graph convolution operation is performed based on the current graph structure and node representation to generate semantic label prediction results for the graph nodes.

[0013] S5. In the same structure propagation cycle, perform graph structure update operations and adjust the graph edge connection relationships in the graph structure based on the semantic label prediction results;

[0014] S6. The graph structure and node representation after the graph structure update operation are used as the input of the next structure propagation cycle, and the graph convolution operation and graph structure update operation are repeatedly performed to make the graph structure evolve cycle by cycle under the influence of the semantic label prediction results.

[0015] S7. After the last structure propagation cycle is completed, the node representation is input into the graph structure aggregation module to generate a global representation vector of the graph structure, which is then input into the quality detection network to output the quality detection results of the meat sample.

[0016] Optionally, each graph node in the initial graph structure corresponds to an image region, and each graph edge represents a spatial adjacency relationship between two image regions.

[0017] Optionally, the image features include texture density, color mean, and edge gradient.

[0018] Optionally, the S2 specifically includes:

[0019] S21, performing grayscale transformation on the image area to generate a grayscale image;

[0020] S22, calculating the average of the absolute differences between the grayscale values ​​of all pixels in the image area and the average grayscale value as a texture density feature;

[0021] S23, respectively calculating the average values ​​of all pixel values ​​in the image area in the three color channels of red, green, and blue to form a color mean vector;

[0022] S24, using an edge detection operator to calculate the gradient magnitude map of the image area, and obtaining the pixel average value as the edge gradient feature;

[0023] S25. Concatenate the texture density feature, the color mean vector, and the edge gradient feature in a fixed order to form a node representation of the corresponding graph node.

[0024] Optionally, the S3 specifically includes:

[0025] S31. Set the number of executions of the structure propagation cycle, denoted as T, where T is a positive integer greater than 1;

[0026] S32. In each structure propagation cycle, the graph structure and node representation output in the previous cycle are used as inputs in the current cycle;

[0027] S33. In the current cycle, a graph convolution operation is performed based on the input graph structure, a weighted adjacency aggregation mechanism is used to aggregate the neighbor node representations of each graph node, and the current node representation is updated;

[0028] S34. In the current cycle, a graph structure update operation is performed based on the updated node representation to generate a new graph structure and use it as input for the next structure propagation cycle.

[0029] Optionally, the S4 specifically includes:

[0030] S41, receiving the updated graph structure and node representation in the current structure propagation cycle, constructing the node representation into a node feature matrix, and constructing the graph structure into a normalized adjacency matrix;

[0031] S42, combining the normalized adjacency matrix and the node feature matrix, performing a graph convolution operation and generating an intermediate node representation;

[0032] S43, linearly superimposing the original input node feature matrix and the intermediate node representation to obtain an enhanced node representation;

[0033] S44, performing a linear transformation on the enhanced node representation to generate a label category score vector corresponding to each graph node;

[0034] S45. Normalize the label category score vector and calculate the semantic label prediction result of each graph node:

[0035]

[0036] Among them, P i,j is the predicted probability of the i-th graph node corresponding to the j-th label, Z i,j is the score of the graph node corresponding to the jth label, and k is the number of categories of semantic labels.

[0037] Optionally, the S5 specifically includes:

[0038] S51, receive the graph node semantic label prediction results generated in the structure propagation cycle, and construct the graph node label prediction matrix Where n is the number of graph nodes, k is the number of semantic label categories;

[0039] S52. For any two graph nodes i and j, calculate the semantic similarity score s between the label representations based on the semantic label prediction results. i,j :

[0040]

[0041] in, Represents the semantic label prediction probability vector of graph nodes i and j respectively, ||P i || and ||P j || is the two-norm of the corresponding vector, P i ·P j is the inner product of the two, D KL (P i ||P j ) represents the Kullback-Leibler divergence from node i to node j, defined as α and β are non-negative real number adjustment coefficients that control the weights of similarity and difference terms respectively. σ is the Sigmoid activation function, which is used to compress the similarity score to between 0 and 1. r ∈(0,1) is the judgment threshold for retaining and deleting edge connection relationships, θ a ∈(0,1) is the judgment threshold added to the graph edge connection relationship;

[0042] S53, when graph nodes i and j have a graph edge connection relationship in the current graph structure, and s i,j <θ r When , the edge connection relationship is deleted from the graph structure;

[0043] S54, when graph nodes i and j do not have a graph edge connection relationship in the current graph structure, and s i,j >θ a When , add graph edge connection relationship in the graph structure;

[0044] S55, when graph nodes i and j have a graph edge connection relationship in the current graph structure, and s i,j ≥θ r When , the edge connection relationship of the graph is preserved;

[0045] S56. After completing the adjustment of the graph edge connection relationships between all graph node pairs, output the graph structure after the graph structure update operation in the current propagation cycle.

[0046] Optionally, the S6 specifically includes:

[0047] S61. Set the maximum number of rounds T of the structure propagation cycle max , initialize the propagation round counter t to 1;

[0048] S62. In the tth round of structure propagation, the graph structure and node representation obtained from the previous graph structure update operation are used as input for the current propagation cycle.

[0049] S63. Based on the current graph structure and node representation, perform graph convolution operations and graph structure update operations in sequence to generate new graph node representations and graph structures for the current propagation cycle.

[0050] S64. Calculate the average rate of change between the current propagation round graph node representation and the previous round graph node representation:

[0051]

[0052] Where n is the number of graph nodes, and are the node representations of node i after the current and previous rounds of propagation, respectively. k is the dimension of the node representation, ||·||2 is the Euclidean norm of the vector, and δ t is the average change magnitude of the nodes in the entire graph;

[0053] S65, when the condition δ is met t <∈or t=T max When t=t+1, the execution process of the structure propagation cycle is terminated; otherwise, let t=t+1 and jump to step S62 to continue execution.

[0054] Optionally, the S7 specifically includes:

[0055] S71, receiving the graph node representation output by the last structure propagation cycle, and constructing a node representation matrix;

[0056] S72. Construct a graph structure aggregation module based on the node representation matrix. The graph structure aggregation module includes an average pooling unit and a maximum pooling unit, which respectively perform average pooling and extreme value pooling operations on the features of all graph nodes.

[0057] S73. Concatenate the average aggregation result and the extreme value aggregation result by dimension to generate a global representation vector of the graph structure;

[0058] S74. Build a quality detection network, where the quality detection network consists of two sequentially connected linear transformation layers, where the first linear transformation layer maps the global representation vector to an intermediate vector, and the second linear transformation layer maps the intermediate vector to a label score vector.

[0059] S75. Perform a nonlinear activation function operation between the two linear transformation layers to perform element-by-element nonlinear transformation on the intermediate vector. The activation function does not change the vector dimension:

[0060] f(x)=max(0,x);

[0061] Where x is any component of the intermediate vector, and f(x) is the output value after activation;

[0062] S76. Perform normalization processing on the label score vector and output the quality detection result of the meat sample.

[0063] The meat quality intelligent detection system based on graph neural network according to an embodiment of the present invention includes:

[0064] The image acquisition and segmentation module is used to acquire a meat sample image and perform image segmentation, dividing the image into image regions of equal size and constructing an initial graph structure;

[0065] Image feature extraction module, used to extract image features from each graph node in the initial graph structure and generate node representation;

[0066] A graph topology evolution network module receives the initial graph structure and node representations and executes a preset number of structure propagation cycles, each of which includes a graph convolution operation and a graph structure update operation.

[0067] The graph convolution processing module is used to perform graph convolution operations based on the current graph structure and node representation in each structure propagation cycle to generate semantic label prediction results for graph nodes;

[0068] The graph structure update module is used to adjust the graph edge connection relationship in the graph structure according to the semantic label prediction results in each structure propagation cycle and update the graph structure;

[0069] The structure propagation control module is used to input the graph structure and node representation output by the graph structure update module into the next structure propagation cycle, and determine whether to terminate the structure propagation based on the rate of change of the graph node representation or the number of propagations;

[0070] The graph structure aggregation module is used to perform average pooling and maximum pooling on the graph node representation after the structure propagation cycle ends to generate a global representation vector of the graph structure;

[0071] The quality detection network module is used to receive the global representation vector generated by the graph structure aggregation module, perform linear mapping, activation function operation and label score prediction, and output the quality detection results of the meat sample.

[0072] The beneficial effects of the present invention are:

[0073] This method constructs a region-level graph structure within meat sample images. Based on image segmentation results, the image is divided into equally sized regions. Each region is modeled as a graph node, and the spatial adjacency between regions is represented by graph edges. This effectively overcomes the limitations of traditional convolutional neural networks in modeling image structures. The introduction of graph neural networks enables the effective integration of structural information between regions during node propagation, providing a more discriminative structural feature foundation for subsequent semantic judgment.

[0074] Unlike existing static graph models, this paper proposes a graph topology evolutionary network that dynamically adjusts edge connections within the graph structure based on predicted semantic labels for graph nodes. By constructing a semantic similarity function that combines cosine similarity and KL divergence, it quantitatively evaluates relationships between nodes and sets criteria for adding, retaining, and deleting edges, enabling periodic feedback updates of the graph structure. This mechanism overcomes the rigid limitations of traditional graph neural network architectures, enabling the graph structure to adaptively adjust during propagation, enhancing the model's ability to model the complex textures and fine-grained variations found in meat images.

[0075] This paper further introduces a structured propagation control mechanism. During each round of structured propagation, the magnitude of changes in graph node representations is monitored and iteration termination is controlled based on the dual conditions of the average rate of change and the number of propagation rounds. This mechanism not only ensures sufficient information dissemination but also avoids redundant computation and feature overfitting caused by excessive propagation rounds, thereby improving the stability of model training and inference efficiency.

[0076] After fully learning the structural information, the present invention constructs a graph structure aggregation module, combining average and maximum pooling operations to generate a full-graph representation vector, preserving global trends and local extremes. Finally, a quality detection network consisting of a two-layer linear mapping is introduced for final classification prediction. This classification structure has a low parameter count and fast response, making it suitable for deployment in real-world scenarios such as rapid meat product testing and automated industrial sorting. BRIEF DESCRIPTION OF THE DRAWINGS

[0077] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:

[0078] Figure 1 This is a flow chart of the meat quality intelligent detection method based on graph neural network proposed in the present invention;

[0079] Figure 2 This is a flowchart of the processing within the graph topology evolution network propagation cycle of the meat quality intelligent detection method based on graph neural network proposed in the present invention;

[0080] Figure 3 This is a flowchart of graph structure aggregation and quality detection of the intelligent meat quality detection method based on graph neural network proposed in this invention. DETAILED DESCRIPTION

[0081] The present invention will now be described in further detail with reference to the accompanying drawings, which are simplified schematic diagrams that illustrate the basic structure of the present invention in a schematic manner.

[0082] refer to Figure 1-3 , an intelligent meat quality detection method based on graph neural network, including the following steps:

[0083] S1. Collect a meat sample image and perform image segmentation to divide the image into image regions of equal size and construct an initial graph structure.

[0084] S2. Extract image features for each graph node and generate node representation;

[0085] S3. Inputting the initial graph structure and node representation into a graph topology evolution network, wherein the graph topology evolution network sequentially executes a preset number of structure propagation cycles, each structure propagation cycle including a graph convolution operation and a graph structure update operation;

[0086] S4. In each structure propagation cycle, a graph convolution operation is performed based on the current graph structure and node representation to generate semantic label prediction results for the graph nodes.

[0087] S5. In the same structure propagation cycle, perform graph structure update operations and adjust the graph edge connection relationships in the graph structure based on the semantic label prediction results;

[0088] S6. The graph structure and node representation after the graph structure update operation are used as the input of the next structure propagation cycle, and the graph convolution operation and graph structure update operation are repeatedly performed to make the graph structure evolve cycle by cycle under the influence of the semantic label prediction results.

[0089] S7. After the last structure propagation cycle is completed, the node representation is input into the graph structure aggregation module to generate a global representation vector of the graph structure, which is then input into the quality detection network to output the quality detection results of the meat sample.

[0090] By dividing meat images into equal-sized regions and constructing a graph structure, the present invention enables graph neural networks to capture the spatial dependencies between regions, thereby effectively expressing the complex texture structure and tissue distribution between regions in meat images, and improving the ability to model quality differences.

[0091] In this embodiment, each graph node in the initial graph structure corresponds to an image region, and each graph edge represents a spatial adjacency relationship between two image regions.

[0092] The present invention establishes a one-to-one correspondence between graph nodes and image regions and defines graph edges based on spatial adjacency, so that the graph structure has clear spatial topological semantics, which helps to maintain structural consistency and perceptual integrity during the graph convolution process.

[0093] In this embodiment, the image features include texture density, color mean, and edge gradient.

[0094] The present invention forms a multi-dimensional node representation by introducing three image features: texture density, color mean and edge gradient, which effectively improves the comprehensive characterization ability of node features for quality attributes such as meat sample texture, fat distribution and edge clarity.

[0095] In this embodiment, S2 specifically includes:

[0096] S21, performing grayscale transformation on the image area to generate a grayscale image;

[0097] S22, calculating the average of the absolute differences between the grayscale values ​​of all pixels in the image area and the average grayscale value as a texture density feature;

[0098] S23, respectively calculating the average values ​​of all pixel values ​​in the image area in the three color channels of red, green, and blue to form a color mean vector;

[0099] S24, using an edge detection operator to calculate the gradient magnitude map of the image area, and obtaining the pixel average value as the edge gradient feature;

[0100] S25. Concatenate the texture density feature, the color mean vector, and the edge gradient feature in a fixed order to form a node representation of the corresponding graph node.

[0101] The present invention designs a multi-stage feature extraction process for image regions, performs grayscale transformation, color channel averaging, and edge gradient calculation respectively, and splices them into a unified node vector, thereby enhancing the fine-grained expression capability of node representation and facilitating feature propagation and fusion in subsequent graph convolution operations.

[0102] In this embodiment, S3 specifically includes:

[0103] S31. Set the number of executions of the structure propagation cycle, denoted as T, where T is a positive integer greater than 1;

[0104] S32. In each structure propagation cycle, the graph structure and node representation output in the previous cycle are used as inputs in the current cycle;

[0105] S33. In the current cycle, a graph convolution operation is performed based on the input graph structure, a weighted adjacency aggregation mechanism is used to aggregate the neighbor node representations of each graph node, and the current node representation is updated;

[0106] S34. In the current cycle, a graph structure update operation is performed based on the updated node representation to generate a new graph structure and use it as input for the next structure propagation cycle.

[0107] The present invention sets the number of executions of the structure propagation cycle and jointly performs graph convolution and structure update operations in each cycle to ensure that the graph structure and node representation continue to evolve in multiple rounds of propagation, thereby enhancing the model's adaptive modeling capability for semantic structure consistency.

[0108] In this embodiment, the S4 specifically includes:

[0109] S41, receiving the updated graph structure and node representation in the current structure propagation cycle, constructing the node representation into a node feature matrix, and constructing the graph structure into a normalized adjacency matrix;

[0110] S42, combining the normalized adjacency matrix and the node feature matrix, performing a graph convolution operation and generating an intermediate node representation;

[0111] S43, linearly superimposing the original input node feature matrix and the intermediate node representation to obtain an enhanced node representation;

[0112] S44, performing a linear transformation on the enhanced node representation to generate a label category score vector corresponding to each graph node;

[0113] S45. Normalize the label category score vector and calculate the semantic label prediction result of each graph node:

[0114]

[0115] Among them, Pi,j is the predicted probability of the i-th graph node corresponding to the j-th label, Z i,j is the score of the graph node corresponding to the jth label, and k is the number of categories of semantic labels.

[0116] In the graph convolution process, the present invention combines the normalized adjacency matrix and the node feature matrix, adopts linear superposition enhancement representation, and finally outputs the label prediction probability, constructing a structured graph neural classification path, which effectively improves the expression depth and judgment accuracy of node label discrimination.

[0117] In this embodiment, the S5 specifically includes:

[0118] S51, receive the graph node semantic label prediction results generated in the structure propagation cycle, and construct the graph node label prediction matrix Where n is the number of graph nodes, k is the number of semantic label categories;

[0119] S52. For any two graph nodes i and j, calculate the semantic similarity score s between the label representations based on the semantic label prediction results. i,j :

[0120]

[0121] in, Represents the semantic label prediction probability vector of graph nodes i and j respectively, ||P i || and ||P j || is the two-norm of the corresponding vector, P i ·P j is the inner product of the two, D KL (P i ||P j ) represents the Kullback-Leibler divergence from node i to node j, defined as α and β are non-negative real number adjustment coefficients that control the weights of similarity and difference terms respectively. σ is the Sigmoid activation function, which is used to compress the similarity score to between 0 and 1. r ∈(0,1) is the judgment threshold for retaining and deleting edge connection relationships, θ a ∈(0,1) is the judgment threshold added to the graph edge connection relationship;

[0122] S53, when graph nodes i and j have a graph edge connection relationship in the current graph structure, and s i,j <θ r When , the edge connection relationship is deleted from the graph structure;

[0123] S54, when graph nodes i and j do not have a graph edge connection relationship in the current graph structure, and s i,j >θ aWhen , add graph edge connection relationship in the graph structure;

[0124] S55, when graph nodes i and j have a graph edge connection relationship in the current graph structure, and s i,j ≥θ r When , the edge connection relationship of the graph is preserved;

[0125] S56. After completing the adjustment of the graph edge connection relationships between all graph node pairs, output the graph structure after the graph structure update operation in the current propagation cycle.

[0126] The present invention calculates the similarity between graph nodes based on the semantic label prediction results, and sets the judgment thresholds for adding, deleting and retaining graph edges, thereby realizing the adaptive update of the graph structure, making the graph structure evolution process closely fit the node semantics, and improving the matching degree between the graph structure and the classification target.

[0127] In this embodiment, S6 specifically includes:

[0128] S61. Set the maximum number of rounds T of the structure propagation cycle max , initialize the propagation round counter t to 1;

[0129] S62. In the tth round of structure propagation, the graph structure and node representation obtained from the previous graph structure update operation are used as input for the current propagation cycle.

[0130] S63. Based on the current graph structure and node representation, perform graph convolution operations and graph structure update operations in sequence to generate new graph node representations and graph structures for the current propagation cycle.

[0131] S64. Calculate the average rate of change between the current propagation round graph node representation and the previous round graph node representation:

[0132]

[0133] Where n is the number of graph nodes, and are the node representations of node i after the current and previous rounds of propagation, respectively. k is the dimension of the node representation, ||·||2 is the Euclidean norm of the vector, and δ t is the average change magnitude of the nodes in the entire graph;

[0134] S65, when the condition δ is met t <∈or t=T max When t=t+1, the execution process of the structure propagation cycle is terminated; otherwise, let t=t+1 and jump to step S62 to continue execution.

[0135] The present invention introduces the average change rate in multiple rounds of propagation as a propagation termination judgment indicator, and combines it with the maximum number of propagation rounds to establish a propagation control mechanism, which effectively balances the full propagation of graph information and the stability of the training process, and improves the model efficiency and convergence.

[0136] In this embodiment, the S7 specifically includes:

[0137] S71, receiving the graph node representation output by the last structure propagation cycle, and constructing a node representation matrix;

[0138] S72. Construct a graph structure aggregation module based on the node representation matrix. The graph structure aggregation module includes an average pooling unit and a maximum pooling unit, which respectively perform average pooling and extreme value pooling operations on the features of all graph nodes.

[0139] S73. Concatenate the average aggregation result and the extreme value aggregation result by dimension to generate a global representation vector of the graph structure;

[0140] S74. Build a quality detection network, where the quality detection network consists of two sequentially connected linear transformation layers, where the first linear transformation layer maps the global representation vector to an intermediate vector, and the second linear transformation layer maps the intermediate vector to a label score vector.

[0141] S75. Perform a nonlinear activation function operation between the two linear transformation layers to perform element-by-element nonlinear transformation on the intermediate vector. The activation function does not change the vector dimension:

[0142] f(x)=max(0,x);

[0143] Where x is any component of the intermediate vector, and f(x) is the output value after activation;

[0144] S76. Perform normalization processing on the label score vector and output the quality detection result of the meat sample.

[0145] The present invention forms a global representation vector of the graph structure through a combination of average pooling and maximum pooling, and inputs it into a quality detection network composed of linear mapping and activation function, thereby realizing the inductive extraction and classification judgment of the overall semantics of the graph structure, and has strong detection generalization capability and deployment adaptability.

[0146] The intelligent meat quality detection system based on graph neural network includes:

[0147] The image acquisition and segmentation module is used to acquire a meat sample image and perform image segmentation, dividing the image into image regions of equal size and constructing an initial graph structure;

[0148] Image feature extraction module, used to extract image features from each graph node in the initial graph structure and generate node representation;

[0149] A graph topology evolution network module receives the initial graph structure and node representations and executes a preset number of structure propagation cycles, each of which includes a graph convolution operation and a graph structure update operation.

[0150] The graph convolution processing module is used to perform graph convolution operations based on the current graph structure and node representation in each structure propagation cycle to generate semantic label prediction results for graph nodes;

[0151] The graph structure update module is used to adjust the graph edge connection relationship in the graph structure according to the semantic label prediction results in each structure propagation cycle and update the graph structure;

[0152] The structure propagation control module is used to input the graph structure and node representation output by the graph structure update module into the next structure propagation cycle, and determine whether to terminate the structure propagation based on the rate of change of the graph node representation or the number of propagations;

[0153] The graph structure aggregation module is used to perform average pooling and maximum pooling on the graph node representation after the structure propagation cycle ends to generate a global representation vector of the graph structure;

[0154] The quality detection network module is used to receive the global representation vector generated by the graph structure aggregation module, perform linear mapping, activation function operation and label score prediction, and output the quality detection results of the meat sample.

[0155] The detection system constructed by the present invention integrates multiple functional modules such as image preprocessing, graph structure modeling, structure evolution, feature aggregation and quality identification, forming a complete end-to-end intelligent detection process with the advantages of clear system structure, high detection accuracy and strong application flexibility.

[0156] Example 1:

[0157] To verify the effectiveness of the present invention in actual meat quality detection, the method of the present invention was applied to the production line of a large meat processing enterprise. A systematic comparison was made between its existing detection methods and the intelligent detection method based on graph neural networks proposed in the present invention, and key performance indicators such as accuracy, efficiency, stability and automation capability were comprehensively evaluated.

[0158] Located in Linyi, Shandong Province, this company processes over 3,000 pork samples daily. Traditional testing methods rely primarily on manual experience and fixed rules, including visual comparisons of color, texture, and fat distribution, supplemented by equipment-assisted grading. Because this method relies heavily on employee experience, it is not only inefficient but also subject to significant individual judgment differences, resulting in unstable grading and frequent fluctuations in quality control.

[0159] In this embodiment, we deployed the inspection system of the present invention on the company's No. 1 sorting production line in March 2025. The system uses an industrial-grade high-definition camera to capture meat images. Through image segmentation, feature extraction, and graph structure construction, the system divides the images into 64 equally sized regions and constructs a spatial adjacency graph. Using a graph neural network to construct a graph topology evolutionary structure, the system automatically extracts features such as color, texture, and edges from each graph node, performs graph convolutional propagation and structural updates, and achieves dynamic structural modeling and layer-by-layer semantic enhancement of meat tissue regions. Ultimately, the quality inspection network outputs corresponding grade labels.

[0160] During the initial system deployment training phase, 600 manually labeled sample images were collected to initialize the model. The deployment took approximately three days, encompassing four phases: system integration, debugging, testing, and launch. After model training and deployment, the system began accepting real-world meat image input from the production line, performing fully automated quality verification on each sample.

[0161] During a week-long test, the system processed 1,980 samples, simultaneously inspected by a manual rule-based team and reviewed and annotated by a quality control team. Throughout this process, the system maintained stable operation, automatically outputting quality grades and recording feature intermediate representations and structure propagation logs for subsequent analysis.

[0162] After statistical comparison, the performance of the two methods on multiple key indicators is shown in Table 1:

[0163] Table 1 Performance comparison between traditional method and the method of the present invention

[0164]

[0165] The data shows that the detection system of the present invention significantly outperforms traditional manual methods in overall accuracy, with an improvement of more than 13 percentage points. This is particularly evident in the identification of low- and medium-grade samples, where the accuracy rate increased from 65.7% to 87.1%. This indicates that the system's ability to discriminate samples at the edge of the grade is significantly enhanced, resolving the frequent misjudgment of samples with ambiguous grades by traditional methods.

[0166] In addition, the traditional method takes an average of about 12 seconds per sample, which mainly includes multiple manual processes such as observation, judgment, and recording. The average detection time of the system of the present invention is only 1.9 seconds, which is nearly 6 times faster. It can fully meet the real-time production line detection needs and avoid bottleneck accumulation.

[0167] In terms of fat distribution modeling and texture stability, the system of the present invention can effectively distinguish between fat, lean meat and fascia tissue areas through structured graph modeling and graph convolution propagation mechanism, significantly reducing the fat content prediction error to 0.23g / 100g. At the same time, the standard deviation of texture score is reduced by half, indicating that the system has a more stable graph structure expression capability.

[0168] From a system-level perspective, the proposed model boasts excellent scalability, making it suitable for testing samples from diverse locations and categories. With minimal sample adjustments, it can be adapted to new scenarios and supports fully automated control throughout the entire process. Its automated processing ratio exceeds 90%, significantly exceeding traditional methods. This significantly reduces the frequency of manual intervention, freeing up labor costs and enhancing the overall intelligence of the production line.

[0169] In summary, this embodiment verifies the technical advantages of the present invention in the field of meat quality detection, especially in key aspects such as detection accuracy, processing speed, information stability, and system deployability. It is applicable to various meat sorting, quality inspection, and packaging automation scenarios, and has good promotion prospects and implementation value in industrial practice.

[0170] The above description is only a preferred specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any technician familiar with the technical field, within the technical scope disclosed by the present invention, who makes equivalent replacements or changes based on the technical solution and inventive concept of the present invention, should be covered by the scope of protection of the present invention.

Claims

1. An intelligent meat quality detection method based on graph neural network, characterized in that: The steps include: S1. Collect a meat sample image and perform image segmentation to divide the image into image regions of equal size and construct an initial graph structure. S2. Extract image features for each graph node and generate node representation; S3. Inputting the initial graph structure and node representation into a graph topology evolution network, wherein the graph topology evolution network sequentially executes a preset number of structure propagation cycles, each structure propagation cycle including a graph convolution operation and a graph structure update operation; S4. In each structure propagation cycle, a graph convolution operation is performed based on the current graph structure and node representation to generate semantic label prediction results for the graph nodes. S5. In the same structure propagation cycle, perform graph structure update operations and adjust the graph edge connection relationships in the graph structure based on the semantic label prediction results; S6. The graph structure and node representation after the graph structure update operation are used as the input of the next structure propagation cycle, and the graph convolution operation and graph structure update operation are repeatedly performed to make the graph structure evolve cycle by cycle under the influence of the semantic label prediction results. S7. After the last structure propagation cycle is completed, the node representation is input into the graph structure aggregation module to generate a global representation vector of the graph structure, which is then input into the quality detection network to output the quality detection results of the meat sample.

2. The meat quality intelligent detection method based on graph neural network according to claim 1 is characterized in that: Each graph node in the initial graph structure corresponds to an image region, and each graph edge represents a spatial adjacency relationship between two image regions.

3. The meat quality intelligent detection method based on graph neural network according to claim 1 is characterized in that: The image features include texture density, color mean and edge gradient.

4. The meat quality intelligent detection method based on graph neural network according to claim 1 is characterized in that: The S2 specifically includes: S21, performing grayscale transformation on the image area to generate a grayscale image; S22, calculating the average of the absolute differences between the grayscale values ​​of all pixels in the image area and the average grayscale value as a texture density feature; S23, respectively calculating the average values ​​of all pixel values ​​in the image area in the three color channels of red, green, and blue to form a color mean vector; S24, using an edge detection operator to calculate the gradient magnitude map of the image area, and obtaining the pixel average value as the edge gradient feature; S25. Concatenate the texture density feature, the color mean vector, and the edge gradient feature in a fixed order to form a node representation of the corresponding graph node.

5. The meat quality intelligent detection method based on graph neural network according to claim 1 is characterized in that: The S3 specifically includes: S31. Set the number of executions of the structure propagation cycle, denoted as T, where T is a positive integer greater than 1; S32. In each structure propagation cycle, the graph structure and node representation output in the previous cycle are used as inputs in the current cycle; S33. In the current cycle, a graph convolution operation is performed based on the input graph structure, a weighted adjacency aggregation mechanism is used to aggregate the neighbor node representations of each graph node, and the current node representation is updated; S34. In the current cycle, a graph structure update operation is performed based on the updated node representation to generate a new graph structure and use it as input for the next structure propagation cycle.

6. The meat quality intelligent detection method based on graph neural network according to claim 1 is characterized in that: The S4 specifically includes: S41, receiving the updated graph structure and node representation in the current structure propagation cycle, constructing the node representation into a node feature matrix, and constructing the graph structure into a normalized adjacency matrix; S42, combining the normalized adjacency matrix and the node feature matrix, performing a graph convolution operation and generating an intermediate node representation; S43, linearly superimposing the original input node feature matrix and the intermediate node representation to obtain an enhanced node representation; S44, performing a linear transformation on the enhanced node representation to generate a label category score vector corresponding to each graph node; S45. Normalize the label category score vector and calculate the semantic label prediction result of each graph node.

7. The meat quality intelligent detection method based on graph neural network according to claim 1 is characterized in that: The S5 specifically includes: S51, receive the graph node semantic label prediction results generated in the structure propagation cycle, and construct the graph node label prediction matrix Where n is the number of graph nodes, k is the number of semantic label categories; S52. For any two graph nodes i and j, calculate the semantic similarity score s between the label representations based on the semantic label prediction results. i,j : in, Represents the semantic label prediction probability vector of graph nodes i and j respectively, ||P i || and ||P j || is the two-norm of the corresponding vector, P i ·P j is the inner product of the two, D KL (P i ||P j ) represents the Kullback-Leibler divergence from node i to node j, α and β are non-negative real adjustment coefficients that control the weights of similarity and difference terms respectively, σ is the Sigmoid activation function, which is used to compress the similarity score to between 0 and 1, and θ r ∈(0,1) is the judgment threshold for retaining and deleting edge connection relationships, θ a ∈(0,1) is the judgment threshold added to the graph edge connection relationship; S53, when graph nodes i and j have a graph edge connection relationship in the current graph structure, and s i,j <θ r When , the edge connection relationship is deleted from the graph structure; S54, when graph nodes i and j do not have a graph edge connection relationship in the current graph structure, and s i,j >θ a When , add graph edge connection relationship in the graph structure; S55, when graph nodes i and j have a graph edge connection relationship in the current graph structure, and s i,j ≥θ r When , the edge connection relationship of the graph is preserved; S56. After completing the adjustment of the graph edge connection relationships between all graph node pairs, output the graph structure after the graph structure update operation in the current propagation cycle.

8. The meat quality intelligent detection method based on graph neural network according to claim 1 is characterized in that: The S6 specifically includes: S61. Set the maximum number of rounds T of the structure propagation cycle max , initialize the propagation round counter t to 1; S62. In the tth round of structure propagation, the graph structure and node representation obtained from the previous graph structure update operation are used as input for the current propagation cycle. S63. Based on the current graph structure and node representation, perform graph convolution operations and graph structure update operations in sequence to generate new graph node representations and graph structures for the current propagation cycle. S64. Calculate the average rate of change between the current propagation round graph node representation and the previous round graph node representation: Where n is the number of graph nodes, and are the node representations of node i after the current and previous rounds of propagation, respectively. k is the dimension of the node representation, ||·||2 is the Euclidean norm of the vector, and δ t is the average change magnitude of the nodes in the entire graph; S65, when the condition δ is met t <∈or t=T max When t=t+1, the execution process of the structure propagation cycle is terminated; otherwise, let t=t+1 and jump to step S62 to continue execution.

9. The meat quality intelligent detection method based on graph neural network according to claim 1, characterized in that: The S7 specifically includes: S71, receiving the graph node representation output by the last structure propagation cycle, and constructing a node representation matrix; S72. Construct a graph structure aggregation module based on the node representation matrix. The graph structure aggregation module includes an average pooling unit and a maximum pooling unit, which respectively perform average pooling and extreme value pooling operations on the features of all graph nodes. S73. Concatenate the average aggregation result and the extreme value aggregation result by dimension to generate a global representation vector of the graph structure; S74. Construct a quality detection network, wherein the quality detection network is composed of two sequentially connected linear transformation layers, wherein the first linear transformation layer maps the global representation vector to an intermediate vector, and the second linear transformation layer maps the intermediate vector to a label score vector; S75. Perform a nonlinear activation function operation between the two linear transformation layers to perform an element-by-element nonlinear transformation on the intermediate vector, wherein the activation function does not change the vector dimension. S76. Perform normalization processing on the label score vector and output the quality detection result of the meat sample.

10. A meat quality intelligent detection system based on a graph neural network, which implements the meat quality intelligent detection method based on a graph neural network according to any one of claims 1 to 9, characterized in that: include: Image acquisition and segmentation module, used to acquire a meat sample image and perform image segmentation, dividing the image into image regions of equal size and constructing the initial graph structure; Image feature extraction module, used to extract image features from each graph node in the initial graph structure and generate node representation; A graph topology evolution network module receives the initial graph structure and node representations and executes a preset number of structure propagation cycles, each of which includes a graph convolution operation and a graph structure update operation. The graph convolution processing module is used to perform graph convolution operations based on the current graph structure and node representation in each structure propagation cycle to generate semantic label prediction results for graph nodes; The graph structure update module is used to adjust the graph edge connection relationship in the graph structure according to the semantic label prediction results in each structure propagation cycle and update the graph structure; The structure propagation control module is used to input the graph structure and node representation output by the graph structure update module into the next structure propagation cycle, and determine whether to terminate the structure propagation based on the rate of change of the graph node representation or the number of propagations; The graph structure aggregation module is used to perform average pooling and maximum pooling on the graph node representation after the structure propagation cycle ends to generate a global representation vector of the graph structure; The quality detection network module is used to receive the global representation vector generated by the graph structure aggregation module, perform linear mapping, activation function operation and label score prediction, and output the quality detection results of the meat sample.