A stone texture recognition and process parameter generation method and system
Patent Information
- Application Number
- CN202410243812.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-04
- Publication Date
- 2026-11-03
- Estimated Expiration
- 2044-03-04
AI Technical Summary
Traditional stone texture recognition methods rely on manual observation, which is inefficient and inaccurate. Existing automated methods have low accuracy in complex texture recognition and cannot provide processing parameters, thus limiting the efficiency and quality of stone processing.
A stone texture recognition model is trained using a YOLOv8 network model. By identifying the texture direction and process parameters from stone images, a mask is generated to indicate the location and shape of the texture area. Combined with image annotation and preprocessing techniques, the recognition accuracy and efficiency are improved.
It achieves efficient and accurate stone texture recognition, reduces human error, provides reliable processing parameter recommendations, improves stone processing quality and efficiency, and promotes technological upgrading in the industry.
Smart Images

Figure CN117994242B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image recognition technology, and in particular to a method and system for stone texture recognition and process parameter generation. Background Technology
[0002] With the rapid development of the construction industry and the increasing demand for decoration, stone, as a high-quality decorative material, has received more and more attention and application. However, traditional stone texture identification methods have many shortcomings, which limit their effectiveness and efficiency in practical applications.
[0003] Traditional manual identification methods rely primarily on human observation, requiring workers to spend significant time and effort identifying the direction of stone textures. This method is inherently subjective and prone to error, as different workers may produce inconsistent results when identifying textures. Furthermore, worker fatigue increases with working hours, leading to a decrease in the accuracy of identification results, which is particularly evident in high-intensity production environments.
[0004] Besides the limitations of manual identification, existing automated texture recognition technologies also have some problems. These technologies are usually based on image processing and feature extraction algorithms. Although they can achieve partial automation, their recognition accuracy and robustness are low when dealing with complex stone textures. The complex and diverse textures of stone make it difficult for traditional feature extraction methods to capture global and local texture information, resulting in inaccurate recognition results that cannot meet the requirements of high-precision texture recognition.
[0005] Furthermore, existing automated texture recognition technologies can typically only perform simple classification and identification of stone textures, failing to provide further information about the direction of the stone texture or processing parameters such as the appropriate tools and pigments. This limits their application in the stone processing process, preventing them from providing effective decision support for subsequent processing work and reducing the efficiency and quality of stone processing.
[0006] In summary, existing methods for identifying stone textures suffer from low efficiency due to manual identification, low accuracy, and the inability to provide further processing parameters. Therefore, a new technical solution is urgently needed. Summary of the Invention
[0007] One objective of this invention is to propose a method for identifying stone texture and generating process parameters, which can efficiently and accurately identify the direction of stone texture and provide a reliable reference for subsequent stone processing, so as to meet the continuous pursuit of high-quality stone decoration in the construction industry and the market demand.
[0008] Another objective of this invention is to propose a stone texture recognition and process parameter generation system, which employs the aforementioned stone texture recognition and process parameter generation method.
[0009] To achieve this objective, the present invention adopts the following technical solution:
[0010] A method for stone texture recognition and process parameter generation includes the following steps:
[0011] Obtain the stone image to be identified, input the stone image into the stone texture recognition model, generate stone texture recognition results and mask, and extract the center position of the texture direction and the corresponding process parameters based on the stone texture recognition results and mask;
[0012] The stone texture recognition result includes: process parameter recognition information corresponding to the texture; and the mask is an indication of the position and shape of each texture region in the stone image.
[0013] Preferably, the stone texture recognition result also includes texture direction recognition information.
[0014] Preferably, the stone texture recognition model is generated through the following training steps:
[0015] Several sample images of stone textures are acquired, and the sample images are preprocessed. The preprocessing includes an information annotation sub-step, which includes image annotation of the sample images to obtain annotated images and corresponding label information. The annotated images include texture bounding boxes and texture direction markers, and the label information includes production process parameter information. An annotated image set and a corresponding label information set are generated.
[0016] Based on the labeled image set and the label information set, a training sample set is generated;
[0017] A YOLOv8 network model is constructed, and the YOLOv8 network model is trained based on the training sample group to obtain a stone texture recognition model.
[0018] Preferably, the process parameter identification information includes the texture tool type identification name and the color powder identification information, and the production process parameter information includes the texture tool type name and the color powder information.
[0019] Preferably, in the training step, a test sample set is also generated based on the labeled image set and the label information set;
[0020] Based on the training sample set, the YOLOv8 network model is trained, and the resulting stone texture recognition model is used as the post-training recognition model.
[0021] Based on the test sample group, the trained recognition model is tested to generate test results. Based on the test results, the trained recognition model is optimized to obtain an optimized recognition model. The testing steps are iterated repeatedly. In response to determining that the test results meet the preset conditions, the optimized recognition model is determined as a stone texture recognition model.
[0022] Preferably, the YOLOv8 network model is trained to obtain a stone texture recognition model, which is then used as the post-training recognition model. This process includes the following steps:
[0023] Configure the environment by creating a new Python 3.8 virtual environment and installing PyTorch, torchvision, and Ultralytics within that environment.
[0024] Perform hyperparameter settings, including initial settings for the learning rate, batch size, number of iterations, optimization algorithm, confidence threshold, and non-maximum suppression threshold of the YOLOv8 network model;
[0025] The optimal parameter settings are selected through cross-validation, including using a loss function to calculate the positive and negative sample allocation strategy and loss during training; specifically including:
[0026] The positive and negative sample allocation strategy involves sorting the samples based on a weighted average of their classification and regression scores, and selecting the k largest positive samples, as shown in the following formula:
[0027] t = s α ×u β
[0028] Where t represents the weighted score, s represents the predicted score corresponding to the labeled category, u represents the intersection-union ratio of the predicted bounding box and the texture bounding box, α and β are weight hyperparameters, and s multiplied by u is used to measure the degree of alignment;
[0029] For loss calculation, binary cross-entropy loss is used:
[0030]
[0031] Where L represents the loss function and y represents the true label. This indicates the predicted label.
[0032] Preferably, in the training step, the preprocessing further includes at least one of the following sub-steps: an image enhancement sub-step and an image denoising sub-step.
[0033] Preferably, the extraction of the texture direction center position and corresponding process parameters includes:
[0034] The mask of each texture region is scanned pixel by pixel. For each row, the index range containing 1 is identified, which is the location where the texture exists in this row.
[0035] Record the middle value of the index range to obtain the texture direction center vector. The texture direction center vector of each texture represents the direction center position of that texture.
[0036] Preferably, in the training step, obtaining sample images of stone textures involves obtaining images of stone textures of different types, specifications, and texture characteristics.
[0037] A stone texture recognition and process parameter generation system, employing the stone texture recognition and process parameter generation method described above, includes:
[0038] An acquisition module is used to acquire images of the stone to be identified;
[0039] The recognition module is equipped with the stone texture recognition model. The recognition module is used to generate stone texture recognition results and masks. The stone texture recognition results include: recognition information of production process parameters corresponding to the texture, and the mask is an indication of the position and shape of each texture region in the stone image.
[0040] The extraction module extracts the center position of the texture direction and the corresponding process parameters based on the stone texture recognition results and the mask.
[0041] One of the above technical solutions offers the following advantages: Based on a stone texture recognition model, stone texture recognition results and masks are generated. By simply viewing the stone image to be recognized once, the position and shape of each stone texture on the image, as well as the direction of the texture and the corresponding process parameters, can be identified. This not only reduces the error of human visual observation in identifying stone textures and improves the accuracy and precision of stone texture recognition, but also identifies the corresponding process parameters, providing a reliable reference for subsequent stone processing to meet the construction industry's continuous pursuit of high-quality stone decoration and market demand. Attached Figure Description
[0042] Figure 1 This is a flowchart illustrating a method for identifying stone texture and generating process parameters according to the present invention.
[0043] Figure 2 This is a schematic diagram of the results of the present invention in a stone texture recognition and process parameter generation system. Detailed Implementation
[0044] The technical solution of the present invention will be further described below with reference to the accompanying drawings and specific embodiments.
[0045] like Figure 1 As shown, a method for stone texture recognition and process parameter generation includes the following steps:
[0046] Obtain the stone image to be identified, input the stone image into the stone texture recognition model, generate stone texture recognition results and mask, and extract the center position of the texture direction and the corresponding process parameters based on the stone texture recognition results and mask;
[0047] The stone texture recognition result includes: process parameter recognition information corresponding to the texture; and the mask is an indication of the position and shape of each texture region in the stone image.
[0048] Existing automated texture recognition technologies can typically only perform simple identification and classification of stone textures, failing to provide further information about the direction of the texture or process parameters such as the appropriate cutting tools and pigments. This limits their application in stone processing, preventing them from providing effective decision support for subsequent processing and hindering improvements in efficiency and quality.
[0049] Therefore, this invention proposes a method for stone texture recognition and process parameter generation. Based on a stone texture recognition model, it generates stone texture recognition results and masks. By simply viewing the stone image to be identified once, the position and shape of each stone texture on the image, as well as the direction of the texture and the corresponding process parameters, can be determined. This not only reduces the error of human visual observation in identifying stone textures and improves the accuracy and precision of stone texture recognition, but also identifies the corresponding process parameters, providing a reliable reference for subsequent stone processing to meet the construction industry's continuous pursuit of high-quality stone decoration and market demands.
[0050] To further clarify, the stone texture recognition result also includes texture direction recognition information. Specifically, the texture direction is related to the processing technology, that is, the direction of the cutting tool during processing.
[0051] To further explain, the stone texture recognition model is generated through the following training steps:
[0052] Several sample images of stone textures are acquired, and the sample images are preprocessed. The preprocessing includes an information annotation sub-step, which includes image annotation of the sample images to obtain annotated images and corresponding label information. The annotated images include texture bounding boxes and texture direction markers, and the label information includes production process parameter information. An annotated image set and a corresponding label information set are generated.
[0053] Based on the labeled image set and the label information set, a training sample set is generated;
[0054] A YOLOv8 network model is constructed, and the YOLOv8 network model is trained based on the training sample group to obtain a stone texture recognition model.
[0055] It's worth noting that the YOLOv8 network model is the latest addition to the YOLO series based on object detection models, developed by Ultralytics. It offers state-of-the-art object detection performance to date. Employing the YOLOv8 network model, it is characterized by its high efficiency and speed. Compared to traditional feature extraction-based texture recognition methods, YOLOv8 can complete stone texture recognition tasks in a shorter time, significantly improving efficiency and speed. In stone production and processing, efficient texture recognition makes production lines smoother, saving time and labor costs.
[0056] To further explain, the process parameter identification information includes the texture tool type identification name and the color powder identification information, and the production process parameter information includes the texture tool type name and the color powder information.
[0057] It should be noted that the sample images are annotated to obtain annotated images and corresponding label information. The label information covers various stone texture directions and corresponding production process parameters, namely tool type name and color powder information, to ensure the generalization ability of the stone texture recognition model.
[0058] To further explain, in the training step, a test sample set is also generated based on the labeled image set and the label information set;
[0059] Based on the training sample set, the YOLOv8 network model is trained, and the resulting stone texture recognition model is used as the post-training recognition model.
[0060] Based on the test sample group, the trained recognition model is tested to generate test results. Based on the test results, the trained recognition model is optimized to obtain an optimized recognition model. The test is iterated repeatedly. In response to determining that the test results meet the preset conditions, the optimized recognition model is determined as a stone texture recognition model.
[0061] To further explain, the stone texture recognition model obtained by training the YOLOv8 network model is used as the post-training recognition model, specifically including the following steps:
[0062] Configure the environment by creating a new Python 3.8 virtual environment and installing PyTorch, torchvision, and Ultralytics within that environment.
[0063] Perform hyperparameter settings, including initial settings for the learning rate, batch size, number of iterations, optimization algorithm, confidence threshold, and non-maximum suppression threshold of the YOLOv8 network model;
[0064] The optimal parameter settings are selected through cross-validation, including using a loss function to calculate the positive and negative sample allocation strategy and loss during training; specifically including:
[0065] The positive and negative sample allocation strategy involves sorting the samples based on a weighted average of their classification and regression scores, and selecting the k largest positive samples, as shown in the following formula:
[0066] t = s α ×u β
[0067] Where t represents the weighted score, s represents the predicted score corresponding to the labeled category, u represents the intersection-union ratio of the predicted bounding box and the texture bounding box, α and β are weight hyperparameters, and s multiplied by u is used to measure the degree of alignment;
[0068] For loss calculation, binary cross-entropy loss is used:
[0069]
[0070] Where L represents the loss function and y represents the true label. This indicates the predicted label.
[0071] To further explain, the preprocessing in the training step also includes at least one of the following sub-steps: an image enhancement sub-step and an image denoising sub-step.
[0072] To improve the training effect of the subsequent stone texture recognition model, preprocessing the above sample images helps to optimize image quality and improve the accuracy of subsequent analysis and recognition.
[0073] In one embodiment, the information annotation sub-step specifically involves: using LabelMe software to annotate the sample images. Specifically, the image to be annotated is opened in LabelMe software, the texture bounding box and the direction of the stone texture are manually drawn, and the corresponding tool and pigment numbers are filled in for each texture as category names and identification marks. This annotation information will serve as a supervisory signal to guide the YOLOv8 network model in learning and optimization. After annotation, LabelMe software generates a JSON file containing the annotated image set and the corresponding label information set. The JSON file is then converted to TXT format using the following conversion function:
[0074] labelme2coco yourLabelmeJsonFile--output yourOutputDirectory
[0075] Here, yourLabelmeJsonFile represents the JSON filename to be converted, and yourOutputDirectory represents the output directory after conversion.
[0076] It should be noted that LabelMe is a Python-based GUI tool that provides a convenient and easy-to-use way to manually annotate images. You can download and install LabelMe from GitHub or install it in a Python environment using pipinstall LabelMe.
[0077] In one embodiment, the image enhancement sub-step specifically involves: using OpenCV software, adjusting the brightness or contrast of the sample image using the cv2.adjustBrightnessContrast() function; and then removing color casts from the sample image by scaling the histograms of the red, green, and blue channels respectively. This ensures that the sample image spans the complete 0-255 scale, achieving color balance.
[0078] In one embodiment, the image denoising sub-step specifically involves using OpenCV software to perform filtering operations using the cv2.medianBlur(), cv2.GaussBlur(), or cv2.bilateralFilter() filtering functions. This removes noise and unnecessary interference from the sample images, resulting in cleaner and more regular image quality.
[0079] To further explain, the extraction of the texture's center position and corresponding process parameters includes:
[0080] The mask of each texture region is scanned pixel by pixel. For each row, the index range containing 1 is identified, which is the location where the texture exists in this row.
[0081] Record the middle value of the index range to obtain the texture direction center vector. The texture direction center vector of each texture represents the direction center position of that texture.
[0082] By scanning the mask of each texture region pixel by pixel and recording the median value of the index range, multiple vectors can be obtained, each representing the center position of a texture's direction. These vectors can be collected and organized into a dataset for further texture direction analysis. This allows us to determine the main direction of each texture in the image, helping to understand the directional characteristics of the textures and enabling further applications in stone processing and design. By analyzing the directional characteristics of different textures, process parameters such as cutting direction and pigment application direction can be optimized. Furthermore, texture direction analysis can provide directional information about the textures for product design, achieving more aesthetically pleasing and realistic effects.
[0083] To further explain, in the training step, obtaining sample images of stone textures means obtaining images of stone textures of different types, specifications, and texture characteristics.
[0084] In a specific embodiment, a large number of stone sample images of different types, specifications, and textures are first collected from stone suppliers, stone processing enterprises, and other sources. These sample images include common stone types such as marble and granite, as well as their different texture orientations. To increase the diversity and representativeness of the samples, it is preferable to additionally select some stone samples with complex textures and color variations.
[0085] A stone texture recognition and process parameter generation system, employing the stone texture recognition and process parameter generation method described above, includes:
[0086] An acquisition module is used to acquire images of the stone to be identified;
[0087] The recognition module is equipped with the stone texture recognition model. The recognition module is used to generate stone texture recognition results and masks. The stone texture recognition results include: recognition information of production process parameters corresponding to the texture, and the mask is an indication of the position and shape of each texture region in the stone image.
[0088] The extraction module extracts the center position of the texture direction and the corresponding process parameters based on the stone texture recognition results and the mask.
[0089] The stone texture recognition and process parameter generation system provided by this invention has achieved many beneficial effects in the stone industry and building decoration field, which will be described in detail below:
[0090] 1. Improved accuracy and precision:
[0091] Traditional stone texture recognition methods rely on manual observation, and the results may be affected by subjective factors and errors. This invention, however, employs a YOLOv8 network model, trained with a large number of sample images of various stone textures. This enables more accurate identification and recognition of different types and orientations of stone textures, reducing human error and improving the accuracy and precision of texture recognition.
[0092] 2. High efficiency and rapid identification:
[0093] This invention employs YOLOv8 as the network model, which is characterized by high efficiency and speed. Compared to traditional texture recognition methods based on feature extraction, YOLOv8 can complete the stone texture recognition task in a shorter time, greatly improving the efficiency and speed of recognition. In the stone production and processing process, efficient texture recognition makes the production line smoother, saving time and labor costs.
[0094] 3. Automated recommendation and intelligent processing:
[0095] This invention not only identifies the direction of stone texture but also intelligently recommends suitable tool types and color powder information based on the identification results. This makes subsequent stone processing more intelligent, eliminating the need for workers to perform tedious parameter selections and allowing them to process directly based on the recommendations, thus improving processing efficiency and quality. Automated recommendations and intelligent processing also reduce error rates and waste rates during processing, saving production costs.
[0096] 4. Improve the quality of stone processing:
[0097] The texture recognition results provided by this invention offer accurate reference and guidance for subsequent stone processing. By accurately identifying the direction of the stone texture and recommending suitable tool types and color powder information, it ensures correct direction during processing, avoiding unnecessary errors and waste. This helps improve the quality and precision of stone processing, resulting in a more aesthetically pleasing final product that meets design requirements.
[0098] 5. Promote technological upgrading in the industry:
[0099] This invention employs advanced deep learning technology and applies it to the field of stone texture recognition, driving the technological transformation and upgrading of the traditional stone industry. By transforming manual recognition into automated recognition, it improves the level of intelligence in stone processing, making the traditional industry more adaptable to the needs of modern production.
[0100] In summary, the stone texture recognition and process parameter generation system provided by this invention brings numerous benefits to the stone industry and the building decoration field, including accuracy, efficiency, automated recommendation, and intelligent processing. Through the application and promotion of this technology, it is expected to promote the development and upgrading of the stone industry, provide higher-quality stone products for the building decoration field, and meet the ever-growing market demand.
[0101] The technical principles of the present invention have been described above with reference to specific embodiments. These descriptions are merely for explaining the principles of the invention and should not be construed as limiting the scope of protection of the invention in any way. Based on this explanation, those skilled in the art can readily conceive of other specific embodiments of the invention without inventive effort, and these equivalent variations or substitutions are all included within the scope defined by the claims of this application.
Claims
1. A method for stone texture recognition and process parameter generation, characterized in that, Includes the following steps: Obtain the stone image to be identified, input the stone image into the stone texture recognition model, generate stone texture recognition results and mask, and extract the center position of the texture direction and the corresponding process parameters based on the stone texture recognition results and mask; The stone texture recognition result includes: process parameter recognition information corresponding to the texture; the mask indicates the position and shape of each texture region in the stone image; the process parameter recognition information includes the texture tool type recognition name and color powder recognition information; The stone texture recognition model is generated through the following training steps: Several sample images of stone textures are acquired, and the sample images are preprocessed. The preprocessing includes an information annotation sub-step, which includes image annotation of the sample images to obtain annotated images and corresponding label information. The annotated images include texture bounding boxes and texture direction markers. The label information includes production process parameter information, which includes texture tool type name and color powder information. An annotated image set and a corresponding label information set are generated. Based on the labeled image set and the label information set, a training sample set is generated; A YOLOv8 network model is constructed, and the YOLOv8 network model is trained based on the training sample group to obtain a stone texture recognition model.
2. The method for stone texture recognition and process parameter generation according to claim 1, characterized in that, The stone texture recognition results also include texture direction recognition information.
3. The method for stone texture recognition and process parameter generation according to claim 1, characterized in that, In the training step, a test sample set is also generated based on the labeled image set and the label information set; Based on the training sample set, the YOLOv8 network model is trained, and the resulting stone texture recognition model is used as the post-training recognition model. Based on the test sample group, the trained recognition model is tested to generate test results. Based on the test results, the trained recognition model is optimized to obtain an optimized recognition model. The test is iterated repeatedly. In response to determining that the test results meet the preset conditions, the optimized recognition model is determined as a stone texture recognition model. The preset conditions are considered to be met when the loss value calculated by the loss function decreases less than a specific threshold.
4. The method for stone texture recognition and process parameter generation according to claim 3, characterized in that, The YOLOv8 network model is trained to obtain a stone texture recognition model, which is then used as the post-training recognition model. The specific steps include: Configure the environment by creating a new Python 3.8 virtual environment and installing PyTorch, torchvision, and Ultralytics within that environment. Perform hyperparameter settings, including initial settings for the learning rate, batch size, number of iterations, optimization algorithm, confidence threshold, and non-maximum suppression threshold of the YOLOv8 network model; The optimal parameter settings are selected through cross-validation, including using a loss function to calculate the positive and negative sample allocation strategy and loss during training; specifically including: The positive and negative sample allocation strategy involves sorting the samples based on a weighted average of their classification and regression scores, and selecting the k largest positive samples, as shown in the following formula: Where t represents the weighted score, s represents the prediction score corresponding to the labeled tool category, and u represents the intersection-union ratio of the predicted bounding box and the texture bounding box. It is a weight hyperparameter; s multiplied by u is used to measure the degree of alignment. For loss calculation, binary cross-entropy loss is used: in, Represents the loss function. Indicates the true label, This indicates the predicted label.
5. The method for stone texture recognition and process parameter generation according to claim 1, characterized in that, In the training step, the preprocessing also includes at least one of the following sub-steps: an image enhancement sub-step and an image denoising sub-step.
6. The method for stone texture recognition and process parameter generation according to claim 1, characterized in that, in, Extract the center position of the texture direction and the corresponding process parameters, including: The CNC texture machine scans the mask of each texture region pixel by pixel. For each row, it identifies the index range containing 1, which is the location where the texture exists in this row. Record the middle value of the index range to obtain the texture direction center vector. The texture direction center vector of each texture represents the direction center position of that texture.
7. The method for stone texture recognition and process parameter generation according to claim 1, characterized in that, In the training step, several sample images of stone textures are obtained, which means obtaining several stone texture images of different types, specifications and texture features.
8. A stone texture recognition and process parameter generation system, characterized in that, The method for stone texture recognition and process parameter generation as described in any one of claims 1-7 includes: An acquisition module is used to acquire images of the stone to be identified; The recognition module is equipped with the stone texture recognition model. The recognition module is used to generate stone texture recognition results and masks. The stone texture recognition results include: recognition information of production process parameters corresponding to the texture, and the mask is an indication of the position and shape of each texture region in the stone image. The extraction module extracts the center position of the texture direction and the corresponding process parameters based on the stone texture recognition results and the mask.
Citation Information
Patent Citations
High-precision automatic processing technology with stone texture recognition function
CN107471890A
