Machine learning-based sea cucumber raw material hardness grading model construction method and application thereof
By constructing a machine learning-based hardness grading model for sea cucumber raw materials and training a random forest classification method using multiple index data, the problem of low efficiency and poor accuracy of manual sensory grading in sea cucumber processing was solved. This enabled efficient, non-destructive, objective, and accurate grading of sea cucumber raw materials, improving processing efficiency and product quality consistency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- DALIAN POLYTECHNIC UNIVERSITY
- Filing Date
- 2026-01-21
- Publication Date
- 2026-05-08
AI Technical Summary
In current sea cucumber processing, manual sensory grading methods are inefficient, inaccurate, difficult to standardize and automate, and cannot form a unified grading standard.
A machine learning-based model for grading the hardness of sea cucumber raw materials was constructed. The model was trained using indicators such as sea cucumber moisture content, hardness grade label, 960 nm characteristic wavelength reflectance value, protein content, and glycosaminoglycan dissolution amount, and a sea cucumber raw material hardness grading system was established.
It achieves efficient, non-destructive, objective, and accurate grading of sea cucumber raw materials, with a grading accuracy rate of 85%, reducing labor costs and improving processing efficiency and product quality consistency.
Smart Images

Figure CN121997202A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a method for constructing a machine learning-based hardness grading model for sea cucumber raw materials and its application, belonging to the field of food processing technology. Background Technology
[0002] Sea cucumbers, as a high-value aquatic product, require strict grading before processing to ensure consistent product quality and specifications. However, the quality of sea cucumber raw materials is influenced by a combination of complex factors, including growth environment, growth cycle, and salting process, resulting in significant differences in individual size, shape, and color between different batches and even within the same batch. This substantial individual variation makes it difficult to employ standardized processing procedures, severely hindering the progress of automated and standardized sea cucumber processing.
[0003] Currently, sea cucumber processing companies generally use sensory testing methods that rely on human experience for raw material grading. This method mainly depends on the operator's visual observation and tactile touch to judge the grade of sea cucumbers, which has obvious drawbacks: Firstly, there is significant subjective variation; different operators have different judgment standards, and even the same operator's judgment may fluctuate under different conditions, leading to poor consistency and low accuracy in grading results. Secondly, standards are difficult to formulate and quantify; sensory experience is difficult to translate into precise, transferable objective indicators, making it impossible to form stable and unified grading standards. This traditional method is not only inefficient and costly in terms of labor, but has also become a key bottleneck restricting the large-scale and intelligent development of the industry.
[0004] Therefore, developing an efficient, non-destructive, objective, and accurate grading method for sea cucumber raw materials to replace traditional manual sensory grading and achieve intelligent, automated, and standardized sea cucumber grading is of great significance for improving the overall processing technology level of the sea cucumber industry, ensuring product quality, and reducing production costs. It is also a core goal that the sea cucumber industry urgently needs to achieve. Summary of the Invention
[0005] [Technical Issues] Current sea cucumber processing relies on manual sensory grading, requiring specialized training for workers. This method is time-consuming and inefficient; moreover, it is greatly affected by subjective factors, making it difficult to formulate and quantify standards. Sensory experience is hard to translate into precise, transferable objective indicators, making it impossible to form a stable and unified grading standard. The purpose of this invention is to provide a method for constructing a machine learning-based sea cucumber raw material hardness grading model and its application. This method can achieve intelligent, automated, and standardized sea cucumber grading; and it is efficient, non-destructive, objective, and accurate.
[0006] [Technical Solution] To achieve the above objectives, the following technical solution is provided: The first objective of this invention is to provide a method for constructing a hardness grading model for sea cucumber raw materials, the method comprising the following steps: Obtain hardness evaluation index data for sea cucumber raw materials; the evaluation index data includes sea cucumber moisture content, hardness grade label, average reflectance value of sea cucumber at a characteristic wavelength of 960 nm, sea cucumber protein content, and sea cucumber glycosaminoglycan dissolution amount. The above-mentioned sea cucumber raw material hardness evaluation index data were used as the training dataset. One or more evaluation indicators, including sea cucumber moisture content, sea cucumber protein content, average reflectance value of sea cucumber at a characteristic wavelength of 960 nm, and sea cucumber glycosaminoglycan dissolution amount, were used as input data for the training model. The corresponding hardness grade label was used as the training target for the training model. The machine learning algorithm was trained to obtain the sea cucumber raw material hardness grading model.
[0007] In one implementation, the machine learning algorithm is a random forest classification method.
[0008] In one implementation, the random forest classification method uses Python's Scikit-learn library to build a random forest classifier, setting the number of decision trees to 100, with the remaining parameters set to default.
[0009] In one embodiment, the input data for the training model are the moisture content of sea cucumber, the average reflectance value of sea cucumber at a characteristic wavelength of 960 nm, and / or the amount of glycosaminoglycans dissolved from sea cucumber.
[0010] In one implementation, the construction of the hardness grade label specifically involves: inviting experienced sea cucumber processors to conduct sensory evaluations of the sea cucumbers' hardness through independent touch and pressing in an environment with uniform light and constant temperature; grading according to a pre-established four-level standard (Grade 1 - extra hard, Grade 2 - hard, Grade 3 - medium, Grade 4 - soft); when expert opinions differ, re-evaluation is required until a consensus is reached, and finally, each sea cucumber is assigned a recognized sensory hardness grade label. The above-mentioned samples that have completed sensory grading were objectively measured using a texture analyzer, and the objective hardness value of the sea cucumbers was recorded. This data was used to verify and calibrate the sensory grading results to ensure the accuracy of the labels.
[0011] In one embodiment, the measurement parameters of the texture analyzer are as follows: a puncture experiment is performed using a P / 2 cylindrical probe, and the test parameters are set as follows: pre-test speed 1.0 mm / s, test speed 1.0 mm / s, post-test speed 10.0 mm / s, puncture distance 5.0 mm; maximum peak force (unit: N) on the puncture curve.
[0012] In one embodiment, the moisture content of the sea cucumber is determined by direct drying method according to the national standard GB 5009.3-2016 Food Safety Standard - Determination of Moisture in Food.
[0013] In one embodiment, the average reflectance value of the sea cucumber at a characteristic wavelength of 960 nm is determined by: using a hyperspectral imaging system to acquire spectral images of the sea cucumber sample in the visible light band (400-1000 nm) under constant environment; placing the sample on a stage, ensuring that the camera is facing the maximum transverse diameter of the sample; after acquisition, extracting the average reflectance value of each sea cucumber at a characteristic wavelength of 960 nm using supporting software.
[0014] In one embodiment, the protein content of the sea cucumber is determined by referring to the Kjeldahl method in the national standard GB 5009.5-2025, "National Food Safety Standard - Determination of Protein in Food".
[0015] In one embodiment, the determination of the sea cucumber glycosaminoglycan dissolution amount is as follows: sea cucumber sample is mixed with phosphate buffer, homogenized under ice-water bath conditions, centrifuged, and its absorbance at 525 nm is determined using the 1,9-dimethylmethylene blue colorimetric method. The glycosaminoglycan content is then obtained by substituting the absorbance into the standard curve.
[0016] In one embodiment, the pH of the phosphate buffer solution is 7.4. In one embodiment, the solid-liquid ratio of the sea cucumber sample and the phosphate buffer is 1:1, g / mL.
[0017] In one embodiment, the centrifugation conditions are: 2~6℃, 5000~8000rpm, and 10~15min.
[0018] A second objective of this invention is to provide a method for grading the hardness of sea cucumber raw materials, the method comprising: By using the sea cucumber raw material hardness grading model constructed by the method described above, one or more of the following data from the sea cucumber raw material sample to be graded—moisture content, protein content, average reflectance value at a characteristic wavelength of 960 nm, and glycosaminoglycan dissolution amount—can be measured and input into the constructed sea cucumber raw material hardness grading model to output the sea cucumber raw material hardness grade label.
[0019] A third objective of this invention is to provide a sea cucumber raw material hardness grading system, comprising: The data interface module is used to obtain hardness evaluation index data of sea cucumber raw materials; The label management module is used to support the labeling of sea cucumber raw material hardness evaluation index data and hardness grade labels to form a training set; The feature extraction module is used to extract one or more feature data from sea cucumber raw material samples, including moisture content, protein content, average reflectance value at a characteristic wavelength of 960 nm, and glycosaminoglycan dissolution amount. The model building module is used to train a machine learning algorithm based on the sea cucumber feature data and the corresponding hardness grade labels to obtain a sea cucumber raw material hardness grading model. The hardness grading module is used to load the sea cucumber raw material hardness grading model and perform hardness grading on the sea cucumber raw material sample to be tested.
[0020] A fourth object of the present invention is to provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, is configured to perform the following steps: Obtain hardness evaluation index data for sea cucumber raw materials; the evaluation index data includes sea cucumber moisture content, hardness grade label, average reflectance value of sea cucumber at a characteristic wavelength of 960 nm, sea cucumber protein content, and sea cucumber glycosaminoglycan dissolution amount. The above-mentioned sea cucumber raw material hardness evaluation index data were used as the training dataset. One or more evaluation indexes, including sea cucumber moisture content, sea cucumber protein content, average reflectance value of sea cucumber at a characteristic wavelength of 960 nm, and sea cucumber glycosaminoglycan dissolution amount, are used as input data for training model. The corresponding hardness grade label is used as the training target for training model. The machine learning algorithm is trained to obtain the sea cucumber raw material hardness grading model. The sea cucumber raw material hardness grading model is loaded to grade the hardness of the sea cucumber raw material sample to be tested.
[0021] A fifth object of the present invention is to provide a computer-readable storage medium having a computer program stored thereon, the computer program being configured, when executed by a processor, to perform the following steps: Obtain hardness evaluation index data for sea cucumber raw materials; the evaluation index data includes sea cucumber moisture content, hardness grade label, average reflectance value of sea cucumber at a characteristic wavelength of 960 nm, sea cucumber protein content, and sea cucumber glycosaminoglycan dissolution amount. The above-mentioned sea cucumber raw material hardness evaluation index data were used as the training dataset. One or more evaluation indexes, including sea cucumber moisture content, sea cucumber protein content, average reflectance value of sea cucumber at a characteristic wavelength of 960 nm, and sea cucumber glycosaminoglycan dissolution amount, are used as input data for training model. The corresponding hardness grade label is used as the training target for training model. The machine learning algorithm is trained to obtain the sea cucumber raw material hardness grading model. The sea cucumber raw material hardness grading model is loaded to grade the hardness of the sea cucumber raw material sample to be tested.
[0022] Beneficial effects: This invention is based on a sea cucumber raw material hardness grading model constructed using machine learning. The model takes the moisture content, hyperspectral data and / or sea cucumber glycosaminoglycan dissolution amount of the sea cucumber raw material as feature input indicators, and the corresponding sea cucumber hardness grade label as the output result. It is trained by random forest classification method. The constructed grading model achieved 100% accuracy in grading the 16 prediction sets of the experimental samples. In subsequent applications, the grading model achieved 85% accuracy in the main reflectivity range (0.18-0.24) at 960nm in sea cucumbers, but its performance was only average in extreme cases (<0.18 or >0.25). Attached Figure Description
[0023] Figure 1 This is a graph showing the hardness data of salted sea cucumber raw materials in different hardness groups in Example 1; Figure 2 This is a graph showing the reflectance data at 960nm for salted sea cucumber raw materials of different hardness groups in Example 1; Figure 3 This is a graph showing the moisture content data of salted sea cucumber raw materials of different hardness groups in Example 1; Figure 4 This is a graph showing the protein content data of salted sea cucumber raw materials in different hardness groups in Example 1; Figure 5 This is a graph showing the GAGs leaching data of salted sea cucumber raw materials of different hardness groups in Example 1; Figure 6 A moisture content-reflectance model diagram for salted sea cucumber raw materials of different hardness groups; Figure 7 A model diagram showing the moisture content versus protein content of salted sea cucumber raw materials in different hardness groups; Figure 8 A model diagram showing the moisture content and GAGs dissolution rate of salted sea cucumber raw materials with different hardness groups; Figure 9 A model diagram showing the protein content and GAG dissolution rate of salted sea cucumber raw materials with different hardness groups; Figure 10 Confusion matrix diagram of moisture content-reflectance random forest model for salted sea cucumber raw materials of different hardness groups; Figure 11 Confusion matrix diagram of moisture content-protein content random forest model for salted sea cucumber raw materials of different hardness groups; Figure 12 Confusion matrix diagram of random forest model for moisture content-GAGs dissolution of salted sea cucumber raw materials of different hardness groups; Figure 13Confusion matrix diagram of random forest model for protein content and GAGs dissolution of salted sea cucumber raw materials of different hardness groups; Figure 14 A graph showing the confidence level of a random forest model for moisture content-reflectance of salted sea cucumber raw materials in different hardness groups; Figure 15 A graph showing the confidence level of a random forest model for moisture-protein content analysis of salted sea cucumber raw materials in different hardness groups. Figure 16 A confidence test graph of the random forest model for moisture content-GAGs dissolution of salted sea cucumber raw materials with different hardness groups; Figure 17 A graph showing the confidence level of a random forest model for protein content and GAGs dissolution of salted sea cucumber raw materials in different hardness groups. Detailed Implementation
[0024] The technical solutions in the embodiments of the present invention will be clearly and completely described below. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention. The specific embodiments described below further illustrate the present invention.
[0025] Example 1 A method for establishing a hardness grading model for sea cucumber raw materials includes the following steps: (1) Sample preparation and pretreatment Eighty salted sea cucumbers from the same batch were selected as experimental samples. To ensure the diversity and representativeness of the samples, individuals of different sizes and shapes were included. All samples were softened at 20°C for 24 hours to eliminate the influence of pretreatment differences on hardness. Then, they were taken out and the surface moisture was absorbed with filter paper before testing. (2) Artificial sensory grading Three experienced sea cucumber processors were invited to conduct sensory evaluations of the sea cucumbers' hardness using methods such as touch and pressure, in an environment with uniform lighting and constant temperature. The sea cucumbers were graded according to a pre-established four-level standard (Grade 1 - Extra Hard, Grade 2 - Hard, Grade 3 - Medium, Grade 4 - Soft). When expert opinions differed, the evaluation was reassessed until a consensus was reached, ultimately assigning each sea cucumber a recognized sensory hardness grade label. (3) Quantitative verification using texture analyzer Objective measurements were performed on samples that had undergone sensory grading using a texture analyzer (TA.XT Plus model). A puncture test was conducted using a P / 2 cylindrical probe, with the following parameters: pre-test speed 1.0 mm / s, test speed 1.0 mm / s, post-test speed 10.0 mm / s, and puncture distance 5.0 mm. The maximum peak force (in N) on the puncture curve was recorded as the objective hardness value of the sea cucumber. This data was used to verify and calibrate the sensory grading results, ensuring the accuracy of the label. Results are as follows: Figure 1 As shown; (4) Hyperspectral data acquisition A hyperspectral imaging system was used to acquire spectral images of sea cucumber samples in the visible light band (400-1000 nm) under constant environmental conditions. The samples were placed on a stage, ensuring the camera was directly facing the sample's maximum transverse diameter. After acquisition, the average reflectance value of each sea cucumber at a characteristic wavelength of 960 nm was extracted using the accompanying software. The results are as follows: Figure 2 As shown; (5) Moisture content determination Immediately after hyperspectral acquisition, the absolute moisture content of the same sample was determined using the direct drying method according to the national standard GB 5009.3-2016, "National Food Safety Standard - Determination of Moisture in Food". The sea cucumber was chopped, mixed, and an appropriate amount was placed in a weighing bottle and dried in an oven at 101-105°C until constant weight. The percentage of moisture content was calculated. The results are as follows: Figure 3 As shown; (6) Protein content determination Immediately after hyperspectral acquisition, the protein content of the same sample was determined using the Kjeldahl method as specified in the national standard GB 5009.5-2025, "National Food Safety Standard - Determination of Protein in Food". The results are as follows: Figure 4 As shown; (7) Determination of the dissolution of glycosaminoglycans (GAGs) Immediately after hyperspectral acquisition, the dissolution rate of GAGs in the same sample was determined. The specific method was as follows: 5 g of sea cucumber sample was mixed with 5 mL of phosphate buffer (pH 7.4) and homogenized under ice-water bath conditions; centrifuged at 4 ℃ and 6000 rpm for 15 min; the absorbance at 525 nm was determined using the 1,9-dimethylmethylene blue colorimetric method, and the glycosaminoglycan content was obtained by substituting the absorbance into the standard curve; the results are as follows. Figure 5 As shown; (8) Construction and training of random forest classification model The data obtained in steps (3) to (5) are integrated into a total dataset; each data record contains: 960 nm reflectance value, percentage of moisture content measured by direct drying method, and corresponding four-level sensory hardness label; 64 samples in the total dataset are randomly divided into a training set, and the remaining 16 samples are used as a test set. A random forest classifier is constructed using Python's Scikit-learn library, with the number of decision trees set to 100 and other parameters left as default. The model is trained using the training set data to learn the complex mapping relationship from multiple features to the final hardness level; such as Figure 6 As shown; (9) Model performance evaluation The trained model was validated using a test set, and the results are as follows: Figure 7 As shown, the model achieved 100% accuracy on both the test and training sets, indicating that the model has good generalization ability.
[0026] (10) Model confidence test is used to evaluate the reliability of the model in practical applications. Seven independent sea cucumber samples that did not participate in the aforementioned modeling process were selected, and their characteristic data (reflectance at 960 nm and water content) were obtained. These data were then input into the trained random forest model for prediction, and the hardness data obtained in step (3) was used as the accurate data for comparison. The model not only outputs the predicted hardness level, but also outputs the probability value (confidence level) corresponding to each prediction result. The results are as follows: Figure 7 As shown, 4 out of 7 samples had a prediction confidence of over 85% in the main reflectance range (0.18-0.24) of sea cucumber, proving that the model has high reliability in practical applications.
[0027] Example 2 The data obtained in steps (3), (5), and (7) of Example 1 were integrated into a total dataset; each data record included the percentage of moisture content, the amount of glycosaminoglycan dissolved, and the corresponding four-level sensory hardness label; 64 samples in the total dataset were randomly divided into a training set, and the remaining 16 samples were used as a test set. A random forest classifier was constructed using the Scikit-learn library in Python, with the number of decision trees set to 100 and other parameters left as default; the model was trained using the training set data to learn the complex mapping relationship from multiple features to the final hardness level; the accuracy of the prediction set was 96.8%, and the accuracy of the training set was 87.5%; Figure 7 , 8 As shown.
[0028] Comparative Example 1 The data obtained in steps (3) and (5) and (6) are integrated into a total dataset; each data record contains the percentage of protein content, the percentage of moisture content, and the corresponding four-level sensory hardness label; 64 samples in the total dataset are randomly divided into a training set, and the remaining 16 samples are used as a test set; a random forest classifier is built using Python's Scikit-learn library, with the number of decision trees set to 100 and other parameters left as default; the model is trained using the training set data to learn the complex mapping relationship from multiple features to the final hardness level. The accuracy of the prediction set is 89.1%, and the accuracy of the training set is 62.5%; Figure 7 , 8 As shown.
[0029] Comparative Example 2 The data obtained in steps (3), (6), and (7) are integrated into a total dataset; each data record contains the percentage of protein content, the amount of glycosaminoglycan dissolved, and the corresponding four-level sensory hardness label; 64 samples in the total dataset are randomly divided into a training set, and the remaining 16 samples are used as a test set; a random forest classifier is built using Python's Scikit-learn library, with the number of decision trees set to 100 and other parameters left as default; the model is trained using the training set data to learn the complex mapping relationship from multiple features to the final hardness level; the accuracy of the prediction set is 92.2%, and the accuracy of the training set is 75.0%; Figure 7 , 8 As shown.
[0030] The embodiments provided above are not intended to limit the scope of the invention, nor are the described steps intended to limit the order of execution. Any obvious modifications made to the invention by those skilled in the art based on existing common knowledge also fall within the scope of protection defined by the claims.
Claims
1. A method for constructing a hardness grading model for sea cucumber raw materials, characterized in that, The method includes the following steps: Obtain hardness evaluation index data for sea cucumber raw materials; the evaluation index data includes sea cucumber moisture content, hardness grade label, average reflectance value of sea cucumber at a characteristic wavelength of 960 nm, sea cucumber protein content, and sea cucumber glycosaminoglycan dissolution amount. The above-mentioned sea cucumber raw material hardness evaluation index data were used as the training dataset. One or more evaluation indicators, including sea cucumber moisture content, sea cucumber protein content, average reflectance value of sea cucumber at a characteristic wavelength of 960 nm, and sea cucumber glycosaminoglycan dissolution amount, were used as input data for the training model. The corresponding hardness grade label was used as the training target for the training model. The machine learning algorithm was trained to obtain the sea cucumber raw material hardness grading model.
2. The method according to claim 1, characterized in that, The machine learning algorithm used is the random forest classification method.
3. The method according to claim 1, characterized in that, The random forest classification method described uses Python's Scikit-learn library to build a random forest classifier, with the number of decision trees set to 100 and other parameters left as default.
4. The method according to claim 1, characterized in that, The input data for the training model are the moisture content of sea cucumber, the average reflectance value of sea cucumber at a characteristic wavelength of 960 nm, and / or the amount of glycosaminoglycans dissolved from sea cucumber.
5. The method according to claim 1, characterized in that, The construction of the hardness grade label is as follows: experienced sea cucumber processors are invited to conduct sensory evaluation of the hardness of sea cucumbers by touch and pressing in an environment with uniform light and constant temperature; the sea cucumbers are graded according to a pre-established four-level standard; when experts disagree, the evaluation is re-evaluated until a consensus is reached, and finally each sea cucumber is assigned a recognized sensory hardness grade label. The above-mentioned samples that have completed sensory grading were objectively measured using a texture analyzer, and the objective hardness value of the sea cucumbers was recorded. This data was used to verify and calibrate the sensory grading results to ensure the accuracy of the labels.
6. The method according to claim 1, characterized in that, The moisture content of the sea cucumber was determined by direct drying method according to the national standard GB 5009.3-2016 Food Safety Standard - Determination of Moisture in Food.
7. A method for grading the hardness of sea cucumber raw materials, characterized in that, The method includes: By using the sea cucumber raw material hardness grading model constructed by the method described in any one of claims 1 to 6, one or more of the following data from the sea cucumber raw material sample to be graded—moisture content, protein content, average reflectance value at a characteristic wavelength of 960 nm, and glycosaminoglycan dissolution amount—can be measured and input into the constructed sea cucumber raw material hardness grading model to output a sea cucumber raw material hardness grade label.
8. A sea cucumber raw material hardness grading system, characterized in that, include: The data interface module is used to obtain hardness evaluation index data of sea cucumber raw materials; The label management module is used to support the labeling of sea cucumber raw material hardness evaluation index data and hardness grade labels to form a training set; The feature extraction module is used to extract one or more feature data from sea cucumber raw material samples, including moisture content, protein content, average reflectance value at a characteristic wavelength of 960 nm, and glycosaminoglycan dissolution amount. The model building module is used to train a machine learning algorithm based on the sea cucumber feature data and the corresponding hardness grade labels to obtain a sea cucumber raw material hardness grading model. The hardness grading module is used to load the sea cucumber raw material hardness grading model and perform hardness grading on the sea cucumber raw material sample to be tested.
9. An electronic device, characterized in that, Includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, is configured to perform the following steps: Obtain hardness evaluation index data for sea cucumber raw materials; the evaluation index data includes sea cucumber moisture content, hardness grade label, average reflectance value of sea cucumber at a characteristic wavelength of 960 nm, sea cucumber protein content, and sea cucumber glycosaminoglycan dissolution amount. The above-mentioned sea cucumber raw material hardness evaluation index data were used as the training dataset. One or more evaluation indexes, including sea cucumber moisture content, sea cucumber protein content, average reflectance value of sea cucumber at a characteristic wavelength of 960 nm, and sea cucumber glycosaminoglycan dissolution amount, are used as input data for training model. The corresponding hardness grade label is used as the training target for training model. The machine learning algorithm is trained to obtain the sea cucumber raw material hardness grading model. The sea cucumber raw material hardness grading model is loaded to grade the hardness of the sea cucumber raw material sample to be tested.
10. A computer-readable storage medium, characterized in that, It stores a computer program, which, when executed by a processor, is configured to perform the following steps: Obtain hardness evaluation index data for sea cucumber raw materials; the evaluation index data includes sea cucumber moisture content, hardness grade label, average reflectance value of sea cucumber at a characteristic wavelength of 960 nm, sea cucumber protein content, and sea cucumber glycosaminoglycan dissolution amount. The above-mentioned sea cucumber raw material hardness evaluation index data were used as the training dataset. One or more evaluation indexes, including sea cucumber moisture content, sea cucumber protein content, average reflectance value of sea cucumber at a characteristic wavelength of 960 nm, and sea cucumber glycosaminoglycan dissolution amount, are used as input data for training model. The corresponding hardness grade label is used as the training target for training model. The machine learning algorithm is trained to obtain the sea cucumber raw material hardness grading model. The sea cucumber raw material hardness grading model is loaded to grade the hardness of the sea cucumber raw material sample to be tested.