Mutton quality identification method and system based on near infrared spectrum

By using near-infrared spectroscopy and utilizing grayscale jump features and abrupt change location indexes, compressed spectral feature vector data is generated, which solves the subjective and destructive problems of traditional mutton quality identification and achieves non-destructive, efficient, and accurate identification of mutton quality.

CN121883391AInactive Publication Date: 2026-04-17XINJIANG ACAD OF ANIMAL SCI
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
XINJIANG ACAD OF ANIMAL SCI
Filing Date
2025-12-26
Publication Date
2026-04-17
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Traditional methods for identifying the quality of mutton rely on human sensory judgment and physicochemical testing, which are subjective and operationally dependent. They are difficult to achieve non-destructive, efficient, and accurate mutton quality identification, and cannot quickly obtain internal attribute information at the processing site.

Method used

By employing near-infrared spectroscopy technology, multi-band spectral data from mutton processing sites are acquired to establish grayscale jump characteristics, extract abrupt change location indices, generate compressed spectral feature vector data, and map it to standard mutton spectral samples for grade labeling, thereby achieving automated quality identification.

Benefits of technology

It has achieved numerical and graphical identification of mutton quality indicators, improved identification efficiency and discrimination accuracy, solved the problems of insufficient accuracy of manual judgment and strong destructiveness of physicochemical methods, and can quickly obtain the internal quality information of mutton at the processing site.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121883391A_ABST
    Figure CN121883391A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of spectral image analysis, in particular to a mutton quality identification method and system based on near infrared spectroscopy, and the method comprises the following steps: based on near infrared gray abrupt change extraction and variation segmentation, comparing with a standard, and matching to generate a mutton quality result. According to the method, a reflection change sequence is established by using gray jump characteristics in a near infrared spectrum image, and a mutation position index is extracted, so that positioning and change identification of internal details of a mutton structure are realized; segmented expression of a variation region is completed through combination of continuous inter-column difference comparison and jump amplitude fluctuation detection, and map feature vector data is constructed, so that judgment of mutton quality indexes has numeralization, mapping and identifiability, automatic mapping is completed through matching with standard sample labels, and label numbers are output. The problems that manual judgment precision is insufficient and a physical and chemical method is high in destructiveness are effectively solved, and the overall recognition efficiency, the judgment precision and the processing intelligence level are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of spectral image analysis technology, and in particular to a method and system for identifying the quality of mutton based on near-infrared spectroscopy. Background Technology

[0002] The field of spectral image analysis technology involves acquiring spectral image data of samples using multispectral or near-infrared spectral imaging equipment, and extracting the chemical composition, physical structure, or other characterization information of the samples through image processing and analysis methods. This includes spectral data acquisition, spectral feature extraction, data modeling, and identification. It primarily achieves non-destructive identification and classification of the internal properties of samples through combined analysis of images from different spectral bands, and has wide applications in agriculture, food, medical diagnostics, and materials analysis. Traditional methods for assessing mutton quality refer to evaluating quality indicators such as freshness, tenderness, moisture content, and fat ratio through sensory evaluation or physicochemical testing. These methods typically involve visually observing meat color and texture, tactilely testing elasticity and moisture content, smelling to identify odor, and cutting to determine muscle structure. Physicochemical testing involves obtaining specific data through sampling, weighing moisture, pH measurement, and chemical titration of fat content.

[0003] Traditional methods of mutton quality assessment mainly rely on human sensory judgment and physicochemical testing, which are subject to significant subjectivity and operational dependence. In the sample processing process, differences in human experience can easily introduce judgment biases, affecting consistency and reliability of results. Sensory assessment is limited by the observer's professional level and environmental conditions, making it difficult to quantify internal tissue changes and subtle structural differences. Physicochemical testing requires sample disassembly, weighing, titration, and other processing procedures, which are cumbersome and time-consuming, making them unsuitable for large-scale, real-time quality screening applications. In addition, they cannot quickly obtain internal attribute information on the processing site, and are characterized by strong destructiveness, low efficiency, and delayed results, failing to meet the needs of the modern meat industry for non-destructive, efficient, and accurate identification methods. Summary of the Invention

[0004] The purpose of this invention is to overcome the shortcomings of existing technologies and propose a method for identifying the quality of mutton based on near-infrared spectroscopy.

[0005] To achieve the above objectives, the present invention adopts the following technical solution: a method for identifying the quality of mutton based on near-infrared spectroscopy, comprising the following steps: S1: Acquire multi-band spectral data of mutton processing site, collect target wavelength gray value changes, establish pixel gray wavelength reflection sequence with column index, and generate wavelength reflection gray value difference data. S2: Based on the wavelength reflection grayscale difference data, calculate the adjacent difference of grayscale values ​​for each column of image pixels, locate the boundary point index of grayscale abrupt change in reflection, extract the extreme point of corresponding grayscale jump amplitude, and generate grayscale abrupt change position index. S3: Based on the gray-scale abrupt change location index, select any three columns of continuous boundary point data, calculate the jump amplitude difference and compare them pairwise. If all jump amplitude differences are less than the set column consistency judgment value, then exclude the corresponding column index information; otherwise, retain it to obtain the number of image column change filters. S4: Based on the number of image column changes filtered, detect whether the difference between any two adjacent jump amplitudes exceeds the set jump fluctuation threshold. If it exceeds, mark the corresponding column as a variation region. If only one column in three consecutive columns meets the condition, merge them into a group of variation segments, convert them into numerical expression vectors segmented by variation region, and generate compressed map feature vector data. S5: Based on the compressed spectral feature vector data, extract the grayscale expression morphology of the variant segment and map it with the standard mutton spectral sample to obtain the near-infrared spectral mutton quality identification result.

[0006] As a further aspect of the present invention, the wavelength reflectance grayscale difference data includes reflectance change feature values, grayscale change amplitude, and pixel position sequence; the grayscale abrupt change location index includes abrupt change boundary point position, abrupt change amplitude extreme point index, and grayscale jump region number; the image column change filtering quantity includes jump consistency judgment result, retained column index, and column difference identifier; the compressed spectral feature vector data includes the number of variant segments, variant segment grayscale change trend record, and variant region segmented expression vector; and the near-infrared spectral mutton quality identification result includes grade label number, matching success status, and sample mapping label.

[0007] As a further aspect of the present invention, the step of acquiring the wavelength reflection grayscale difference data specifically comprises: S111: Acquire multi-band spectral data collected at mutton processing sites in Xinjiang, extract column indexes for each column in the image, and index and label the gray values ​​in the column direction of the image based on the corresponding gray value position in each column of gray pixels to establish column gray value identifiers and generate a column gray value identifier sequence. S112: Based on the column grayscale identifier sequence and the configured target wavelength configuration parameter set, retrieve the grayscale value matching the grayscale pixel at the corresponding column index in the image data, and make a one-to-one correspondence between each column grayscale value and the target wavelength parameter to generate a wavelength grayscale mapping data frame. S113: Based on the wavelength grayscale mapping data frame, perform adjacent difference calculations on the grayscale values ​​corresponding to different target wavelengths in the same column, use the numerical difference between the current wavelength grayscale value and the previous target wavelength grayscale value as the difference basis, perform full column wavelength grayscale value difference processing, and generate wavelength reflection grayscale difference data.

[0008] As a further aspect of the present invention, the grayscale mutation location index acquisition step specifically comprises: S211: Based on the wavelength reflection grayscale difference data, calculate the vertical difference of the grayscale values ​​of adjacent pixels in each column of grayscale vector, construct a two-dimensional difference matrix for the vertical grayscale difference of each column, and index and mark the positions of all non-zero elements in the two-dimensional difference matrix to generate an intra-column grayscale difference matrix. S212: Based on the gray-scale difference matrix within the column, determine whether the difference in gray-scale values ​​in the vertical direction of each column exceeds the set gray-scale jump amplitude. When the absolute value of the difference in each column is greater than or equal to the set gray-scale jump amplitude, record the corresponding row and column index positions as candidate jump point index sequences to generate a gray-scale jump candidate index set. S213: Read the grayscale jump candidate index set, calculate the grayscale difference amplitude sequence corresponding to each column of candidate jump points, perform extreme value extraction operation, select the index point with the largest jump amplitude in each column as the grayscale mutation position index point, aggregate the index positions corresponding to the largest amplitude in each column, and establish the grayscale mutation position index.

[0009] As a further aspect of the present invention, the step of obtaining the number of images for column change filtering is specifically as follows: S311: Obtain the gray-scale mutation location index, sequentially select any three consecutive index positions in the image, extract the corresponding mutation point gray-scale value in the three columns, calculate the jump amplitude difference between adjacent columns by subtracting each other, and obtain the column jump difference sequence. S312: Based on the inter-column jump difference sequence, each difference is compared with a set column consistency judgment threshold. When any difference is greater than or equal to the set column consistency judgment threshold, the index identifier of the corresponding column index is recorded as a reserved column. Otherwise, the current three column index values ​​are removed from the sequence to generate a reserved column index set. S313: Based on the reserved column index set, count the number of column indices in the set, calculate the effective change ratio between column indices, and perform rounding calculation based on the ratio result and the base of the index set to generate the number of image column change filters.

[0010] As a further aspect of the present invention, the formula for calculating the effective change ratio between the indexes is as follows: ; in, Indicates the effective proportion of changes between column indexes. , , They represent the first The grayscale values ​​of the mutation in the group 3 columns, Indicates the threshold for column consistency judgment. The number of column groups to satisfy the inconsistency condition.

[0011] As a further aspect of the present invention, the step of obtaining the compressed map feature vector data specifically comprises: S411: Based on the number of image column changes filtered, obtain the indexes of all filtered and retained image columns in sequence, and read the jump amplitude value corresponding to each column to construct a jump amplitude sequence. Sort the sequence according to the numerical values ​​from smallest to largest, and generate a jump amplitude sorting sequence by performing index rearrangement on the sorted sequence. S412: Based on the jump amplitude sorting sequence, extract any two adjacent jump amplitude values ​​and calculate the difference between them one by one. Compare the difference with the set jump fluctuation threshold. When the difference is greater than or equal to the set jump fluctuation threshold, mark the corresponding column as a variant column. If only one of the three consecutive columns meets the condition, merge the three columns to define the same variant segment and generate a variant segment column index set. S413: Based on the column index set of the variant segments, the sequence of jump amplitude values ​​of all columns in each variant segment is restructured and reorganized according to the column index order and quantized, and converted into a gray-scale jump trend vector with the variant segment as the dividing unit. All vector fragments are aggregated into a unified data frame structure to establish compressed map feature vector data.

[0012] As a further aspect of the present invention, the steps for obtaining the near-infrared spectroscopy mutton quality identification results are as follows: S511: Based on the compressed spectral feature vector data, extract the numerical sequence of jump amplitudes in each variant segment and normalize it to represent it as a standard morphological expression vector. Structurally number each expression vector and match it with the set standard mutton spectral grade template to generate a variant segment grade mapping label set. S512: Based on the mutation segment level mapping label set, extract the label number corresponding to each mutation segment and combine and encode them according to the mutation segment index order. Write all matching label numbers into the standard output sequence in a fixed format, establish the index binding relationship between the label and the source segment, and generate the structure label mapping sequence. S513: Based on the structure label mapping sequence, aggregate all label results, extract the highest frequency value of the label in the sequence as the main level label number of the image recognition region, and associate it with the corresponding spectral quality level standard information to construct the overall recognition structure data at the spectral level, and obtain the near-infrared spectral mutton quality identification result.

[0013] A mutton quality identification system based on near-infrared spectroscopy, comprising: The grayscale construction module is used to execute S1: acquire multi-band spectral data of the mutton processing site, collect the grayscale value changes of the target wavelength, establish a pixel grayscale wavelength reflection sequence with column index, and generate wavelength reflection grayscale difference data. The boundary extraction module is used to perform S2: based on the wavelength reflection grayscale difference data, calculate the adjacent difference of the grayscale values ​​of each column of image pixels, locate the boundary point index of grayscale change in reflection, extract the extreme point of the corresponding grayscale jump amplitude, and generate the grayscale change position index. The column change filtering module is used to execute S3: Based on the gray-scale change position index, select any three columns of continuous boundary point data, count the jump amplitude difference and compare them pairwise. If all jump amplitude differences are less than the set column consistency judgment value, then exclude the corresponding column index information; otherwise, retain it to obtain the number of image column change filters. The feature compression module is used to perform S4: based on the number of image column changes filtered, detect whether the difference between any two adjacent jump amplitudes exceeds the set jump fluctuation threshold. If it exceeds the threshold, mark the corresponding column as a variation region. If only one column in three consecutive columns meets the condition, merge them into a group of variation segments, convert them into numerical expression vectors segmented by variation region, and generate compressed map feature vector data. The label output module is used to execute S5: based on the compressed spectral feature vector data, extract the grayscale expression morphology of the variant segment and map it with the standard mutton spectral sample to obtain the near-infrared spectral mutton quality identification result.

[0014] Compared with the prior art, the advantages and positive effects of the present invention are as follows: In this invention, by utilizing the gray-scale jump features in near-infrared spectral images to establish a reflectance change sequence and extract a mutation location index, the internal details and changes of mutton structure can be located and identified. By comparing the differences between consecutive columns and detecting the fluctuation of jump amplitude, the segmented expression of the variation region is completed and spectral feature vector data is constructed, making the judgment of mutton quality indicators numerical, spectral, and identifiable. By matching with standard sample labels, the label number is automatically mapped and output, effectively solving the problems of insufficient accuracy of manual judgment and strong destructiveness of physicochemical methods. This achieves the goal of quickly obtaining the internal quality information of mutton at the processing site, improving the overall recognition efficiency, discrimination accuracy, and intelligent processing level. Attached Figure Description

[0015] Figure 1 This is a flowchart of the main steps of the present invention; Figure 2 This is a flowchart of the wavelength reflection grayscale difference data acquisition process of the present invention; Figure 3 This is a flowchart of the grayscale mutation location index acquisition process of the present invention; Figure 4 This is a flowchart illustrating the process of obtaining the number of images filtered by changes in image columns according to the present invention. Figure 5 This is a flowchart of the compressed map feature vector data acquisition process of the present invention; Figure 6 This is a flowchart illustrating the process of obtaining near-infrared spectroscopy results for mutton quality identification according to the present invention. Detailed Implementation

[0016] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.

[0017] In the description of this invention, it should be understood that the terms "length," "width," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," and "outer," etc., indicating orientation or positional relationships, are based on the orientation or positional relationships shown in the accompanying drawings and are only for the convenience of describing the invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the invention. Furthermore, in the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.

[0018] Please see Figure 1 A method for identifying the quality of mutton based on near-infrared spectroscopy includes the following steps: S1: Acquire multi-band spectral data collected by a near-infrared spectral imager at a mutton processing site in Xinjiang. For each column of grayscale pixels in the image, collect the change in target wavelength grayscale value, establish a pixel grayscale wavelength reflection sequence using column index, and generate wavelength reflection grayscale difference data. S2: Based on the wavelength reflection grayscale difference data, perform adjacent difference calculations on the grayscale values ​​of each column of image pixels. Through continuous calculation in the up and down directions, locate the boundary point index of grayscale abrupt change in reflection, and extract the extreme point of the corresponding grayscale jump amplitude to generate the grayscale abrupt change position index. S3: Based on the gray-scale abrupt change location index, select any three consecutive boundary point data columns, calculate the jump amplitude difference and compare them pairwise. If all jump amplitude differences are less than the set column consistency judgment value, then exclude the corresponding column index. If any jump amplitude difference is greater than or equal to the set column consistency judgment value, then retain the corresponding column index information to obtain the number of image column change filters. S4: Based on the number of image column changes, sort the filter columns by jump amplitude in turn, detect whether the difference between any two adjacent jump amplitudes exceeds the set jump fluctuation threshold. If it exceeds the threshold, mark the corresponding column as a variation region. If only one column in three consecutive columns meets the condition, merge them into a group of variation segments. Rearrange the grayscale change trend data in the variation segment, convert it into a numerical expression vector segmented by variation region, integrate it into a one-dimensional recognition map structure, and generate compressed map feature vector data. S5: Based on the compressed spectral feature vector data, extract the grayscale expression morphology of the variant segment, map it with the standard mutton spectral sample for grade labeling, record the matching label number and transmit it back to obtain the near-infrared spectral mutton quality identification result.

[0019] The wavelength reflectance grayscale difference data includes reflectance change characteristic values, grayscale change amplitude, and pixel position sequence. The grayscale mutation location index includes mutation boundary point location, mutation amplitude extreme point index, and grayscale jump region number. The number of image column changes to be filtered includes jump consistency judgment results, retained column index, and inter-column difference identifier. The compressed spectral feature vector data includes the number of variant segments, grayscale change trend record of variant segments, and segmented expression vector of variant regions. The near-infrared spectral mutton quality identification results include grade label number, matching success status, and sample mapping label.

[0020] Please see Figure 2 Step S1 is as follows: S111: Acquire multi-band spectral data collected at mutton processing sites in Xinjiang, extract column indexes for each column in the image, and index and label the gray values ​​in the column direction of the image based on the corresponding gray value position in each column of gray pixels to establish column gray value identifiers and generate a column gray value identifier sequence. To obtain multi-band spectral data from mutton processing sites in Xinjiang, a field acquisition system must first be established. This system integrates a near-infrared spectral imager, an image acquisition control terminal, and an ambient light suppression module. In the actual processing workshop, the spectral imager is vertically fixed and aimed at the moving mutton raw materials on the conveyor belt. Images acquired at each moment are stored, resulting in time-series grayscale image frames. Each frame has a resolution of 640×480 pixels. Each column in the image represents the grayscale response at different spatial locations. Combining the column index of the image frame, the data can be analyzed... Columns are defined as grayscale column vectors. ,in Each column of grayscale values ​​is serialized, and the grayscale values ​​of each pixel are extracted to form a column vector. grayscale value The range is set at This is to facilitate subsequent analysis of image grayscale gradient changes. For example, the grayscale vector of the 320th pixel in a certain frame of an image is... Then, after normalizing the vector, it can be used for further indexing. Next, all column grayscale vectors in the image need to be uniformly identified to establish their column identifier sequence, that is... and Perform structural binding, represented as a column structure. This structure explicitly reflects the horizontal grayscale distribution position of the image through the binding relationship between column number and grayscale vector, thereby establishing a complete column grayscale identifier sequence. This sequence forms the basis for subsequent wavelength grayscale mapping and difference calculation. If a mutton sample appears between column 320 and column 370 in the image, its corresponding grayscale column vector will be... to This constitutes a subset of local grayscale information. During the acquisition process, each column of grayscale values ​​is obtained through a near-infrared detection component calibrated by the system, eliminating ambient light interference and ensuring that the value range is acquired under uniform conditions. This indicates that the image grayscale values ​​provide a stable input data basis for subsequent wavelength reflectance analysis.

[0021] Table 1. Example table of image grayscale columns; As shown in Table 1, the distribution of image grayscale values ​​in different columns has a certain regularity, which helps in subsequent wavelength mapping and difference processing, and finally generates a column grayscale identifier sequence.

[0022] S112: Based on the column grayscale identifier sequence and the configured target wavelength configuration parameter set, retrieve the grayscale value matching the grayscale pixel at the corresponding column index in the image data, and make a one-to-one correspondence between each column grayscale value and the target wavelength parameter to generate a wavelength grayscale mapping data frame. Based on the column grayscale identifier sequence, the target wavelength configuration parameter set must first be determined. ,in This indicates the i-th wavelength channel set by the imager, typically set to... nm to nm spacing nm, total Each wavelength channel, combined with the column grayscale structure According to column number Traverse the corresponding grayscale vector Position each grayscale value With wavelength sequence To perform index matching, each pixel in the grayscale vector needs to be searched item by item, and a corresponding wavelength label needs to be assigned to form a grayscale wavelength mapping pair. In grayscale values Mapped to corresponding wavelength If the grayscale column vector Include If there are 100 pixels, then each 100 pixels will be a 100-pixel pixel. correspond A mapping pair constitutes Further construct full-column wavelength grayscale mapping data frames In a practical example, the grayscale value of the 10th pixel in column 320 is... The matched wavelength is nm, then its mapping pair is This process is repeated for each column of pixels to assign wavelength labels, forming a complete grayscale wavelength structured result set, and the entire mapped data frame. By constructing columns and rows to pair grayscale values ​​with wavelengths, we can ensure that each grayscale value has a unique wavelength label for difference analysis in subsequent analysis, and finally generate a wavelength grayscale mapping data frame.

[0023] S113: Based on the wavelength grayscale mapping data frame, perform adjacent difference calculations on the grayscale values ​​corresponding to different target wavelengths in the same column, use the numerical difference between the current wavelength grayscale value and the previous target wavelength grayscale value as the difference basis, perform full column wavelength grayscale value difference processing, and generate wavelength reflection grayscale difference data. Based on wavelength grayscale mapping data frames, it is necessary to process the same column vector within each column of the mapping set. Calculate the gray value difference between adjacent wavelengths and construct a gray value difference sequence. ,in This reflects the degree of change in grayscale reflection between adjacent wavelengths. The calculation requires a sequential difference method, starting from the second term and proceeding to the last. In actual calculations, if... The corresponding difference is And so on. Sequence, further for all columns Perform unified difference calculations to construct a complete difference matrix. This difference matrix reflects the variation in grayscale values ​​of adjacent wavelengths along the column direction. Different grayscale reflectance characteristics are represented by numerical differences. It is necessary to statistically analyze the distribution of all differences and label their fluctuation ranges. For example, if... This is considered a stable interval. Considered as a point of strong reflection change, the specific boundary is determined experimentally. Taking mutton samples as an example, at wavelength... nm to grayscale values ​​between nm Rise to The difference is For regions with high fluctuations in reflection, all difference results in this column are ultimately recorded into the structure. This leads to the formation of a sequence of column difference results. The structure reflects the changing trend of grayscale wavelength reflection, and finally generates wavelength reflection grayscale difference data.

[0024] Please see Figure 3 Step S2 is as follows: S211: Based on wavelength reflection grayscale difference data, calculate the vertical difference of grayscale values ​​of adjacent pixels in each column of grayscale vector, construct a two-dimensional difference matrix of vertical grayscale difference of each column, and index and mark the positions of all non-zero elements in the two-dimensional difference matrix to generate an intra-column grayscale difference matrix. Based on the wavelength reflection grayscale difference data, obtain the pixel grayscale vector corresponding to each column in this data structure. ,in Indicates column number, This represents the number of pixels in the vertical direction of the image, and the sampled image size is... pixels, then Each column of grayscale values ​​originates from the grayscale reflection sequence after wavelength difference processing, targeting every two adjacent pixels in the column vector. and Perform the difference calculation and construct the difference expression as follows: This difference reflects the degree of change in grayscale values ​​between adjacent vertical pixels in the column, thus providing a quantitative description of the vertical grayscale variation characteristics of the image. The grayscale value range is [range missing]. The difference is Calculate the results of each column Sequence combination into column difference vector Then, iterate through all column indices of the image. Construct a two-dimensional gray-level difference matrix Then, the absolute value operation is performed on all elements in the matrix. And filter out all position index pairs of elements with non-zero difference. This refers to the row and column coordinates where grayscale values ​​exhibit abrupt changes. This processing method can be used in scenarios involving the identification of mutation features in the surface tissue of mutton, such as a column of an image. middle , ,but If the absolute value is greater than 0, record the difference as a valid change. If the column... Calculated The difference values ​​are combined with other columns to form a complete matrix, which provides the basis for the subsequent extraction of boundary positions, and finally obtains the gray-level difference matrix within the column.

[0025] S212: Based on the gray-scale difference matrix within the column, determine whether the difference in gray-scale values ​​in the vertical direction of each column exceeds the set gray-scale jump amplitude. When the absolute value of the difference in each column is greater than or equal to the set gray-scale jump amplitude, record the corresponding row and column index positions as candidate jump point index sequences to generate a gray-scale jump candidate index set. Based on the gray-level difference matrix within the column, set the transition judgment threshold. This threshold is used to identify points with strong grayscale changes, and it is set based on the statistical analysis of experimental samples. This means that if the grayscale value of a pixel changes by more than 25, it can be determined that a sudden change in grayscale has occurred in the corresponding area. During the calculation, each difference element... Perform absolute value operation to When comparing, When, then the position As a candidate mutation point record, it exists in image acquisition scenarios, for example, in the pixel value of column 340. , The difference is greater than Therefore, this point Once identified as a candidate point for a gray-level abrupt change, all column vectors are further processed. After comparing each item, all pixel index points that meet the abrupt change threshold condition can be extracted. All candidate index pairs are stored in a list structure. The candidate point attribute set is formed by combining the difference magnitudes of each point. Subsequent operations will use this structure to extract extreme values ​​of jump magnitudes. All points that meet the criteria... The location of the condition is categorized into the grayscale transition candidate index set.

[0026] S213: Read the candidate index set of gray-level jumps, calculate the gray-level difference amplitude sequence corresponding to each column of candidate jump points, perform extreme value extraction, select the index point with the largest jump amplitude in each column as the gray-level mutation position index point, aggregate the index positions corresponding to the largest amplitude in each column, and establish the gray-level mutation position index. Based on the candidate mutation point positions recorded in each column of the gray-scale transition candidate index set. Extract the corresponding grayscale difference range Composition of amplitude vector ,in For each column, the number of candidate points that meet the transition condition is [number]. of Perform extreme value calculations on medium grayscale amplitude And locate the index position of the maximum value. The point with the largest jump in this column As an effective gray-level abrupt change point in this column, to improve the representativeness of boundary determination, continue traversing all column numbers. Perform the above extreme value localization operation on each candidate point set to generate a result index set. This constitutes the spatial coordinate set of mutation points. Using a mutton processing image as an example, if there exists a candidate point grayscale amplitude set in column 400... The maximum amplitude is The corresponding position is the 2nd element, that is, the index position is Finally, the index positions of the points with the largest jump amplitude in all columns are constructed into a two-dimensional index array to obtain the gray-scale change position index.

[0027] Table 2. Examples of extreme points of grayscale jump amplitude; As shown in Table 2, the position corresponding to the maximum grayscale jump is used for grayscale mutation location operation, and the result directly constitutes the spatial coordinate structure of the mutation point, supporting boundary extraction processing.

[0028] Please see Figure 4 Step S3 is as follows: S311: Obtain the gray-scale mutation location index, select any three consecutive index positions in the image, extract the corresponding mutation point gray-scale value in the three columns, calculate the jump amplitude difference between adjacent columns by subtracting each pair, and obtain the column jump difference sequence. Obtain the grayscale mutation location index. Based on the mutation point index information extracted from the image column, perform a three-column combination processing operation column by column, selecting three consecutive index columns in sequence. , , The corresponding grayscale amplitude value , , And construct a sequence of grayscale amplitude jumps. Calculate the difference in jump amplitude between two adjacent columns. , Here, the difference is represented by the absolute value operation to indicate the intensity difference of the grayscale transition. An application scenario is, for example, in an image of mutton slices, if... to The jump amplitude values ​​are as follows: , , ,but , The difference represents the degree of inconsistency in local continuous regions. The system automatically performs batch processing on the image matrix, traversing all... The columns are combined to construct a difference sequence matrix group by group, and the record structure is as follows: Finally, the inter-column jump difference sequence is obtained.

[0029] S312: Based on the inter-column jump difference sequence, each difference is compared with a set column consistency judgment threshold. When any difference is greater than or equal to the set column consistency judgment threshold, the index identifier of the corresponding column index is recorded as a retained column. Otherwise, the current three column index values ​​are removed from the sequence to generate a retained column index set. Based on the inter-column jump difference sequence, for each group of jump amplitude differences and Set column consistency judgment threshold This threshold was set based on the sample stability verification experiment. When any difference satisfies If a sudden inconsistency is found between the three columns, all three columns in the current column combination are retained as valid changed columns; otherwise, the entire index group is removed, as in the example above. , All less than Therefore, this column group index Excluded, if listed to The corresponding jump amplitude is , , The difference , All exceeded the threshold, column group Retained, a set of retained indexes is created after each row is evaluated. This is used for subsequent statistical analysis of image jump columns, completing the index filtering operation, and obtaining the set of retained column indexes.

[0030] S313: Based on the set of retained column indexes, count the number of column indices in the set using the following formula: ; The calculation obtains the effective change ratio between column indices, and then rounds the result to the cardinality of the index set to generate the number of image column change filters; among which... Indicates the effective proportion of changes between column indexes. , , They represent the first The grayscale values ​​of the mutation in the group 3 columns, Indicates the threshold for column consistency judgment. The number of column groups required to satisfy the inconsistency condition; Based on the set of retained column indexes, extract all column index positions from the set and count their effective numbers. This reflects the number of column changes in the image that satisfy the transition consistency judgment condition. Combined with the aforementioned judgment rules, each retained column combination... The corresponding jump amplitude value , , Calculate the sum of their amplitude differences in sequence. The average change ratio between each group of columns is obtained by formula calculation, and then normalized by multiplying it by the column consistency judgment threshold. Finally, the normalized result is... Round down to get the number of images filtered by change in the column.

[0031] We now define three groups of reserved columns, which are column groups. , , The corresponding grayscale amplitude values ​​are as follows: Groups 130-132: , , ; Groups 200-202: , , ; Groups 260-262: , , ; The formula calculation for each column is as follows: Group 1: ; Group 2: ; Group 3: ; Substituting into the formula, we get: ; Regarding the results Rounding down, we get a total of 4 filter columns.

[0032] Table 3 Image Column Jump Filtering Calculation Table; As shown in Table 3, the sum of jump differences divided by The average proportion of each group was obtained, and the results were summed to obtain the final number of image column changes. This result shows the distribution of the number of columns with consistent characteristics in terms of transition amplitude in the image, providing an index for subsequent structure extraction.

[0033] The formula aims to evaluate the overall trend of grayscale jump amplitude between column indices in an image. First, it calculates the absolute value of adjacent jump amplitude values ​​in each group of three consecutive columns to eliminate the influence of the direction of grayscale increase or decrease, retaining only the quantitative characteristic of the jump intensity. Then, it adds the two differences to comprehensively measure the total change of the column group across the entire span. Aggregate the two ranges of change to obtain the total intensity of the local grayscale abrupt change, then divide this total value by... This involves standardizing the intensity of change, where multiplying by 2 is because each group of three columns has two difference terms, which are then uniformly divided by twice the column consistency judgment threshold. The purpose is to construct a normalized ratio to make the results comparable. Finally, the summation of all retained columns is rounded down to obtain the number of image column changes that are statistically representative. The overall structure takes into account the absoluteness of the jump amplitude, the continuity within the local range, and the standardization of the judgment threshold to ensure the rationality of the calculation results in terms of magnitude and discrimination.

[0034] The effective change ratio between column indices is used to quantify the average change intensity of adjacent columns in an image in terms of abrupt changes. Specifically, it reflects the overall deviation of the gray-level abrupt change amplitude between consecutive column groups. This ratio is obtained by summing the absolute values ​​of the gray-level abrupt change differences between adjacent columns in each group of three columns and normalizing them to a set column consistency judgment threshold. It represents the relative amplitude of the gray-level reflectance change of that column group compared to a reference standard. The larger the value, the more drastic the abrupt change in that column group, and the more likely it is to represent the true structural boundary or abnormal texture region in the mutton cross-section image. Conversely, a value close to 0 indicates that the gray-level changes between columns tend to be stable and lack structural differences. Therefore, this ratio index can serve as both a measure of the intensity of image structural change screening and an operational numerical reference standard for subsequent boundary extraction or region division.

[0035] Please see Figure 5 Step S4 is as follows: S411: Based on the number of image column changes, obtain the indexes of all the filtered and retained image columns in sequence, and read the jump amplitude value corresponding to each column to construct a jump amplitude sequence. Sort the sequence according to the numerical values ​​from smallest to largest, and generate a jump amplitude sorted sequence by performing index rearrangement on the sorted sequence. Based on the number of images filtered by column changes, the indexes of all filtered columns are extracted sequentially. Extract the jump amplitude value corresponding to each column. These values ​​are used to construct an initial magnitude vector. Then, an ascending sort operation is performed on the vector, and a mapping sequence of its corresponding column index positions is established. During the sorting process, both the grayscale amplitude values ​​and column indexes need to be bound and processed simultaneously to ensure that the spatial positioning relationship is preserved after the amplitude values ​​are rearranged. The sorting rule is based on... Sort by ascending value. For values ​​with the same amplitude, use the original column index size as the secondary sorting criterion. For example, if a set of values ​​with abrupt amplitude changes exists in a certain filter result... Its corresponding column index is The result after sorting is After sorting, the grayscale jump values ​​express the continuous range of change in mutation intensity, which is suitable for subsequent difference identification and segmentation. After sorting, the output structure is recorded in the form of a two-dimensional structure array, which provides continuous input for the next step of difference threshold judgment, and finally generates a jump amplitude sorting sequence.

[0036] S412: Based on the jump amplitude sorting sequence, extract any two adjacent jump amplitude values ​​and calculate the difference for each pair. Compare the difference with the set jump fluctuation threshold. When the difference is greater than or equal to the set jump fluctuation threshold, mark the corresponding column as a variant column. If only one of the three consecutive columns meets the condition, merge the three columns to define the same variant segment and generate a variant segment column index set. Based on the sequence of jump amplitudes, extract any two adjacent amplitude values ​​from the sequence one by one. , And perform the difference operation. The difference was then compared with the jump fluctuation confirmation threshold. Perform a comparison; if the conditions are met... If the column corresponding to that position is determined to be a variant column, its column index is marked as a valid variant index. In practical applications, if the sorting magnitude sequence is... Then the difference sequence is At this point, the middle section Corresponding column The index is marked as a variant column. The variation in each of three consecutive columns is then determined. If only one of the three columns meets the variation marking condition, the three columns are merged into the same variant segment to maintain the consistency of the region determination. The merging process uses a sliding window to traverse the sorted sequence with a window step size of 1. Each time, three columns are taken out and their number of variant columns is analyzed. If there is only one variant marker column, the corresponding three columns are added to the variant segment structure for storage. Finally, all three columns that meet the conditions are combined to build an index set in segments, completing the spatial mapping assembly and generating the variant segment column index set.

[0037] S413: Based on the column index set of the variant segments, the sequence of jump amplitude values ​​of all columns in each variant segment is restructured and reorganized according to the column index order and quantized, and converted into a gray-scale jump trend vector with the variant segment as the dividing unit. All vector fragments are aggregated into a unified data frame structure to establish compressed map feature vector data. Based on the column index set of the variant segments, the set of column numbers contained in each variant segment is obtained sequentially. And re-extract the corresponding grayscale value based on the column index. A grayscale change trend sequence is constructed, and then the sequence is rearranged in ascending order of column index to ensure that the jump trends within the variation segments are structurally consistent with the column index order. During the rearrangement process, if the original order is... The rearranged sequence is then obtained. Then, the rearranged vectors of each variant segment are treated as local structural fragments and aggregated into a unified matrix structure. Each row represents a variant segment, and each column represents the grayscale amplitude value under the column order within that segment. Finally, all the grayscale vector sequences of the variant segments are concatenated in sequence to form a continuous one-dimensional vector. This constitutes a standardized recognition vector structure, which is then aggregated into a recognition expression template for the system output, and compressed map feature vector data is established.

[0038] Table 4. Examples of rearranged grayscale values ​​for variant segments; As shown in Table 4, the abrupt gray values ​​within each variant segment form an ordered expression structure after rearrangement, and are then spliced ​​together as the constituent units of the compressed map feature vector.

[0039] Please see Figure 6 The S5 steps are as follows: S511: Based on the compressed spectral feature vector data, extract the numerical sequence of jump amplitudes in each variant segment and normalize it to represent it as a standard morphological expression vector. Structurally number each expression vector and match it with the set standard mutton spectral grade template to generate a variant segment grade mapping label set. Based on compressed spectral feature vector data, a one-dimensional jump amplitude sequence corresponding to each variant segment is extracted. The grayscale change patterns in each segment sequence are then retrieved and normalized, with the normalization range set to [0, 1]. Specifically, a linear mapping method is used for normalization, mapping the minimum value of each segment sequence to 0, the maximum value to 1, and the remaining values ​​to linear compression. Based on this, a standard morphological expression vector is established. Subsequently, each normalized segment vector is assigned a unique number, and a matching mapping relationship between the feature vector and the label template is constructed. The matching process uses Euclidean distance as the criterion, calculating the target expression vector and the sample database. If the minimum distance between standard templates is less than a set threshold, the corresponding label of the segment is considered to have matched the standard template successfully. The matched label is one of the levels from level label 1 to level label 4. The matching threshold is set to 0.28. The optimal label is selected based on the distance sorting results. In the example, if the normalized expression vector is [0, 0.3, 0.7, 1], and the Euclidean distance between it and a certain standard template [0, 0.25, 0.65, 1] ​​in the sample library is 0.12, then the match is considered successful, and the label is level label 2. Finally, the label numbers of all successfully matched segments are recorded to generate a variant segment level mapping label set.

[0040] S512: Based on the variant segment level mapping label set, extract the label number corresponding to each variant segment and combine and encode them according to the variant segment index order. Write all matching label numbers into the standard output sequence in a fixed format, and establish the index binding relationship between the label and the source segment to generate the structure label mapping sequence. Based on the variant segment-level mapping tag set, each matched tag is traversed sequentially, and its corresponding segment index position is extracted to construct a tag index binding table. Then, the tag numbers are combined according to the variant segment index order to form a standard output tag list arranged by segment sequence. Each element in the list consists of a segment index and a level tag. To ensure the standardization of the output structure, the tag record format is set as a binary tuple (i, L), where i represents the segment index number and L represents the matching tag level number. For example, if the 3rd segment matches the level 3 tag, the corresponding record is (3, 3). At the same time, a tag index structure is established for back lookup operations. This structure uses the segment number as the key and the tag number as the value. After all records are summarized, a tag data frame is formed. The column fields are set as segment index, tag number, and tag code timestamp. The timestamp records the current tag writing time to realize the back-pass synchronization mechanism. The data frame structure stores each group of tag relationships in a row vector for subsequent identification of the main tag extraction processing, and finally generates a structure tag mapping sequence.

[0041] S513: Based on the structural label mapping sequence, aggregate all label results, extract the highest frequency value of the label in the sequence as the main level label number of the image recognition region, and associate it with the corresponding spectral quality level standard information to construct the overall recognition structure data at the spectral level and obtain the near-infrared spectral mutton quality identification result. Based on the structural label mapping sequence, frequency statistics are performed on all label numbers. The label number with the most occurrences is identified by sorting and used as the primary level label number for the current image recognition region. The statistical method is to count the occurrences of each label number and select the label corresponding to the highest frequency value as the primary label. If multiple labels have the same frequency, the label number with the highest index is taken as the primary label. For example, if the label sequence is [2, 2, 3, 2, 3], then label 2 appears 3 times, label 3 appears 2 times, and the primary label is 2. Subsequently, the correspondence between the label number and the spectral quality standard table is called to map the label number to a specific level description. For example, label 2 corresponds to the standard level "moderate distribution of fat texture". This level description is output in the recognition result. At the same time, the correspondence between the label number and the spectral index is recorded and packaged into a recognition result structure. The structure content fields include primary label number, label description, label frequency, label coverage, and corresponding spectral sequence number. The structure is used to transmit the recognition status within the system to realize closed-loop management of the data chain and finally obtain the near-infrared spectral mutton quality identification result.

[0042] Table 5. Results of Grade Label Matching and Recognition; As shown in Table 5, the main grade label number is confirmed by comparing the label frequency, and the number is mapped to the semantic description of the spectral quality of mutton to complete the grade evaluation of the spectral recognition area.

[0043] A mutton quality identification system based on near-infrared spectroscopy, comprising: The grayscale construction module is used to execute S1: acquire multi-band spectral data of the mutton processing site, collect the grayscale value changes of the target wavelength, establish a pixel grayscale wavelength reflection sequence with column index, and generate wavelength reflection grayscale difference data. The boundary extraction module is used to execute S2: based on the wavelength reflection gray-level difference data, calculate the adjacent difference of the gray-level values ​​of each column of image pixels, locate the boundary point index of gray-level abrupt change in reflection, extract the extreme point of the corresponding gray-level jump amplitude, and generate the gray-level abrupt change position index. The column change filtering module is used to execute S3: Based on the gray-scale change position index, select any three consecutive boundary point data columns, calculate the jump amplitude difference and compare them pairwise. If all jump amplitude differences are less than the set column consistency judgment value, the corresponding column index information is excluded; otherwise, it is retained, and the number of image column change filtering is obtained. The feature compression module is used to perform S4: based on the number of image column changes, it detects whether the difference between any two adjacent jump amplitudes exceeds the set jump fluctuation threshold. If it exceeds the threshold, the corresponding column is marked as a variation region. If only one column in three consecutive columns meets the condition, they are merged into a group of variation segments and converted into a numerical expression vector segmented by variation region to generate compressed map feature vector data. The label output module is used to execute S5: based on the compressed spectral feature vector data, extract the grayscale expression morphology of the variant segment and map it with the standard mutton spectral sample to obtain the near-infrared spectral mutton quality identification result.

[0044] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention in any other way. Any person skilled in the art may make changes or modifications to the above-disclosed technical content to create equivalent embodiments that can be applied to other fields. However, any simple modifications, equivalent changes, and modifications made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the protection scope of the present invention.

Claims

1. A method for identifying the quality of mutton based on near infrared spectroscopy, characterized by, Includes the following steps: S1: Acquire multi-band spectral data of mutton processing site, collect target wavelength gray value changes, establish pixel gray wavelength reflection sequence with column index, and generate wavelength reflection gray value difference data. S2: Based on the wavelength reflection grayscale difference data, calculate the adjacent difference of grayscale values ​​for each column of image pixels, locate the boundary point index of grayscale abrupt change in reflection, extract the extreme point of corresponding grayscale jump amplitude, and generate grayscale abrupt change position index. S3: Based on the gray-scale abrupt change location index, select any three columns of continuous boundary point data, calculate the jump amplitude difference and compare them pairwise. If all jump amplitude differences are less than the set column consistency judgment value, then exclude the corresponding column index information; otherwise, retain it to obtain the number of image column change filters. S4: Based on the number of image column changes filtered, detect whether the difference between any two adjacent jump amplitudes exceeds the set jump fluctuation threshold. If it exceeds, mark the corresponding column as a variation region. If only one column in three consecutive columns meets the condition, merge them into a group of variation segments, convert them into numerical expression vectors segmented by variation region, and generate compressed map feature vector data. S5: Based on the compressed spectral feature vector data, extract the grayscale expression morphology of the variant segment and map it with the standard mutton spectral sample to obtain the near-infrared spectral mutton quality identification result.

2. The method for identifying the quality of mutton based on near-infrared spectroscopy according to claim 1, characterized in that, The wavelength reflectance grayscale difference data includes reflectance change feature values, grayscale change amplitude, and pixel position sequence. The grayscale abrupt change location index includes the abrupt change boundary point position, the abrupt change amplitude extreme point index, and the grayscale jump region number. The image column change filtering quantity includes jump consistency judgment results, retained column index, and column difference identifier. The compressed spectral feature vector data includes the number of variant segments, variant segment grayscale change trend record, and variant region segment expression vector. The near-infrared spectral mutton quality identification results include grade label number, matching success status, and sample mapping label.

3. The method for identifying the quality of mutton based on near-infrared spectroscopy according to claim 1, characterized in that, The specific steps for obtaining the wavelength reflection grayscale difference data are as follows: S111: Acquire multi-band spectral data collected at the mutton processing site, extract column indexes for each column in the image, and index and label the gray values ​​in the column direction of the image based on the corresponding gray value position in each column of gray pixels to establish column gray value identifiers and generate a column gray value identifier sequence. S112: Based on the column grayscale identifier sequence and the configured target wavelength configuration parameter set, retrieve the grayscale value matching the grayscale pixel at the corresponding column index in the image data, and make a one-to-one correspondence between each column grayscale value and the target wavelength parameter to generate a wavelength grayscale mapping data frame. S113: Based on the wavelength grayscale mapping data frame, perform adjacent difference calculations on the grayscale values ​​corresponding to different target wavelengths in the same column, use the numerical difference between the current wavelength grayscale value and the previous target wavelength grayscale value as the difference basis, perform full column wavelength grayscale value difference processing, and generate wavelength reflection grayscale difference data.

4. The method for identifying the quality of mutton based on near-infrared spectroscopy according to claim 1, characterized in that, The specific steps for obtaining the grayscale mutation location index are as follows: S211: Based on the wavelength reflection grayscale difference data, calculate the vertical difference of the grayscale values ​​of adjacent pixels in each column of grayscale vector, construct a two-dimensional difference matrix for the vertical grayscale difference of each column, and index and mark the positions of all non-zero elements in the two-dimensional difference matrix to generate an intra-column grayscale difference matrix. S212: Based on the gray-scale difference matrix within the column, determine whether the difference in gray-scale values ​​in the vertical direction of each column exceeds the set gray-scale jump amplitude. When the absolute value of the difference in each column is greater than or equal to the set gray-scale jump amplitude, record the corresponding row and column index positions as candidate jump point index sequences to generate a gray-scale jump candidate index set. S213: Read the grayscale jump candidate index set, calculate the grayscale difference amplitude sequence corresponding to each column of candidate jump points, perform extreme value extraction operation, select the index point with the largest jump amplitude in each column as the grayscale mutation position index point, aggregate the index positions corresponding to the largest amplitude in each column, and establish the grayscale mutation position index.

5. The method for identifying the quality of mutton based on near-infrared spectroscopy according to claim 1, characterized in that, The specific steps for obtaining the number of images filtered by changes in the image column are as follows: S311: Obtain the gray-scale mutation location index, sequentially select any three consecutive index positions in the image, extract the corresponding mutation point gray-scale value in the three columns, calculate the jump amplitude difference between adjacent columns by subtracting each other, and obtain the column jump difference sequence. S312: Based on the inter-column jump difference sequence, each difference is compared with a set column consistency judgment threshold. When any difference is greater than or equal to the set column consistency judgment threshold, the index identifier of the corresponding column index is recorded as a reserved column. Otherwise, the current three column index values ​​are removed from the sequence to generate a reserved column index set. S313: Based on the reserved column index set, count the number of column indices in the set, calculate the effective change ratio between column indices, and perform rounding calculation based on the ratio result and the base of the index set to generate the number of image column change filters.

6. The method for identifying the quality of mutton based on near-infrared spectroscopy according to claim 5, characterized in that, The formula for calculating the effective change ratio between the indexes is: ; in, Indicates the effective proportion of changes between column indexes. , , They represent the first The grayscale values ​​of the mutation in the group 3 columns, Indicates the threshold for column consistency judgment. The number of column groups to satisfy the inconsistency condition.

7. The method for identifying the quality of mutton based on near-infrared spectroscopy according to claim 1, characterized in that, The specific steps for obtaining the compressed map feature vector data are as follows: S411: Based on the number of image column changes filtered, obtain the indexes of all filtered and retained image columns in sequence, and read the jump amplitude value corresponding to each column to construct a jump amplitude sequence. Sort the sequence according to the numerical values ​​from smallest to largest, and generate a jump amplitude sorting sequence by performing index rearrangement on the sorted sequence. S412: Based on the jump amplitude sorting sequence, extract any two adjacent jump amplitude values ​​and calculate the difference between them one by one. Compare the difference with the set jump fluctuation threshold. When the difference is greater than or equal to the set jump fluctuation threshold, mark the corresponding column as a variant column. If only one of the three consecutive columns meets the condition, merge the three columns to define the same variant segment and generate a variant segment column index set. S413: Based on the column index set of the variant segments, the sequence of jump amplitude values ​​of all columns in each variant segment is restructured and reorganized according to the column index order and quantized, and converted into a gray-scale jump trend vector with the variant segment as the dividing unit. All vector fragments are aggregated into a unified data frame structure to establish compressed map feature vector data.

8. The method for identifying the quality of mutton based on near-infrared spectroscopy according to claim 1, characterized in that, The specific steps for obtaining the near-infrared spectroscopy results for mutton quality identification are as follows: S511: Based on the compressed spectral feature vector data, extract the numerical sequence of jump amplitudes in each variant segment and normalize it to represent it as a standard morphological expression vector. Structurally number each expression vector and match it with the set standard mutton spectral grade template to generate a variant segment grade mapping label set. S512: Based on the mutation segment level mapping label set, extract the label number corresponding to each mutation segment and combine and encode them according to the mutation segment index order. Write all matching label numbers into the standard output sequence in a fixed format, establish the index binding relationship between the label and the source segment, and generate the structure label mapping sequence. S513: Based on the structure label mapping sequence, aggregate all label results, extract the highest frequency value of the label in the sequence as the main level label number of the image recognition region, and associate it with the corresponding spectral quality level standard information to construct the overall recognition structure data at the spectral level, and obtain the near-infrared spectral mutton quality identification result.

9. A lamb meat quality identification system based on near infrared spectroscopy, characterized by, The system is used to implement the mutton quality identification method based on near-infrared spectroscopy as described in any one of claims 1-8, comprising: The grayscale construction module is used to execute S1: acquire multi-band spectral data of the mutton processing site, collect the grayscale value changes of the target wavelength, establish a pixel grayscale wavelength reflection sequence with column index, and generate wavelength reflection grayscale difference data. The boundary extraction module is used to perform S2: based on the wavelength reflection grayscale difference data, calculate the adjacent difference of the grayscale values ​​of each column of image pixels, locate the boundary point index of grayscale abrupt change in reflection, extract the extreme point of the corresponding grayscale jump amplitude, and generate the grayscale abrupt change position index. The column change filtering module is used to execute S3: Based on the gray-scale change position index, select any three consecutive boundary point data columns, count the jump amplitude difference and compare them pairwise. If all jump amplitude differences are less than the set column consistency judgment value, then exclude the corresponding column index information; otherwise, retain it to obtain the number of image column change filters. The feature compression module is used to perform S4: based on the number of image column changes filtered, detect whether the difference between any two adjacent jump amplitudes exceeds the set jump fluctuation threshold. If it exceeds the threshold, mark the corresponding column as a variation region. If only one column in three consecutive columns meets the condition, merge them into a group of variation segments, convert them into numerical expression vectors segmented by variation region, and generate compressed map feature vector data. The label output module is used to execute S5: based on the compressed spectral feature vector data, extract the grayscale expression morphology of the variant segment and map it with the standard mutton spectral sample to obtain the near-infrared spectral mutton quality identification result.