Image recognition system and method based on gray level co-occurrence matrix and neural network
Through an image recognition system based on grayscale symbiosis matrix and neural network, the texture features of the image are extracted and classified and recognized, and the problems of limited recognition capabilities and sensitivity to environmental factors in the prior art are solved, and the image recognition effect with high accuracy and robustness is achieved.
Patent Information
- Application Number
- CN202311298632.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-09
- Publication Date
- 2025-04-11
AI Technical Summary
The existing image recognition technology has limited recognition capabilities, cannot effectively recognize complex images, and lacks the function of autonomous improvement, and has problems such as low recognition accuracy and sensitivity to factors such as lighting and angle.
The image recognition system based on grayscale symbiosis matrix and neural network is adopted to collect images through the image acquisition module, the grayscale symbiosis matrix module extracts the texture characteristics of the image, the neural network module performs classification and recognition, and the control module controls the operation of the entire system.
It realizes fast and accurate identification of target objects in complex environments, improves recognition rate and robustness, and can adaptively adjust model parameters to improve recognition accuracy.
Smart Images

Figure CN119810611A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of image recognition, and in particular relates to an image recognition system and method based on gray-level co-occurrence matrix and neural network. Background Art
[0002] Image recognition is an important part of the field of computer vision and artificial intelligence. Its ultimate goal is to enable computers to analyze and understand image content. Image recognition is a comprehensive problem that covers technologies such as image matching, image classification, image retrieval, face detection, pedestrian detection, etc., and has broad application value in the fields of Internet search engines, autonomous driving, medical analysis, remote sensing analysis, etc. The existing image recognition technology has limited recognition capabilities and can only recognize simple graphics. It also lacks the ability to improve itself through training. It has problems such as low recognition accuracy and sensitivity to factors such as lighting and angle. Summary of the invention
[0003] In order to solve the above-mentioned problems, the present invention proposes: an image recognition system based on grayscale co-occurrence matrix and neural network, including an image acquisition module for acquiring an image to be recognized and converting it into a digital signal, a grayscale co-occurrence matrix module for extracting texture features of the image, a neural network module for classifying and recognizing the image, and a control module for controlling the operation of the entire image recognition system, wherein the image acquisition module, the grayscale co-occurrence matrix module, and the neural network module are all connected to the control module.
[0004] Furthermore, the image acquisition module uses a camera or other image acquisition equipment arranged at the well site to acquire the on-site image to be identified and convert it into a digital signal.
[0005] An image recognition method based on gray level co-occurrence matrix and neural network comprises the following steps:
[0006] S1, the image acquisition module acquires the image to be recognized and converts it into a digital signal;
[0007] S2, gray level co-occurrence matrix module extracts the texture features of the image. The image is divided into several pixel blocks, and then the gray level co-occurrence matrix between each pixel block and its surrounding pixel blocks is calculated. The texture features of the image are extracted through the gray level co-occurrence matrix, thus providing a basis for subsequent image recognition;
[0008] S3, the neural network module classifies and recognizes the image, uses the texture features extracted by the gray-level co-occurrence matrix as input, and realizes the classification and recognition of images of different categories by training the neural network model. The neural network module is adjusted according to actual needs to improve the recognition rate and robustness;
[0009] S4. Output the recognition result, which is processed and controlled by the control module. The control module controls the operation of the entire image recognition device, including image acquisition, gray-level co-occurrence matrix calculation, neural network training and recognition operations.
[0010] Furthermore, the co-occurrence matrix of the gray-level co-occurrence matrix module is defined by the joint probability density of pixels at two positions, considering the second-order statistics and studying the pixel pairs with spatial relationship:
[0011] P(i,jld,0)
[0012] It means that when the spatial distance d and direction θ are given, the probability of gray level j appearing with gray level i as the starting point. The frequency is normalized, that is, divided by the sum of all frequencies, which constitutes the elements of the gray level co-occurrence matrix.
[0013] Furthermore, the spatial relationship of the gray-level co-occurrence matrix module is defined as follows:
[0014] Assume that the spatial position relationship of a pair of pixels is expressed as δ = (a, b), different values of (a, b) have different values in the gray-level co-occurrence matrix, and the values of a and b are selected according to the characteristics of the texture periodic distribution.
[0015] Furthermore, the gray level co-occurrence matrix generation process is as follows:
[0016] Any point (x, y) in the image and a point (x+a, y+b) deviating from it constitute a point pair. Let the gray value of the point pair be (f1, f2). Assuming the maximum gray level of the image is L, there are L*L combinations of f1 and f2.
[0017] For the entire image, count the number of times each (f1, f2) value appears, and then arrange it into a square matrix;
[0018] Then the total number of occurrences of (f1, f2) is normalized to obtain the probability P(f1, f2), and the resulting matrix is the gray-level co-occurrence matrix.
[0019] Furthermore, some statistics are constructed as texture classification features based on the gray-level co-occurrence matrix, and some parameters reflecting the matrix status are derived from the co-occurrence matrix. The statistics include angular second moment ASM, contrast, correlation and information entropy ENT.
[0020] Furthermore, the calculation formula of the angular second-order moment ASM is:
[0021]
[0022] The formula for calculating contrast is:
[0023]
[0024] The formula for calculating the correlation is:
[0025]
[0026] The calculation formula of information entropy EN is:
[0027]
[0028] The beneficial effects of the present invention are as follows: the present invention can quickly and accurately identify the target object in a complex environment, extract the texture features of the image through the grayscale co-occurrence matrix, and then train and identify through a neural network, thereby achieving rapid and accurate recognition of the target object.
[0029] 1. Improve recognition rate: Traditional image recognition technology has the problem of low recognition rate. The present invention uses a combination of gray-level co-occurrence matrix and neural network to effectively improve the accuracy of image recognition, thereby more accurately identifying images of different categories.
[0030] 2. Improve robustness: It can effectively improve the robustness of image recognition, that is, it can still accurately identify images of different categories under different lighting, angles, scales, etc.
[0031] 3. Fast recognition: It can quickly recognize images, thereby improving the efficiency of image recognition.
[0032] 4. Wide application: The image recognition device of the present invention can be used in the fields of face recognition, fire recognition, leakage recognition, crude oil leakage recognition, license plate recognition, work clothes wearing condition detection, object recognition, etc., and has high practical value and economic benefits. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 It is a system module diagram of the present invention;
[0034] Figure 2 is a probabilistic neural network structure diagram of the present invention;
[0035] Figure 3 A diagram of the training and identification subroutines of the program of the present invention;
[0036] Figure 4 Part of the gray level co-occurrence matrix parameter map selected for the present invention;
[0037] Figure 5 It is the gray level co-occurrence matrix axis diagram of the present invention;
[0038] Figure 6 The co-occurrence matrix axis of the present invention Figure 1 ; (Figure a is the gray value distribution diagram of the texture image, and Figure b is the 4th order square matrix diagram after gray level compression);
[0039] Figure 7 The co-occurrence matrix axis of the present invention Figure 2 ;
[0040] Figure 8 This is a program diagram of the neural network module for texture images of the present invention. DETAILED DESCRIPTION
[0041] In order to make the technical means adopted by the present invention and the purpose achieved easy to understand, the present invention is further explained in combination with a specific implementation method below. An image recognition system based on a grayscale co-occurrence matrix and a neural network includes an image acquisition module for acquiring an image to be recognized and converting it into a digital signal, a grayscale co-occurrence matrix module for extracting texture features of the image, a neural network module for classifying and recognizing the image, and a control module for controlling the operation of the entire image recognition system. The image acquisition module, the grayscale co-occurrence matrix module, and the neural network module are all connected to the control module.
[0042] An image recognition method based on gray level co-occurrence matrix and neural network comprises the following steps:
[0043] S1, the image acquisition module acquires the image to be recognized and converts it into a digital signal;
[0044] S2, gray level co-occurrence matrix module extracts the texture features of the image. The image is divided into several pixel blocks, and then the gray level co-occurrence matrix between each pixel block and its surrounding pixel blocks is calculated. The texture features of the image are extracted through the gray level co-occurrence matrix, thus providing a basis for subsequent image recognition;
[0045] S3, the neural network module classifies and recognizes the image, uses the texture features extracted by the gray-level co-occurrence matrix as input, and realizes the classification and recognition of images of different categories by training the neural network model. The neural network module is adjusted according to actual needs to improve the recognition rate and robustness;
[0046] S4. Output the recognition result, which is processed and controlled by the control module. The control module controls the operation of the entire image recognition device, including image acquisition, gray-level co-occurrence matrix calculation, neural network training and recognition operations.
[0047] Image acquisition module: Use the camera or other image acquisition equipment arranged at the well site to collect the on-site images to be identified and convert them into digital signals.
[0048] Gray-level co-occurrence matrix module: Divide the collected image into several pixel blocks, and then calculate the gray-level co-occurrence matrix between each pixel block and its surrounding pixel blocks. Through the gray-level co-occurrence matrix, the texture features of the image can be extracted, thus providing a basis for subsequent image recognition.
[0049] The co-occurrence matrix is defined by the joint probability density of pixels at two locations. It not only reflects the distribution characteristics of brightness, but also reflects the position distribution characteristics between pixels with the same or close brightness. It is a second-order statistical feature of image brightness changes. It is the basis for defining a set of texture features.
[0050] Consider second-order statistics to study pairs of pixels that have spatial relationships:
[0051] P(i,jld,0)
[0052] It means the probability of gray level j (column) appearing with gray level i as the starting point (row) when the spatial distance d and direction θ are given (the frequency is normalized, that is, divided by the sum of all frequencies). It constitutes the elements of the gray level co-occurrence matrix.
[0053] Define spatial relationships:
[0054] Assume that the spatial position relationship of a pair of pixels is expressed as δ = (a, b), and the values of (a, b) are different, and the values in the gray-level co-occurrence matrix are different.
[0055] The values of a and b should be selected according to the characteristics of the texture periodic distribution. For finer textures, it is necessary to choose values such as (1,0), (1,1), (2,0), etc.
[0056] Smaller values of a and b correspond to slowly changing texture images, and the values on the diagonal of their gray-level co-occurrence matrix are larger.
[0057] The faster the texture changes, the smaller the values on the diagonal line, while the values on both sides of the diagonal line increase.
[0058] Gray Level Co-occurrence Matrix will take the image (represented as a matrix).
[0059] Define angles (["0", "45", "90", "135"]) and integer distances d ([1,2,8,16] __ '1' is optimal).
[0060] The axes of the gray-level co-occurrence matrix are defined by the gray levels present in the image.
[0061] Each pixel of the image is scanned and stored as a "reference pixel". The reference pixel is then compared to a pixel that is a distance d away, which is an angle θ (where "0" degrees is the pixel to the right and "90" is the pixel above).
[0062] The pixels far from the reference pixel are called neighboring pixels. Each time a reference value and a neighbor value pair is found, the corresponding row and column of the gray level co-occurrence matrix is incremented by 1. Figure 5 As shown,
[0063] (a,b) = (1,0), the pixel pair is horizontal, i.e., 0 degree scanning;
[0064] (a,b) = (0,1), the pixel pair is vertical, i.e., 90-degree scanning;
[0065] (a,b) = (1,1), the pixel pair is right diagonal, i.e. 45 degree scanning;
[0066] (a,b)=(-1,1), the pixel pair is the left diagonal, that is, 135 degrees scanning.
[0067] The gray level co-occurrence matrix generation process is as follows:
[0068] Any point (x, y) in the image and a point (x+a, y+b) that deviates from it form a point pair. Let the grayscale value of the point pair be (f1, f2). Assuming the maximum grayscale of the image is L, there are L*L combinations of f1 and f2.
[0069] For the entire image, count the number of times each (f1, f2) value appears, and then arrange them into a square matrix.
[0070] Then the total number of occurrences of (f1, f2) is normalized to obtain the probability P(f1, f2), and the resulting matrix is the gray-level co-occurrence matrix.
[0071] Suppose now there is a texture image with the following grayscale value distribution:
[0072] like Figure 6 As shown, Figure a is the original image, and the maximum grayscale level is 16. Here the grayscale levels are compressed to 4, and the grayscale co-occurrence matrix is a 4-order square matrix (the order of the grayscale co-occurrence matrix is equal to the number of grayscale levels). Figure a becomes the form of Figure b.
[0073] In this way, the value range of (f1, f2) is [0, 3]. By taking different position relationships and arranging the number of times various combinations of (f1, f2) appear, we can obtain the gray-level co-occurrence matrix shown in Figure cd.
[0074] Figure c shows that when (x, y) in Figure b forms a point pair with (x+1, y+0) deviating from it, there are 10 possible values of (f1, f2) = (0, 1) (the filled part in Figure b).
[0075] Similarly, Figure d shows the situation where the point pair (f1, f2) formed by (x, y) in Figure b appears at the point (x+1, y+1) respectively.
[0076] It can be seen that the gray-level co-occurrence matrix is actually the joint histogram of two pixels. For fine and regular textures in the image, the two-dimensional histogram of paired pixels tends to be evenly distributed; for coarse and regular textures, it tends to be most diagonally distributed.
[0077] Common features of gray-level co-occurrence matrix
[0078] Since the dimension of gray-level co-occurrence matrix is large, it is generally not directly used as a feature to distinguish textures. Instead, some statistics constructed based on it are used as texture classification features.
[0079] In order to describe the texture status more intuitively with the co-occurrence matrix, some parameters reflecting the matrix status are derived from the co-occurrence matrix. The typical ones are as follows:
[0080] Angular second moment (ASM): also called energy, is a measure of the uniformity of image grayscale distribution and texture coarseness.
[0081] If the values of the elements of the gray-level co-occurrence matrix are similar, the energy is small, indicating a fine texture; if some of the values are large and others are small, the energy value is large. A large energy value indicates a more uniform and regularly changing texture pattern.
[0082]
[0083] Contrast: Also called moment of inertia, it measures the local changes in an image. Contrast reflects the clarity of an image and the depth of the texture. The clearer the texture, the greater the contrast.
[0084]
[0085] Correlation: It is used to measure the similarity of the grayscale of an image in the row or column direction. Therefore, the value reflects the local grayscale correlation. The larger the value, the greater the correlation.
[0086]
[0087] Information entropy (ENT): It indicates the degree of non-uniformity or complexity of the texture in the image.
[0088] When all values in the co-occurrence matrix are equal or the pixel values show the greatest randomness, the entropy is the largest; therefore, the entropy value indicates the complexity of the grayscale distribution of the image. The larger the entropy value, the more complex the image.
[0089]
[0090] Neural network module: Using the texture features extracted from the gray-level co-occurrence matrix as input, the neural network model is trained to achieve classification and recognition of different scenes. The neural network module can be adjusted according to actual needs to improve the recognition rate and robustness.
[0091] Control module: controls the operation of the entire image recognition device, including image acquisition, gray-level co-occurrence matrix calculation, neural network training and recognition, etc.
[0092] By taking pictures of work clothes, work shoes, safety helmets, and oil stains, the color images are converted into grayscale images, and then their grayscale co-occurrence matrices are extracted. Some feature data are shown in Table 2. In the experiment, four typical substances were imaged, and each type of image had 2000 samples, of which 1500 samples were selected as learning samples and the remaining 500 samples were used as test samples. The probabilistic neural network method introduced above was used for recognition. The recognition cycle was short, and the recognition accuracy rate could reach 99.8% (accuracy rate = correct retrieval results / (correct retrieval results + false detection images)), achieving good classification results.
[0093] Table 2 Image surface texture feature parameters
[0094] Image Type Angular second-order matrix Information Entropy Contrast Relevance Work clothes 0.2837 1.6625 0.1748 1.4033 Work shoes 0.1458 2.6241 0.2428 0.0956 helmet 0.0904 2.9226 0.4514 0.0989 Oil pollution 0.7333 0.6762 0.0193 1.4839
[0095] In practical applications, we can install the image recognition device in places such as well sites and joint stations for intelligent identification. When a person enters or leaves, the device will automatically collect image information and identify whether they are personnel of the unit and whether they are wearing work clothes correctly. It can control whether the access control is opened or record violation information. The image recognition device can also collect on-site pictures to identify the type of accident and issue corresponding alarms when fire, leakage or sparks occur. The image recognition device can be adjusted and optimized according to actual needs to improve the recognition rate and robustness, and is suitable for different occasions and applications.
[0096] The present invention has the following advantages:
[0097] 1. The present invention can perform accurate recognition in complex environments, thereby improving the accuracy and robustness of image recognition.
[0098] 2. The present invention extracts texture features of images through gray-level co-occurrence matrix, and can better identify target objects with texture features.
[0099] 3. The present invention uses neural network for training and recognition, and can adaptively adjust model parameters, thereby improving the accuracy and robustness of recognition.
[0100] Therefore, image recognition based on gray-level co-occurrence matrix and neural network has broad application prospects. It can be applied to face recognition, intelligent security, autonomous driving, object recognition and other fields, and has important economic and social value.
[0101] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can make equivalent replacements or changes according to the technical solutions and concepts of the present invention within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.
Claims
1. An image recognition system based on gray-level co-occurrence matrix and neural network, characterized in that: It includes an image acquisition module for acquiring images to be recognized and converting them into digital signals, a grayscale co-occurrence matrix module for extracting texture features of images, a neural network module for classifying and recognizing images, and a control module for controlling the operation of the entire image recognition system. The image acquisition module, the grayscale co-occurrence matrix module, and the neural network module are all connected to the control module.
2. The image recognition system based on gray level co-occurrence matrix and neural network as claimed in claim 1, characterized in that: The image acquisition module uses a camera or other image acquisition equipment arranged at the well site to acquire the on-site image to be identified and convert it into a digital signal.
3. An image recognition method based on gray level co-occurrence matrix and neural network, characterized in that: The steps include: S1, the image acquisition module acquires the image to be recognized and converts it into a digital signal; S2, gray level co-occurrence matrix module extracts the texture features of the image. The image is divided into several pixel blocks, and then the gray level co-occurrence matrix between each pixel block and its surrounding pixel blocks is calculated. The texture features of the image are extracted through the gray level co-occurrence matrix, thus providing a basis for subsequent image recognition; S3, the neural network module classifies and recognizes the image, uses the texture features extracted by the gray-level co-occurrence matrix as input, and realizes the classification and recognition of images of different categories by training the neural network model. The neural network module is adjusted according to actual needs to improve the recognition rate and robustness; S4. Output the recognition result, which is processed and controlled by the control module. The control module controls the operation of the entire image recognition device, including image acquisition, gray-level co-occurrence matrix calculation, neural network training and recognition operations.
4. The image recognition method based on gray level co-occurrence matrix and neural network as claimed in claim 3, characterized in that: The co-occurrence matrix of the gray-level co-occurrence matrix module is defined by the joint probability density of pixels at two locations, considering the second-order statistics and studying the pixel pairs with spatial relationships: P(i, j|d, θ) It means that when the spatial distance d and direction θ are given, the probability of gray level j appearing with gray level i as the starting point. The frequency is normalized, that is, divided by the sum of all frequencies, which constitutes the elements of the gray level co-occurrence matrix.
5. The image recognition method based on gray level co-occurrence matrix and neural network as claimed in claim 4, characterized in that: The spatial relationship of the gray-level co-occurrence matrix module is defined as follows: Assume that the spatial position relationship of a pair of pixels is expressed as δ = (a, b), different values of (a, b) have different values in the gray-level co-occurrence matrix, and the values of a and b are selected according to the characteristics of the texture periodic distribution.
6. The image recognition method based on gray level co-occurrence matrix and neural network as claimed in claim 5, characterized in that: The gray level co-occurrence matrix generation process is as follows: Any point (x, y) in the image and a point (x+a, y+b) deviating from it constitute a point pair. Let the gray value of the point pair be (f1, f2). Assuming the maximum gray level of the image is L, there are L*L combinations of f1 and f2. For the entire image, count the number of times each (f1, f2) value appears, and then arrange it into a square matrix; Then the total number of occurrences of (f1, f2) is normalized to obtain the probability P(f1, f2), and the resulting matrix is the gray-level co-occurrence matrix.
7. The image recognition method based on gray level co-occurrence matrix and neural network as claimed in claim 6, characterized in that: Based on the gray-level co-occurrence matrix, some statistics are constructed as texture classification features, and some parameters reflecting the matrix status are derived from the co-occurrence matrix. The statistics include angular second moment ASM, contrast, correlation and information entropy ENT.
8. The image recognition method based on gray level co-occurrence matrix and neural network as claimed in claim 7, characterized in that: The calculation formula of the angular second-order moment ASM is: The formula for calculating contrast is: The formula for calculating the correlation is: The calculation formula of information entropy EN is: