# 中文版
## 软件介绍
scum剪线脚本至少有三种思路:
1. 根据线的路径识别答案(涉及各种图像处理技巧);
2. 将每根线的6种答案分别记录,每次遍历这些图片进行相似度匹配,找到答案;
3. 基于2,但引入卷积神经网络,通过堆大量数据提高识别准确率并减少运行时间;
1方案是比较难的一种方案,目前似乎还没看到有成熟的软件结果。现今市面上比较常见的应该是基于方案2的软件,这种方案是有效的,但仍存在一些缺陷:
1. 多少数据才是合适的?少点很多情况识别不完整得不到正确答案,多点又会拖慢运行速度;
2. 不一定会得到正确的结果,我在测试中发现的一些情况是某张图和多张数据库中的图相似度都很高,这种情况很容易做出错误判断;
3. 对没见过的图无法给出一个高正确概率的判断。
我实现的这套软件采用了卷积神经网络,这里首先介绍下相关背景:
> 随着科技的快速发展,人工智能和机器学习已经成为了当今社会的热门话题。作为机器学习领域的一个重要分支,神经网络已经经历了从初步探索到蓬勃发展的历程。在神经网络的研究与应用中,卷积神经网络(Convolutional Neural Network,简称CNN)是一种非常重要的模型,并在多个领域取得了显著的成果。本文将围绕神经网络中的卷积神经网络展开讨论,重点突出该主题中的重点词汇或短语。
> 卷积神经网络是一种深度学习的算法,它模拟了人脑中神经元的连接方式,通过多层神经元的组合和连接来实现对输入数据的特征提取和分类。CNN的基本结构包括输入层、卷积层、池化层和输出层。其中,卷积层负责从输入数据中提取特征,池化层则用于降低数据的维度,以减少计算量和过拟合的风险。通过这些层的组合和连接,CNN能够自动学习并提取输入数据的特征,从而在图像分类、语音识别、自然语言处理等任务中取得良好的效果。
通过AI根据大量训练集智能调参的方式,能够使得scum剪线脚本有如下提升:
1. 用户使用体验: 开发者直接将模型训练好,用户不需要维护图片数据;(相较方案2)
2. 正确率: 我训练出的模型参数经过测试集验证正确率在98%以上,经过1天游戏中实战测试也是几千次中出现几次识别不正确的情况;
3. 识别速度: 该脚本可以使用GPU进行识别加速,同时也没有方案2数据越多识别越慢的问题。
此外,本软件的**安全性**较同类软件要高出一个量级,该软件没有任何对游戏进程的操作,也不像某些软件一样会被杀毒软件查杀(感觉就不安全,谁知道里面插了什么广告或者病毒),同时由于市面上绝大多数脚本都是用按键精灵或者易语言写的,树大招风但不会影响到另辟蹊径的本软件(python实现)。
下图是我收集的部分验证集展示(800多张不足挂齿):
![picture][1]
## 软件使用步骤
由于python打包一直是一个比较头痛的问题,并且该软件涉及的模块较多,因此体积也比较大,这个难以避免。下面介绍使用步骤:
1. 通过链接: <https://caiyun.139.com/m/i?2eAjrTnhbgChv>,提取码:`uvez` 下载相应软件包。一个是软件本体,另一个是PyTorch的库(这是个大头,所以单独放在一边,使用时需拷贝到软件exe文件夹下),用户也可以自己安装PyTorch2.2.2版本并手动拷贝。最后是cuda的安装包(如果使用GPU版本则需要安装);
2. 打开软件exe,不出意外会显示如下图所示朴实无华的界面:
![picture][2]
- 状态栏Usage中点击会跳转到相应有用的网页,Info在Unlock后会显示当前状态。
- 左边为模式选择栏分别是:自动剪线/语音播报/图片显示答案/循环练技能模式。
- 右边为调参区,一般按我设的默认不用改,第一个为循环练技能模式的倒数时间(默认2s经验最多)、第二个为自动剪线和练技能模式中剪线钳移动的距离(如果感觉剪的位置有些许偏差可以通过略微减小或增大调整)、第三个为剪线移动的时间间隔(一般不调,调大了可能变龟速移动)
- 左下状态栏为AI训练模型的导入状态(不导入当然无法使用),有时候脚本没反应可以先清除缓存再导入下试试(还不行直接重启软件解决)。
- 右下为开始和暂停键,注意按下开始时对应模式栏的底色会变灰色,当停止后会恢复原来颜色,用来判断当前软件是否在运行中。
## 游戏参数设置
**注意!该部分十分重要,关系到软件能否在您的电脑上也能很好地运行**
- 分辨率设置,无边框全屏1920x1080,伽马拉满(我这个图应该是显示有问题,我实际分辨率是1920x1080)
![picture][3]
- 画质调成低
![picture][4]
- 注意这里的鼠标灵敏度是否和我一致(默认应该就是50)
![picture][5]
- 我的鼠标DPI为1100(老罗技用户了)
![picture][6]
- 控制面板->轻松使用->更改鼠标的工作方式->鼠标设置
![picture][7]
- 控制面板->轻松使用->更改鼠标的工作方式->设置鼠标键(加速拉最低)
![picture][8]
## 问题及反馈
有问题可以通过[该页面](https://shop.tdbrywwwcg.xyz)找到售后客服的联系方式,我会根据提问者的角色定位做出合适的回应。
## 总结
scum剪线脚本有多种实现思路:第一种是通过图像处理技术识别线路径;第二种是记录每根线的六种可能答案,通过相似度匹配来找到答案;第三种是在第二种的基础上使用卷积神经网络(CNN),利用大量数据提高识别准确率和减少运行时间。目前,基于第二种方案的软件较为常见,但存在数据量和识别准确性的问题。作者实现的软件采用了CNN,利用AI智能调参,提升了用户体验,提高了正确率(98%以上),并加快了识别速度。软件使用步骤包括下载软件包、运行exe文件、选择模式和调参。游戏参数设置对软件运行至关重要,包括分辨率、画质、鼠标灵敏度和DPI等。如果用户遇到问题,可以通过提供的联系方式获得售后客服支持。
# English Version
## Software Introduction
There are at least three approaches to implementing the scum wire-cutting script:
1. Identifying the answer based on the wire's path (involves various image processing techniques);
2. Recording the six possible answers for each wire and matching the images for similarity to find the answer;
3. Based on the second approach, but introducing convolutional neural networks (CNN) to improve recognition accuracy and reduce running time through extensive data training.
The first approach is quite challenging and does not seem to have mature software results yet. Currently, the most common method in the market is based on the second approach. This method is effective but still has some drawbacks:
1. How much data is appropriate? Too little data leads to incomplete recognition, and too much data slows down the processing speed.
2. It doesn't always yield the correct result. During my tests, I found instances where an image had high similarity with multiple images in the database, leading to incorrect judgments.
3. It cannot provide a high-probability correct judgment for unseen images.
The software I developed uses a convolutional neural network (CNN). Here is a brief introduction to the relevant background:
> With the rapid development of technology, artificial intelligence (AI) and machine learning have become hot topics in today's society. As an important branch of machine learning, neural networks have undergone significant advancements. In the research and application of neural networks, convolutional neural networks (CNN) are a crucial model and have achieved remarkable results in various fields. This article discusses CNNs in depth, highlighting key terms and concepts.
> A convolutional neural network is a deep learning algorithm that mimics the connections between neurons in the human brain. It uses a combination of multiple layers of neurons to extract and classify features from input data. The basic structure of a CNN includes the input layer, convolutional layers, pooling layers, and output layer. The convolutional layers extract features from the input data, while the pooling layers reduce the dimensionality to decrease computational load and reduce the risk of overfitting. Through the combination and connection of these layers, CNNs can automatically learn and extract features from the input data, achieving excellent results in image classification, speech recognition, natural language processing, and other tasks.
Using AI to intelligently adjust parameters based on a large training set, the scum wire-cutting script offers the following improvements:
1. **User Experience:** Developers train the model, so users don't need to maintain image data (compared to the second approach).
2. **Accuracy:** The model parameters I trained have been validated with a test set, achieving an accuracy rate of over 98%. In one day of gameplay testing, only a few misrecognitions occurred out of thousands of attempts.
3. **Recognition Speed:** This script can utilize GPU acceleration, avoiding the slowdown that occurs with more data in the second approach.
Below is a portion of the validation set I collected (800+ images, just a sample):
![picture][1]
## Software Usage Steps
Packaging Python programs can be a headache, and this software involves multiple modules, resulting in a relatively large size. Here are the steps for using the software:
1. Download the software package via this link: <https://caiyun.139.com/m/i?2eAjrTnhbgChv>, extraction code: `uvez`. One package is the software itself, another is the PyTorch library (due to its large size, it's separated; copy it to the software's exe folder). Alternatively, users can install PyTorch 2.2.2 and manually copy it. The last package is the CUDA installer (required for GPU version).
2. Open the software exe file. If everything goes well, you'll see a simple interface like the one below:
![picture][2]
- Clicking on the Usage status bar redirects to useful webpages. Info will display the current status after unlocking.
- The left panel offers mode selection: Auto wire-cutting / Voice Broadcast / Display Answers / Skill Training Mode.
- The right panel is for parameter adjustment, usually set to default. The first parameter is the countdown for the skill training mode (default 2s for maximum experience), the second is the movement distance for wire cutters in auto wire-cutting and training modes (adjust slightly if the position is off), and the third is the movement interval (usually not adjusted, increasing may slow down movement).
- The bottom left status bar indicates the AI model import status (cannot be used without importing). If the script is unresponsive, try clearing the cache and re-importing (if still unresponsive, restart the software).
- The bottom right has start and pause buttons. When the start button is pressed, the corresponding mode's background color will turn gray, reverting to the original color when stopped, indicating whether the software is running.
## Game Parameter Settings
**Note! This section is crucial for ensuring the software runs well on your computer**
- Set the resolution to borderless fullscreen 1920x1080, max out the gamma (the image may display incorrectly, but my actual resolution is 1920x1080):
![picture][3]
- Set the graphics quality to low:
![picture][4]
- Ensure the mouse sensitivity matches mine (default should be 50):
![picture][5]
- My mouse DPI is 1100 (using an old Logitech mouse):
![picture][6]
- Control Panel -> Ease of Access -> Change how your mouse works -> Mouse settings:
![picture][7]
- Control Panel -> Ease of Access -> Change how your mouse works -> Set up Mouse Keys (set acceleration to the lowest):
![picture][8]
## Issues and Feedback
For any issues, you can contact after-sales support through [this page](https://shop.tdbrywwwcg.xyz). I will respond appropriately based on the role of the questioner.
## Summary
There are multiple approaches to implementing the scum wire-cutting script: the first involves identifying the wire path through image processing techniques; the second records the six possible answers for each wire and matches images for similarity; the third uses a convolutional neural network (CNN) on top of the second approach to improve recognition accuracy and reduce running time through extensive data training. The second approach is the most common but has issues with data volume and accuracy. The software I developed uses CNN and AI parameter tuning to enhance user experience, improve accuracy (over 98%), and speed up recognition. The usage steps include downloading the software package, running the exe file, selecting modes, and adjusting parameters. Game parameter settings are crucial for the software to run effectively, including resolution, graphics, mouse sensitivity, and DPI. If users encounter issues, they can contact after-sales support for assistance.
图片见: