A method, system, device and storage medium for picture content recognition training
By grouping and object peeling methods, the associated distribution parameters of the image objects are analyzed, and the problems of long picture recognition time and many results in the prior art are solved, and efficient and accurate picture content recognition is achieved.
Patent Information
- Application Number
- CN202410538098.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-30
- Publication Date
- 2025-05-27
- Estimated Expiration
- 2044-04-30
AI Technical Summary
When the existing picture recognition method processes pictures of many types of objects, the recognition time is long and multiple recognition results may occur, resulting in identification contradictions and the main content of the picture cannot be effectively extracted, affecting the recognition efficiency.
A training method for image content recognition is proposed, multiple images are obtained through big data, grouped and processed, and image objects are obtained using object peeling method, and their associated distribution parameters are analyzed, and the image content is finally recognized based on these parameters.
It improves the efficiency of image recognition, ensures the uniqueness of the recognition results, avoids identification contradictions, and can effectively extract the main content of the image.
Smart Images

Figure CN118429746B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image recognition, and particularly to a method, system, device and storage medium for training image content recognition. Background Art
[0002] Image recognition is a technology that uses computer algorithms to process, analyze and understand images, aiming to identify information such as objects, scenes and patterns in the images; the basic principle of image recognition lies in decomposing the image into pixel points and identifying the content of the image by recognizing features such as the color and brightness of these pixel points. This process usually includes several key steps, such as image preprocessing, feature extraction, feature matching and final result output, which can involve forms such as text, numbers and tables.
[0003] Existing improvements in image content recognition usually focus on improving the accuracy of image content recognition. For example, in the Chinese patent with the application publication number CN105446997A, a method and device for image content recognition are disclosed. This solution recognizes the to-be-recognized image according to an image recognition model, and the image recognition model includes a set of first feature sets, and the first feature sets have content information for recognizing image content; output the image recognition result, so as to be applied to image content recognition devices with relatively high requirements for the accuracy of image content recognition. Other improvements in image content recognition usually focus on improvements in color and increasing the types of recognized content. In the prior art, when there are many types of objects in the image, the existing image recognition methods will consume a long recognition time to analyze the image content, and may have multiple recognition results for the same image, resulting in contradictory recognition, and unable to effectively extract the main content of the image, affecting the recognition efficiency of the image. In view of this, it is necessary to improve the existing image content recognition. Summary of the Invention
[0004] The present invention aims to at least solve one of the technical problems in the prior art to some extent. By providing a method, system, device and storage medium for training image content recognition, it is used to solve the problem that in the prior art, when recognizing each object in the image based on the content of the image itself and then recognizing the image content based on the recognition results of each object, there is a lack of effective improvement methods. This will lead to the situation that when there are many types of objects in the image, the existing image recognition methods will consume a long recognition time to analyze the image content, and may have multiple recognition results for the same image, resulting in contradictory recognition, and unable to effectively extract the main content of the image, affecting the recognition efficiency of the image.
[0005] To achieve the above object, in the first aspect, the present invention provides a method for training image content recognition, including:
[0006] Obtain multiple pictures based on big data, denoted as test training pictures; perform grouping processing on the test training pictures based on the content of the test training pictures;
[0007] Process the grouped test training pictures using the object stripping method, and obtain multiple picture objects based on the processing results;
[0008] Obtain the associated distribution parameters of the picture objects based on the test training pictures, and analyze the associated distribution parameters;
[0009] Identify the picture content based on the picture objects and their associated distribution parameters.
[0010] Further, obtain multiple pictures based on big data, denoted as test training pictures; the grouping processing of the test training pictures based on the content of the test training pictures includes:
[0011] Use big data to obtain multiple pictures that have been labeled, and denote them as training test pictures 1 to training test pictures N in sequence, where the pictures that have been labeled are pictures in which each object has been labeled with its corresponding name;
[0012] Use AI recognition to obtain the picture content of training test pictures 1 to training test pictures N, and put the training test pictures with the same picture content into the same training test group, and denote all the obtained training test groups as training test groups 1 to training test groups M in sequence.
[0013] Further, the processing of the grouped test training pictures using the object stripping method and obtaining multiple picture objects based on the processing results includes:
[0014] Use the object stripping method to analyze and process the pictures in training test groups 1 to training test groups M, and obtain the recognizable objects of each training test group;
[0015] Obtain the recognizable objects of all training test groups and denote all the recognizable objects as picture objects 1 to picture objects P in sequence.
[0016] Further, the object stripping method includes:
[0017] For any one of the training test groups M1 in training test groups 1 to training test groups M, denote the pictures in training test group M1 as training test pictures M1~1 to training test pictures M1~T in sequence;
[0018] For any one of the training test pictures M1~1 to training test pictures M1~T, perform grayscale processing on the training test picture M1~T1, and denote the grayscale processed training test picture M1~T1 as the grayscale test picture;
[0019] Obtain the grayscale values of all pixels in the grayscale test image, and adjust the grayscale values of pixels whose grayscale values are greater than or equal to the average grayscale value to pure white pixel values, and adjust the grayscale values of pixels whose grayscale values are less than the average grayscale value to pure black pixel values; after the grayscale values of all pixels in the grayscale test image are adjusted, all closed figures surrounded by pixels whose grayscale values are pure black pixel values are recorded as pixel contours 1 to pixel contours K in sequence;
[0020] The regions corresponding to pixel contour 1 to pixel contour K in the training test images M1 to T1 are recorded as image sub-region 1 to image sub-region K in sequence;
[0021] Obtain all the image sub-regions in the training test images M1-1 to M1-T, and annotate the image sub-regions based on the names of the objects annotated in each training test image, wherein the annotating method is: for any object in any training test image, annotate the annotated name of the object in all the image sub-regions covered by the object;
[0022] For any image sub-region A, when the image sub-region A is labeled with only one name, the name labeled with the image sub-region A is recorded as the image name of the image sub-region A; when the image sub-region A is not labeled with a name, the image sub-region A is removed from all image sub-regions;
[0023] When the image sub-region A is labeled with multiple names, the multiple names are sequentially recorded as the waiting name 1 to the waiting name R of the image sub-region A; for any waiting name R1 among the waiting names 1 to the waiting name R, a picture sub-region B marked as the waiting name R1 is randomly obtained, and the picture similarity between the picture sub-region A and the picture sub-region B is obtained, which is recorded as the matching similarity of the waiting name R1; the matching similarities of all the waiting names are obtained, and the waiting name with the largest matching similarity is recorded as the picture name of the picture sub-region A;
[0024] All image sub-regions containing image names are obtained and recorded as recognizable objects in the training test group M1.
[0025] Furthermore, acquiring the associated distribution parameters of the image objects based on the test training images and analyzing the associated distribution parameters include:
[0026] For any test training picture N1 from the test training pictures 1 to the test training pictures N, the number of picture objects in the test training picture N1 is recorded as U, and they are recorded as picture object 1 to picture object U in sequence; the number of types of picture names in all picture names corresponding to picture object 1 to picture object U is recorded as C;
[0027] For any one of the picture objects U1 from picture object 1 to picture object U, denote the picture name of picture object U1 as picture name U1, and denote the number of picture objects with the picture name U1 among picture object 1 to picture object U as Z;
[0028] Z×C
[0029] Denote U as the associated distribution parameter of picture object U1;
[0030] Obtain the associated distribution parameters of all picture objects in the test training picture N1;
[0031] Based on the above analysis method, obtain the associated distribution parameters of all picture objects in all test training pictures.
[0032] Furthermore, obtaining the associated distribution parameters of picture objects based on test training pictures and analyzing the associated distribution parameters also includes:
[0033] For any one of the picture objects P1 from picture object 1 to picture object P, when picture object P1 contains only one associated distribution parameter, denote the picture content corresponding to the training test group where picture object P1 is located as the picture environment of picture object P1;
[0034] When picture object P1 contains multiple associated distribution parameters, denote the multiple associated distribution parameters of picture object P1 as associated distribution parameter P1~1 to associated distribution parameter P1~G in sequence; obtain the picture content corresponding to the test training pictures where associated distribution parameter P1~1 to associated distribution parameter P1~G are located, and denote it as the parameter picture content of associated distribution parameter P1~1 to associated distribution parameter P1~G;
[0035] Obtain the picture environment of all picture objects or the parameter picture content corresponding to all associated distribution parameters of picture objects.
[0036] Furthermore, identifying picture content based on picture objects and their associated distribution parameters includes:
[0037] Denote the picture to be identified as the picture to be recognized, use the object stripping method to obtain multiple picture objects in the picture to be recognized, and denote them as to-be-recognized object 1 to to-be-recognized object D in sequence;
[0038] Obtain the picture names of all to-be-recognized objects, and obtain the associated distribution parameters of all to-be-recognized objects based on the picture names of all to-be-recognized objects, and denote them as actual distribution parameters;
[0039] For any object D1 to be recognized among objects D1 to D to be recognized, when object D1 to be recognized contains only one associated distribution parameter and the associated distribution parameter of object D1 to be recognized is equal to the actual distribution parameter of object D1 to be recognized, the picture environment of object D1 to be recognized is recorded as reference content; when object D1 to be recognized contains only one associated distribution parameter and the associated distribution parameter of object D1 to be recognized is not equal to the actual distribution parameter of object D1 to be recognized, object D1 to be recognized is recorded as a useless object;
[0040] When object D1 to be recognized contains multiple associated distribution parameters and any one of the associated distribution parameters A of object D1 to be recognized is equal to the actual distribution parameter of object D1 to be recognized, the parameter picture content corresponding to associated distribution parameter A is recorded as reference content; when object D1 to be recognized contains multiple associated distribution parameters and all the associated distribution parameters A of object D1 to be recognized are not equal to the actual distribution parameter of object D1 to be recognized, object D1 to be recognized is recorded as a useless object;
[0041] Obtain the reference content corresponding to all objects D1 to be recognized that have not been recorded as useless objects, and record them as reference content 1 to reference content S in sequence. When any two or more of reference content 1 to reference content S are the same, record the reference content with the largest quantity among reference content 1 to reference content S as the picture content of the picture to be recognized;
[0042] When reference content 1 to reference content S are all different from each other, record reference content 1 to reference content S as the picture content of the picture to be recognized;
[0043] When all objects D1 to be recognized are recorded as useless objects, add the picture to be recognized to the test training pictures for analysis, and update the picture object and its associated distribution parameters based on the analysis results.
[0044] In a second aspect, the present invention also provides a picture content recognition training system, including a picture grouping module, a picture object extraction module, a parameter analysis module, and a recognition update module;
[0045] The picture grouping module is used to obtain multiple pictures based on big data, recorded as test training pictures; perform grouping processing on the test training pictures based on the content of the test training pictures;
[0046] The picture object extraction module is used to process the grouped test training pictures using the object stripping method, and obtain multiple picture objects based on the processing results;
[0047] The parameter analysis module is used to obtain the associated distribution parameters of the picture objects based on the test training pictures, and analyze the associated distribution parameters;
[0048] The recognition update module is used to recognize the content of a picture based on the picture object and its associated distribution parameters.
[0049] In a third aspect, the present invention provides an electronic device, including a processor and a memory. The memory stores computer-readable instructions. When the computer-readable instructions are executed by the processor, the steps in the above method are run.
[0050] In a fourth aspect, the present invention provides a storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above method are run.
[0051] Advantages of the present invention: The present invention first tests and trains pictures based on big data; performs grouping processing on the test training pictures based on the content of the test training pictures; processes the grouped test training pictures using the object stripping method, and obtains multiple picture objects based on the processing results. The advantage of this is that by performing grouping processing on the test training pictures, it helps to use relatively the same analysis data during the analysis of pictures within the same group in subsequent analysis, thereby improving the analysis efficiency of each picture within a group, and thus improving the overall analysis efficiency. By using the object stripping method for processing, it can effectively obtain each object in the test training pictures and mark each object, so that different objects can be effectively recognized during subsequent recognition;
[0052] The present invention also obtains the associated distribution parameters of the picture object based on the test training pictures, analyzes the associated distribution parameters, and finally recognizes the picture content based on the picture object and its associated distribution parameters. The advantage of this is that by obtaining the associated distribution parameters of the picture object, the characteristic data of the picture object in the picture can be obtained, so that when analyzing the picture content subsequently, the picture content corresponding to the picture where the picture object is located can be matched according to the characteristic data of the picture object, thereby effectively determining the picture content based on all picture objects in the picture, making the analysis result unique, and preventing contradictions in recognition caused by multiple recognition results, which affects the recognition efficiency of the picture.
[0053] Other features and advantages of the present application will be described in the subsequent specification, and, in part, will be obvious from the specification, or will be understood by implementing the present application. The objectives and other advantages of the present application can be achieved and obtained by the structures specifically pointed out in the written specification, claims, and drawings. Description of the Drawings
[0054] Figure 1 It is the principle block diagram of the system of the present invention;
[0055] Figure 2 It is the step flow chart of the method of the present invention;
[0056] Figure 3 Schematic diagram of the sub-region of the picture of the present invention being labeled;
[0057] Figure 4 Schematic diagram of the electronic device of the present invention. Specific embodiments
[0058] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0059] Embodiment 1, please refer to Figure 1 As shown, in the first aspect, the present application provides a picture content recognition training system, including a picture grouping module, a picture object extraction module, a parameter analysis module, and an identification update module;
[0060] The picture grouping module is used to obtain multiple pictures based on big data, denoted as test training pictures; group the test training pictures based on the content of the test training pictures;
[0061] The picture grouping module is configured with a picture grouping strategy, and the picture grouping strategy includes:
[0062] Use big data to obtain multiple labeled pictures, and sequentially denote them as training test pictures 1 to training test pictures N. Among them, the labeled pictures are pictures in which each object is labeled with its corresponding name;
[0063] Use AI recognition to obtain the picture content of training test pictures 1 to training test pictures N, and put the training test pictures with the same picture content into the same training test group, and sequentially denote all the obtained training test groups as training test groups 1 to training test groups M.
[0064] In the specific implementation process, the purpose of grouping the training test pictures is that by putting the training test pictures with the same picture content into the same training test group, the analysis data used in the subsequent analysis of the pictures within the same training test group can be relatively the same, thereby improving the analysis efficiency of each picture in a group and thus improving the overall analysis efficiency;
[0065] The picture object extraction module is used to process the grouped test training pictures using the object stripping method, and obtain multiple picture objects based on the processing results;
[0066] The picture object extraction module is configured with an identification extraction strategy, and the identification extraction strategy includes:
[0067] Analyze and process the pictures in training and test groups 1 to M using the object stripping method, and obtain the recognizable objects in each training and test group.
[0068] The object stripping method includes:
[0069] For any one of the training and test groups M1 from training and test groups 1 to M, sequentially denote the pictures in training and test group M1 as training and test pictures M1~1 to training and test pictures M1~T;
[0070] For any one of the training and test pictures M1~1 to training and test pictures M1~T, perform grayscale processing on training and test picture M1~T1, and denote the grayscale processed training and test picture M1~T1 as the grayscale test picture;
[0071] Obtain the grayscale values of all pixel points in the grayscale test picture, and adjust the grayscale values of the pixel points with grayscale values greater than or equal to the equal grayscale value to pure white pixel values, and adjust the grayscale values of the pixel points with grayscale values less than the equal grayscale value to pure black pixel values; after adjusting the grayscale values of all pixel points in the grayscale test picture, sequentially denote all the closed figures surrounded by the pixel points with pure black pixel values as pixel contours 1 to pixel contours K;
[0072] In the specific implementation process, the value of the pure white pixel value is 255, and the value of the pure black pixel value is 0. By adjusting the grayscale values of all pixel points in the grayscale test picture to 0 or 255, the contours of each figure in the grayscale test picture can be effectively obtained, and the contours of the figures can be collected;
[0073] Sequentially denote the areas corresponding to pixel contours 1 to pixel contours K in training and test picture M1~T1 as picture sub-areas 1 to picture sub-areas K;
[0074] Obtain all the picture sub-areas in training and test pictures M1~1 to training and test pictures M1~T, and label the picture sub-areas based on the names labeled for each object in each training and test picture. Among them, the labeling method is: for any object in any training and test picture, label the name labeled for the object in all the picture sub-areas covered by the object;
[0075] Please refer to Figure 3 As shown, where TT0 is the training and test picture, the solid-line figures where TT1 to TT7 are located are all picture sub-areas, and the dashed-line figure where TT8 is located is an object in the training and test picture. Then label the name labeled for object TT8 in picture sub-areas TT1 to picture sub-areas TT7.
[0076] For any image sub-region A, when the image sub-region A is labeled with only one name, the name labeled with the image sub-region A is recorded as the image name of the image sub-region A; when the image sub-region A is not labeled with a name, the image sub-region A is removed from all image sub-regions;
[0077] When the image sub-region A is labeled with multiple names, the multiple names are sequentially recorded as the waiting name 1 to the waiting name R of the image sub-region A; for any waiting name R1 among the waiting names 1 to the waiting name R, a picture sub-region B marked as the waiting name R1 is randomly obtained, and the picture similarity between the picture sub-region A and the picture sub-region B is obtained, which is recorded as the matching similarity of the waiting name R1; the matching similarities of all the waiting names are obtained, and the waiting name with the largest matching similarity is recorded as the picture name of the picture sub-region A;
[0078] In the specific implementation process, in this embodiment, when any one of the standby names 1 to the standby names R of the picture sub-region A only marks the picture sub-region A, the standby name R1 is directly recorded as the picture name of the picture sub-region A; when there are multiple standby names that only mark the picture sub-region A, one of the multiple standby names is randomly recorded as the picture name of the picture sub-region A;
[0079] In a specific implementation process, for example, in a data processing, all the names to be used of the picture sub-region A are flower, tree, sunflower and dandelion, then the picture sub-region B1 marked as flower, the picture sub-region B2 marked as tree, the picture sub-region B3 marked as sunflower and the picture sub-region B4 marked as dandelion are randomly obtained, and through analysis, it is obtained that the similarities between the picture sub-regions B1 to B4 and the picture sub-region A are 36%, 45%, 90% and 50% respectively, then sunflower is recorded as the picture name of the picture sub-region A;
[0080] All image sub-regions containing image names are obtained and recorded as recognizable objects in the training test group M1.
[0081] Obtain all recognizable objects in the training test group and record all recognizable objects as picture object 1 to picture object P in sequence.
[0082] During the specific implementation process, in this embodiment, for any two picture objects P1 and picture object P2 among picture objects 1 to P, it is assumed that picture object P1 and picture object P2 are different. When two identical picture objects appear in the specific analysis, the identical picture objects can be marked separately according to the specific situation before subsequent analysis.
[0083] The parameter analysis module is used to obtain the associated distribution parameters of the image objects based on the test training images and analyze the associated distribution parameters;
[0084] The parameter analysis module is configured with an associated parameter acquisition strategy and an associated parameter analysis strategy. The associated parameter acquisition strategy includes:
[0085] For any one of the test training pictures N1 from test training picture 1 to test training picture N, record the number of picture objects in test training picture N1 as U, and sequentially record them as picture object 1 to picture object U; record the number of types of picture names among all the picture names corresponding to picture object 1 to picture object U as C;
[0086] In the specific implementation process, the number of types of picture names is the number of all distinct picture names. For example, in a data processing, all the picture names corresponding to picture object 1 to picture object U are: flower, flower, dandelion, tree, dandelion, flower, white cloud, grassland, and sunflower. Then the number of types of picture names among all the picture names corresponding to picture object 1 to picture object U is 6;
[0087] For any one of the picture objects U1 from picture object 1 to picture object U, record the picture name of picture object U1 as picture name U1, and record the number of picture objects with picture name U1 among picture object 1 to picture object U as Z;
[0088] Z×C
[0089] Record U as the associated distribution parameter of picture object U1;
[0090] In the specific implementation process, for example, in a data processing, the number of picture objects in test training picture N1 is 30, the number of types of picture names corresponding to all the picture objects' picture names is 6, and the number of picture objects with picture name sunflower in test training picture N1 is 5. Then through calculation, it can be obtained that the associated distribution parameter corresponding to the picture object with picture name sunflower is 1;
[0091] Obtain the associated distribution parameters of all the picture objects in test training picture N1;
[0092] Based on the above analysis method, obtain the associated distribution parameters of all the picture objects in all the test training pictures.
[0093] The associated parameter analysis strategy includes:
[0094] For any one of the picture objects P1 from picture object 1 to picture object P, when picture object P1 has only one associated distribution parameter, record the picture content corresponding to the training and test group where picture object P1 is located as the picture environment of picture object P1;
[0095] When the picture object P1 contains multiple associated distribution parameters, the multiple associated distribution parameters of the picture object P1 are sequentially denoted as the associated distribution parameter P1~1 to the associated distribution parameter P1~G; obtain the picture content corresponding to the test training pictures where the associated distribution parameter P1~1 to the associated distribution parameter P1~G are located, and denote it as the parameter picture content of the associated distribution parameter P1~1 to the associated distribution parameter P1~G;
[0096] In the specific implementation process, when a picture object contains multiple associated distribution parameters, it means that the picture object exists in multiple test training pictures. Therefore, the picture object can reflect multiple picture contents, and each associated distribution parameter of the picture object can correspond to a test training picture and the picture content of the test training picture;
[0097] Obtain the picture environment of all picture objects or the parameter picture content corresponding to all the associated distribution parameters of the picture objects.
[0098] The recognition and update module is used to recognize the picture content based on the picture object and its associated distribution parameters.
[0099] The recognition and update module is configured with a picture content recognition strategy, and the picture content recognition strategy includes:
[0100] Denote the picture to be recognized as the picture to be recognized, use the object stripping method to obtain multiple picture objects in the picture to be recognized, and sequentially denote them as the object to be recognized 1 to the object to be recognized D;
[0101] Obtain the picture names of all objects to be recognized, and obtain the associated distribution parameters of all objects to be recognized based on the picture names of all objects to be recognized, and denote them as the actual distribution parameters;
[0102] For any object to be recognized D1 among the object to be recognized 1 to the object to be recognized D, when the object to be recognized D1 contains only one associated distribution parameter and the associated distribution parameter of the object to be recognized D1 is equal to the actual distribution parameter of the object to be recognized D1, denote the picture environment of the object to be recognized D1 as the content for reference; when the object to be recognized D1 contains only one associated distribution parameter and the associated distribution parameter of the object to be recognized D1 is not equal to the actual distribution parameter of the object to be recognized D1, denote the object to be recognized D1 as a useless object;
[0103] In the specific implementation process, for example, in a data processing, it is obtained that the object to be recognized D1 contains only one associated distribution parameter and the associated distribution parameter is 1, and the actual distribution parameter of the object to be recognized D1 is calculated to be 1, then denote the picture environment of the object to be recognized D1 as the content for reference;
[0104] When the object D1 to be recognized contains multiple associated distribution parameters and any one of the associated distribution parameters A of the object D1 to be recognized is equal to the actual distribution parameter of the object D1 to be recognized, the parameter picture content corresponding to the associated distribution parameter A is recorded as the reference content; when the object D1 to be recognized contains multiple associated distribution parameters and all the associated distribution parameters A of the object D1 to be recognized are not equal to the actual distribution parameter of the object D1 to be recognized, the object D1 to be recognized is recorded as a useless object;
[0105] In a specific implementation process, for example, in a data processing, the associated distribution parameters of the object D1 to be recognized are obtained as 0.2, 0.6, 1.1, 2.2, 2, and 3.1 respectively. By calculation, the actual distribution parameter of the object D1 to be recognized is 0.6. Then, the parameter picture content corresponding to the associated distribution parameter 0.6 of the object D1 to be recognized is recorded as the reference content;
[0106] Obtain the reference content corresponding to all the objects to be recognized that have not been recorded as useless objects, and record them as reference content 1 to reference content S in sequence. When any two or more of the reference content 1 to reference content S are the same, the reference content with the largest quantity among the reference content 1 to reference content S is recorded as the picture content of the picture to be recognized;
[0107] When the reference content 1 to reference content S are all different from each other, the reference content 1 to reference content S are recorded as the picture content of the picture to be recognized;
[0108] In a specific implementation process, for example, in a data processing, the obtained reference content are a garden picture, a greenhouse picture, a garden picture, a garden picture, a greenhouse picture, a shrub picture, and a garden picture respectively. Then, the picture content of the picture to be recognized is recorded as a garden picture;
[0109] When all the objects to be recognized are recorded as useless objects, the picture to be recognized is added to the test training pictures for analysis, and the picture objects and their associated distribution parameters are updated based on the analysis results.
[0110] Embodiment 2, please refer to Figure 2 As shown, in a second aspect, the present invention provides a picture content recognition training method, including: Step S1, obtaining multiple pictures based on big data, recorded as test training pictures; performing grouping processing on the test training pictures based on the content of the test training pictures.
[0111] Step S1 includes the following sub-steps: Step S101, using big data to obtain multiple pictures that have been labeled, and recording them as training test picture 1 to training test picture N in sequence, where the pictures that have been labeled are pictures in which each object has been labeled with its corresponding name;
[0112] Step S102, use AI recognition to obtain the image content of training and test images 1 to training and test images N, and put the training and test images with the same image content into the same training and test group. Denote all the obtained training and test groups as training and test group 1 to training and test group M in sequence.
[0113] Step S2, process the grouped test and training images using the object stripping method, and obtain multiple image objects based on the processing results.
[0114] Step S2 includes the following sub-steps: Step S201, use the object stripping method to analyze and process the images in training and test group 1 to training and test group M, and obtain the recognizable objects of each training and test group;
[0115] The object stripping method includes: Step S2011, for any one training and test group M1 among training and test group 1 to training and test group M, denote the images in training and test group M1 as training and test images M1~1 to training and test images M1~T in sequence;
[0116] Step S2012, for any one training and test image M1~T1 among training and test images M1~1 to training and test images M1~T, perform grayscale processing on training and test image M1~T1, and denote the grayscale processed training and test image M1~T1 as the grayscale test image;
[0117] Step S2013, obtain the grayscale values of all pixel points in the grayscale test image, and adjust the grayscale values of the pixel points with grayscale values greater than or equal to the equal grayscale value to pure white pixel values, and adjust the grayscale values of the pixel points with grayscale values less than the equal grayscale value to pure black pixel values; after adjusting the grayscale values of all pixel points in the grayscale test image, denote all the closed figures surrounded by the pixel points with pure black pixel values as pixel contours 1 to pixel contours K in sequence;
[0118] Step S2014, denote the regions corresponding to pixel contours 1 to pixel contours K in training and test image M1~T1 as image sub-regions 1 to image sub-regions K in sequence;
[0119] Step S2015, obtain all the image sub-regions in training and test images M1~1 to training and test images M1~T, and label the image sub-regions based on the names labeled for each object in each training and test image. The labeling method is: for any object in any training and test image, label the name labeled for the object in all the image sub-regions covered by the object;
[0120] For any picture sub-region A, when the picture sub-region A is labeled with only one name, the labeled name of the picture sub-region A is recorded as the picture name of the picture sub-region A; when the picture sub-region A is not labeled with a name, the picture sub-region A is excluded from all picture sub-regions.
[0121] When the picture sub-region A is labeled with multiple names, the multiple names are successively recorded as standby name 1 to standby name R of the picture sub-region A; for any standby name R1 among standby name 1 to standby name R, a picture sub-region B labeled with the standby name R1 is randomly obtained, and the picture similarity between the picture sub-region A and the picture sub-region B is obtained, which is recorded as the matching similarity of the standby name R1; the matching similarities of all standby names are obtained, and the standby name with the maximum matching similarity is recorded as the picture name of the picture sub-region A.
[0122] All picture sub-regions containing the picture name are obtained and recorded as the recognizable objects of the training and testing group M1.
[0123] Step S202: Obtain all the recognizable objects of the training and testing groups and successively record all the recognizable objects as picture object 1 to picture object P.
[0124] Step S3: Obtain the associated distribution parameters of the picture objects based on the test training pictures and analyze the associated distribution parameters.
[0125] Step S3 includes: Step S301, for any test training picture N1 among test training pictures 1 to test training pictures N, the number of picture objects in the test training picture N1 is recorded as U and successively recorded as picture object 1 to picture object U; the number of types of picture names among all the picture names corresponding to picture object 1 to picture object U is recorded as C.
[0126] For any picture object U1 among picture object 1 to picture object U, the picture name of the picture object U1 is recorded as picture name U1, and the number of picture objects with the picture name U1 among picture object 1 to picture object U is recorded as Z.
[0127] Z×C
[0128] U is recorded as the associated distribution parameter of the picture object U1.
[0129] Obtain the associated distribution parameters of all the picture objects in the test training picture N1.
[0130] Based on the above analysis method, obtain the associated distribution parameters of all the picture objects in all the test training pictures.
[0131] Step S302: For any one of the picture objects 1 to P, namely picture object P1, when picture object P1 has only one associated distribution parameter, record the picture content corresponding to the training and testing group where picture object P1 is located as the picture environment of picture object P1;
[0132] When picture object P1 has multiple associated distribution parameters, record the multiple associated distribution parameters of picture object P1 as associated distribution parameters P1~1 to associated distribution parameter P1~G in sequence; Obtain the picture content corresponding to the test and training pictures where associated distribution parameters P1~1 to associated distribution parameter P1~G are located, and record it as the parameter picture content of associated distribution parameters P1~1 to associated distribution parameter P1~G;
[0133] Obtain the picture environment of all picture objects or the parameter picture content corresponding to all the associated distribution parameters of the picture objects.
[0134] Step S4: Identify the picture content based on the picture object and its associated distribution parameters.
[0135] Step S4 includes: Step S401, record the picture to be identified as the picture to be recognized, and use the object stripping method to obtain multiple picture objects in the picture to be recognized, and record them as to-be-recognized object 1 to to-be-recognized object D in sequence;
[0136] Step S402, obtain the picture names of all to-be-recognized objects, and obtain the associated distribution parameters of all to-be-recognized objects based on the picture names of all to-be-recognized objects, and record them as actual distribution parameters;
[0137] Step S403: For any one of the to-be-recognized objects 1 to to-be-recognized object D, namely to-be-recognized object D1, when to-be-recognized object D1 has only one associated distribution parameter and the associated distribution parameter of to-be-recognized object D1 is equal to the actual distribution parameter of to-be-recognized object D1, record the picture environment of to-be-recognized object D1 as the reference content; When to-be-recognized object D1 has only one associated distribution parameter and the associated distribution parameter of to-be-recognized object D1 is not equal to the actual distribution parameter of to-be-recognized object D1, record to-be-recognized object D1 as a useless object;
[0138] Step S404: When to-be-recognized object D1 has multiple associated distribution parameters and any one of the associated distribution parameters A of to-be-recognized object D1 is equal to the actual distribution parameter of to-be-recognized object D1, record the parameter picture content corresponding to associated distribution parameter A as the reference content; When to-be-recognized object D1 has multiple associated distribution parameters and all the associated distribution parameters A of to-be-recognized object D1 are not equal to the actual distribution parameter of to-be-recognized object D1, record to-be-recognized object D1 as a useless object;
[0139] Step S405: Obtain the reference content corresponding to all the objects to be recognized that are not marked as useless objects, and sequentially denote them as reference content 1 to reference content S. When any two or more of the reference content 1 to reference content S are the same, denote the reference content with the largest quantity among the reference content 1 to reference content S as the picture content of the picture to be recognized.
[0140] Step S406: When all of the reference content 1 to reference content S are mutually different, denote the reference content 1 to reference content S as the picture content of the picture to be recognized.
[0141] Step S407: When all the objects to be recognized are marked as useless objects, add the picture to be recognized to the test training pictures for analysis, and update the picture objects and their associated distribution parameters based on the analysis results.
[0142] Embodiment 3, Third aspect, please refer to Figure 4 As shown, the present application provides an electronic device, including a processor 501 and a memory 502. The memory 502 stores computer-readable instructions. When the computer-readable instructions are executed by the processor 501, the steps in the above method are run. Through the above technical solution, the processor 501 and the memory 502 are interconnected and communicate with each other through a communication bus and / or other forms of connection mechanisms (not marked). The memory 502 stores a computer program executable by the processor 501. When the electronic device runs, the processor 501 executes the computer program to execute the method in any optional implementation manner of the above embodiments to achieve the following functions: First, based on big data test training pictures; perform grouping processing on the test training pictures based on the content of the test training pictures; process the grouped test training pictures using the object stripping method, and obtain multiple picture objects based on the processing results. Then, obtain the associated distribution parameters of the picture objects based on the test training pictures, and analyze the associated distribution parameters. Finally, recognize the picture content based on the picture objects and their associated distribution parameters.
[0143] Embodiment 4, Fourth aspect, the present application provides a storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above method are run. Through the above technical solution, when the computer program is executed by the processor, the method in any optional implementation manner of the above embodiments is executed to achieve the following functions: First, based on big data test training pictures; perform grouping processing on the test training pictures based on the content of the test training pictures; process the grouped test training pictures using the object stripping method, and obtain multiple picture objects based on the processing results. Then, obtain the associated distribution parameters of the picture objects based on the test training pictures, and analyze the associated distribution parameters. Finally, recognize the picture content based on the picture objects and their associated distribution parameters.
[0144] In the above embodiments of the present application, the descriptions of the various embodiments each have their own focuses. For parts not detailed in a certain embodiment, reference may be made to the relevant descriptions of other embodiments.
[0145] Those skilled in the art should understand that the embodiments of the present invention can be provided as a method, a system, or a computer program product. Therefore, the present invention can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention can take the form of a computer program product implemented on one or more computer-usable storage media that contain computer-usable program code. Among them, the storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (Static Random Access Memory, abbreviated as SRAM), electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, abbreviated as EEPROM), erasable programmable read-only memory (Erasable Programmable Read Only Memory, abbreviated as EPROM), programmable read-only memory (Programmable Read-Only Memory, abbreviated as PROM), read-only memory (Read-Only Memory, abbreviated as ROM), magnetic memory, flash memory, a magnetic disk, or an optical disc. These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured article including an instruction device, and the instruction device implements the functions specified in one process Figure 1 one process or multiple processes and / or blocks Figure 1 specified in a block or multiple blocks.
[0146] In the embodiments provided in the present application, it should be understood that the disclosed device and method can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of the units is only a logical function division, and there can be other division methods in actual implementation. For another example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection between each other can be through some communication interfaces. The indirect coupling or communication connection of the device or unit can be in an electrical, mechanical or other form.
Claims
1. A method for training image content recognition, characterized in that: include: Based on big data, multiple pictures are obtained and recorded as test training pictures; Grouping the test training images based on their contents; The grouped test training images are processed using an object stripping method, and multiple image objects are obtained based on the processing results; Obtaining the associated distribution parameters of the image objects based on the test training images, and analyzing the associated distribution parameters; Identify the image content based on the image objects and their associated distribution parameters; Based on big data, multiple pictures are obtained and recorded as test training pictures; The grouping process of the test training images based on the content of the test training images includes: Use big data to obtain multiple annotated pictures, and record them as training test picture 1 to training test picture N in sequence, where the annotated pictures are pictures in which each object is annotated with its corresponding name; Use AI recognition to obtain the image contents of training test images 1 to training test images N, and put the training test images with the same image contents into the same training test group, and record all the obtained training test groups as training test group 1 to training test group M in sequence; The grouped test training images are processed using the object stripping method, and multiple image objects are obtained based on the processing results, including: Use the object stripping method to analyze and process the images in the training test group 1 to the training test group M, and obtain the identifiable objects in each training test group; Obtain all recognizable objects in the training test group and record all recognizable objects as picture object 1 to picture object P in sequence; Object stripping methods include: For any training test group M1 from the training test group 1 to the training test group M, the pictures in the training test group M1 are recorded as training test pictures M1-1 to training test pictures M1-T in sequence; For any one of the training test pictures M1-1 to the training test pictures M1-T1, grayscale the training test pictures M1-T1, and record the grayscaled training test pictures M1-T1 as grayscale test pictures; Obtain the grayscale values of all pixels in the grayscale test image, and adjust the grayscale values of pixels whose grayscale values are greater than or equal to the average grayscale value to pure white pixel values, and adjust the grayscale values of pixels whose grayscale values are less than the average grayscale value to pure black pixel values; after the grayscale values of all pixels in the grayscale test image are adjusted, all closed figures surrounded by pixels whose grayscale values are pure black pixel values are recorded as pixel contours 1 to pixel contours K in sequence; The regions corresponding to pixel contour 1 to pixel contour K in the training test images M1 to T1 are recorded as image sub-region 1 to image sub-region K in sequence; Obtain all the image sub-regions in the training test images M1-1 to M1-T, and annotate the image sub-regions based on the names of the objects annotated in each training test image, wherein the annotating method is: for any object in any training test image, annotate the annotated name of the object in all the image sub-regions covered by the object; For any image sub-region A, when the image sub-region A is labeled with only one name, the name labeled with the image sub-region A is recorded as the image name of the image sub-region A; when the image sub-region A is not labeled with a name, the image sub-region A is removed from all image sub-regions; When the image sub-region A is labeled with multiple names, the multiple names are sequentially recorded as the waiting name 1 to the waiting name R of the image sub-region A; for any waiting name R1 among the waiting names 1 to the waiting name R, a picture sub-region B marked as the waiting name R1 is randomly obtained, and the picture similarity between the picture sub-region A and the picture sub-region B is obtained, which is recorded as the matching similarity of the waiting name R1; the matching similarities of all the waiting names are obtained, and the waiting name with the largest matching similarity is recorded as the picture name of the picture sub-region A; All image sub-regions containing image names are obtained and recorded as recognizable objects in the training test group M1.
2. A method for training image content recognition according to claim 1, characterized in that: Based on the test training images, the associated distribution parameters of the image objects are obtained, and the associated distribution parameters are analyzed, including: For any test training picture N1 from the test training pictures 1 to the test training pictures N, the number of picture objects in the test training picture N1 is recorded as U, and they are recorded as picture object 1 to picture object U in sequence; the number of types of picture names in all picture names corresponding to picture object 1 to picture object U is recorded as C; For any picture object U1 from picture object 1 to picture object U, the picture name of picture object U1 is recorded as picture name U1, and the number of picture objects from picture object 1 to picture object U whose picture name is picture name U1 is recorded as Z; Will Denoted as the associated distribution parameter of the image object U1; Get the associated distribution parameters of all image objects in the test training image N1; Based on the above method, the associated distribution parameters of all image objects in all test training images are obtained.
3. A method for training image content recognition according to claim 2, characterized in that: Acquiring the associated distribution parameters of the image objects based on the test training images and analyzing the associated distribution parameters also include: For any image object P1 from image object 1 to image object P, when image object P1 contains only one associated distribution parameter, the image content corresponding to the training test group where image object P1 is located is recorded as the image environment of image object P1; When the image object P1 contains multiple associated distribution parameters, the multiple associated distribution parameters of the image object P1 are recorded in sequence as associated distribution parameters P1~1 to associated distribution parameters P1~G; the image content corresponding to the test training image where the associated distribution parameters P1~1 to associated distribution parameters P1~G are located is obtained, and recorded as the parameter image content of the associated distribution parameters P1~1 to associated distribution parameters P1~G; Gets the parameter image content corresponding to the image environment of all image objects or all associated distribution parameters of the image objects.
4. The image content recognition training method according to claim 3, characterized in that: Identifying image content based on image objects and their associated distribution parameters includes: The image to be identified is recorded as the image to be identified, and the object stripping method is used to obtain multiple image objects in the image to be identified, and they are recorded as the object to be identified 1 to the object to be identified D in sequence; Obtain the image names of all objects to be identified, and based on the image names of all objects to be identified, obtain the associated distribution parameters of all objects to be identified, which are recorded as actual distribution parameters; For any object D1 to be identified from the objects 1 to D to be identified, when the object D1 to be identified has only one associated distribution parameter and the associated distribution parameter of the object D1 to be identified is equal to the actual distribution parameter of the object D1 to be identified, the image environment of the object D1 to be identified is recorded as a reference content; when the object D1 to be identified has only one associated distribution parameter and the associated distribution parameter of the object D1 to be identified is not equal to the actual distribution parameter of the object D1 to be identified, the object D1 to be identified is recorded as a useless object; When the object D1 to be identified contains multiple associated distribution parameters and any associated distribution parameter A of the object D1 to be identified is equal to the actual distribution parameter of the object D1 to be identified, the parameter image content corresponding to the associated distribution parameter A is recorded as the reference content; when the object D1 to be identified contains multiple associated distribution parameters and all associated distribution parameters A of the object D1 to be identified are not equal to the actual distribution parameter of the object D1 to be identified, the object D1 to be identified is recorded as a useless object; Obtain all reference contents corresponding to the objects to be identified that are not recorded as useless objects, and record them as reference contents 1 to reference contents S in sequence. When any two or more reference contents among reference contents 1 to reference contents S are the same, record the reference contents with the largest number among reference contents 1 to reference contents S as the image contents of the image to be identified; When the reference contents 1 to S are all different from each other, the reference contents 1 to S are recorded as the image contents of the image to be identified; When all the objects to be identified are recorded as useless objects, the images to be identified are added to the test training images for analysis, and the image objects and their associated distribution parameters are updated based on the analysis results.
5. A picture content recognition training system, applicable to a picture content recognition training method according to any one of claims 1 to 4, characterized in that: It includes a picture grouping module, a picture object extraction module, a parameter analysis module and a recognition update module; The picture grouping module is used to obtain multiple pictures based on big data, which are recorded as test training pictures; Grouping the test training images based on their contents; The image object extraction module is used to process the grouped test training images using an object stripping method, and obtain multiple image objects based on the processing results; The parameter analysis module is used to obtain the associated distribution parameters of the image objects based on the test training images and analyze the associated distribution parameters; The recognition update module is used to identify the image content based on the image objects and their associated distribution parameters.
6. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores computer-readable instructions. When the computer-readable instructions are executed by the processor, the steps in the method according to any one of claims 1 to 4 are executed.
7. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are executed.
Citation Information
Patent Citations
Image content identification method and device
CN105446997A
Facial recognition method and device applicable to psychology
CN107169427A