CN-121999454-A - Image detection method and device and terminal equipment
Abstract
The application is applicable to the technical field of image recognition, and provides an image detection method, an image detection device and terminal equipment, wherein the method comprises the following steps: after the image to be detected is obtained, carrying out inter-instance feature extraction and intra-instance feature extraction on the image to be detected in parallel to obtain inter-instance features and intra-instance features of the image to be detected, and finally obtaining information of target elements in the image to be detected according to the inter-instance features and the intra-instance features. When the method and the device are used for detecting the target element in the image, the inter-instance feature extraction and the intra-instance feature extraction can be simultaneously carried out, and as the inter-instance feature extraction and the intra-instance feature extraction are simultaneously carried out, the detection time of the target element in the image is shortened, and the image detection efficiency is improved.
Inventors
- XIANG CANQUN
- CHEN KANGLIANG
- PAN XING
Assignees
- 毫末智行科技有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20241105
Claims (10)
- 1. An image detection method, comprising: Acquiring an image to be detected; Performing parallel processing of inter-instance feature extraction and intra-instance feature extraction on the image to be detected to obtain inter-instance features and intra-instance features of the image to be detected, wherein the inter-instance features represent the relative relationship between target elements in the image to be detected, and the intra-instance features represent the internal features of each target element in the image to be detected; and obtaining information of the target element in the image to be detected based on the inter-instance features and the intra-instance features.
- 2. The image detection method according to claim 1, wherein the performing parallel processing of inter-instance feature extraction and intra-instance feature extraction on the image to be detected to obtain inter-instance features and intra-instance features of the image to be detected includes: Acquiring an instance query vector of a target element and a point query vector of the target element, wherein the instance query vector is used for distinguishing each target element in an image to be detected, the point query vector is used for positioning the position of a target point on the target element in the image to be detected, and each target element consists of a plurality of target points; determining inter-instance query vectors and intra-instance query vectors for the target element based on the instance query vectors and the point query vectors; And carrying out parallel processing on the inter-instance feature extraction and the intra-instance feature extraction on the image to be detected based on the inter-instance query vector and the intra-instance query vector to obtain inter-instance features and intra-instance features of the image to be detected.
- 3. The image detection method according to claim 2, wherein the performing, based on the inter-instance query vector and the intra-instance query vector, parallel processing of inter-instance feature extraction and intra-instance feature extraction on the image to be detected to obtain inter-instance features and intra-instance features of the image to be detected includes: Carrying out inter-instance feature extraction on the image to be detected by using the inter-instance query vector to obtain inter-instance features of the image to be detected; And carrying out intra-instance feature extraction on the image to be detected by using the intra-instance query vector to obtain intra-instance features of the image to be detected, wherein the inter-instance feature extraction and the intra-instance feature extraction are carried out in parallel.
- 4. The image detection method of claim 3, wherein the determining an inter-instance query vector and an intra-instance query vector for a target element based on the instance query vector and the point query vector comprises: Carrying out structuring treatment on the instance query vector and the point query vector to obtain a structured query vector of the target element, wherein the structured query vector consists of query vectors of each target element, and the structured query vector is used for determining information of each target element in the image to be detected; Determining inter-instance query vectors for the target elements based on the query vector for each target element in the structured query vector; an intra-instance query vector for a target element is determined based on the differences between the inter-instance query vector and the structured query vector.
- 5. The image detection method of claim 4, wherein the determining an inter-instance query vector for a target element based on the query vector for each target element in the structured query vector comprises: And calculating the average value of the query vector of the ith target element in the structured query vector to obtain the average value vector of the ith target element, wherein the average value vectors of all target elements in the structured query vector form the query vector among the examples, and i < N is more than or equal to 1 and is less than or equal to the total number of target elements which can be queried by the preset structured query vector.
- 6. The image detection method of claim 4, wherein the determining an intra-instance query vector for a target element based on a difference between the inter-instance query vector and the structured query vector comprises: and calculating the difference value of the query vector between the structured query vector and the instance to obtain the query vector in the instance.
- 7. The image detection method according to any one of claims 1 to 6, wherein the obtaining information of the target element in the image to be detected based on the inter-instance features and the intra-instance features includes: adding the inter-instance features and the intra-instance features to obtain target element features of target elements; and generating information of the target element in the image to be detected based on the target element characteristics.
- 8. The image detection method as claimed in claim 3, wherein the performing inter-instance feature extraction on the image to be detected using the inter-instance query vector to obtain inter-instance features of the image to be detected includes: extracting characteristic relations among all target elements in the image to be detected by using the inter-instance query vector and the first self-attention model to obtain inter-instance characteristics of the image to be detected; And extracting the intra-instance features of the image to be detected by using the intra-instance query vector to obtain the intra-instance features of the image to be detected, wherein the method comprises the following steps: And respectively extracting the internal characteristics of each target element in the image to be detected based on the intra-instance query vector and the second self-attention model to obtain the intra-instance characteristics of the image to be detected, wherein the first self-attention model and the second self-attention model are different self-attention models.
- 9. An image detection apparatus, comprising: the image acquisition module is used for acquiring an image to be detected; the image processing module is used for carrying out parallel processing of inter-instance feature extraction and intra-instance feature extraction on the image to be detected to obtain inter-instance features and intra-instance features of the image to be detected, wherein the inter-instance features represent the relative relation between all target elements in the image to be detected, and the intra-instance features represent the internal features of each target element in the image to be detected; And the information output module is used for obtaining the information of the target element in the image to be detected based on the inter-instance features and the intra-instance features.
- 10. A terminal device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the image detection method according to any one of claims 1 to 8 when executing the computer program.
Description
Image detection method and device and terminal equipment Technical Field The application belongs to the technical field of image recognition, and particularly relates to an image detection method, an image detection device and terminal equipment. Background With the development of the intelligence of vehicles, the functions of the vehicles are more and more increased, and more convenience is provided for users, for example, the automatic driving of the vehicles and the auxiliary driving of the vehicles are provided for the users. When the vehicle executes functions such as automatic driving and auxiliary driving, each element on the road needs to be detected first, the vehicle is controlled to automatically run or carry out auxiliary driving according to the information of each element on the road, if the detection efficiency of the elements on the road is low, the performance of the vehicle can be influenced, poor experience is brought to a user, and therefore, the problem that the detection efficiency of the elements in the image needs to be solved at present is improved. Disclosure of Invention The embodiment of the application provides an image detection method, an image detection device and terminal equipment, which can solve the problem of low detection efficiency of elements in an image. In a first aspect, an embodiment of the present application provides an image detection method, including: Acquiring an image to be detected; Performing parallel processing of inter-instance feature extraction and intra-instance feature extraction on the image to be detected to obtain inter-instance features and intra-instance features of the image to be detected, wherein the inter-instance features represent the relative relationship between target elements in the image to be detected, and the intra-instance features represent the internal features of each target element in the image to be detected; and obtaining information of the target element in the image to be detected based on the inter-instance features and the intra-instance features. In a possible implementation manner of the first aspect, the performing parallel processing of inter-instance feature extraction and intra-instance feature extraction on the image to be detected to obtain inter-instance features and intra-instance features of the image to be detected includes: Acquiring an instance query vector of a target element and a point query vector of the target element, wherein the instance query vector is used for distinguishing each target element in an image to be detected, the point query vector is used for positioning the position of a target point on the target element in the image to be detected, and each target element consists of a plurality of target points; determining inter-instance query vectors and intra-instance query vectors for the target element based on the instance query vectors and the point query vectors; And carrying out parallel processing on the inter-instance feature extraction and the intra-instance feature extraction on the image to be detected based on the inter-instance query vector and the intra-instance query vector to obtain inter-instance features and intra-instance features of the image to be detected. In a possible implementation manner of the first aspect, the performing, based on the inter-instance query vector and the intra-instance query vector, parallel processing of inter-instance feature extraction and intra-instance feature extraction on the image to be detected to obtain inter-instance features and intra-instance features of the image to be detected includes: Carrying out inter-instance feature extraction on the image to be detected by using the inter-instance query vector to obtain inter-instance features of the image to be detected; And carrying out intra-instance feature extraction on the image to be detected by using the intra-instance query vector to obtain intra-instance features of the image to be detected, wherein the inter-instance feature extraction and the intra-instance feature extraction are carried out in parallel. In a possible implementation manner of the first aspect, the determining an inter-instance query vector and an intra-instance query vector of a target element based on the instance query vector and the point query vector includes: Carrying out structuring treatment on the instance query vector and the point query vector to obtain a structured query vector of the target element, wherein the structured query vector consists of query vectors of each target element, and the structured query vector is used for determining information of each target element in the image to be detected; Determining inter-instance query vectors for the target elements based on the query vector for each target element in the structured query vector; an intra-instance query vector for a target element is determined based on the differences between the inter-instance query vector and the structured query vector.