Method, system, device and medium for generating simulation training set for sand casting
By generating and expanding casting images with characters in different fonts, numerical simulations of heat transfer are performed, a training set is constructed and input into the convolutional neural network model, which solves the problems of traditional numerical simulations with heavy calculations and difficulty in data generation, and achieves rapid generation of training sets and predictions. Effect of casting temperature field.
Patent Information
- Application Number
- CN202210445547.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-26
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2042-04-26
AI Technical Summary
Traditional numerical simulation methods are computationally intensive, time-consuming, and costly when the casting structure or parameters change, and it is difficult to quickly generate a large amount of casting modeling data of different shapes to train the neural network model.
By using characters in different fonts as castings, multiple basic sand casting images are generated, and cold iron and thermal insulation riser sleeves are added to the images, the parameter area is expanded for numerical simulation of heat transfer, and a training set is generated to input the convolutional neural network model. train.
It achieves the rapid construction of a massive casting graphics set with comprehensive coverage, saves storage space, retains data integrity, and can predict the temperature field results under any casting shape, with strong generalization capabilities.
Smart Images

Figure CN114707419B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of material processing and artificial intelligence, and in particular to a method, system, equipment and medium for generating a simulation training set for a sand casting. Background Art
[0002] At present, neural networks have covered all aspects of daily life, and their main application areas include target detection, face recognition, image segmentation, etc. Traditional fields such as material processing have also gradually introduced neural networks as the main tool for microstructure morphology recognition, classification, and reconstruction. In the casting field, simulation of the casting process can predict the temperature field, stress field, and tissue field of the casting solidification process, and can predict casting defects.
[0003] The commonly used casting process simulation method is numerical simulation, but numerical simulation requires the use of finite difference or finite element analysis software, and any structural changes or parameter changes in castings or molds need to be recalculated. Therefore, the numerical simulation method has a large amount of calculation, a long calculation time, and high cost.
[0004] The use of artificial intelligence methods such as deep learning and neural networks can replace numerical simulation to a certain extent, opening up new ideas for predicting the temperature field of the casting solidification process and casting defects. When training a neural network model, a large amount of data sets are often required, and it is difficult to generate a large number of castings of different shapes using CAD software. Summary of the invention
[0005] In view of the above problems, the purpose of the present invention is to provide a method, system, equipment and medium for generating a sand casting simulation training set, which can quickly generate a large amount of sand casting model data as a training set for a convolutional neural network model.
[0006] To achieve the above object, the present invention adopts the following technical solutions:
[0007] A method for generating a simulation training set for sand castings comprises the following steps: using characters of different fonts as castings to generate a plurality of basic sand casting images; expanding each basic sand casting image to generate a parameter area for storing material parameters; performing heat transfer numerical simulation on each basic sand casting image with the material parameters contained in each parameter area to obtain a temperature field result of each sand casting image corresponding to the casting shape at a corresponding moment; pairing each basic sand casting image containing a parameter area and its corresponding temperature field result one by one to form a training set, and inputting a pre-built convolutional neural network model for training.
[0008] Furthermore, the method of using characters of different fonts as castings to generate multiple basic sand casting images includes: using characters of different fonts as castings to generate multiple initial sand casting images that meet the single connectivity standard; adding chillers at preset positions of each initial sand casting image, and retaining the sand casting images without and with the chillers; adding risers and insulating riser sleeves at the top of each sand casting image with and without the chillers, and retaining the sand casting images without and with the insulating riser sleeves; and changing the riser pixel value of each sand casting image to a casting grayscale value to obtain multiple basic sand casting images.
[0009] Furthermore, the method of using characters of different fonts as castings to generate multiple initial sand mold casting images that meet the simple connectivity standard includes: establishing a table in text editing software, and inputting characters of different fonts in each cell of the table, using the characters to represent the castings, and other areas of the cells to represent the sand molds, after setting the cell and character formats according to preset rules, enlarging the table and outputting it to obtain a grayscale image containing all the characters; dividing the obtained grayscale image at equal intervals according to the number of rows and columns of the table to obtain multiple grayscale sub-images, each of which has the same size and contains only one character; randomly cutting a basic graphic area of random size at the pixel position where the character is located in each grayscale sub-image, and changing the grayscale value of the cut area to the background grayscale value, after repeating the operation multiple times, obtaining multiple cut grayscale sub-images based on each grayscale sub-image; for all the cut grayscale sub-images obtained, checking the connectivity of the characters in the image, discarding the cut grayscale sub-images that do not meet the simple connectivity standard, and using the remaining cut grayscale sub-images as the initial sand mold casting images.
[0010] Furthermore, the method of adding chill at a preset position of each initial sand casting image includes: extending a preset number of pixels downward along the bottom edge of the characters in each initial sand casting image, and setting the color grayscale values of all extended pixels to a first preset value as chill during the casting process.
[0011] Furthermore, the method for adding risers and thermal insulation riser sleeves on the top of each sand casting image with or without chilling iron comprises: first, identifying the characters in each sand casting image, and adding a trapezoidal riser with a small bottom and a large top directly above the top of each character, wherein the length of the lower base of the trapezoidal riser is half of the width of the character and is not less than the width of the top of the character, and then setting the grayscale value of the trapezoidal riser to a second preset value; secondly, for each trapezoidal riser in the sand casting image, adding a shell layer with the same outer contour as the trapezoidal riser on both sides, and the horizontal thickness of the outer contour is a preset value, and setting the grayscale value of the shell layer pixel to a third preset value as a thermal insulation riser sleeve.
[0012] Further, when the obtained basic sand mold casting images are expanded, it includes: expanding 6 columns of pixels on one side of each basic sand mold casting image as a parameter area, wherein the first to fourth columns are respectively used to store casting parameters, sand mold parameters, chiller parameters and insulation riser sleeve parameters, and the parameter recording order is: material density, specific heat, thermal conductivity, liquidus temperature, solidus temperature, latent heat of crystallization, blackness, initial temperature, and the rest are reserved; the fifth column is used to store the interface heat transfer coefficient, and the parameter recording order is: interface heat transfer coefficient between casting and sand mold, interface heat transfer coefficient between casting and chiller, heat transfer coefficient between casting and insulation riser sleeve, heat transfer coefficient between casting and environment, heat transfer coefficient between chiller and sand mold, heat transfer coefficient between insulation riser sleeve and sand mold, heat transfer coefficient between sand mold and environment, heat transfer coefficient between insulation riser sleeve and environment; the sixth column stores the cooling time after casting.
[0013] Further, when the training set is input into the convolutional neural network model for training, the method includes: reading in basic sand casting image data each containing a parameter area in the form of a matrix, the image size is (m+6)*m, wherein m is the length and width of the basic sand casting image; splitting the last 6 columns of the read basic sand casting image data, and retaining the basic sand casting image data as the model data matrix; according to the distribution of the model data matrix, expanding the last 6 columns of parameters into a matrix of size m*m*n according to the corresponding relationship, and obtaining a final input training set of size i*m*m*(n+1), wherein i is the number of sand casting images in the training set, and n is the number of parameter types.
[0014] In a second aspect, the present invention provides a sand casting simulation training set generation system, comprising: a basic sand casting image generation module, which is used to use characters of different fonts as castings to generate multiple basic sand casting images; a parameter area expansion module, which is used to expand the obtained basic sand casting images to generate a parameter area for storing material parameters; a heat transfer numerical module, which is used to perform heat transfer numerical simulation on each basic sand casting image with the material parameters contained in each parameter area, and obtain a temperature field result corresponding to the casting shape of each sand casting image at the corresponding time; a training set generation module, which is used to pair each basic sand casting image containing a parameter area and its corresponding temperature field results one by one to form a training set, and input a pre-built convolutional neural network model for training.
[0015] In a third aspect, the present invention provides a processing device, which includes at least a processor and a memory, wherein a computer program is stored in the memory, and when the processor runs the computer program, the steps of the method for generating a sand casting simulation training set are executed to implement the method.
[0016] In a fourth aspect, the present invention provides a computer storage medium having computer-readable instructions stored thereon, wherein the computer-readable instructions can be executed by a processor to implement the steps of the method for generating a sand casting simulation training set.
[0017] The present invention adopts the above technical solution, which has the following advantages:
[0018] 1. The present invention uses different characters as castings, and can quickly construct a large number of casting graphics sets. The casting shapes are fully covered and non-repetitive, saving storage space while retaining the integrity of the data.
[0019] 2. In the present invention, a parameter area is obtained by expanding the casting image to store material parameters. The variable information includes casting shape, material parameters, initial temperature, and cooling time parameters, all of which need to be included in the training set.
[0020] 3 The sand casting model provided by the present invention has strong generalization ability and can predict the temperature field results of castings of any casting shape, with chillers and insulation sleeves at different times.
[0021] Therefore, the present invention can be widely applied to the fields of material processing and artificial intelligence. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Throughout the accompanying drawings, the same reference numerals are used to represent the same components. In the accompanying drawings:
[0023] Figure 1 It is a flow chart of a method for generating a sand casting simulation training set provided by an embodiment of the present invention;
[0024] Figure 2 It is the basic shape provided by the embodiment of the present invention;
[0025] Figure 3 is a schematic diagram of a randomly generated casting process structure provided by an embodiment of the present invention;
[0026] Figure 4 It is a sand casting image with added material parameters provided by an embodiment of the present invention: the size is 128*134;
[0027] Figure 5 is the heat transfer calculation result (finite difference method) of the sand casting model provided by the embodiment of the present invention;
[0028] The reference numerals are described as follows:
[0029] 1. Casting; 2. Sand mold; 3. Chill; 4. Riser; 5. Insulation riser sleeve; 6. Cut basic graphics; 7. Parameter area. DETAILED DESCRIPTION
[0030] In order to make the purpose, technical solution and advantages of the embodiment of the present invention clearer, the technical solution of the embodiment of the present invention will be clearly and completely described below in conjunction with the drawings of the embodiment of the present invention. Obviously, the described embodiment is a part of the embodiment of the present invention, not all of the embodiments. Based on the described embodiment of the present invention, all other embodiments obtained by ordinary technicians in this field belong to the scope of protection of the present invention.
[0031] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present application. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprise" and / or "include" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.
[0032] In some embodiments of the present invention, a method for generating a simulation training set for sand castings is provided, comprising: using characters of different fonts as basic graphics to generate multiple basic sand casting images; expanding each basic sand casting image obtained to generate a parameter area for storing material parameters; performing heat transfer numerical simulation on each basic sand casting image using the material parameters contained in each parameter area to obtain the temperature field result of each sand casting image corresponding to the casting shape at the corresponding moment; pairing each basic sand casting image containing the parameter area and its corresponding temperature field result one by one to form a training set, and inputting a pre-built convolutional neural network model for training. The present invention can quickly construct a massive casting graphics set, with comprehensive and non-repetitive casting shape coverage, saving storage space while retaining the integrity of the data.
[0033] Correspondingly, in some other embodiments of the present invention, a sand casting simulation training set generation system, equipment and medium are also provided.
[0034] Example 1
[0035] like Figure 1 As shown, this embodiment provides a method for generating a sand casting simulation training set, comprising the following steps:
[0036] 1) Using characters of different fonts as castings to generate multiple basic sand casting images;
[0037] 2) Expanding each basic sand casting image obtained to generate a parameter area for storing material parameters;
[0038] 3) Performing heat transfer numerical simulation on each basic sand casting image with the material parameters contained in each parameter area, and obtaining the temperature field result of each basic sand casting image corresponding to the casting shape at the corresponding time;
[0039] 4) The basic sand casting images containing the parameter area and their corresponding temperature field results are paired one by one to form a training set, which is input into the pre-built convolutional neural network model for training.
[0040] As a preferred embodiment, in the above step 1), the method of using characters in different fonts as castings to generate multiple basic sand casting images comprises the following steps:
[0041] 1.1) Using characters of different fonts as castings, multiple initial sand casting images that meet the single connectivity criterion are generated;
[0042] 1.2) adding chills to each initial sand casting image, and retaining the sand casting images without and with the chills;
[0043] 1.3) Add risers and heat-insulating riser sleeves to the images of sand castings with and without chilling iron, and retain the images of two sand castings with and without heat-insulating riser sleeves;
[0044] 1.4) The pixel value of the riser of each sand casting image in 1.3) is changed to the gray value of the casting to obtain a plurality of basic sand casting images.
[0045] As a preferred embodiment, in the above step 1.1), the method of using characters of different fonts as castings to generate a plurality of initial sand casting images that meet the single connectivity standard comprises the following steps:
[0046] 1.1.1) Create a table in a text editing software, and enter characters of different fonts in each cell of the table. After setting the cell and character formats according to preset rules, enlarge the table and output it to obtain a grayscale image containing all the characters.
[0047] Specifically, the characters involved in this embodiment include numbers 0-9, English letters, Greek letters, mathematical symbols, Chinese characters with less than 10 strokes, Russian letters, Japanese, Korean, Thai and other letters and fonts of various countries.
[0048] When you format a table, you can make each cell the same size and hide the borders of each cell.
[0049] When you format characters, you make sure that each character is the same size and that there is the same amount of space between lines and between words.
[0050] When the table is enlarged and output as a grayscale image, the characters represent the castings, and their grayscale values are set to 255 as the foreground; the other areas of the cells where the characters are located represent the sand molds, and their grayscale values are set to 0 as the background, and the number of pixels occupied by each character is not less than 28*28.
[0051] 1.1.2) The obtained grayscale image is divided into equal intervals according to the number of rows and columns in the table to obtain multiple grayscale sub-images, each of which has the same size and contains only one character.
[0052] 1.1.3) Randomly cut a basic graphic area of random size at the pixel position where the character (i.e., casting) of each grayscale sub-image is located, and the grayscale value of the cut area is changed to the background grayscale value (i.e., sand mold); wherein the basic graphics include polygons such as circles, ellipses, triangles, quadrilaterals, and any randomly generated graphics.
[0053] 1.1.4) Repeat step 1.1.3) to obtain n cut grayscale sub-images based on each grayscale sub-image.
[0054] 1.1.5) For all the obtained sheared grayscale subgraphs, a two-pass method is used to check the connectivity of the characters in the graph, discard the sheared grayscale subgraphs that do not meet the single connectivity standard, and use the remaining sheared grayscale subgraphs as the initial sand casting image.
[0055] As a preferred embodiment, in the above step 1.2), when adding chill to each initial sand casting image, the adding position is the lower part of the character, the side of the character or randomly added to a part of the outer surface of the casting.
[0056] This embodiment takes adding chill at the bottom of a character as an example for introduction, and the adding method includes: extending 1 to 10 pixels downward along the bottom edge of the character in each initial sand casting image, and setting the color grayscale value of all extended pixels to 100 as chill in the casting process. In particular, the bottom edge of the extended pixels needs to be above the bottom edge of the initial sand casting image.
[0057] As a preferred embodiment, in the above step 1.3), the method of adding a riser and a heat-insulating riser sleeve on the top of each sand casting image with or without a chiller comprises:
[0058] First, the characters in each sand casting image are recognized, and a trapezoidal riser with a small bottom and a large top is added just above the top of each character. The length of the bottom edge of the trapezoidal riser is half of the character width and not less than the width of the top of the character. Then the grayscale value of the trapezoidal riser is set to 50.
[0059] Secondly, for the riser in each sand casting image, a shell layer with the same outer contour is added on both sides, and the horizontal thickness of each side contour is 1 to 10 pixels, and the gray value of the pixel is set to 150, as a heat-insulating riser sleeve. The gray value setting can also be set in other parameters according to actual needs, and the present invention does not limit this.
[0060] As a preferred embodiment, in the above step 2), when expanding each basic sand mold casting image obtained, it includes: expanding 6 columns of pixels on one side of each basic sand mold casting image as a parameter area, wherein the first to fourth columns are respectively used to store casting parameters, sand mold parameters, chiller parameters and insulation riser sleeve parameters, and the parameter recording order is: material density, specific heat, thermal conductivity, liquidus temperature, solidus temperature, latent heat of crystallization, blackness, initial temperature, and the rest are reserved; the fifth column is used to store the interface heat transfer coefficient, and the parameter recording order is: the interface heat transfer coefficient between the casting and the sand mold, the interface heat transfer coefficient between the casting and the chiller, the heat transfer coefficient between the casting and the insulation riser sleeve, the heat transfer coefficient between the casting and the environment, the heat transfer coefficient between the chiller and the sand mold, the heat transfer coefficient between the insulation riser sleeve and the sand mold, the heat transfer coefficient between the sand mold and the environment, and the heat transfer coefficient between the insulation riser sleeve and the environment; the sixth column is used to store the cooling time after the casting is poured.
[0061] As a preferred embodiment, in the above step 3), when the heat transfer numerical simulation is performed on the basic sand casting image, pixels of different colors correspond to the sand mold, casting, chill and insulation riser sleeve, and the simulation is performed based on the material parameters in step 2). The temperature field results corresponding to the casting shape at the corresponding moment of each basic sand casting image obtained include the temperature field distribution of the casting, sand mold, chill, riser and insulation riser sleeve.
[0062] As a preferred embodiment, in the above step 4), when the training set is input into the convolutional neural network model for training, it includes:
[0063] 4.1) Read in the form of a matrix the basic sand casting image data including the parameter area, the image data size is m*(m+6), wherein m is the length and width of the basic sand casting image (the size of the sand casting in this embodiment is m*m), and also represents the number of divided grids;
[0064] 4.2) Split the last 6 columns (i.e., parameter area) of the read-in image data, and retain the basic sand casting image data as the model data matrix (size is m*m);
[0065] 4.3) According to the distribution of the model data matrix, the last 6 columns of parameters are expanded into a matrix of size m*m*n according to the corresponding relationship, and the final input training set of size i*m*m*(n+1) is obtained, where n is the number of parameter types. In this embodiment, the parameter types are: density, specific heat, thermal conductivity, liquidus temperature, solidus temperature, latent heat of crystallization, blackness, initial temperature, interface heat transfer coefficient, cooling time. Therefore, in this embodiment, n is 10; i is the number of sand casting images in the training set.
[0066] Example 2
[0067] Practical examples:
[0068] The size of the experimental sand mold is 0.512m*0.512m, image pixels are used instead of finite difference grids, the grid size is 0.005m*0.005m, and the image size of the sand casting model is 128*128.
[0069] like Figure 2 As shown, this embodiment selects 60 characters as basic shapes, including concave surfaces, convex surfaces, arc-shaped boundaries, straight-line boundaries, etc., and the grayscale value of the casting part is 255, and the grayscale value of the sand mold part is 0.
[0070] In the sand casting image, a pixel position on the casting is randomly selected to remove a circular area of fixed size, and the gray value of its pixel is converted to 0. Then, the two-pass method (an algorithm for fast marking of connected domains) is used to detect connected domains, which requires two cycles. The first cycle calibrates the position and records the equivalence relationship of the connected domains, and the second cycle counts the number of connected domains based on the pixel position and the equivalence relationship of the connected domains. Shapes that do not meet the simple connectivity are directly discarded.
[0071] like Figure 3 As shown in the figure, a pouring riser, an insulation riser sleeve, and a chiller are added to the top of the generated sand casting set to generate a sand casting dataset that conforms to the actual situation. The dataset contains a total of 800 sand casting model images.
[0072] like Figure 4 As shown, at this time, the image size of the sand casting model is 128*128, and six columns are expanded to represent material parameters. In order to avoid data overflow or data being too small, the material parameters are scaled to different degrees so that their size is between 0-255.
[0073] like Figure 5As shown in the figure, the heat transfer numerical simulation is performed on the sand casting model image without adding material parameters, where pixels of different colors correspond to the sand mold, casting, chill and insulation riser sleeve. The material parameters, initial conditions and boundary conditions, and the cooling time after casting are given in the heat transfer program, and the temperature field results corresponding to the casting shape at the corresponding time of each image are obtained, including the temperature field distribution of the casting, sand mold, chill, riser and insulation riser sleeve. This simulation result is paired with the sand casting image with added material parameters to form a training set.
[0074] In the training phase, the input image data is read in the form of a matrix with a size of 128*(128+6), the last six columns are split, and the model data matrix of 128*128 is retained. According to the distribution of the model data matrix, the last six columns of parameters are expanded into 10 matrices of 128*128 in accordance with the corresponding relationship (in this example, there are 10 types of related parameters, including specific heat capacity, density, heat transfer coefficient, interface heat transfer coefficient, crystallization latent heat, blackness, solidus temperature, liquidus temperature, initial temperature, cooling time). The final input training set size is 800*10*128*128.
[0075] Example 3
[0076] The above-mentioned embodiment 1 provides a method for generating a simulation training set for sand castings. Correspondingly, this embodiment provides a system for generating a simulation training set for sand castings. The system provided in this embodiment can implement the method for generating a simulation training set for sand castings in embodiment 1, and the system can be implemented by software, hardware, or a combination of software and hardware. For example, the system may include integrated or separate functional modules or functional units to execute the corresponding steps in each method of embodiment 1. Since the system of this embodiment is basically similar to the method embodiment, the process described in this embodiment is relatively simple, and the relevant parts can refer to the partial description of embodiment 1. The embodiment of the system provided in this embodiment is only schematic.
[0077] The present embodiment provides a sand casting simulation training set generation system, comprising:
[0078] A basic sand casting image generation module is used to generate multiple basic sand casting images by using characters of different fonts as castings;
[0079] A parameter area expansion module is used to expand each basic sand casting image obtained to generate a parameter area for storing material parameters;
[0080] The heat transfer numerical module is used to perform heat transfer numerical simulation on each basic sand casting image with the material parameters contained in each parameter area, and obtain the temperature field result of each sand casting image corresponding to the casting shape at the corresponding time;
[0081] The training set generation module is used to pair the basic sand casting images containing the parameter area and their corresponding temperature field results one by one to form a training set, and input the pre-built convolutional neural network model for training.
[0082] Example 4
[0083] This embodiment provides a processing device corresponding to the sand casting simulation training set generation method provided in this embodiment 1. The processing device can be a processing device for a client, such as a mobile phone, a laptop computer, a tablet computer, a desktop computer, etc., to execute the method of embodiment 1.
[0084] The processing device includes a processor, a memory, a communication interface and a bus, and the processor, the memory and the communication interface are connected through the bus to complete mutual communication. The memory stores a computer program that can be run on the processor, and the processor executes the sand casting simulation training set generation method provided in this embodiment 1 when running the computer program.
[0085] In some embodiments, the memory may be a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk memory.
[0086] In other embodiments, the processor may be a central processing unit (CPU), a digital signal processor (DSP), or other general-purpose processors of various types, which are not limited herein.
[0087] Example 5
[0088] The method for generating a sand casting simulation training set of this embodiment 1 can be specifically implemented as a computer program product, which may include a computer-readable storage medium carrying computer-readable program instructions for executing the method for generating a sand casting simulation training set described in this embodiment 1.
[0089] Computer readable storage media can be tangible devices that hold and store instructions used by instruction execution devices. Computer readable storage media can be, for example, but not limited to, electronic storage devices, magnetic storage devices, optical storage devices, electromagnetic storage devices, semiconductor storage devices, or any combination thereof.
[0090] It should be noted that the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the systems, methods and computer program products according to multiple embodiments of the present application. Each box in the flowchart or block diagram may represent a module, a program segment or a part of the code, and the module, program segment or a part of the code contains one or more executable instructions for implementing the specified logical functions.
[0091] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.
Claims
1. A method for generating a sand casting simulation training set, characterized in that The following steps are involved: Using characters of different fonts as castings, multiple basic sand casting images are generated; Expanding each basic sand casting image obtained to generate a parameter area for storing material parameters; The heat transfer numerical simulation is performed on each basic sand casting image using the material parameters contained in each parameter area to obtain the temperature field result of each sand casting image corresponding to the casting shape at the corresponding time; The basic sand casting images containing the parameter area and their corresponding temperature field results are paired one by one to form a training set, which is input into the pre-built convolutional neural network model for training; The method of using characters of different fonts as castings to generate multiple basic sand casting images comprises: Using characters of different fonts as castings, multiple initial sand casting images that meet the single connectivity criterion are generated; Adding chills to the preset positions of each initial sand casting image, and simultaneously retaining the sand casting images without and with the chills; Adding risers and heat-insulating riser sleeves on the top of each sand casting image with or without a chiller, and retaining the sand casting images without or with a heat-insulating riser sleeve; The pixel value of the riser of each sand casting image is changed into the gray value of the casting to obtain a plurality of basic sand casting images.
2. A method for generating a sand casting simulation training set according to claim 1, characterized in that: The method of using characters of different fonts as castings to generate a plurality of initial sand casting images that meet the single connectivity standard comprises: A table is created in a text editing software, and characters of different fonts are input in each cell of the table, with the characters representing the castings and the other areas of the cells representing the sand molds. After the cell and character formats are set according to the preset rules, the table is enlarged and output to obtain a grayscale image containing all the characters; The obtained grayscale image is divided into equal intervals according to the number of rows and columns in the table to obtain multiple grayscale sub-images, each of which has the same size and contains only one character; A basic graphic area of random size is randomly cut at the pixel position where the character is located in each grayscale sub-image, and the grayscale value of the cut area is changed to the background grayscale value. After repeating the operation multiple times, multiple cut grayscale sub-images based on each grayscale sub-image are obtained; For all the obtained shear grayscale subgraphs, the connectivity of the characters in the graph is checked, the shear grayscale subgraphs that do not meet the single connectivity standard are discarded, and the remaining shear grayscale subgraphs are used as the initial sand casting image.
3. A method for generating a sand casting simulation training set according to claim 1, characterized in that: The method for adding chill at a preset position of each initial sand casting image comprises: extending a preset number of pixels downward along the bottom edge of the characters in each initial sand casting image, and setting the color grayscale values of all the extended pixels to a first preset value as the chill in the casting process.
4. A method for generating a sand casting simulation training set according to claim 1, characterized in that: The method of adding a riser and a heat-insulating riser sleeve on the top of each sand casting image with or without a chiller comprises: First, the characters in each sand casting image are recognized, and a trapezoidal riser with a small bottom and a large top is added just above the top of each character, the length of the bottom side of the trapezoidal riser is half of the character width and not less than the width of the top of the character, and then the grayscale value of the trapezoidal riser is set to a second preset value; Secondly, for the trapezoidal riser in each sand casting image, a shell layer with the same outer contour is added on both sides, and the horizontal thickness of the outer contour is a preset value, and the grayscale value of the shell layer pixel is set to a third preset value as a heat-insulating riser sleeve.
5. The method for generating a sand casting simulation training set according to claim 1, characterized in that: When the obtained basic sand mold casting images are expanded, it includes: expanding 6 columns of pixels on one side of each basic sand mold casting image as a parameter area, wherein the first to fourth columns are respectively used to store casting parameters, sand mold parameters, chiller parameters and insulation riser sleeve parameters, and the parameter recording order is: material density, specific heat, thermal conductivity, liquidus temperature, solidus temperature, latent heat of crystallization, blackness, initial temperature, and the rest are reserved; the fifth column is used to store interface heat transfer coefficient, and the parameter recording order is: interface heat transfer coefficient between casting and sand mold, interface heat transfer coefficient between casting and chiller, heat transfer coefficient between casting and insulation riser sleeve, heat transfer coefficient between casting and environment, heat transfer coefficient between chiller and sand mold, heat transfer coefficient between insulation riser sleeve and sand mold, heat transfer coefficient between sand mold and environment, heat transfer coefficient between insulation riser sleeve and environment; the sixth column stores the cooling time after casting.
6. A method for generating a sand casting simulation training set according to claim 1, characterized in that: When the training set is input into the convolutional neural network model for training, it includes: The basic sand casting image data including the parameter area is read in the form of a matrix, and the image size is (m+6)*m, where m is the length and width of the basic sand casting image; The last 6 columns of the read-in basic sand casting image data are split, and the basic sand casting image data is retained as the model data matrix; According to the distribution of the model data matrix, the last 6 columns of parameters are expanded into a matrix of size m*m*n according to the corresponding relationship, and the final input training set of size i*m*m*(n+1) is obtained, where i is the number of sand casting images in the training set and n is the number of parameter types.
7. A sand casting simulation training set generation system, characterized in that: include: The basic sand casting image generation module is used to use characters of different fonts as castings to generate multiple basic sand casting images, including: using characters of different fonts as castings to generate multiple initial sand casting images that meet the single connectivity standard; adding chills to the preset positions of each initial sand casting image, and simultaneously retaining the sand casting images without and with the chills; adding risers and heat-insulating riser sleeves to the tops of each sand casting image with and without the chills, and simultaneously retaining the sand casting images without and with the heat-insulating riser sleeves; changing the riser pixel value of each sand casting image to a casting gray value to obtain multiple basic sand casting images; A parameter area expansion module is used to expand each basic sand casting image obtained to generate a parameter area for storing material parameters; The heat transfer numerical module is used to perform heat transfer numerical simulation on each basic sand casting image with the material parameters contained in each parameter area, and obtain the temperature field result of each sand casting image corresponding to the casting shape at the corresponding time; The training set generation module is used to pair each basic sand casting image containing the parameter area and its corresponding temperature field results one by one to form a training set, and input the pre-built convolutional neural network model for training.
8. A processing device, comprising at least a processor and a memory, wherein a computer program is stored in the memory, wherein: When the processor runs the computer program, the processor executes the steps of the method for generating a sand casting simulation training set according to any one of claims 1 to 6.
9. A computer storage medium, characterized in that: Computer-readable instructions are stored thereon, and the computer-readable instructions can be executed by a processor to implement the steps of the method for generating a sand casting simulation training set according to any one of claims 1 to 6.
Citation Information
Patent Citations
Intelligent processing equipment for casting, casting method and casting for casting
CN110681826A
Sand mold defect detection method and system based on machine vision
CN114387233A
