DOI: 10.6084/m9.figshare.27922929.v1
title: Aluminum alloy industrial materials defect

description: The dataset used in this study experiment was from the preliminary competition dataset of the 2018 Guangdong Industrial Intelligent Manufacturing Big Data Intelligent Algorithm Competition organized by Tianchi Feiyue Cloud (https://tianchi.aliyun.com/competition/entrance/231682/introduction). We have selected the dataset, removing images that do not meet the requirements of our experiment. All datasets have been classified for training and testing. The image pixels are all 2560×1960. Before training, all defects need to be labeled using labelimg and saved as json files. Then, all json files are converted to txt files. Finally, the organized defect dataset is detected and classified.Description of the data and file structureThis is a project based on the YOLOv8 enhanced algorithm for aluminum defect classification and detection tasks.All code has been tested on Windows computers with Anaconda and CUDA-enabled GPUs. The following instructions allow users to run the code in this repository based on a Windows+CUDA GPU system already in use.Files and variablesFile: defeat_dataset.zip,algorithm.zip<b>Description:</b><b>Setup</b>Please follow the steps below to set up the project:<b>Download Project Repository</b>Download the project repository defeat_dataset.zip and algorithm.zip from the following location.Unzip and navigate to the project folder; it should contain a subfolder: quexian_dataset,ultralytics-main<b>Download data</b>1.Download data .defeat_dataset.zip and algorithm.zip2.Unzip the downloaded data and move the 'defeat_dataset','algorithm' folder into the project's main folder.3. Make sure that your defeat_dataset folder now contains a subfolder: quexian_dataset, and that your algorithm folder contains a subfolder within it: ultralytics-main4. Within the folder you should find various subfolders such as addquexian-13, quexian_dataset, new_dataset-13, ultralytics, examples, etc.Code/software<b>Set up the Python environment</b>1.Download and install the Anaconda.2.Once Anaconda is installed, activate the Anaconda Prompt. For Windows, click Start, search for Anaconda Prompt, and open it.3.Create a new conda environment with Python 3.8. You can name it whatever you like; for example. Enter the following command: conda create -n yolov8 python=3.84.Activate the created environment. If the name is , enter: conda activate yolov8Download and install the Visual Studio Code.Install PyTorch based on your system:For Windows/Linux users with a CUDA GPU: bash conda install pytorch==1.10.0 torchvision==0.11.0 torchaudio==0.10.0 cudatoolkit=11.3 -c pytorch -c conda-forgeInstall some necessary libraries:Install scikit-learn with the command: conda install anaconda scikit-learn=0.24.1Install astropy with: conda install astropy=4.2.1Install pandas using: conda install anaconda pandas=1.2.4Install Matplotlib with: conda install conda-forge matplotlib=3.5.3Install scipy by entering: conda install scipy=1.10.1<b>Code running</b>Once you have completed the setup process, follow these steps to run the code.Activate the environment that has been created and has all Python dependencies installed: if the environment name is different, replace it with the actual name.Once the environment is activated, navigate to the project folder you downloaded earlier.<b>Analysis Code</b>All analyses in the paper can be fully reproduced by running the analysis code in this folder. This folder contains the .py files used to preprocess the original dataset. the ultralytics-main folder contains the algorithms used in this experiment, with subfolders clearly indicating the roles and functions of the modules. For example, train.py is used to train the dataset and predict.py is used to test the results of the training.<b>Training Parameters</b>One of these is named train.py. This file defines default values for many hyperparameters. Note that these parameters need to be adjusted to fit your own computer; each parameter is accompanied by a comment explaining its meaning and possible parameters.Before the training, the size of the defect images was uniformly processed. The resolution was scaled from the original 2560 × 1920 to 640 × 640, the training period (epochs) was set to 200 rounds, and the number of images in each batch (batch size) was set to 32. The GPU training was specified by default, the number of workers was set to 8, and the optimization algorithm was Stochastic Gradient Descent (SGD). The learning rate was 0.01, and the weight decay was 0.0005. The mean Average Precision (mAP) measures the model in the final test.<b>Repeatability</b>For PyTorch, it's a well-known fact:There is no guarantee of fully reproducible results between PyTorch versions, individual commits, or different platforms. In addition, results may not be reproducible between CPU and GPU executions, even if the same seed is used.All results in the Analysis Notebook that involve only model evaluation are fully reproducible. However, when it comes to updating the model on the GPU, the results of model training on different machines vary.Access informationOther publicly accessible locations of the data:https://tianchi.aliyun.com/dataset/public/Data was derived from the following sources:https://tianchi.aliyun.com/dataset/140666<br>