Stone texture recognition and process parameter generation method and system
By training the stone texture recognition model through the YOLOv8 network model, the problems of low efficiency and poor accuracy in traditional stone texture recognition methods are solved, efficient and accurate texture recognition and process parameter generation are achieved, and the automation and quality of stone processing are improved.
Patent Information
- Application Number
- PCT/CN2024/139888
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-03-04
- Filing Date
- 2024-12-17
- Publication Date
- 2025-09-11
AI Technical Summary
Traditional stone texture recognition methods rely on manual observation, which has low efficiency and poor accuracy. Existing automated methods have low accuracy in complex texture recognition and cannot provide processing parameters, which limits the efficiency and quality of stone processing.
The YOLOv8 network model is used to train the stone texture recognition model. The texture direction and process parameters are identified through stone images, and a mask is generated to indicate the position and shape of the texture area. Combined with image annotation and hyperparameter optimization, the recognition accuracy and efficiency are improved.
It achieves efficient and accurate stone texture recognition, reduces human errors, provides reliable process parameter recommendations, improves stone processing efficiency and quality, and meets high-quality decoration needs.
Smart Images

Figure CN2024139888_12092025_PF_FP_ABST
Abstract
Description
A method and system for stone texture recognition and process parameter generation
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application claims priority to Chinese patent application number 202410243812.2, filed with the Patent Office of China on March 4, 2024, entitled “A Method and System for Identifying Stone Texture and Generating Process Parameters,” the entire contents of which are incorporated herein by reference. Technical Field
[0003] The present 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 Art
[0004] 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 recognition methods have many defects, which limit their effectiveness and efficiency in practical applications.
[0005] Traditional manual identification methods rely primarily on visual observation, requiring workers to expend considerable time and effort to discern and identify the direction of stone textures. This method is subject to significant subjectivity and error, as different workers may produce inconsistent results when identifying textures. Furthermore, worker fatigue over extended working hours can lead to a decrease in the accuracy of identification results, which is particularly noticeable in high-intensity production environments.
[0006] In addition to the shortcomings of manual recognition, existing automated texture recognition technologies also have some issues. These technologies are typically based on image processing and feature extraction algorithms. While they can achieve partial automation, their recognition accuracy and robustness are low in complex stone textures. The complex and diverse nature of stone textures makes 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.
[0007] Furthermore, existing automated texture recognition technology can typically only perform simple classification and identification of stone textures, failing to provide further information on the direction of the stone texture or the appropriate processing parameters, such as cutting tools and toners. This limits its application in stone processing, hindering effective decision-making for subsequent processing, and reducing both efficiency and quality.
[0008] In summary, existing stone texture recognition methods have problems such as low manual recognition efficiency, low recognition accuracy, and inability to provide further processing parameters. Therefore, a new technical solution is urgently needed. Summary of the Invention
[0009] One purpose of the present invention is to propose a method for stone texture recognition and process parameter generation, which can efficiently and accurately identify the direction of stone texture and provide a reliable reference for subsequent stone processing to meet the construction industry's continuous pursuit of high-quality stone decoration and market demand.
[0010] Another object of the present invention is to provide a stone texture recognition and process parameter generation system, which adopts the above-mentioned stone texture recognition and process parameter generation method.
[0011] To achieve this object, the present invention adopts the following technical solutions:
[0012] A method for stone texture recognition and process parameter generation includes the following steps:
[0013] Obtain a stone image to be identified, input the stone image into the stone texture recognition model, generate stone texture recognition results and masks, and extract the center position of the texture direction and the corresponding process parameters based on the stone texture recognition results and masks;
[0014] The stone texture recognition result includes: identification information of process parameters corresponding to the texture; and the mask is information indicating the position and shape of each texture area in the stone image.
[0015] Preferably, the stone texture recognition result also includes texture direction recognition information.
[0016] Preferably, the stone texture recognition model is generated through the following training steps:
[0017] Obtaining a number of sample images of stone textures and preprocessing the sample images; wherein the preprocessing includes an information labeling substep, the information labeling substep includes image labeling of the sample images to obtain labeled images and corresponding label information, the labeled images including texture bounding boxes and texture direction marks, the label information including production process parameter information, and generating a labeled image set and a corresponding label information set;
[0018] generating a training sample group based on the annotated image set and the label information set;
[0019] A YOLOv8 network model is constructed, and based on the training sample group, the YOLOv8 network model is trained to obtain a stone texture recognition model.
[0020] Preferably, the process parameter identification information includes a texture tool type identification name and toner identification information, and the production process parameter information includes a texture tool type name and toner information.
[0021] Preferably, in the training step, a test sample group is also generated based on the annotated image set and the label information set;
[0022] Based on the training sample group, the YOLOv8 network model is trained, and the obtained stone texture recognition model is used as the trained recognition model;
[0023] Based on the test sample group, the trained recognition model is tested to generate test results, and the trained recognition model is tuned based on the test results to obtain a tuned recognition model. The test steps are iterated in a loop, and in response to determining that the test results meet preset conditions, the tuned recognition model is determined as a stone texture recognition model.
[0024] Preferably, the YOLOv8 network model is trained to obtain a stone texture recognition model as a trained recognition model, specifically comprising the following steps:
[0025] Configure the environment, create a new Python 3.8 virtual environment, and install PyTorch, TorchVision, and Ultralytics in this environment;
[0026] Perform hyperparameter settings, including preliminary settings for the learning rate, batch size, number of iterations, optimization algorithm, confidence threshold, and non-maximum suppression threshold of the YOLOv8 network model;
[0027] The optimal parameter settings are selected through cross-validation, including the use of loss functions to calculate the positive and negative sample allocation strategy and loss calculation during training; specifically,
[0028] The positive and negative sample allocation strategy is to select the largest k positive samples according to the weighted score ranking of classification and regression scores. The formula is as follows: t = s α ×u β
[0029] Where t represents the weighted score, s represents the predicted score corresponding to the labeled category, u represents the intersection-over-union ratio of the predicted box and the texture bounding box, α and β are weight hyperparameters, and s is multiplied by u to measure the degree of alignment;
[0030] For loss calculation, we use the binary cross entropy loss:
[0031] Among them, L represents the loss function, y represents the true label, Represents 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, extracting the center position of the texture and the corresponding process parameters includes:
[0034] Scan the mask of each texture area row by row, and for each row, identify the index range containing 1, that 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 the texture.
[0036] Preferably, in the training step, obtaining a plurality of sample images of stone textures is obtaining a plurality of stone texture images of different types, different specifications and different texture features.
[0037] A stone texture recognition and process parameter generation system adopts the stone texture recognition and process parameter generation method as described above, comprising:
[0038] An acquisition module, which is used to acquire a picture of a stone to be identified;
[0039] An identification module, wherein the identification module is deployed with the stone texture recognition model, and the identification module is used to generate a stone texture recognition result and a mask, wherein the stone texture recognition result includes: identification information of production process parameters corresponding to the texture, and the mask is information indicating the position and shape of each texture area in the stone image;
[0040] The extraction module extracts the center position of the texture and the corresponding process parameters based on the stone texture recognition result and the mask.
[0041] One of the aforementioned technical solutions has the following beneficial effects: Based on a stone texture recognition model, stone texture recognition results and masks are generated. With a single glance at the stone image to be identified, the position and shape of each stone texture within the image, along with its orientation and corresponding process parameters, can be determined. This not only reduces the error associated with human visual observation of stone textures, improving the accuracy and precision of stone texture recognition, but also identifies the process parameters corresponding to each stone texture, providing a reliable reference for subsequent stone processing, thereby meeting the construction industry's ongoing pursuit of high-quality stone decoration and market demand. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] FIG1 is a flow chart of a method for stone texture recognition and process parameter generation according to the present invention;
[0043] FIG2 is a schematic diagram of the results of a stone texture recognition and process parameter generation system according to the present invention. DETAILED DESCRIPTION
[0044] The technical solution of the present invention will be further described below with reference to the accompanying drawings and through specific implementation methods.
[0045] As shown in FIG1 , a method for stone texture recognition and process parameter generation includes the following steps:
[0046] Obtain a stone image to be identified, input the stone image into the stone texture recognition model, generate stone texture recognition results and masks, and extract the center position of the texture direction and the corresponding process parameters based on the stone texture recognition results and masks;
[0047] The stone texture recognition result includes: identification information of process parameters corresponding to the texture; and the mask is information indicating the position and shape of each texture area in the stone image.
[0048] Existing automated texture recognition technology can typically only identify and classify stone textures, but cannot provide further information on the direction of the stone texture or process parameters such as the appropriate tool and toner. This limits its application in stone processing, hindering its ability to provide effective decision support for subsequent processing and further improving the efficiency and quality of stone processing.
[0049] Therefore, the present invention proposes a method for stone texture recognition and process parameter generation. Based on a stone texture recognition model, the method generates stone texture recognition results and masks. With a single glance at an image of the stone to be identified, the method can identify the position and shape of each stone texture within the image, as well as its orientation and corresponding process parameters. This method not only reduces the error associated with human visual observation of stone textures and improves the accuracy and precision of stone texture recognition, but also identifies the process parameters corresponding to each stone texture, providing a reliable reference for subsequent stone processing, thereby meeting the construction industry's ever-increasing demand for high-quality stone decoration and market demand.
[0050] To further illustrate, 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 knife during processing.
[0051] To further illustrate, the stone texture recognition model is generated through the following training steps:
[0052] Obtaining a number of sample images of stone textures and preprocessing the sample images; wherein the preprocessing includes an information labeling substep, the information labeling substep includes image labeling of the sample images to obtain labeled images and corresponding label information, the labeled images including texture bounding boxes and texture direction marks, the label information including production process parameter information, and generating a labeled image set and a corresponding label information set;
[0053] generating a training sample group based on the annotated image set and the label information set;
[0054] A YOLOv8 network model is constructed, and based on the training sample group, the YOLOv8 network model is trained to obtain a stone texture recognition model.
[0055] It's important to note that the YOLOv8 network model is the latest in the YOLO family of object detection models from Ultralytics, offering state-of-the-art object detection performance. The YOLOv8 network model is highly efficient and fast. Compared to traditional feature-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 streamlines production lines, saving time and labor costs.
[0056] To further illustrate, the process parameter identification information includes a texture tool type identification name and toner identification information, and the production process parameter information includes a texture tool type name and toner information.
[0057] It should be noted that the sample images are annotated to obtain annotated images and corresponding label information. The label information covers the texture directions of various stones and the corresponding production process parameter information, namely the tool type name and color powder information, to ensure the generalization ability of the stone texture recognition model.
[0058] To further illustrate, in the training step, a test sample group is also generated based on the annotated image set and the label information set;
[0059] Based on the training sample group, the YOLOv8 network model is trained, and the obtained stone texture recognition model is used as the trained recognition model;
[0060] Based on the test sample group, the trained recognition model is tested to generate test results, and the trained recognition model is tuned based on the test results to obtain a tuned recognition model. The test steps are iterated in a loop, and in response to determining that the test results meet preset conditions, the tuned recognition model is determined as a stone texture recognition model.
[0061] To further illustrate, the YOLOv8 network model is trained to obtain a stone texture recognition model as a post-training recognition model, specifically including the following steps:
[0062] Configure the environment, create a new Python 3.8 virtual environment, and install PyTorch, TorchVision, and Ultralytics in this environment;
[0063] Perform hyperparameter settings, including preliminary 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 the use of loss functions to calculate the positive and negative sample allocation strategy and loss calculation during training; specifically,
[0065] The positive and negative sample allocation strategy is to select the largest k positive samples according to the weighted score ranking of classification and regression scores. The formula is as follows: t = s α ×u β
[0066] Where t represents the weighted score, s represents the predicted score corresponding to the labeled category, u represents the intersection-over-union ratio of the predicted box and the texture bounding box, α and β are weight hyperparameters, and s is multiplied by u to measure the degree of alignment;
[0067] For loss calculation, we use the binary cross entropy loss:
[0068] Among them, L represents the loss function, y represents the true label, Represents the predicted label.
[0069] To further illustrate, 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.
[0070] In order to improve the effect of subsequent stone texture recognition model training, preprocessing the above sample images helps to optimize image quality and improve the accuracy of subsequent analysis and recognition.
[0071] In one embodiment, the information labeling sub-step is specifically as follows: using LabelMe software to perform image labeling on the sample image, specifically opening the image to be labeled in LabelMe software, manually drawing the texture boundary box and the direction of the stone texture, and filling in the corresponding tool and color powder label for each texture as the category name and identification mark. The above-mentioned labeling information will serve as a supervision signal to guide the learning and optimization of the YOLOv8 network model. After labeling, the LabelMe software generates a JSON file containing the labeled image set and the corresponding label information set. The JSON file is converted to txt format using the following conversion function: labelme2cocoyourLabelmeJsonFile--outputyourOutputDirectory
[0072] Where yourLabelmeJsonFile indicates the name of the JSON file to be converted, and yourOutputDirectory indicates the output directory after conversion.
[0073] 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 LabelMe from GitHub and install it or use pip install LabelMe in a Python environment to install it.
[0074] In one embodiment, the image enhancement sub-step specifically comprises: using OpenCV software to adjust the brightness or contrast of the sample image using the cv2.adjustBrightnessContrast() brightness and contrast adjustment function; and then removing the color cast in the sample image by scaling the histograms of the red, green, and blue color channels, so that the sample image spans the full 0-255 scale and achieves color balance.
[0075] In one embodiment, the image denoising sub-step specifically includes: using OpenCV software to perform a filtering operation using the cv2.medianBlur(), cv2.GaussBlur(), or cv2.bilateralFilter() filtering function to remove noise and unnecessary interference from the sample image, making the sample image cleaner and more regular.
[0076] Further explanation, wherein the extraction of the center position of the texture and the corresponding process parameters include:
[0077] Scan the mask of each texture area row by row, and for each row, identify the index range containing 1, that is, the location where the texture exists in this row;
[0078] 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 the texture.
[0079] By scanning the mask of each texture region pixel by pixel and recording the median value of the index range, multiple vectors are generated, 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 the primary direction of each texture in the image to be determined, helping to understand the directional characteristics of textures and providing further application in stone processing and design. By analyzing the directional characteristics of different textures, process parameters such as cutting direction and toner application direction can be optimized. Furthermore, texture direction analysis can provide directional information for product design, achieving more aesthetically pleasing and realistic results.
[0080] To further explain, in the training step, obtaining a number of sample images of stone textures is to obtain a number of stone texture images of different types, different specifications and different texture features.
[0081] In a specific embodiment, a large number of stone sample images of different types, specifications, and texture characteristics are first collected from stone suppliers, stone processing companies, and other channels. 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 sample, it is preferred to additionally select stone samples with complex textures and color variations.
[0082] A stone texture recognition and process parameter generation system adopts the stone texture recognition and process parameter generation method as described above, comprising:
[0083] An acquisition module, which is used to acquire a picture of a stone to be identified;
[0084] An identification module, wherein the identification module is deployed with the stone texture recognition model, and the identification module is used to generate a stone texture recognition result and a mask, wherein the stone texture recognition result includes: identification information of production process parameters corresponding to the texture, and the mask is information indicating the position and shape of each texture area in the stone image;
[0085] The extraction module extracts the center position of the texture and the corresponding process parameters based on the stone texture recognition result and the mask.
[0086] The stone texture recognition and process parameter generation system provided by the present invention has achieved many beneficial effects in the stone industry and architectural decoration field. These effects are described in detail below:
[0087] 1. Improved accuracy and precision:
[0088] Traditional stone texture recognition methods rely on manual observation, and their results may be affected by subjective factors and errors. However, this invention uses the YOLOv8 network model, which is trained on a large number of sample images of stone textures. It can more accurately identify and recognize stone textures of different types and orientations, reducing human errors and improving the accuracy and precision of texture recognition.
[0089] 2. Efficiency and rapid identification:
[0090] This paper uses YOLOv8 as its network model, which is highly efficient and fast. Compared to traditional feature extraction-based texture recognition methods, YOLOv8 can complete stone texture recognition tasks in a shorter time, significantly improving recognition efficiency and speed. In stone production and processing, efficient texture recognition makes production lines more streamlined, saving time and labor costs.
[0091] 3.Automated recommendation and intelligent processing:
[0092] This invention not only identifies the direction of stone texture but also intelligently recommends appropriate tool types and toner information based on the identification results. This makes subsequent stone processing more intelligent, eliminating the need for tedious parameter selection and allowing workers to proceed directly based on the recommended results, improving processing efficiency and quality. Automated recommendations and intelligent processing also reduce errors and waste during processing, saving production costs.
[0093] 4. Improve the quality of stone processing:
[0094] The texture recognition results provided by this invention provide accurate reference and guidance for subsequent stone processing. By accurately identifying the stone's grain direction and recommending appropriate tool types and toner information, the correct direction can be ensured during processing, avoiding unnecessary errors and waste. This helps improve the quality and precision of stone processing, resulting in a more aesthetically pleasing finished product that meets design requirements.
[0095] 5. Promote industry technology upgrading:
[0096] This invention leverages advanced deep learning technology and applies it to stone texture recognition, driving technological transformation and upgrading in the traditional stone industry. By transitioning from manual to automated identification, it improves the intelligence level of stone processing, making the traditional industry more adaptable to the demands of modern production.
[0097] In summary, the stone texture recognition and process parameter generation system provided by this invention offers numerous benefits in the stone industry and architectural decoration fields, including accuracy, efficiency, automated recommendations, 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 architectural decoration field, and meet growing market demand.
[0098] The technical principles of the present invention have been described above with reference to specific embodiments. These descriptions are intended solely to illustrate the principles of the present invention and are not to be construed in any way as limiting the scope of protection of the present invention. Based on the explanations herein, those skilled in the art will be able to devise other specific embodiments of the present invention without inventive effort, and such equivalent variations or substitutions are intended to be encompassed within the scope of the claims of this application.
Claims
1. A method for stone texture recognition and process parameter generation, characterized in that: The following steps are involved: Obtain a stone image to be identified, input the stone image into the stone texture recognition model, generate stone texture recognition results and masks, and extract the center position of the texture direction and the corresponding process parameters based on the stone texture recognition results and masks; The stone texture recognition result includes: identification information of process parameters corresponding to the texture; and the mask is information indicating the position and shape of each texture area in the stone image.
2. The method for stone texture recognition and process parameter generation according to claim 1, characterized in that: The stone texture recognition result also includes texture direction recognition information.
3. The method for stone texture recognition and process parameter generation according to claim 2, characterized in that: The stone texture recognition model is generated through the following training steps: Obtaining a number of sample images of stone textures and preprocessing the sample images; wherein the preprocessing includes an information labeling substep, the information labeling substep includes image labeling of the sample images to obtain labeled images and corresponding label information, the labeled images including texture bounding boxes and texture direction marks, the label information including production process parameter information, and generating a labeled image set and a corresponding label information set; generating a training sample group based on the annotated image set and the label information set; A YOLOv8 network model is constructed, and based on the training sample group, the YOLOv8 network model is trained to obtain a stone texture recognition model.
4. The method for stone texture recognition and process parameter generation according to claim 2, characterized in that: The process parameter identification information includes a texture tool type identification name and toner identification information, and the production process parameter information includes a texture tool type name and toner information.
5. The method for stone texture recognition and process parameter generation according to claim 2, characterized in that: In the training step, a test sample group is also generated based on the annotated image set and the label information set; Based on the training sample group, the YOLOv8 network model is trained, and the obtained stone texture recognition model is used as the trained recognition model; Based on the test sample group, the trained recognition model is tested to generate test results, and the trained recognition model is tuned based on the test results to obtain a tuned recognition model. The test steps are iterated in a loop. In response to determining that the test results meet the preset conditions, the tuned recognition model is determined as a stone texture recognition model, wherein when the loss value calculated by the loss function drops below a specific threshold, it is considered that the preset conditions are met.
6. The method for stone texture recognition and process parameter generation according to claim 5, characterized in that: The YOLOv8 network model is trained to obtain a stone texture recognition model as a post-training recognition model, specifically including the following steps: Configure the environment, create a new Python 3.8 virtual environment, and install PyTorch, TorchVision, and Ultralytics in this environment; Perform hyperparameter settings, including preliminary 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 the use of loss functions to calculate the positive and negative sample allocation strategy and loss calculation during training; specifically, The positive and negative sample allocation strategy selects the largest k positive samples based on the weighted score sorting of classification and regression scores. The formula is as follows: t=s α ×u β Where t represents the weighted score, s represents the predicted score corresponding to the annotated tool category, u represents the intersection-over-union ratio between the predicted box and the texture bounding box, α and β are weight hyperparameters, and s is multiplied by u to measure the degree of alignment; For loss calculation, we use the binary cross entropy loss: Among them, L represents the loss function, y represents the true label, Represents the predicted label.
7. The method for stone texture recognition and process parameter generation according to claim 2, characterized in that: 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.
8. 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 and the corresponding process parameters, including: The CNC texture machine scans the mask of each texture area row by row, and for each row, identifies the index range containing 1, that 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 the texture.
9. The method for stone texture recognition and process parameter generation according to claim 1, characterized in that: In the training step, obtaining a number of sample images of stone textures is obtaining a number of stone texture images of different types, different specifications and different texture features.
10. A stone texture recognition and process parameter generation system, characterized in that: A stone texture recognition and process parameter generation method according to any one of claims 1 to 9 is used, comprising: An acquisition module, which is used to acquire a picture of a stone to be identified; An identification module, wherein the identification module is deployed with the stone texture recognition model, and the identification module is used to generate a stone texture recognition result and a mask, wherein the stone texture recognition result includes: identification information of production process parameters corresponding to the texture, and the mask is information indicating the position and shape of each texture area in the stone image; The extraction module extracts the center position of the texture and the corresponding process parameters based on the stone texture recognition result and the mask.
Citation Information
Patent Citations
High-precision automatic processing technology with stone texture recognition function
CN107471890A
Tile texture detection method, system and apparatus, and readable storage medium
CN107730500A
A stone texture image CNN recognition method considering the complexity of an image set
CN108985349A
Stone texture recognition and process parameter generation method and system
CN117994242A
Building material classifications from imagery
US20150371112A1