A YOLOv7-based image risk classification method and apparatus
By improving the feature extraction and classification structure of the YOLOv7 algorithm, the YOLO-GFCN model was constructed, which solved the problem of comprehensive detection of digital content image risks and achieved fast and accurate image risk classification.
Patent Information
- Application Number
- CN202310717110.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-15
- Publication Date
- 2025-11-14
- Estimated Expiration
- 2043-06-15
AI Technical Summary
Existing technologies lack comprehensive detection methods for digital content images, especially new types of digital content such as blockchain digital artworks. Traditional algorithms cannot effectively detect these risks, and they consume a lot of computing resources and have long training and detection times.
An improved YOLOv7 algorithm is adopted, the feature extraction module is improved through the I-ELAN structure, the pooling operation is improved through the SPPFCSPC structure, and the GAP-FCN classification structure is combined to construct the YOLO-GFCN model for image risk classification.
It achieves comprehensive detection of digital content images with multiple risk types, reduces network training parameters, lowers computational resource consumption, and improves detection speed and accuracy.
Smart Images

Figure CN116797830B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the technical field of computer image risk classification, and particularly relates to an image risk classification method and apparatus based on YOLOv7. Background Technology
[0002] With the increasing prevalence of digital media, the quantity and impact of digital images are also growing, which raises the issue of digital image risks. These digital images may contain pornographic or violent / terrorist risks, negatively impacting society. Therefore, risk classification of digital content images is crucial. Currently, considerable research has been conducted both domestically and internationally on various digital content risks. Using deep learning image classification technology for risk detection is a recognized effective method. For example, patent CN202010133407.7 uses a convolutional neural network (CNN) for image risk detection. Patents CN202010073871.1 and CN202010859695.4 also utilize deep learning image classification technology for various risk detections. However, these technologies still generally suffer from the following problems:
[0003] (1) There is a lack of comprehensive detection methods for digital content image risks. Current technologies are mainly designed for vertical fields. For some new types of digital content, such as blockchain digital artworks, there are many types of risks, and traditional technologies cannot establish effective risk detection for them.
[0004] (2) The classification algorithm usually adopts a traditional simple algorithm, which is insufficient in the extraction and fusion of image features. It can only cope with single and simple image environments and cannot cope with complex types of images.
[0005] (3) Although some existing algorithms have high network depth and complex models, they have many training parameters, consume a lot of computing resources, have high hardware requirements, and require a long training and detection time, resulting in low cost-effectiveness.
[0006] Therefore, there is an urgent need to design an image risk classification algorithm that can accurately, quickly, and cope with complex digital image environments. Summary of the Invention
[0007] The purpose of this application is to provide a method, apparatus, and electronic device to solve the technical problems of numerous model training parameters, large computational resources, and long training and testing times in related technologies.
[0008] According to a first aspect of the embodiments of this application, an image risk classification method based on YOLOv7 is provided, comprising the following steps:
[0009] (1) Obtain the image dataset, label the data with risk tags, and divide it into training set, validation set and test set;
[0010] (2) Train the model using the training set and validation set. First, input the image to be obtained into the network model.
[0011] (3) The backbone network in the model performs feature extraction and feature fusion on each image to obtain image feature maps with different perceptions;
[0012] (4) The head network in the model performs further feature fusion on the different receptive field feature maps obtained from the backbone network, and uses the new GAP-FCN classification structure to obtain the classification result.
[0013] (5) The model uses the obtained classification results and preset labels to calculate the loss degree, and updates the network weights in reverse. Through continuous training with multiple batches of samples, the model can acquire the ability to classify image risks and obtain the trained model.
[0014] (6) Input the test set image or the image to be predicted into the trained model, and repeat steps (2) and (3) to obtain the classification result.
[0015] Furthermore, step (1) specifically includes the following sub-steps:
[0016] (1.1) Data Acquisition: Acquire digital content images from the internet and retrieve risky digital content through retrieval;
[0017] (1.2) Dataset construction: The risky digital content was classified by manual preliminary risk assessment, and a digital content dataset with multiple risk types was constructed, including three labels: pornography risk, violent terrorism risk and normal. The training set, validation set and test set were randomly divided in a ratio of 7:1.5:1.5.
[0018] (1.3) Data augmentation of the dataset: Data augmentation techniques are used to expand the dataset and increase the number of training samples;
[0019] (1.4) The network model is divided into a backbone network and a head network. The backbone network is mainly responsible for feature extraction, and the head network is responsible for further feature fusion and classification. For the feature extraction part in the backbone network, the feature extraction module E-ELAN in the YOLOv7 algorithm is improved, that is, feature extraction is performed using the improved I-ELAN structure.
[0020] (1.5) In the feature extraction process of the backbone network, the feature extraction pooling structure in the improved YOLOv7 algorithm is used to complete the pooling operation: the improvement is to use a convolutional layer with a stride of (2,2) to perform the pooling operation, and to use convolutional pooling to replace the original pooling structure.
[0021] (1.6) At the junction of the backbone network and the head network, the original SPPCSPC structure of the spatial pyramid pooling cross-stage partial connection is improved into a new structure SPPFCSPC. The input of SPPFCSPC is divided into two parts. One part is passed through a triple convolution and then enters a triple pooling layer. The three pooling layers of SPPCSPC are changed to three pooling layers that are performed continuously. Then, the triple pooling structures are spliced and fused by convolution to form a cross-stage partial structure. The other part is used as a cross connection and is fused with the output of the cross-stage partial structure.
[0022] (1.7) At the junction of the backbone network and the head network, the feature fusion capability is enhanced by using the improved YOLOv7 FPN structure; the feature maps of the three scales retained by the FPN are processed by the SPPFCSPC structure described in step (1.6).
[0023] (1.8) In the head network, the classification prediction structure of YOLOv7 is improved by replacing the prediction structure of the YOLOv7 head network with the GAP-FCN classification structure. The GAP-FCN structure is used to make the model focus on classification. The GAP-FCN is a global average pooling-full convolution structure, which is a new classification-focused structure that combines a fully convolutional neural network and global average pooling.
[0024] (1.9) Input the images of the training set and validation set into the improved YOLO-GFCN algorithm model in batches. After feature extraction by the backbone network and classification by the head network, the output feature vector is obtained. The dimension of the feature vector is the number of classification categories. The vector with the largest value corresponding to the number of categories is the classification result. Then, the loss degree is calculated using the obtained classification result and the preset label, and the network weight is updated in reverse. Through continuous training with multiple batches of samples, the model can acquire the ability to classify image risks and obtain the trained model.
[0025] (1.10) Input the images from the test set or the images to be predicted into the trained model. The model calculation process is the same as the training process, and the classification result can be obtained.
[0026] Furthermore, step (1.1) specifically includes the following sub-steps:
[0027] (1.1.1) Crawl the basic information of NFTs through the API provided by OpenSea, and obtain digital content images from the basic information;
[0028] (1.1.2) Acquisition of open-source datasets, i.e., digital content data from all SuperRare platforms;
[0029] (1.1.3) Obtain risky digital content by conducting keyword searches on NFT platforms such as OpenSea or SuperRare.
[0030] Specifically, the I-ELAN in step (1.4) involves first performing a cat concatenation on the three output feature maps of the CSP structure from the right input, then performing a 1*1 convolution fusion, then performing a random cardinality rearrangement operation on the feature map of the cross-connection from the left input, and then performing a merging operation to make the overall number of channels half of the original.
[0031] Specifically, the specific operation of GAP-FCN in step (1.8) is as follows: For the three size feature map outputs of the PAN inverse pyramid in YOLOv7, we expand them to a larger number of channels through convolution, and then unify them into three one-dimensional vectors of the same dimension through a global average pooling. By calculating the superposition of the three one-dimensional vectors, we obtain a new feature vector. This vector represents the feature information of the image at multiple scales. We then use this vector to perform a classification into three different classification results. Finally, we obtain the final classification result through a fully connected layer with the number of neurons equal to the number of categories.
[0032] According to a second aspect of the embodiments of this application, an image risk classification device based on YOLOv7 is provided, comprising the following steps:
[0033] Dataset partitioning module: Obtain the image dataset, label the data with risk tags, and partition it into training, validation, and test sets;
[0034] Input module: The network model is trained using the training and validation sets. First, the image to be input is used to obtain the network model.
[0035] Extraction and fusion module: The backbone network in the model performs feature extraction and feature fusion on each image to obtain image feature maps with different perceptions;
[0036] Feature fusion module: The head network in the model further fuses the different receptive field feature maps obtained from the backbone network, and uses the new GAP-FCN classification structure to obtain the classification result;
[0037] Training module: The model uses the obtained classification results and preset labels to calculate the loss, and updates the network weights in reverse. Through continuous training with multiple batches of samples, the model acquires the ability to classify image risks and obtains the trained model.
[0038] Result Acquisition Module: Input the test set images or the images to be predicted into the trained model, and repeat the input module and extraction and fusion module to obtain the classification results.
[0039] According to a third aspect of the embodiments of this application, an electronic device is provided, comprising:
[0040] One or more processors;
[0041] Memory, used to store one or more programs;
[0042] When the one or more programs are executed by the one or more processors, the one or more processors perform the method as described in any of the preceding statements.
[0043] According to a fourth aspect of the embodiments of this application, a computer-readable storage medium is provided that stores computer instructions thereon, which, when executed by a processor, implement the steps of the method as described in any of the preceding claims.
[0044] The technical solutions provided by the embodiments of this application may include the following beneficial effects:
[0045] As can be seen from the above embodiments, it should be understood that the above general description and the following detailed description are merely exemplary and explanatory, and do not limit this application.
[0046] The beneficial effects of this invention are as follows:
[0047] (1) A comprehensive detection algorithm for digital content image risks is proposed, which can deal with digital content images with multiple risk types, especially emerging blockchain digital artworks.
[0048] (2) The algorithm adopts the latest deep learning feature extraction and fusion structure in recent years, which can deeply extract and fuse image features and can cope with various complex image environments.
[0049] (3) Compared with traditional algorithms, the proposed algorithm significantly reduces the number of network training parameters, ensuring high accuracy while reducing computational resource consumption, lowering hardware requirements, and reducing the required training and detection time. Attached Figure Description
[0050] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0051] Figure 1 This is a structural diagram of the I-ELAN of the present invention;
[0052] Figure 2 This is a structural diagram of the SPPFCSPC of the present invention;
[0053] Figure 3 This is a structural diagram of the multiple SPPFCSPC of the present invention;
[0054] Figure 4This is the overall network structure diagram of the present invention;
[0055] Figure 5 This is a schematic diagram of the device flow of the present invention;
[0056] Figure 6 This is a diagram of the electronic device of the present invention. Detailed Implementation
[0057] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application.
[0058] The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The singular forms “a,” “the,” and “the” used in this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any or all possible combinations of one or more of the associated listed items.
[0059] It should be understood that although the terms first, second, third, etc., may be used in this application to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, without departing from the scope of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to determination."
[0060] To address the current technical challenges in image risk classification, this invention proposes a YOLOv7-based image risk classification algorithm (YOLO-GFCN) to solve the problem of digital content image risk detection. Compared to existing traditional classification algorithms, it exhibits greater lightweightness and higher detection accuracy. The dataset preparation for this algorithm includes the following steps:
[0061] (1) Data Acquisition: Digital content images from the internet are acquired through web scraping, open-source datasets, etc., with the main targets being mainstream international NFT art platforms. The specific methods are as follows:
[0062] 1) Crawl NFT basic information through the API provided by OpenSea, and obtain digital content images from the basic information.
[0063] 2) Obtaining open-source datasets, such as the SuperRare dataset, which contains digital content data from all SuperRare platforms from 2018 to 2021.
[0064] 3) Obtain potentially risky digital content by conducting keyword searches on larger NFT platforms such as OpenSea and SuperRare.
[0065] (2) Dataset construction: Digital content risk classification is carried out through preliminary risk assessment by human, and a digital content dataset with multiple risk types is constructed, including three labels: pornography risk, violent terrorism risk and normal. The training set, validation set and test set are randomly divided according to the ratio of 7:1.5:1.5.
[0066] (3) Data augmentation of the dataset: This invention uses data augmentation technology to expand the dataset, increase the number of training samples, improve data utilization, and provide robustness of the model.
[0067] The steps of the YOLOv7 algorithm are as follows, and its data augmentation parameters are shown in Table 2:
[0068] Table 2
[0069] parameter meaning value rotation_range Random rotation range 30 width_shift_range Random horizontal displacement range 0.2 height_shift_range Random vertical displacement range 0.2 zoom_range Random scaling range 0.2 fill_mode Fill method nearest
[0070] (4) Figure 1 The diagram shows the I-ELAN architecture. I-ELAN improves upon the E-ELAN feature extraction module in the YOLOv7 algorithm. The I-ELAN first performs a cat concatenation of the three output feature maps from the CSP structure input from the right, then performs a 1*1 convolution to fuse them. Next, it performs a shuffle cardinality merge operation with the cross-connection feature map from the left input, followed by a final merging operation. This design of fusing before merging effectively improves the network's feature fusion capability and reduces the overall channel count to half, significantly decreasing the number of parameters in the network.
[0071] (5) Improve the pooling structure for feature extraction in YOLOv7: Use a convolutional layer with a stride of (2,2) for pooling operations. The feature extraction capability of convolutional pooling is much higher than that of traditional pooling layers. By completely replacing the original pooling structure with convolutional pooling, the accuracy of the overall network can be effectively improved while sacrificing some speed.
[0072] (6) Improve the SPPC / SPC structure: such as Figure 2As shown, the input in SPPFCSPC is divided into two parts. One part passes through a triple convolution and then enters a triple pooling layer. This invention changes the original three separate pooling layers of SPPCSPC to three consecutive pooling layers. Then, the triple pooling structures are spliced together and fused by convolution to form a CSP structure. The other part serves as a cross-connect and is fused with the output of the CSP structure.
[0073] (7) Improved FPN structure in YOLOv7: Proposed multiple SPPFCSPC structure, such as Figure 3 As shown, the feature maps of the three scales preserved by FPN are processed using our proposed SPPFCSPC structure. Since the SPPFCSPC structure itself is more efficient than SPPCPSC, this improvement can balance speed and accuracy.
[0074] (8) Improved classification prediction structure of YOLOv7: In the head network, the present invention proposes the GAP-FCN classification structure to replace the classification prediction structure of the YOLOv7 head network: GAP-FCN, namely global average pooling-full convolution structure, is a new classification-focused structure that combines the characteristics of fully convolutional neural networks and global average pooling.
[0075] The specific operation of GAP-FCN is as follows: For the three size feature map outputs of the PAN inverse pyramid in YOLOv7, we expand them to a larger number of channels through convolution, and then unify them into three one-dimensional vectors of the same dimension through a global average pooling. By calculating the sum of the three one-dimensional vectors, we obtain a new feature vector. This vector represents the feature information of the image at multiple scales. Using this vector for classification can effectively improve the accuracy of network classification. In fact, it is also an integration of three different classification results. Finally, the final classification result is obtained through a fully connected layer with neurons equal to the number of categories.
[0076] (9) Input the images of the training set and validation set into the YOLO-Global Average Pooling Fully Convolutional Network model, i.e. YOLO-GFCN algorithm model, in batches. After feature extraction by the backbone network and classification by the head network, the output feature vector is obtained. The dimension of the feature vector is the number of classification categories. The vector with the largest value corresponding to the number of categories is the classification result. Then, the loss degree is calculated using the obtained classification result and the preset label, and the network weight is updated in reverse. Through continuous training of multiple batches of samples, the model can acquire the ability to classify image risks and obtain the trained model.
[0077] (10) Input the images from the test set or the images to be predicted into the trained model. The model calculation process is the same as the training process, and the classification result can be obtained. The overall network structure is as follows: Figure 4 As shown.
[0078] Corresponding to the aforementioned embodiment of an image risk classification method based on YOLOv7, this application also provides an embodiment of an image risk classification device based on YOLOv7.
[0079] Figure 5 This is a block diagram of an image risk classification device based on YOLOv7, according to an exemplary embodiment. (Refer to...) Figure 5 The device may include:
[0080] Dataset partitioning module: Obtain the image dataset, label the data with risk tags, and partition it into training, validation, and test sets;
[0081] Input module: The network model is trained using the training and validation sets. First, the image to be input is used to obtain the network model.
[0082] Extraction and fusion module: The backbone network in the model performs feature extraction and feature fusion on each image to obtain image feature maps with different perceptions;
[0083] Feature fusion module: The head network in the model further fuses the different receptive field feature maps obtained from the backbone network, and uses the new GAP-FCN classification structure to obtain the classification result;
[0084] Training module: The model uses the obtained classification results and preset labels to calculate the loss, and updates the network weights in reverse. Through continuous training with multiple batches of samples, the model acquires the ability to classify image risks and obtains the trained model.
[0085] Result Acquisition Module: Input the test set image or the image to be predicted into the trained model, and repeat the input module and extraction and fusion module to obtain the classification result.
[0086] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.
[0087] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this application according to actual needs. Those skilled in the art can understand and implement this without creative effort.
[0088] Accordingly, this application also provides an electronic device, including: one or more processors; a memory for storing one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors implement the image risk classification method based on YOLOv7 as described above. In addition... Figure 6 In addition to the processor, memory, and network interface shown, any data processing device in the embodiment may also include other hardware depending on the actual function of the data processing device, which will not be described in detail here.
[0089] Accordingly, this application also provides a computer-readable storage medium storing computer instructions that, when executed by a processor, implement the YOLOv7-based image risk classification method described above. The computer-readable storage medium can be an internal storage unit of any data-processing device as described in any of the foregoing embodiments, such as a hard disk or memory. The computer-readable storage medium can also be an external storage device, such as a plug-in hard disk, smart media card (SMC), SD card, flash card, etc., equipped on the device. Furthermore, the computer-readable storage medium can include both internal storage units of any data-processing device and external storage devices. The computer-readable storage medium is used to store the computer program and other programs and data required by the data-processing device, and can also be used to temporarily store data that has been output or will be output.
[0090] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the disclosure herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein.
[0091] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope.
Claims
1. An image risk classification method based on YOLOv7, characterized in that, Includes the following steps: (1) Obtain the image dataset, label the data with risk tags, and divide it into training set, validation set and test set; (2) Use the training set and validation set to train the model, that is, to obtain the network model by inputting the image to be used; (3) The backbone network in the model performs feature extraction and feature fusion on each image to obtain image feature maps with different perceptions; (4) The head network in the network model performs further feature fusion on the image feature maps of different perceptions obtained from the backbone network, and uses the new GAP-FCN classification structure to obtain the classification result; (5) The network model uses the obtained classification results and preset labels to calculate the loss degree, and updates the network weights in reverse. Through continuous training with multiple batches of samples, the model can acquire the ability to classify image risks and obtain the trained model. The network model in steps (3) to (5) consists of a backbone network and a head network. The backbone network is mainly responsible for feature extraction, and the head network is responsible for further feature fusion and classification. Specifically: (a) For the feature extraction part in the backbone network, the feature extraction module E-ELAN in the YOLOv7 algorithm is improved, that is, the improved I-ELAN structure is used for feature extraction; the I-ELAN is specifically as follows: first, the three output feature maps from the CSP structure from the right input are cat concatenated, then fused by a 1*1 convolution, then randomly rearranged with the feature map from the cross-connection from the left input, and then merged and fused, so that the overall number of channels is half of the original. (b) In the feature extraction process of the backbone network, the pooling operation is completed by using the feature extraction pooling structure in the improved YOLOv7 algorithm: the improvement is to use a convolutional layer with a stride of (2,2) to perform the pooling operation, and to use convolutional pooling to replace the original pooling structure. (c) At the junction of the backbone network and the head network, the original SPPCSPC structure of the spatial pyramid pooling cross-stage partial connection is improved into a new structure SPPFCSPC. The input of SPPFCSPC is divided into two parts. One part passes through a triple convolution and then enters a triple pooling layer. The three pooling layers of SPPCSPC are changed from separate independent pooling layers to three consecutive pooling layers. Then, the triple pooling structures are spliced and fused by convolution to form a cross-stage partial structure. The other part serves as a cross-connection and is fused with the output of the cross-stage partial structure. (d) At the junction of the backbone network and the head network, the feature fusion capability is enhanced by using the improved FPN structure of YOLOv7; The SPPFCSPC structure is used to process the feature maps of the three scales preserved by FPN. (e) In the head network, the classification prediction structure of YOLOv7 is improved by replacing the prediction structure of the YOLOv7 head network with the GAP-FCN classification structure. The GAP-FCN structure enables the model to focus on classification. The GAP-FCN is a global average pooling-fully convolutional structure, which is a new classification-focused structure that combines fully convolutional neural networks and global average pooling. The specific operation of the GAP-FCN is as follows: For the three size feature map outputs of the PAN inverse pyramid in YOLOv7, they are expanded to a large number of channels by convolution, and then unified into three one-dimensional vectors of the same dimension by a global average pooling. A new feature vector is obtained by calculating the superposition of the three one-dimensional vectors. This vector represents the feature information of the image at multiple scales. This vector is then used to classify into three different classification results. Finally, the final classification result is obtained by passing through a fully connected layer with the number of neurons equal to the number of categories. (6) Input the images from the test set or the images to be predicted into the trained model, and repeat steps (2) and (3) to obtain the classification results.
2. The image risk classification method based on YOLOv7 according to claim 1, characterized in that, Step (1) specifically includes the following sub-steps: (1.1) Data Acquisition: Acquire digital content images from the internet and retrieve risky digital content through retrieval; (1.2) Dataset construction: The risky digital content was classified by manual preliminary risk assessment, and a digital content dataset with multiple risk types was constructed, including three labels: pornography risk, violent terrorism risk and normal. The training set, validation set and test set were randomly divided in a ratio of 7:1.5:1.
5. (1.3) Data augmentation of the dataset: Data augmentation techniques are used to expand the dataset and increase the number of training samples.
3. The image risk classification method based on YOLOv7 according to claim 2, characterized in that, Step (1.1) specifically includes the following sub-steps: (1.1.1) Crawl the basic information of NFTs through the API provided by OpenSea, and obtain digital content images through the basic information; (1.1.2) Acquisition of open-source datasets, i.e., digital content data from all SuperRare platforms; (1.1.3) Obtain risky digital content by conducting keyword searches on NFT platforms such as OpenSea or SuperRare.
4. The image risk classification method based on YOLOv7 according to claim 1, characterized in that, In step (4), the images of the training set and validation set are input into the improved YOLO-GFCN algorithm model in batches. After feature extraction by the backbone network and classification by the head network, the output feature vector is obtained. The dimension of the feature vector is the number of classification categories. The vector with the largest value corresponding to the number of categories is the classification result. Then, the loss degree is calculated using the obtained classification result and the preset label, and the network weight is updated in reverse. Through continuous training with multiple batches of samples, the model can acquire the ability to classify image risks and obtain the trained model. The images of the test set or the images to be predicted are input into the trained model. The model calculation process is the same as the training process, and the classification result can be obtained.
5. An apparatus for an image risk classification method based on YOLOv7 as described in any one of claims 1-4, characterized in that, Includes the following modules: Dataset partitioning module: Obtain the image dataset, label the data with risk tags, and partition it into training, validation, and test sets; Input module: The model is trained using the training and validation sets, i.e., the image to be input into the obtained model; Extraction and fusion module: The backbone network in the model performs feature extraction and feature fusion on each image to obtain image feature maps with different perceptions; Feature fusion module: The head network in the model further fuses the feature maps obtained from different perceptions in the backbone network, and uses the new GAP-FCN classification structure to obtain the classification result; Training module: The model uses the obtained classification results and preset labels to calculate the loss, and updates the network weights in reverse. Through continuous training with multiple batches of samples, the model acquires the ability to classify image risks and obtains the trained model. Result Acquisition Module: Input the test set images or the images to be predicted into the trained model, and repeat the input module and extraction and fusion module to obtain the classification results.
6. An electronic device, characterized in that, include: One or more processors; Memory, used to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1-4.
7. A computer-readable storage medium storing computer instructions thereon, characterized in that, When executed by the processor, this instruction implements the steps of the method as described in any one of claims 1-4.
Citation Information
Patent Citations
A Method and System for Highway Safety Risk Identification Based on Computer Vision and Artificial Intelligence
CN111310607B
Content safety monitoring system and method for realizing image feature recognition based on convolutional neural network
CN111400572A
Vehicle-mounted road traffic safety facility risk source intelligent identification device and method
CN111985418A
Processing method for quickly auditing video content
CN114359815A
Pedestrian occlusion detection method based on improved YOLOX algorithm
CN115082855A